Hi all,
I'm trying to make a very simple script, but have some troubles with a timer..
Firstly, here's what I did :
/stock {
/set %stock $1
/set %timeleft $2
msg $chan Current stock : %stock - Time left : %timeleft
.timer $calc($2 * 2) 1 set %timeleft $calc(%timeleft - 0.5)
}
So when I type, for example, /stock 115 5000, people on the chan are alerted of the new Stock and Time left.
Now, people can also check the Stock and Time left at any time by typing !stock. So I added in Remote :
on *:TEXT:!stock:*:{
notice $nick Current stock : %stock - Time left : %timeleft
}
Now, my problem is that the time left is supposed to be reduced of 0.5 every second. But it seems to stop after the first change, so people will always see the same value (timeleft - 0.5) every time they type !stock.
1) What's wrong in my script ?
2) Any solution ? Thanks
~ Crupu