Would I be able to create a timer that can be triggered, reset and shown on command?
I'm having a hard to figuring this out. Basically, I want to be able to show how long a stream has been going for and will need a mod to trigger the timer. Thank you ^^
You can /inc a global var OR /hinc a hash table item using the -c switch, which will increase the value once per second.
Basic example (using hash table items):
alias stream return $hget(stream,$+($1@,$2))
on $*:TEXT:/^~timer($| (on|off|reset))/Si:#Meta_Testing_Stuff:{
if $nick isop # {
var %t $+(#,@,$network), %r, %n $stream(#,$network)
:RESET
if $regml(2) == on || %r {
if %n != $null { .notice $nick The timer is already running! }
else {
hinc -mc stream %t
msg # The timer has been $iif($regml(2) == reset,restarted!,started!)
}
}
elseif $regml(2) {
if %n == $null { .notice $nick The timer is not currently running. }
else {
hdel stream %t
if $regml(2) == off { msg # The timer has been stopped! [[ $+ $duration(%n) $+ ] }
else {
var %r $true, %n
goto RESET
}
}
}
else msg # The timer $iif(%n != $null,has been running for: $duration(%n),is not currently running.)
}
}
Edit: The /hdel command should not have used the -c switch; removed.
Thank you! I've been looking for solutions forever! I was thinking of how I could use the timer already existing but yeah
Thank you very much! I'll work on it :)
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.
You can /inc a global var OR /hinc a hash table item using the -c switch, which will increase the value once per second.
Basic example (using hash table items):
Edit: The /hdel command should not have used the -c switch; removed.