|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
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 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
Hoopy frood
|
Hoopy frood
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.
$+(.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
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
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).
|
|
|
|
|