Advertisement
debiangr

Untitled

Apr 12th, 2023
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. ON *:START: {
  2. var %h = GOODNICK
  3. var %f = $mircdirdata\ $+ %h $+ .list
  4.  
  5. if (!$file(%f)) { return }
  6.  
  7. hmake %h 3000
  8. hload %h $qt(%f)
  9. }
  10.  
  11. alias gnadd {
  12. tokenize 32 $strip($1-)
  13.  
  14. var %h = GOODNICK
  15. var %d = $hfind(%h,$1,0,W).data
  16.  
  17. if (!$1) { echo 4 -gate Error: Please specify a parameter! | return }
  18. if (%d) { echo 4 -gate Error: Already exists $qt($1) in %h list! | return }
  19.  
  20. hadd -m %h $ctime $1
  21. hsave %h $qt($mircdirdata\ $+ %h $+ .list)
  22.  
  23. echo 3 -gate Added $qt($1) in the %h list. - Total: $hget(%h,0).item
  24. }
  25.  
  26. alias gndel {
  27. tokenize 32 $strip($1-)
  28.  
  29. var %h = GOODNICK
  30. var %d = $hfind(%h,$1,1,W).data
  31.  
  32. if (!$1) { echo 4 -gate Error: Please specify a parameter! | return }
  33. if (!%d) { echo 4 -gate Error: Not exists $qt($1) on the %h list! | return }
  34.  
  35. hdel %h %d
  36. hsave %h $qt($mircdirdata\ $+ %h $+ .list)
  37.  
  38. echo 3 -gate Removed $qt($1) from the %h list. - Total: $hget(%h,0).item
  39. }
  40.  
  41. alias gnlist {
  42. var %h = GOODNICK
  43. var %t = $hget(%h,0).item
  44.  
  45. if (!%t) { echo 4 -gate Error: %h list is empty! | return }
  46.  
  47. echo 10 -gate Display all %h list..
  48.  
  49. var %i = 1
  50. while (%i <= %t) {
  51. var %item = $hget(%h,%i).item
  52. var %data = $hget(%h,%item)
  53.  
  54. if (%item) && (%data) { echo 6 -gate $+($chr(35),%i,:) %data - Added on: $asctime(%item) }
  55.  
  56. inc %i
  57. }
  58.  
  59. echo 10 -gate End of %h list.
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement