!active (show no. of active nicks on chan)

By knoeki on Jan 26, 2009

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
   }
}

Comments

Sign in to comment.
Pangaea   -  Mar 26, 2012

knoeki, do you think there might be a way to make a a script to go with a multi server relay script so ppl can list nicks for the other channel via a notice as so not to msg the list of nicks in the target channel.
Like all nicks, as apposed to most active nicks

 Respond  
knoeki   -  Mar 07, 2012

@Pangaea: this is absolutely terrible code (: I could make something much better.

 Respond  
Pangaea   -  Oct 07, 2011

nice, sorta reminds me of !lastspoke / !lastline script
however, I dont suppose there is anyway for this script to say the names of the nicks..
perhaps have an option to ignore certain nicks too

just a suggestion :)
well done tho

 Respond  
knoeki   -  Jan 29, 2009

Thelmrac: yup... I don't know why I do this kind of stuff and also manage to not notice it at all... oh well... it works, and that's also important ;_)

 Respond  
TheImrac   -  Jan 28, 2009
If ($2 == $null) 
ElseIf ($me !ison $2)
Else

is more proper =)

 Respond  
knoeki   -  Jan 27, 2009

Your if-statements are a bit jumbled. and bad habits! :P

DAMN YOU BAD HABBITS?! WHY DO YOU TORMENT ME IN SUCH A CRUDE AND AWFUL WAY?!

;_)

 Respond  
Jonesy44   -  Jan 27, 2009

Your if-statements are a bit jumbled. and bad habits! :P

 Respond  
uneek   -  Jan 27, 2009

I like this script. There is a bot with this on my server and it can also do !active 30 or !active 60 and it gives the actives within your specified time frame,

 Respond  
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.