Check if something is equal to every sec ?
 

Check if something is equal to every sec ?

Started by kepp, 06 January, 2004, 22:18:26

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kepp

i use a timer, and its interval is 1 second, Each second it's cheking

if something == something2 then
...
end

But how much will that take on my computer or my hub to check something like that out every second!??
Guarding    

NightLitch

depending what you gonna check or trigger...
//NL

kepp

Allright..

hmm :S      Just an example

time2 = "14:13:30"

function Main()
   StartTimer(1000)
   SetTimer()
end

function OnTimer()
time = date("%H:%M:%S")
   if time == time2 then
...
end
Guarding    

NightLitch

#3
looks like it should work but what you gonna trigger...

That will only go around...

Put a text message there and it will just loop ex:

SendToAll("Display text")

Dispay text will just reapting it self in main-chat...

all depends on the function you gonna trigger I think...

it can not do a too huge function the it gonna crash...

it will take resources...

put up the hole function and show us...

*EDIT*

missed a part... that will only trigger on that time/date

so you could set instead of sec in minutes
//NL

kepp

Well, yet i don't know what task it's gonna do, that's why im asking if it would take much recorces,

hm... it will loop yea... but in that example i can end it with StopTimer()

But thanks, Depends on how huge and how much the task is with other words?
Guarding    

NightLitch

this will be shown every day at given time:

time2 = "14:13:30"

function Main()
   StartTimer(60000)  -- 1 Min right ???
   SetTimer()
end

function OnTimer()
local time = date("%H:%M:%S")
   if time == time2 then
     SendToAll("Given time reached...")
   end
end
//NL

NightLitch

the more data to passm the more memory demanding...

Stop me if am Wrong so I know... anybody that is... Chilla, Tezlo etc.
//NL

kepp

yea... but like i said, that was just an example..

Would be perfect to perform tasks while you're gone ;)
Guarding    

NightLitch

Quotetasks while you're gone

humm.. how should take this... hehe

When Am gone... hmm ;-)
//NL

SMF spam blocked by CleanTalk