Guest User

Untitled

a guest
Jun 25th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. /*
  2. � /nicks
  3. � by toggle^/Yigxi
  4. � Syntax
  5. � Not as an identifier
  6. � /nicks #channel (aohvr) [prop]
  7. � Example: (#Lunaranime contains 400 people at the moment with 20 ops, 12 voices, and 14 hops)
  8.  
  9. � /nicks #Lunaranime ohv
  10. � ^ Returns those 20 ops, 12 voices, and 14 hops
  11.  
  12. � /nicks #Lunaranime ohv pnick
  13. � ^ returns the 20 ops, 12 voices, and 14 hops including the .pnick (@,%,+)
  14.  
  15. � Obviously we have 354 regular users left. Let's say 42 of them are idle.
  16. � /nicks #Lunaranime r idle
  17. � ^ returns the matching 42 nicks.
  18.  
  19. � Basically, the properties in /nicks are equivilent to $nick's properties.
  20. � For quick reference:
  21. � a = all nicks, o = ops, h = halfops, v = voiced nicks, r = regular users
  22. � The color property will return the nicks color in the nicklist
  23. � Obviously, the pnick property will return the .pnick format of the nick.
  24. � The idle property returns the nicks that are idle out of your parameters.
  25. � As an identifier
  26. � $nicks(#channelname,aohvr,[pnick|color|idle]).[N|t]
  27. � ^ #channelname being the channel
  28. � ^ ahovr being our params.
  29. � ^ [pnick|color|idle] being even more specific params.
  30. � ^ [N] returns the Nth list of nicks (multiple lists are created for large channels)
  31. � ^ [t] returns the total number of lists, making it easier to know which lists to view.
  32. */
  33.  
  34. alias nicks {
  35. if (!$1-2 || $me !ison $1 || $2 !isin aohvr) {
  36. $iif($isid,return $null,echo -ac info * /nicks: insufficient parameters)
  37. }
  38. var %x = 1, %u = 1
  39. if ($hget(nicks)) .hfree nicks
  40. .hmake nicks
  41. while (%x <= $nick($1,0,$2)) {
  42. if ($len($hget(nicks,$+(nicks,.,$1,.,%u))) > 900) inc %u
  43. hadd nicks $+(nicks,.,$1,.,%u) $hget(nicks,$+(nicks,.,$1,.,%u)) $iif($3,$($+($,nick($1,%x,$2),.,$3),2),$nick($1,%x,$2))
  44. inc %x
  45. }
  46. if (($isid) && ($prop)) return $iif($prop == t,$hget(nicks,0).item,$hget(nicks,$prop).data)
  47. else {
  48. var %t = 1
  49. while ($hget(nicks,%t).item) {
  50. echo -ac info2 -
  51. if (%t = 1 && !$hget(nicks,%t).data) {
  52. echo -ac info No matches.
  53. break
  54. }
  55. else echo -ac info $hget(nicks,%t).data
  56. inc %t
  57. }
  58. }
  59. }
Add Comment
Please, Sign In to add comment