PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: servaks on 27 October, 2003, 15:54:28

Title: Merge scripts, witk too timers...
Post by: servaks on 27 October, 2003, 15:54:28
Im too lame to do this, som plz help me...

BotName = "InfoBot"
TimeSpanInMinutes = 60
function Main()
SetTimer(TimeSpanInMinutes*60000)
StartTimer()
end

function OnTimer()
SendToAll(BotName, "============="..frmHub:GetHubName().."============|      ::Huba maajaslapa:    www.hub.lv/|      ::Huba Forums:          http://forum.hub.lv/|      ::Huba Rules:              http://www.hub.lv/info.php|      ::Huba Galerija:           http://gallery.hub.lv/|      ::Huba F.A.Q:              http://www.hub.lv/faq.php|      ::Huba Chats:              irc.delfi.lv #lv.hub|      ::Huba sloti:                 min.slotu skaits 3 uz katru hubu, maks. 10 hubi = 30 sloti|      ::Huba Addrese:          alfa.hub.lv:3412 vai 62.85.47.106:3412 un omega.hub.lv:5412")
SendToAll(BotName, "============"..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." Users Connected=============")
end


AND

sRecordFile = "hubstats//records.txt"

iShareAllTime = ""
iUserAllTime  = ""


function Main()
  SetTimer(2731)
  StartTimer()
end

function OnTimer()

  local hFile
  local uptms
  local sec = clock()
  local days = floor(sec/86400)
  local hrs = floor((sec-(days*86400))/3600)
  local min = floor((sec-(days*86400)-(hrs*3600))/60)
  local uptms

  uptms = days.." days, "..hrs.." hours, "..min.." minutes."

  ReadRecords()

  hFile = openfile("..\\html\\webstats\\uptimeplus", "w")
  if (hFile) then
    write(hFile, uptms..iShareAllTime..iUserAllTime)
    closefile(hFile)
  end

end

function ReadRecords()
  local flRecordFile = openfile(sRecordFile, "r")

  if (flRecordFile) then
    _, _, iShareAllTime = strfind(read(flRecordFile), "^share=(%d+)$")
    _, _, iUserAllTime = strfind(read(flRecordFile), "^users=(%d+)$")
    closefile(flRecordFile)
    iShareAllTime="\n"..iShareAllTime
    iUserAllTime="\n"..iUserAllTime
  end
end

PLZ PLZ PLZ, merge theese scripts...  :rolleyes:

/shipis
Title:
Post by: OpiumVolage on 27 October, 2003, 18:03:14
Look here (http://board.univ-angers.fr/thread.php?threadid=7&boardid=4) and use RegTimer more than one time :)
Title:
Post by: servaks on 27 October, 2003, 18:55:40
Maby you can fiz it please..
Im too LAME  ?(
Title:
Post by: pHaTTy on 27 October, 2003, 18:56:31
Why? have you even tried?
Title:
Post by: servaks on 27 October, 2003, 19:02:04
Nop...
I can't understand the HOW-TO..

/shipis