Advertisement
Guest User

/channels again

a guest
Jan 11th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.77 KB | None | 0 0
  1. ;/channels (Remade on 1/11/2014 @ 3:38AM CST) by Cinos Modnar <cinos@mtbnc.us>
  2. ;
  3. ;  USAGE: /channels [snc] [color]
  4. ;     s: "Silent" - Omit channel list (good idea in channels that don't allow advertising or for keeping your channels private)
  5. ;     n: "No colors" - Strip colors from output (good for channels with control codes blocked or channels where color usage is not welcome)
  6. ;     a: "Action" - Use CTCP ACTION (/me) instead of PRIVMSG (normal message to channel or user) to list information
  7. ;     c: "Color" - Use a custom color for highlighted parts of the message. Only use the a valid number from 0 to 15. Any invalid numbers will be ignored, and the
  8. ;                  default color (4, red) will be used. If -n is used, this does nothing. If no color is specified, a random one is chosen.
  9.  
  10. ;The beginning of the ALIAS definition
  11. alias channels {
  12.   var %totalchans $chan(0)
  13.   var %op = 0, %hop = 0, %voice = 0, %owner = 0, %sop = 0
  14.   var %n 1
  15.   if (%totalchans == 0) {
  16.     $iif(a isincs $1,me is not currently on any channels.,say I am not currently in any channels.)
  17.     halt
  18.   }
  19.   while ($chan(%n)) {
  20.     var %chans %chans $chan(%n)
  21.     inc %op $iif(@ isin $nick($chan(%n),$me).pnick,1,0)
  22.     inc %hop $iif($chr(37) isin $nick($chan(%n),$me).pnick,1,0)
  23.     inc %voice $iif(+ isin $nick($chan(%n),$me).pnick,1,0)
  24.     inc %owner $iif(~ isin $nick($chan(%n),$me).pnick,1,0)
  25.     inc %sop $iif(& isin $nick($chan(%n),$me).pnick,1,0)
  26.     inc %n
  27.   }
  28.  
  29.   ;set the color here
  30.   if (c !isincs $1) { var %col 4 }
  31.   else {
  32.     if ($2) {
  33.       if ($2 !isnum 0-15) { var %col 4 }
  34.       else { var %col $2 }
  35.     }
  36.     else { var %col $r(0,15) }
  37.   }
  38.   var %chanline $+(,%col,%chans,) $+ , a total of $+(,%totalchans,) $+(channel,$iif(%totalchans == 1,$null,s),.)
  39.  
  40.   var %opline $+(,%col,Voice) (+v/+) in $+(,%voice,) $+(channel,$iif(%voice == 1,$null,s)) ( $+ $+($round($calc(100*(%voice / %totalchans)),0),$chr(37)) $+ ), $&
  41.     $+(,%col,Halfop) (+h/%) in $+(,%hop,) $+(channel,$iif(%hop == 1,$null,s)) ( $+ $+($round($calc(100*(%hop / %totalchans)),0),$chr(37)) $+ ), $&
  42.     $+(,%col,Op) (+o/@) in $+(,%op,) $+(channel,$iif(%op == 1,$null,s)) ( $+ $+($round($calc(100*(%op / %totalchans)),0),$chr(37)) $+ ), $&
  43.     $+(,%col,Protect) (+a/&) in $+(,%sop,) $+(channel,$iif(%sop == 1,$null,s)) ( $+ $+($round($calc(100*(%sop / %totalchans)),0),$chr(37)) $+ ), $&
  44.     and $+(,%col,Owner) (+q/~) in $+(,%owner,) $+(channel,$iif(%owner == 1,$null,s)) ( $+ $+($round($calc(100*(%owner / %totalchans)),0),$chr(37)) $+ ).
  45.  
  46.   if (s !isincs $1) { $iif(a isincs $1,me is on:,say I am on:) $iif(n isincs $1,$remove($strip(%chanline),),%chanline)  }
  47.   $iif(a isincs $1,me has,say I have) $iif(n isincs $1,$remove($strip(%opline),),%opline)
  48.  
  49. }
  50. ;EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement