Another fun little trigger I made, and also my first time playing with hashtables.
usage:
!active <#chan>
shows active nicks in the past few minutes on the current channel, or another channel, if specified. (the bot must be on the other channel for it to work, obviously).
it also conveniently saves the highest amount of active nicks in an ini file.
[00:43:38] <~Knoeki> !active
[00:43:39] <&miffy> There have been 3 active nicks on #zomgwtfbbq in the last few minutes. Record: 12
on *:TEXT:!active*:#: {
if ($2 == $null) {
/msg $chan There have been $hget(active.nicks. [ $+ [ $chan ] ], 0).item active nicks on $chan in the last few minutes. Record: $readini($scriptdiractivenicks.ini, $chan, record)
}
else {
if ($me ison $2) {
/msg $chan There have been $hget(active.nicks. [ $+ [ $2 ] ], 0).item active nicks on $2 in the last few minutes. Record: $readini($scriptdiractivenicks.ini, $2, record)
}
else {
/msg $chan I'm not on $2 $+ .
}
}
}
on *:TEXT:*:#: {
/hadd -mu120 active.nicks. [ $+ [ $chan ] ] $nick 1
if ($hget(active.nicks. [ $+ [ $chan ] ], 0).item > $readini($scriptdiractivenicks.ini, $chan, record)) {
/writeini $qt($scriptdiractivenicks.ini) $chan record $hget(active.nicks. [ $+ [ $chan ] ], 0).item
}
elseif ($readini($scriptdiractivenicks.ini, $chan, record) == $null) {
/writeini $qt($scriptdiractivenicks.ini) $chan record $hget(active.nicks. [ $+ [ $chan ] ], 0).item
}
}