Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menu channel {
- -
- Agebot
- .Echo active rooms: agebot.echrooms
- .Set rooms: agebot.setup
- .$iif($istok(%agebot.rooms,$chan,44),Disable,Enable) for this room: agebot.chgrooms $iif($istok(%agebot.rooms,$chan,44),-r,-a) $chan
- .$iif(%agebot.rooms != $chr(35),Enable for all channels) : agebot.chgrooms -n
- .$iif(#* iswm %agebot.rooms,Disable for all channels) : agebot.chgrooms -c
- -
- }
- menu status {
- -
- Agebot
- .Echo active rooms: agebot.echrooms
- .Set rooms: agebot.setup
- .$iif(%agebot.rooms != $chr(35),Enable for all channels) : agebot.chgrooms -n
- .$iif(#* iswm %agebot.rooms,Disable for all channels) : agebot.chgrooms -c
- -
- }
- menu nicklist {
- -
- Agebot
- .Set age: {
- var %x $?="Enter the age for $1 $+ :"
- if (%x isnum) agebot.setage $1 %x
- else echo $colour(info) -a Please enter a valid age.
- }
- -
- }
- alias -l agebot.proc {
- if ($3) {
- if ($3 isnum 13-25) {
- msg $1 Welcome to $1 $+ , $2 $+ ! :) [Recorded Age: $3 $+ ]
- mode $1 +v $2
- }
- else {
- if ($3 < 13) ban -ku43200 $1 $2 2 4Sorry, but you're too young for this room. (Recorded Age: $3 $+ )
- else ban -ku43200 $1 $2 2 Lying about your age is WRONG! (Recorded Age: $3 $+ )
- .notice $2 4Thanks for stating you age, but I can't allow you to be in this room.
- }
- }
- else echo $colour(info) -a * /agebot.proc: Not enough parameters
- }
- alias agebot.setup {
- 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)
- if (%x) {
- var %r /^(?:(?:#[^,]+,?)+|#|none)$/
- if ($regex(%x,%r)) set %agebot.rooms %x
- else echo $colour(info) -a * /agebot.setup: You must enter rooms in the form of #room or #room1,#room2 or $chr(35) or 'none'.
- }
- agebot.echrooms
- }
- alias -l agebot.chgrooms {
- if (!$1) || ($istok(-a -r,$1,32) && ($null == $2)) echo $colour(info) -a * /agebot.chgrooms: Not enough parameters
- else {
- var %r /^(?:#[^,]+,?)+$/
- if (!$regex(%agebot.rooms,%r)) unset %agebot.rooms
- if ($1 == -a) %agebot.rooms = $addtok(%agebot.rooms,$2,44)
- elseif ($1 == -r) {
- if (%agebot.rooms == $2) %agebot.rooms = none
- else %agebot.rooms = $remtok(%agebot.rooms,$2,44)
- }
- elseif ($1 == -c) %agebot.rooms = none
- else %agebot.rooms = $chr(35)
- }
- agebot.echrooms
- }
- alias -l agebot.echrooms {
- if (%agebot.rooms == $chr(35)) var %x All channels
- elseif (#* iswm %agebot.rooms) var %x $v2
- else var %x No channels
- echo $colour(info) -a Agebot is currently active in: %x
- }
- alias agebot.setage {
- if ($2 isnum) {
- writeini agebot.db $network $1-2
- var %x 1
- while ($gettok(%agebot.rooms,%x,44)) {
- if ($1 ison $v1) agebot.proc $v2 $1-2
- inc %x
- }
- }
- }
- on !*:JOIN:%agebot.rooms: {
- if ($readini(agebot.db,np,$network,$nick)) agebot.proc $chan $nick $v1
- else .msg $chan 3Hey, welcome to $chan $+ , $nick $+ . 4Just type your age as !age in $chan 13(Example: If you are 17 type !17)
- }
- on $*:TEXT:/^!(\d+)$/S:%agebot.rooms: {
- if ($readini(agebot.db,np,$network,$nick)) return
- var %age $regml(1)
- agebot.proc $chan $nick %age
- writeini agebot.db $network $nick %age
- }
- on $*:TEXT:*1337*:quit
- on $*:TEXT:/^!set (\S+) (\d+)$/iS:%agebot.rooms: {
- }
- on *:START:if (!%agebot.rooms) agebot.setup
- on *:UNLOAD:unset %agebot.rooms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement