mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:connect:{
   $+(.timeridle,.,$cid) -m 0 500 .scon -at1 $iif($!idle == 60,inc $+(%,new.idle,.,$!network),$iif($!idle <= 10, set $+(%,new.idle,.,$!network) 0))
 } 

Returns */set: invalid parameters
Code:
 on *:connect: {   $+(.timeridle,.,$cid) -m 0 500 .scon -at1 idle3 }
alias idle3 {
$iif($!idle == 60,inc $+(%,new.idle,.,$!network),$iif($!idle <= 10,set $+(%,new.idle,.,$!network) 0))
} 

Second code works. Aside from the fact that the second code calls an alias, I don't see any difference, so why doesn't the first one work?

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I found that the simplest way to use identifiers in timer/scon commands is to use the $eval(,0) or $(,0) id.
Code:
  $+(.timeridle,.,$cid) -m 0 500 $(.scon -at1 $iif($idle == 60,inc $+(%,new.idle,.,$network),$iif($idle <= 10, set $+(%,new.idle,.,$network) 0)),0)


-genius_at_work

Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
thanks

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
without checking i would believe that that this should also work.

on *:connect:{ $+(.timeridle,.,$cid) -m 0 500 .scon -at1 $!iif($idle == 60,inc $!+(%,new.idle,.,$network),$iif($idle <= 10, set $!+(%,new.idle,.,$network) 0)) }

You were !'ing the wrong $identifiers, only the ones directly preceded by a space need doing, anything following text never gets evaluated

I do however like genius's $eval( ,0) method, of course it starts running into some problems if your needing to source some of the line from vars, say the 60 was in %tripval but you didnt want it using %tripval just the contents of it. (sorry couldnt think of a more realistic example of somewhere that you would want partial evaluation and have a problem becuase of $eval ( ,0).


Link Copied to Clipboard