PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: steks on 07 April, 2005, 12:22:56

Title: HELP with scripts
Post by: steks on 07 April, 2005, 12:22:56
HI HI
Can someone help me? I hawe old script and i need it in LUA5

here it is the old script:

BotName = "bla bla"
function Main()
   frmHub:RegBot(BotName)
   SendPmToAll("bla bla bla")   
end
TimeSpanInMinutes = 80
function Main()
SetTimer(TimeSpanInMinutes*60000)
StartTimer()
end
 
function OnTimer()
   SendToAll(BotName,date("bla bla bla bla"))
   readfrom("sponsor.txt")
   while 1 do
      line = read()
      if line == nil then
         break
      end
      SendToAll(BotName,line)
   end
   readfrom()
end



PLZ HELP
Title:
Post by: Dessamator on 07 April, 2005, 12:37:45
BotName = "bla bla"
function Main()
frmHub:RegBot(BotName)
SendPmToAll("bla bla bla")
end
TimeSpanInMinutes = 80
function Main()
SetTimer(TimeSpanInMinutes*60000)
StartTimer()
end

function OnTimer()
--SendToAll(BotName,date("bla bla bla bla"))
showtext("sponsor.txt")
end

function showtext(file)
local contents ="\r\n\r\n"
for line in io.lines(file) do
contents = contents..line.."\r\n"
end
SendToAll(BotName,"\r\n"..contents.."\r\n|")
end


Done !!