Check if something is equal to every sec ?
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

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