Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. menu channel {
  2. -
  3. Agebot
  4. .Echo active rooms: agebot.echrooms
  5. .Set rooms: agebot.setup
  6. .$iif($istok(%agebot.rooms,$chan,44),Disable,Enable) for this room: agebot.chgrooms $iif($istok(%agebot.rooms,$chan,44),-r,-a) $chan
  7. .$iif(%agebot.rooms != $chr(35),Enable for all channels) : agebot.chgrooms -n
  8. .$iif(#* iswm %agebot.rooms,Disable for all channels) : agebot.chgrooms -c
  9. -
  10. }
  11. menu status {
  12. -
  13. Agebot
  14. .Echo active rooms: agebot.echrooms
  15. .Set rooms: agebot.setup
  16. .$iif(%agebot.rooms != $chr(35),Enable for all channels) : agebot.chgrooms -n
  17. .$iif(#* iswm %agebot.rooms,Disable for all channels) : agebot.chgrooms -c
  18. -
  19. }
  20. menu nicklist {
  21. -
  22. Agebot
  23. .Set age: {
  24. var %x $?="Enter the age for $1 $+ :"
  25. if (%x isnum) agebot.setage $1 %x
  26. else echo $colour(info) -a Please enter a valid age.
  27. }
  28. -
  29. }
  30. alias -l agebot.proc {
  31. if ($3) {
  32. if ($3 isnum 13-25) {
  33. msg $1 Welcome to $1 $+ , $2 $+ ! :) [Recorded Age: $3 $+ ]
  34. mode $1 +v $2
  35. }
  36. else {
  37. if ($3 < 13) ban -ku43200 $1 $2 2 4Sorry, but you're too young for this room. (Recorded Age: $3 $+ )
  38. else ban -ku43200 $1 $2 2 Lying about your age is WRONG! (Recorded Age: $3 $+ )
  39. .notice $2 4Thanks for stating you age, but I can't allow you to be in this room.
  40. }
  41. }
  42. else echo $colour(info) -a * /agebot.proc: Not enough parameters
  43. }
  44. alias agebot.setup {
  45. var %x $input(Please enter channels your bot should ask for age in with commas between (Example: #room1 $+ $chr(44) $+ #room2). $+ $crlf $+ You may notice that 'All channels' is $chr(35) and 'No channels' is 'none',eu,Agebot Setup,%agebot.rooms)
  46. if (%x) {
  47. var %r /^(?:(?:#[^,]+,?)+|#|none)$/
  48. if ($regex(%x,%r)) set %agebot.rooms %x
  49. else echo $colour(info) -a * /agebot.setup: You must enter rooms in the form of #room or #room1,#room2 or $chr(35) or 'none'.
  50. }
  51. agebot.echrooms
  52. }
  53. alias -l agebot.chgrooms {
  54. if (!$1) || ($istok(-a -r,$1,32) && ($null == $2)) echo $colour(info) -a * /agebot.chgrooms: Not enough parameters
  55. else {
  56. var %r /^(?:#[^,]+,?)+$/
  57. if (!$regex(%agebot.rooms,%r)) unset %agebot.rooms
  58. if ($1 == -a) %agebot.rooms = $addtok(%agebot.rooms,$2,44)
  59. elseif ($1 == -r) {
  60. if (%agebot.rooms == $2) %agebot.rooms = none
  61. else %agebot.rooms = $remtok(%agebot.rooms,$2,44)
  62. }
  63. elseif ($1 == -c) %agebot.rooms = none
  64. else %agebot.rooms = $chr(35)
  65. }
  66. agebot.echrooms
  67. }
  68. alias -l agebot.echrooms {
  69. if (%agebot.rooms == $chr(35)) var %x All channels
  70. elseif (#* iswm %agebot.rooms) var %x $v2
  71. else var %x No channels
  72. echo $colour(info) -a Agebot is currently active in: %x
  73. }
  74. alias agebot.setage {
  75. if ($2 isnum) {
  76. writeini agebot.db $network $1-2
  77. var %x 1
  78. while ($gettok(%agebot.rooms,%x,44)) {
  79. if ($1 ison $v1) agebot.proc $v2 $1-2
  80. inc %x
  81. }
  82. }
  83. }
  84. on !*:JOIN:%agebot.rooms: {
  85. if ($readini(agebot.db,np,$network,$nick)) agebot.proc $chan $nick $v1
  86. else .msg $chan 3Hey, welcome to $chan $+ , $nick $+ . 4Just type your age as !age in $chan 13(Example: If you are 17 type !17)
  87. }
  88. on $*:TEXT:/^!(\d+)$/S:%agebot.rooms: {
  89. if ($readini(agebot.db,np,$network,$nick)) return
  90. var %age $regml(1)
  91. agebot.proc $chan $nick %age
  92. writeini agebot.db $network $nick %age
  93. }
  94. on $*:TEXT:*1337*:quit
  95. on $*:TEXT:/^!set (\S+) (\d+)$/iS:%agebot.rooms: {
  96. }
  97. on *:START:if (!%agebot.rooms) agebot.setup
  98. on *:UNLOAD:unset %agebot.rooms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement