mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2017
Posts: 57
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 57
So I have this specific timer, as follows:

timerHealth.$nick $calc(%rpgMaxHealth.$nick - %rpgCurrentHealth.$nick) 15 inc %rpgCurrentHealth.$nick

The name works, the command works, but for whatever reason, the $calc() doesn't.
If %rpgCurrentHealth.$nick is 75 and %rpgMaxHealth.$nick is 100, then $calc(%rpgMaxHealth.$nick - %rpgCurrentHealth.$nick) should return 25, right?

So the timer SHOULD be
timerHealth.kuboskube 25 15 inc %rpgCurrentHealth.kuboskube

But instead it comes out
timerHealth.kuboskube 100 15 inc %rpgCurrentHealth.kuboskube

The EXACT code I'm using is
Quote:
timerHealth. [ $+ [ $nick ] ] $calc((%rpgMaxHealth. [ $+ [ $nick ] ] )- (%rpgCurrentHealth. [ $+ [ $nick ] ] )) 15 inc %rpgCurrentHealth. [ $+ [ $nick ] ]

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Try "$!calc" - /timer requires "!" to re-evaluate ids.


Dont give a fish - teach to fish!
Joined: Jan 2017
Posts: 57
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 57
I actually ended up putting those timers in an alias and I removed the $calc to outside the timer, so instead it's

set %rpgMissingHealth.$nick $calc($2-$1)

timerRpg.regen.$nick %rpgMissingHealth.$nick 15 inc %rpgCurrentHealth.$nick

But if I ever need to put the calc straight into the timer, I'm gonna try your suggestion.


Link Copied to Clipboard