Advertisement
SpliftOn

TRAK USERS

Sep 28th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. ON *:START: {
  2. ; Create a hash table and load the saved user data
  3. hmake trackusers 10
  4. if ($isfile(trackusers.dat)) {
  5. hload trackusers trackusers.dat
  6. }
  7. }
  8. on *:JOIN:#: {
  9. ; Check if there are any nicknames for this mask
  10. if ($hget(trackusers,$address($nick,2))) {
  11. var %n = $ifmatch
  12. ; Delete the current nickname from the list of used nicknames
  13. if ($istok(%n,$nick,32)) { var %d = $deltok(%n,$findtok(%n,$nick,1,32),32) }
  14. else { var %d = %n }
  15. ; If there are no nicknames left in the list then stop
  16. if (!%d) { return }
  17. ; Display the nicknames
  18. echo $colour(info) -ti2 $chan * $nick has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
  19. if (!$istok(%n,$nick,32)) {
  20. ; Add the current nickname to the list
  21. hadd trackusers $address($nick,2) %n $nick
  22. }
  23. }
  24. else {
  25. ; Create a new entry for this mask
  26. hadd trackusers $address($nick,2) $nick
  27. }
  28. }
  29. on *:NICK: {
  30. if ($hget(trackusers,$address($newnick,2))) {
  31. var %n = $ifmatch
  32. if (!$istok(%n,$newnick,32)) {
  33. ; Append the new nickname to the list for this mask
  34. hadd trackusers $address($newnick,2) %n $newnick
  35. }
  36. }
  37. else {
  38. ; Create a new entry for this mask
  39. hadd trackusers $address($nick,2) $newnick
  40. }
  41. }
  42. -
  43. menu nicklist,query {
  44. -
  45. Track Users
  46. .View Other Nicknames:{
  47. if (!$address($$1,2)) { echo $colour(info) -ti2 # * IAL not updated for $$1 $+ , performing userhost lookup | userhost $$1 | return }
  48. if ($hget(trackusers,$address($$1,2))) {
  49. var %n = $ifmatch
  50. if ($istok(%n,$$1,32)) { var %d = $deltok(%n,$findtok(%n,$$1,1,32),32) }
  51. else { var %d = %n }
  52. if (!%d) { goto notknown }
  53. echo $colour(info) -ti2 # * $$1 has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
  54. }
  55. else {
  56. :notknown
  57. echo $colour(info) -ti2 # * $$1 has not been known by any other nickname
  58. }
  59. }
  60. ; This resets the data for this nick's mask only
  61. .Reset:hdel trackusers $address($$1,2)
  62. }
  63. ON *:EXIT: {
  64. ; Save data on exit
  65. if ($hget(trackusers)) { hsave -o trackusers trackusers.dat }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement