mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2006
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Sep 2006
Posts: 2
Hi,

I want to use a timer to check the value of a variable %Var every X seconds. And then if %Var has changed I need the timer to execute another command and halt the timer.

How do I go about doing this?

I've tried:

Code:
%Var = 1

timer 15 1 if (%Var == 0) { command here }


Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
use an alias

timer 15 1 check
Code:
alias check {
if (%var == 0) { command here }
}



-Kurdish_Assass1n
Joined: Mar 2006
Posts: 47
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Mar 2006
Posts: 47
Would it work to use $iif identifier?

/timer 39 29 $iif(%this == %that,command here)

Or would the conditional only evaluate once?

Last edited by CitizenKane; 14/01/07 02:40 PM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Originally Posted By: CitizenKane
Would it work to use $iif identifier?

/timer 39 29 $iif(%this == %that,command here)

Or would the conditional only evaluate once?


You'd have to prevent mIRC from evaluating it when the timer is first set by using something like timer 39 29 $!iif(%this == $!+(%,that),command here). In other words it's ugly as sin so it's usually better to use an alias.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
Originally Posted By: starbucks_mafia

You'd have to prevent mIRC from evaluating it when the timer is first set by using something like timer 39 29 $!iif(%this == $!+(%,that),command here).


not quite, would be $!iif(%this == $+(%,that) ,command) or $!iif(%this == $!(%that),command). while it may be easier to use an alias, i personally enjoy the challenge of considering how each part evaluates.. especially with longer and more complex series of evaluations laugh


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Yeah, messed that up didn't I wink? Just goes to show that trying to mess around with non-evaluation is usually more trouble then it's worth, especially in mIRC where you get the unpleasant side-effect of whitespace becoming synactically signficant in places where it usually wouldn't be.


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard