PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: tamilzone on 24 December, 2003, 18:32:13

Title: Whats Wrong in this script?
Post by: tamilzone on 24 December, 2003, 18:32:13
code
____________________________________________



Bot= "Tamil Zone Hub"

function DataArrival(user, data)
   if(user.bOperator and strsub(data, 1, strlen(user.sName)+8) == "<"..user.sName.."> mass ") then
      SendPmToAll("Hub Mass Message from "..user.sName, strsub(data, strlen(user.sName)+9))
   end
end


_____________________________________________

code

i will that the msg as popup tp all users comes!
whats wrong with this script?

thx
Tamilzone
Title:
Post by: pHaTTy on 24 December, 2003, 19:50:55
well you need to register bots name cliet issue
Title:
Post by: pHaTTy on 24 December, 2003, 19:51:43
or someone on forum is this one


--Mass bot by Phatty
--13th December 2k3

function Main()
Bot = "Captain-Barbossa"
frmHub:RegBot(Bot)
end

function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")

if (cmd=="!mass") then
if user.bOperator then
s,e,cmd,message = strfind(data,"%s+(%S+)%s+(.*)")
if message == nil then
user:SendData(Bot,"Please type !mass ")
else
SendPmToAll(Bot," "..user.sName..": "..message)
end
end
end
end
end


l8rr