PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: EXNET OWNER on 29 September, 2004, 01:31:32

Title: About my Bot....Wont Return 1 commands...
Post by: EXNET OWNER on 29 September, 2004, 01:31:32
i have the following code...


function exNewUserConnected(user)
if user.sName == WhoCan then
customCMDS(user)
user:SendData("\r\n***AnarchyBot? is in Operation***")
else
return

end
end


function customCMDS(user)
user:SendData("$UserCommand 1 3 AnarchyBot? by Exile\\Bot Status\\Bot Exit Hub $<%[mynick]> "..DropCmd.."

%[line:BotName]||")
user:SendData("$UserCommand 1 3 AnarchyBot? by Exile\\Bot Status\\Bot Enter Hub $<%[mynick]> "..AddCmd.."

%[line:BotName]||")
user:SendData("$UserCommand 1 3 AnarchyBot? by Exile\\Bot Status\\Bot Status Away $<%[mynick]> "..AwayCmd.."

%[line:BotName]||")
user:SendData("$UserCommand 1 3 AnarchyBot? by Exile\\Bot Status\\Bot Status Back $<%[mynick]> "..BackCmd.."

%[line:BotName]||")
end

function exDataArrival(user, data)
if user.sName == WhoCan then
if strsub(data,1,1)=="<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd,name = strfind(data,"%b<>%s+(%S+)%s+(%S+)")
if cmd == DropCmd then
frmHub:UnregBot(name)
SendToAll("<"..name.."> I'm gone blud")
SendToAll("<"..name.."> -=1=-")
SendToAll(" The Operator "..name.." Left The Hub")

return 1
end
if cmd == AddCmd then
frmHub:RegBot(name)
SendToAll(" The Operator "..name.." Has Entered The Hub")
SendToAll("<"..name.."> Safe evry1, wots gwanin?")

return 1
end
                                if cmd == AwayCmd then
frmHub:RegBot(name)
SendToAll("<"..name.."> "..AwayMsg.."")
SendToAll("<"..name.."> -=1=-")
SendToAll(" The Operator "..name.." told us at "..date("%H:%M").." that he/she

is away! - Message: BL?$$")

return 1
end
if cmd == BackCmd then
frmHub:RegBot(name)
SendToAll("<"..name.."> "..BackMsg.."")
SendToAll(" The Operator "..name.." returned at "..date("%H:%M").."!")

return 1

end
end
end
end

                               

when i execute the commands they show in main, i dont want them to, the prefix for all of them is "!" so it should as i have put return 1 after the command...any ideas?
Title:
Post by: plop on 29 September, 2004, 06:33:47
"return 1" the moment the script is done in the ptokax standard functions (newuserbla, databla).

plop