ChanServ Access List Sorter

By Apo123 on Aug 10, 2009

Normally, when you do a command like /chanserv access #channel list, you get the list of usernames and accesses sorted by time of entry into the list. This can make it difficult to see how many users of a certain access level are in your channel, and it can also make it hard to find specific records.

This script will take ChanServ's output and sort it by access level, so it's a lot easier to determine who has what access in a channel. Simply place in your remotes.

on *:NOTICE:*Num *Lev *Nick:*:{
  set %chanservaccess 1
  set %i 1
  set %currentlevellist $null
}

on ^$*:NOTICE:/^  (.*)  (.*)  (.*)/Si:*:{
  if (%chanservaccess == 1) {
    haltdef
    set %chanservaccess.level. [ $+ [ %i ] ] $regml(2)
    set %chanservaccess.name. [ $+ [ %i ] ] $regml(3)
    inc %i 1
    if ($+(*,$chr(32),$regml(2),$chr(32),*) !iswm %currentlevellist) {
      set %currentlevellist $+(%currentlevellist,$chr(32),$regml(2),$chr(32))
    }
  }
}

on ^*:NOTICE:End of access list.:*:{
  haltdef
  echo 5 -ta -ChanServ-  Name  Num  Lev
  set %currentlevellist $sorttok(%currentlevellist, 32, n)
  var %accessloopcounter 1
  var %nameincrementor 1
  var %accesslevelsdone $null
  while (%accessloopcounter <= $numtok(%currentlevellist, 32)) {
    var %currentaccesslevel $gettok(%currentlevellist, %accessloopcounter, 32)
    if ($+(*,$chr(32),%currentaccesslevel,*) iswm %accesslevelsdone) {
      inc %accessloopcounter
      continue
    }
    var %nameloopcounter 1
    while (%nameloopcounter < %i) {
      if (%currentaccesslevel == %chanservaccess.level. [ $+ [ %nameloopcounter ] ] ) {
        echo 5 -ta -ChanServ- $+ $chr(32) $+ $chr(32) $+ %nameincrementor $+ $chr(32) $+ $chr(32) $+ %currentaccesslevel $+ $chr(32) $+ $chr(32) $+ %chanservaccess.name. [ $+ [ %nameloopcounter ] ]
        inc %nameincrementor
      }
      inc %nameloopcounter
    }
    %accesslevelsdone = $+(%accesslevelsdone,$chr(32),%currentaccesslevel)
    inc %accessloopcounter
  }
  echo 5 -ta -ChanServ- End of access list.
  unset %chanservaccess
  unset %chanservaccess.*
  unset %i
  unset %currentlevellist
}

Comments

Sign in to comment.
D2K7   -  Aug 10, 2009

Yes exactly that

 Respond  
Apo123   -  Aug 10, 2009

You mean like add the information from /ns info nick to a /whois?

 Respond  
D2K7   -  Aug 10, 2009

Now i like This i like it alot it's very help full can you do one so Like when u do a /ns info nick It would come up in main channel and so when u do whois it will do it with that :D

 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.