Whell, i was trying to make a script, there is no syntax error, but he just not working:( can you please tell where is a problem in this one???
BotName="CauruleBot"
commandlinkhelp="!linkhelp"
function Showlinkhelp(target)
target:SendData(BotName,"*** This one is a link bot ***")
target:SendData(BotName,"")
target:SendData(BotName,"!crack: Crack links")
target:SendData(BotName,"!movie: Movie links")
target:SendData(BotName,"")
end
if ("cmd=!crack") then
readfrom("cracklinks.txt")
end
if ("cmd=!movie") then
readfrom("movielinks.txt")
end
\first of all you need a data arrival, go check in the HOW-TO's i have lessons on writing a bot, go check ;)
here is how it wud be ;)
BotName="CauruleBot"
commandlinkhelp="!linkhelp"
function Showlinkhelp(user)
user:SendData(BotName,"*** This one is a link bot ***")
user:SendData(BotName,"")
user:SendData(BotName,"!crack: Crack links")
user:SendData(BotName,"!movie: Movie links")
user:SendData(BotName,"")
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 == "!crack") then
readfrom("cracklinks.txt")
elseif (cmd == "!movie") then
readfrom("movielinks.txt")
elseif (cmd == commandlinkhelp) then
Showlinkhelp(user)
end
end
end
l8rr,,
-phatty
im not actually sure that user:SendData BotName,"")
will work, it becomes nil i think maybe a space
user:SendData(BotName," ")
WOW:)))
Thanks gonna check out whrite now!!!
Sorry about my english:)
Whell only the !linkhelp command is working, but he don't what to read from movielinks.txt and cracklinks.txt files:(
I made them and placed in the scripts directory, but.......:(
heheh it is reading the file just not sending it hehehe
BotName="CauruleBot"
commandlinkhelp="!linkhelp"
function Showlinkhelp(user)
user:SendData(BotName,"*** This one is a link bot ***")
user:SendData(BotName,"")
user:SendData(BotName,"!crack: Crack links")
user:SendData(BotName,"!movie: Movie links")
user:SendData(BotName,"")
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 == "!crack") then
readfrom("cracklinks.txt")
WhileRead(user)
elseif (cmd == "!movie") then
readfrom("movielinks.txt")
WhileRead(user)
elseif (cmd == commandlinkhelp) then
Showlinkhelp(user)
end
end
end
function WhileRead(user)
while 1 do
line = read()
if line == nil then break end
user:SendData(BotName,line)
end
readfrom()
end
l8rr,,
-phatty
I don't know how to thank you:)))
Working perfect:)
Maybe putt this one in the threads? Actually this is a nice idea, because ussualy every body in the hubs asking for new movies or game cracks, and this one can be updeited with searial maybe or music, MP3:)))
http://caurule.netfirms.com
There is a script that does all of that already ;)
Whell ok ok:)))
Just didn't know about that .