Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; USAGE: /channels [snc] [color]
- ; s: "Silent" - Omit channel list (good idea in channels that don't allow advertising or for keeping your channels private)
- ; n: "No colors" - Strip colors from output (good for channels with control codes blocked or channels where color usage is not welcome)
- ; a: "Action" - Use CTCP ACTION (/me) instead of PRIVMSG (normal message to channel or user) to list information
- ; 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
- ; default color (4, red) will be used. If -n is used, this does nothing. If no color is specified, a random one is chosen.
- ;The beginning of the ALIAS definition
- alias channels {
- var %totalchans $chan(0)
- var %op = 0, %hop = 0, %voice = 0, %owner = 0, %sop = 0
- var %n 1
- if (%totalchans == 0) {
- $iif(a isincs $1,me is not currently on any channels.,say I am not currently in any channels.)
- halt
- }
- while ($chan(%n)) {
- var %chans %chans $chan(%n)
- inc %op $iif(@ isin $nick($chan(%n),$me).pnick,1,0)
- inc %hop $iif($chr(37) isin $nick($chan(%n),$me).pnick,1,0)
- inc %voice $iif(+ isin $nick($chan(%n),$me).pnick,1,0)
- inc %owner $iif(~ isin $nick($chan(%n),$me).pnick,1,0)
- inc %sop $iif(& isin $nick($chan(%n),$me).pnick,1,0)
- inc %n
- }
- ;set the color here
- if (c !isincs $1) { var %col 4 }
- else {
- if ($2) {
- if ($2 !isnum 0-15) { var %col 4 }
- else { var %col $2 }
- }
- else { var %col $r(0,15) }
- }
- var %chanline $+(,%col,%chans,) $+ , a total of $+(,%totalchans,) $+(channel,$iif(%totalchans == 1,$null,s),.)
- var %opline $+(,%col,Voice) (+v/+) in $+(,%voice,) $+(channel,$iif(%voice == 1,$null,s)) ( $+ $+($round($calc(100*(%voice / %totalchans)),0),$chr(37)) $+ ), $&
- $+(,%col,Halfop) (+h/%) in $+(,%hop,) $+(channel,$iif(%hop == 1,$null,s)) ( $+ $+($round($calc(100*(%hop / %totalchans)),0),$chr(37)) $+ ), $&
- $+(,%col,Op) (+o/@) in $+(,%op,) $+(channel,$iif(%op == 1,$null,s)) ( $+ $+($round($calc(100*(%op / %totalchans)),0),$chr(37)) $+ ), $&
- $+(,%col,Protect) (+a/&) in $+(,%sop,) $+(channel,$iif(%sop == 1,$null,s)) ( $+ $+($round($calc(100*(%sop / %totalchans)),0),$chr(37)) $+ ), $&
- and $+(,%col,Owner) (+q/~) in $+(,%owner,) $+(channel,$iif(%owner == 1,$null,s)) ( $+ $+($round($calc(100*(%owner / %totalchans)),0),$chr(37)) $+ ).
- if (s !isincs $1) { $iif(a isincs $1,me is on:,say I am on:) $iif(n isincs $1,$remove($strip(%chanline),),%chanline) }
- $iif(a isincs $1,me has,say I have) $iif(n isincs $1,$remove($strip(%opline),),%opline)
- }
- ;EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement