mIRC Home    About    Download    Register    News    Help

Print Thread
Timing Something? #45042 30/08/03 05:39 AM
Joined: Aug 2003
Posts: 29
2
2big Offline OP
Ameglian cow
OP Offline
Ameglian cow
2
Joined: Aug 2003
Posts: 29
Is there a way to time something without a timer? Like increment something by 1 every second(not necessarily timing), or keeping someone else's online time, (or time in a channel) by incrementing a variable every second they are there? I've looked everywhere in the help file. Any help is appreciated.

Re: Timing Something? #45043 30/08/03 05:51 AM
Joined: Dec 2002
Posts: 169
J
Jerk Offline
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
/inc [-cszuN] <%var> [value]
This increases the value of %var by value.

If you specify the -uN switch, %var is increased by the value once and then %var is unset N seconds later, assuming it is not set again by another script.

The -c switch increases %var once per second.

The -z switch decreases %var until it reaches zero and then unsets it.

-

A better way to time something is store $ctime in a variable when you want to start timing. To determine the elapsed time simply $calc($ctime - %variable)

Re: Timing Something? #45044 30/08/03 10:26 AM
Joined: Dec 2002
Posts: 774
T
theRat Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
just set a variable to $ctime when you start "timing" and when stopped you decrease the var from current $ctime

00:00:10 Start %start = $ctime = 10
00:10:15 End %end = $ctime = 615

duration = %end - %start = 605


Code:
//if ( khaled isgod ) echo yes | else echo no