PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: (=CyberPimp=) on 18 June, 2004, 00:16:35

Title: cmd not to be seen in main
Post by: (=CyberPimp=) on 18 June, 2004, 00:16:35
Can someone fix this bot so the command +joke don?t
show on main... PLZ


-- JokeBot .lua by Cloud
--Some more content by [ANCIENT]Klismo :P

botname = "JokeBot"

sec = 1000
min = 60 * sec
hour = 60 * min

Command = "+Joke"

jokes = {

"SHE WAS SO BLONDE THAT... She thought a quarterback was a refund.",
}


function Main()
frmHub:RegBot(botname)
SetTimer(2 * hour)
StartTimer()
end



function DataArrival(user, data)
if (strsub(data, 1, 1) == "<") or ( strsub(data, 1, 4) == "$To:" ) then
data = strsub(data,1,strlen(data)-1)

if (strfind(strlower(data), strlower(Command))) then
Joke = jokes[random(1,getn(jokes))]
user:SendPM(botname, ""..Joke.." =P")

end
end
end
Title:
Post by: pHaTTy on 18 June, 2004, 02:12:45
QuoteOriginally posted by (=CyberPimp=)
Can someone fix this bot so the command +joke don?t
show on main... PLZ


-- JokeBot .lua by Cloud
--Some more content by [ANCIENT]Klismo :P

botname = "JokeBot"

sec = 1000
min = 60 * sec
hour = 60 * min

Command = "+Joke"

jokes = {

"SHE WAS SO BLONDE THAT... She thought a quarterback was a refund.",
}


function Main()
frmHub:RegBot(botname)
SetTimer(2 * hour)
StartTimer()
end



function DataArrival(user, data)
if (strsub(data, 1, 1) == "<") or ( strsub(data, 1, 4) == "$To:" ) then
data = strsub(data,1,strlen(data)-1)

if (strfind(strlower(data), strlower(Command))) then
Joke = jokes[random(1,getn(jokes))]
user:SendPM(botname, ""..Joke.." =P")

end
end
end


add return 1 below this line: user:SendPM(botname, ""..Joke.." =P")
Title:
Post by: (=CyberPimp=) on 18 June, 2004, 02:21:26
Thx this has been bugging me for long time hehe  :D
Title:
Post by: pHaTTy on 18 June, 2004, 12:18:50
QuoteOriginally posted by (=CyberPimp=)
Thx this has been bugging me for long time hehe  :D

np, but if u check out in the finished scripts, or seacrh for edited joke bot i think ya will find one much beter ;-)