Advertisement
westor

Channel Ops Status in StatusBar for Sonny v1.0

May 11th, 2019
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.02 KB | None | 0 0
  1. ; For AdiIRC v3.4+
  2.  
  3. ON *:LOAD: {
  4.   if ($active == $chan) { update_opstats $chan }
  5. }
  6.  
  7. ON *:UNLOAD: { .timer[OPS_STATS] off | close_opstats }
  8.  
  9. ON *:QUIT: { if ($active ischan) { .timer[OPS_STATS] -h 1 1500 update_opstats $active } }
  10. ON *:JOIN:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  11. ON *:PART:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  12. ON *:OWNER:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  13. ON *:DEOWNER:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  14. ON *:ADMIN:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  15. ON *:DEADMIN:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  16. ON *:OP:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  17. ON *:DEOP:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  18. ON *:HELP:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  19. ON *:DEHELP:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  20. ON *:VOICE:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  21. ON *:DEVOICE:#: { if ($active == $chan) { .timer[OPS_STATS] -h 1 1500 update_opstats $chan } }
  22.  
  23. ON *:APPACTIVE: {
  24.   .timer[OPS_STATS] off
  25.   close_opstats
  26.   if ($appactive) && ($active ischan) { update_opstats $target }
  27. }
  28.  
  29. ON *:ACTIVE:*: {
  30.   .timer[OPS_STATS] off
  31.   close_opstats
  32.   if ($target ischan) { .timer[OPS_STATS] -h 1 500 update_opstats $target }
  33. }
  34.  
  35. alias close_opstats {
  36.   if ($statusbar(opstatsep)) { statusbar -h opstatsep }
  37.   if ($statusbar(opstats)) { statusbar -h opstats }
  38. }
  39.  
  40. alias update_opstats {
  41.   if (!$1) || ($status !== connected) || ($active !ischan) || ($1 !ischan) { close_opstats | return }
  42.  
  43.   var %t = $nick($1,0)
  44.   var %prefix = $prefix
  45.  
  46.   var %owners = 0
  47.   var %admins = 0
  48.   var %ops = 0
  49.   var %halfops = 0
  50.   var %voicers = 0
  51.  
  52.   var %i = 1
  53.   while (%i <= %t) {
  54.     var %p = $nick($1,%i).cmode
  55.  
  56.     if (*~* iswm %prefix) && (~ == %p) { inc %owners 1 }
  57.     if (*&* iswm %prefix) && ($chr(38) == %p) { inc %admins 1 }
  58.     if (*@* iswm %prefix) && (@ == %p) { inc %ops 1 }
  59.     if (*%* iswm %prefix) && ($chr(37) == %p) { inc %halfops 1 }
  60.     if (*+* iswm %prefix) && (+ == %p) { inc %voicers 1 }
  61.  
  62.     inc %i
  63.   }
  64.  
  65.   var %line = $iif(*~* iswm %prefix,Owners: %owners $chr(166)) $iif(*&* iswm %prefix,Admins: %admins $chr(166)) $iif(*@* iswm %prefix,Ops: %ops $chr(166)) $iif(*%* iswm %prefix,HalfOps: %halfops $chr(166)) $iif(*+* iswm %prefix,Voicers: %voicers $chr(166)) Regular: $nick($1,0,r)
  66.  
  67.   if (!$statusbar(opstatsep)) { statusbar -a opstatsep $qt() $chr(160) $qt() | return }
  68.   if (!$statusbar(opstats)) { statusbar -a opstats $qt(%line) @opstats $qt(%line) | return }
  69.  
  70.   statusbar -w opstatsep
  71.   statusbar -wg opstats $qt(%line)
  72. }
  73.  
  74. menu @opstats {
  75.   Announce in $active $+ :say Currenly on $active are: $statusbar(opstats).text
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement