Help with binding commands to channels. - 24/07/15 09:03 PM
So I am trying to learn this. How would I bind channels on something like this script to only activate on that one channel and disable if you wish to. I am trying to make it so that this script will turn on links in only the channel that activated the script and I am also trying to figure out how to make points system be able to be turned off by an on or off command. Here are the two scripts. Nillen helped me with the points system. I also can't get !addreg to work with the link script either. Last but least, how would I create an on and off command for this script.
Regards,
Powerade661
Points system
Links system
Code:
on *:text:*:#:{ if ($nick == $remove(#,$chr(35))) { return } if ($nick == nightbot) { return } if ($nick == wizebot) { return } if ($nick == moobot) { return } if !$readini(activity.ini,n,$chan,$nick) { msg $chan /me Welcome to the stream $nick $+ ! :) /writeini activity.ini $chan $nick $ctime } }
Regards,
Powerade661
Points system
Code:
on !*:JOIN:#:{ $+(.timerpoints.,#,.,$nick) 0 300 add.pts # $+(#,.,$nick) add.pts # $+(#,.,$nick) } on !*:PART:#:$+(.timerpoints.,#,.,$nick) off alias add.pts { if ($mid($1,2-) ison $1) writeini -n Points.ini $2 Points $calc($readini(Points.ini,$2,Points) + 1) } on *:text:!Points:#: msg # $nick has $iif($readini(Points.ini,$+(#,.,$nick),Points),$v1,0) points. on $*:text:/!Points (add|remove)/Si:#:{ if ($nick isop #) { if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return } writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1)) msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. } else msg $chan This command is only available to moderators. }
Links system
Code:
on *:text:!links *:#: { if ($nick isop #) { if ($2 == on) { if (%links) { msg # Link protection is already enabled return } else { msg # Link protection enabled set %links On return } } if ($2 == off) { if (%links) { msg # Link protection disabled unset %links on return } else { msg # Link protection is already disabled return } } else { msg # ' $+ $2 $+ ' is not a valid function. use '!links on' to enable link protection and '!links off' to disable it again. } } } on *:text:!permit*:#: { if ($nick isop #) { if (%links) { set -u30 %permit $addtok(%permit,$2,32) msg $chan You have 30 seconds to post a link, $2 } } } on *:text:!addreg *:#: { if ($nick isop #) { var %m = $read($chan $+ regulars.txt,ns,$2) if (!%m) { .write $chan $+ regulars.txt $2 | msg $chan $2 was successfully to the regulars list. | return } else { .msg $chan $2 is already in the regulars list. } } } on +201:text:*:#: { if ($nick isop #) { return } if ($istok(%permit,$nick,32)) { return } if (%links) { if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) { .timer3 off | /ruser 201 $nick msg # /timeout $nick 86400 msg # That was your 3rd link. Try again tomorrow, $nick [Link] [24h] return } } } on +200:text:*:#: { if ($nick isop #) { return } if ($istok(%permit,$nick,32)) { return } if (%links) { if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) { .timer2 off | .auser 201 $nick | /timer3 1 3600 .ruser 200 $nick msg # /timeout $nick msg # No links without permission, $nick $+ ! [Link] [Timeout] return } } } on *:text:*:#: { if ($nick isop #) { return } if ($nick == nightbot) { return } if ($nick == moobot) { return } if ($nick == wizebot) { return } if ($read($chan $+ regulars.txt,nw,$nick)) { return } if ($istok(%permit,$nick,32)) { return } if (%links) { if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) { msg $chan /timeout $nick 10 msg $chan Please ask permission before posting a link, $nick [Link] [Warning] .auser 200 $nick | /timer2 1 3600 .ruser $nick return } } }