Hi guys,
I'm still in the process of learning lua, but I hacked together a small script to open a text file, read the contents and post it in a pm.
The problem is it pm's you in main, I'm guessing it's due to the fact that it sends the request too quickly and doesn't have time to open a new pm window.
Anything I can do?
QuoteBot = "-=Info-Bot=-"
v1 = "Information"
file = "info.txt"
function Main()
--frmHub:RegBot(sBot)
end
function DataArrival(user, data)
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
_,_,cmd=strfind(data, "%b<>%s+(%S+)")
if (cmd=="!goactive") then
ReadGoActive(user, data, cmd)
return 1
end
end
end
function ReadGoActive(user, data, cmd)
local release = ""
readfrom(file)
while 1 do
local line = read()
if (line == nil) then
break
else
release = release.." "..line.."\r\n"
end
end
user:SendPM(Bot, "\r\n\r\n".." "..v1.." posted by Info-Bot ".."\r\n\r\n"..release)
readfrom()
end
Thanks :)
Reef
general dc++ settings causes a problem soooo
function Main()
frmHub:RegBot(Bot)
end
/pha
you must reg your bot or name it to another bot you have regged... otherwise it will send the PM in main... due to not be in userlist...
change:
function Main()
--frmHub:RegBot(sBot)
end
to
function Main()
frmHub:RegBot(Bot)
end
/NL
Damit Phatty I was first... lmao... hehe
LOL!!! Thanks for the quick reply guys!
I didn't realise the bot *has* to be regged in order for the message to pop up from it, thought it would just pop up and display the bot name anyway :D
Ta ;)