hello ppl
i have a timed mass message
but it only sends a message to unreg users
and i want to chose to profile i want the message goes to
like :
netfounder = 1
master = 0
moderator = 0
op = 1
vip = 1
reg = 1
user = 0
the script i have is thiss :
--Lua 5 By Dessamator(added message To Profile)
-- timed mass message from text by ?˜”??•Hawk•??”˜?
-- create a massmessage.txt file in the scripts directory
-- containing your message
SendEvery = 1 ---- time in hrs
textfile = "massmessage.txt"
bot = frmHub:GetHubBotName()
hrs = 1000 * 60 * 60 * SendEvery
ProfileNumber= -1 -- type here the profile u wish to send to
function Main()
SetTimer(hrs)
StartTimer()
end
function OnTimer()
local handle = io.open(textfile, "r")
if (handle ~= nil) then
Temptimerfile = "\r\n"
for line in io.lines(textfile) do
Temptimerfile = Temptimerfile.."\r\n"..line
io.read()
end
for pos,user in frmHub:GetOnlineUsers(ProfileNumber) do
user:SendPM(bot, Temptimerfile)
end
io.close()
end
end
and to tranform this :
SendEvery = 1 ---- time in hrs
i want te timer im minutes if possible
Best regards
Loading
Not tested let me know if alls well
--Lua 5 By Dessamator(added message To Profile)
-- timed mass message from text by ??????Hawk??????
-- create a massmessage.txt file in the scripts directory
-- containing your message
CanDo = {
[0] = 1, -- Master
[1] = 1, -- Operator
[2] = 1, -- VIP
[3] = 0, -- Reg
[4] = 0, -- Moderator
[5] = 1, -- Netfounder
[-1] =0, -- User
}
SendEvery = 1 ---- time in Mins
textfile = "massmessage.txt"
bot = frmHub:GetHubBotName()
hrs = 1000 * 60 * SendEvery
function Main()
SetTimer(hrs)
StartTimer()
end
function OnTimer()
local handle = io.open(textfile, "r")
if (handle ~= nil) then
Temptimerfile = "\r\n"
for line in io.lines(textfile) do
Temptimerfile = Temptimerfile.."\r\n"..line
io.read()
end
for prf,sw in CanDo do
if sw == 1 then
for pos,user in frmHub:GetOnlineUsers(prf) do
user:SendPM(bot, Temptimerfile)
end
end
end
end
io.close()
end
i get this error :
[23:40] Syntax E:\Programas\Ptokax 0.3.3.0.b17.04.nt.dbg\scripts\Timed Mass message.lua:96: `end' expected (to close `function' at line 63) near `'
Loading
heheh you must have been quick i spotted the mistake as soon as i posted it ..
i edited the code..
try again :P :P :P :P
hi
tanks hawk for the modifications
it works in the all profiles
tanks man
Best regards
Loading
:)) :)) :)) :))
Hi Hawks,
Is it possible to have the same script with more messages ??
And with command for add messages as '!addmess' ??
Thank you very much
Hai everybody ,
I was looking for a script like this :)
Can someone change this script so it works for in main and not in pm please :D
--Lua 5 By Dessamator(added message To Profile)
-- timed mass message from text by ??????Hawk??????
-- create a massmessage.txt file in the scripts directory
-- containing your message
CanDo = {
- = 1, -- Master
[1] = 1, -- Operator
[2] = 1, -- VIP
[3] = 0, -- Reg
[4] = 0, -- Moderator
[5] = 1, -- Netfounder
[-1] =0, -- User
}
SendEvery = 1 ---- time in Mins
textfile = "massmessage.txt"
bot = frmHub:GetHubBotName()
hrs = 1000 * 60 * SendEvery
function Main()
SetTimer(hrs)
StartTimer()
end
function OnTimer()
local handle = io.open(textfile, "r")
if (handle ~= nil) then
Temptimerfile = "\r\n"
for line in io.lines(textfile) do
Temptimerfile = Temptimerfile.."\r\n"..line
io.read()
end
for prf,sw in CanDo do
if sw == 1 then
for pos,user in frmHub:GetOnlineUsers(prf) do
user:SendPM(bot, Temptimerfile)
end
end
end
end
io.close()
end
change this
user:SendPM(bot, Temptimerfile)
to this
SendToAll((bot, Temptimerfile)
Thx for your reaction Dessamator :)
Ive changed it but getting this error in de ptokax
[00:03] Syntax ...ings\Default\Mijn documenten\Forbiddenpalace\robo10\scripts\advertiser.lua:43: `)' expected near `,'
[00:03] Syntax advertiser.lua:43: `)' expected near `,'
I dont know what is wrong ,Ihope you can tell me ? :D