PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Tw?sT?d-d?v on 22 May, 2005, 23:02:27

Title: ok i found the one i was after but it needs converting(if you can help
Post by: Tw?sT?d-d?v on 22 May, 2005, 23:02:27
would it be at possible for some one to convert this script please .. and alter it a bit so it only sends a message to certain profiles  
-- 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 = "Mass_Message"
hrs = 1000 * 60 * 60 * SendEvery


function Main()
SetTimer(hrs)
StartTimer()
end



function OnTimer()
massMessageToAll()
end




function massMessageToAll()
local handle = io.open(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

THX
Title:
Post by: Dessamator on 23 May, 2005, 00:04:12
--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()--"Mass_Message"
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

 
Done !
Title:
Post by: Tw?sT?d-d?v on 23 May, 2005, 07:08:09
Thx :D
Title:
Post by: Dessamator on 23 May, 2005, 08:37:39
ur welcome :))