HI
the script is perfeck but i vill not send it in main as this script do
i wont the script send a pm to everyone type !pm or
!mass someone here who can lock at this and fix it ?
but i worthless to edit lua script so i need help there
im running Ptokac soft whit robocop 8
thankz
//Bolle
-----------------------------------------------------------------------
endEvery = 2 ---- time in hrs
textfile = "massmessage.txt"
bot = "Mass_Message"
hrs = 1000 * 60 * 60 * SendEvery
function Main()
SetTimer(hrs)
StartTimer()
end
function OnTimer()
massMessageToAll()
end
function massMessageToAll()
local handle = openfile(textfile, "r")
if (handle ~= nil) then
local line = read(handle)
Temptimerfile = "\r\n"
while line do
Temptimerfile = Temptimerfile.."\r\n"..line
line = read(handle)
end
SendPmToAll(bot, Temptimerfile)
closefile(handle)
end
end
you have +mass in Robocop mate... :D
Bolle a clue would be to try changing SendPmToAll(bot, Temptimerfile)
to smth like
SendToAll(bot, Temptimerfile)
Try reading through the Scripting.txt in the docs folder of PtokaX. ...
SendEvery = 2 ---- time in hrs
textfile = "massmessage.txt"
bot = "Mass_Message"
hrs = 1000 * 60 * 60 * SendEvery
Prefix = "+"
Trigger1 = "pm"
function Main()
SetTimer(hrs)
StartTimer()
frmHub:RegBot(bot)
end
function OnTimer()
massMessageToAll()
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
local data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == Prefix..Trigger1 then
massMessageToAll()
return 1
end
end
end
function massMessageToAll()
local handle = openfile(textfile, "r")
if (handle ~= nil) then
local line = read(handle)
Temptimerfile = "\r\n"
while line do
Temptimerfile = Temptimerfile.."\r\n"..line
line = read(handle)
end
SendPmToAll(bot, Temptimerfile)
closefile(handle)
end
end
I hope this was what you had in mind..
Command is :
+pm
Will send the content of the massmessage.txt to all users in the hub + send it on the timer..
Best regards,
Snooze
Ptokax say =
Syntax Error bad argument #1 to'strlen' sting expected got nil
can u fix it i worthless to edit lua script
/Bolle
QuoteOriginally posted by Snooze
SendEvery = 2 ---- time in hrs
textfile = "massmessage.txt"
bot = "Mass_Message"
hrs = 1000 * 60 * 60 * SendEvery
Prefix = "+"
Trigger1 = "pm"
function Main()
SetTimer(hrs)
StartTimer()
frmHub:RegBot(bot)
end
function OnTimer()
massMessageToAll()
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
local data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == Prefix..Trigger1 then
massMessageToAll()
return 1
end
end
end
function massMessageToAll()
local handle = openfile(textfile, "r")
if (handle ~= nil) then
local line = read(handle)
Temptimerfile = "\r\n"
while line do
Temptimerfile = Temptimerfile.."\r\n"..line
line = read(handle)
end
SendPmToAll(bot, Temptimerfile)
closefile(handle)
end
end
I hope this was what you had in mind..
Command is :
+pm
Will send the content of the massmessage.txt to all users in the hub + send it on the timer..
Best regards,
Snooze
SendEvery = 2 ---- time in hrs
textfile = "massmessage.txt"
bot = "Mass_Message"
hrs = 1000 * 60 * 60 * SendEvery
Prefix = "+"
Trigger1 = "pm"
function Main()
SetTimer(hrs)
StartTimer()
frmHub:RegBot(bot)
end
function OnTimer()
massMessageToAll()
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" or (strsub(data,1,5+strlen(bot))=="$To: "..bot) then
local data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == Prefix..Trigger1 then
massMessageToAll()
return 1
end
end
end
function massMessageToAll()
local handle = openfile(textfile, "r")
if (handle ~= nil) then
local line = read(handle)
Temptimerfile = "\r\n"
while line do
Temptimerfile = Temptimerfile.."\r\n"..line
line = read(handle)
end
SendPmToAll(bot, Temptimerfile)
closefile(handle)
end
end
Sorry about that .. :)
No problem youre script its perfeckt im so happy now :)
i realy realy will THANK U
//bolle
QuoteOriginally posted by Snooze
SendEvery = 2 ---- time in hrs
textfile = "massmessage.txt"
bot = "Mass_Message"
hrs = 1000 * 60 * 60 * SendEvery
Prefix = "+"
Trigger1 = "pm"
function Main()
SetTimer(hrs)
StartTimer()
frmHub:RegBot(bot)
end
function OnTimer()
massMessageToAll()
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" or (strsub(data,1,5+strlen(bot))=="$To: "..bot) then
local data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == Prefix..Trigger1 then
massMessageToAll()
return 1
end
end
end
function massMessageToAll()
local handle = openfile(textfile, "r")
if (handle ~= nil) then
local line = read(handle)
Temptimerfile = "\r\n"
while line do
Temptimerfile = Temptimerfile.."\r\n"..line
line = read(handle)
end
SendPmToAll(bot, Temptimerfile)
closefile(handle)
end
end
Sorry about that .. :)
Im glad that it worked out as you wished..
Snooze
Yes
and u are good on lua script
i hope i can ask u more if i have problem whit lua y are so goood at that
anyway
a BIG Thankz
//bolle
QuoteOriginally posted by Snooze
Im glad that it worked out as you wished..
Snooze
I'm still a newbie, but feel free to ask and I'll do my best