Heres another one, its a timed message script, and its uses are pretty self explanitory, it should work in IceCube and TD. I did not write it but if you have trouble I will try to help :-p
_____________________________________
botname = "Reminder"
minutes = 360
file = "MsgAll.txt"
function Main()
SetTimer(minutes*60000)
StartTimer()
end
function OnTimer()
MessageToAll()
end
function MessageToAll()
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
while line do
SendToAll(botname,line)
line = read(handle)
end
closefile(handle)
end
end
DO I have to make a folder called "txt" and and put a file in it called MsgAll.txt to make this work?
in the script folder i suppose
Hmm because its only using the timer once instead of jumping from timer to another function might as well be all in timer
bot = "Reminder"
mins = 360
file = "MsgAll.txt"
function Main()
SetTimer(mins*60000)
StartTimer()
end
function OnTimer()
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
while line do
SendToAll(bot,line)
line = read(handle)
end
closefile(handle)
end
end
how to modify this bot for sending message in PM instead of main?
QuoteOriginally posted by angelsanges
how to modify this bot for sending message in PM instead of main?
Replace this line=
SendToAll(bot,line)
with this =
SendPmToAll(bot,line)
i have this error if i modify that line
Syntax error: cannot access a variable in outer scope;
last token read: `handle' at line 16 in string "bot = "Offertissime"
..."