|
Joined: Jun 2014
Posts: 77
Babel fish
|
OP
Babel fish
Joined: Jun 2014
Posts: 77 |
Every time the bot gives time-out for any bad word I get an error with this piece of script: if ($ ($ + (%, blacklist, $ gettok ($ 1 -,% i, 32), #).. , 2)) {
I would appreciate any help or advice.
on *:TEXT:!blacklist add*:#: { if ($nick isop #) { set %blacklist. $+ $3 $+ . $+ $chan On msg # $3 Has been added to my blacklist, anyone using $3 will be timed out for 10 minutes. } else { msg # Sorry $nick $+ , you do not have permission to add words to the blacklist } }
on *:TEXT:!blacklist del*:#: { if ($nick isop #) { unset %blacklist. $+ $3 $+ . $+ $chan On msg # $3 Has been removed from the blacklist } else { msg # Sorry $nick $+ , you do not have permission to add words to the blacklist } }
on *:TEXT:*:#: { if ($nick isop #) return var %i = 1 while (%i <= $0) { if ($($+(%,blacklist.,$gettok($1-,%i,32),.,#),2)) { msg # $nick -> Do not use Blacklisted Words. (Timeout) msg # .timeout $nick 600 break } inc %i } }
|
|
|
|
Joined: Jun 2014
Posts: 248
Fjord artisan
|
Fjord artisan
Joined: Jun 2014
Posts: 248 |
on *:TEXT:!blacklist add*:#: {
if ($nick isop #) {
set %blacklist. $+ $chan $addtok($($+(%,blacklist.,$chan),2), $3, 44)
msg # $3 Has been added to my blacklist, anyone using $3 will be timed out for 10 minutes.
}
else {
msg # Sorry $nick $+ , you do not have permission to add words to the blacklist.
}
}
on *:TEXT:!blacklist del*:#: {
if ($nick isop #) {
set %blacklist. $+ $chan $deltok($($+(%,blacklist.,$chan),2), $3, 44)
msg # $3 Has been removed from the blacklist
}
else {
msg # Sorry $nick $+ , you do not have permission to delete words from the blacklist.
}
}
on *:TEXT:*:#: {
if ($nick isop #) return
var %i = 1
while (%i <= $0) {
if ($istok($+(%,blacklist.,$chan), $gettok($1-,%i,32), 44) == $true) {
msg # $nick -> Do not use Blacklisted Words. (Timeout)
msg # .timeout $nick 600
break
}
inc %i
}
}
I guess thats a little different than what you had, but it doesn't make a new variable for every word.
Last edited by Belhifet; 31/07/14 02:46 AM.
|
|
|
|
Joined: Jun 2014
Posts: 77
Babel fish
|
OP
Babel fish
Joined: Jun 2014
Posts: 77 |
Thanks @Belhifet not shoot me any error, but now does not work to add to the blacklist words or phrases the bot does not timeout, and writing "!blacklist del [word/phrase]" does not eliminate them.
Appreciate your help I'll see if the script you gave me can fix it.
|
|
|
|
Joined: Jun 2014
Posts: 248
Fjord artisan
|
Fjord artisan
Joined: Jun 2014
Posts: 248 |
on *:TEXT:!blacklist add*:#: {
if ($nick isop #) {
set %blacklist. $+ $chan $addtok($($+(%,blacklist.,$chan),2), $3, 44)
msg # $3 Has been added to my blacklist, anyone using $3 will be timed out for 10 minutes.
}
else {
msg # Sorry $nick $+ , you do not have permission to add words to the blacklist
}
}
on *:TEXT:!blacklist del*:#: {
if ($nick isop #) {
set %blacklist. $+ $chan $remtok($($+(%,blacklist.,$chan),2), $3, 44)
msg # $3 Has been removed from the blacklist
}
else {
msg # Sorry $nick $+ , you do not have permission to add words to the blacklist
}
}
on *:TEXT:*:#: {
if ($nick isop #) { return }
var %i = 1
while (%i <= $0) {
if ($istok($($+(%,blacklist.,$chan),2), $gettok($1-,%i,32), 44) == $true) {
msg # $nick -> Do not use Blacklisted Words. (Timeout)
msg # .timeout $nick 600
break
}
inc %i
}
}
oops I used deltok instead of remtok. If you wanna use phrases instead of words you'd have to rework this a little... Change the $3 to $3- in the add/del sections and change the if to an isin statement for token vs the line of text.
Last edited by Belhifet; 31/07/14 11:29 PM.
|
|
|
|
Joined: Mar 2014
Posts: 215
Fjord artisan
|
Fjord artisan
Joined: Mar 2014
Posts: 215 |
please [ code]scripts here[/code]
(remove space)
|
|
|
|
Joined: Sep 2014
Posts: 6
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Sep 2014
Posts: 6 |
Hey Belhifet. I tried to make it work so its able to add phrases, i actualy does add it but it times them out for any of the words in the phrase and not for the whole phrase. Example: If you add "you are ugly" to the blacklist, the gonna be timeouted even for "you" or "are", but i want to let them timeout if they say the whole sentence. Is that possible and could you help me? on *:TEXT:!blacklist add*:#: {
if ($nick isop #) {
set %blacklist. $+ $chan $addtok($($+(%,blacklist.,$chan),2), $3-, 44)
msg # $3- Has been added to my blacklist, anyone using $3- will be timed out for 10 minutes.
}
else {
msg # Sorry $nick $+ , you do not have permission to add words to the blacklist
}
}
on *:TEXT:!blacklist del*:#: {
if ($nick isop #) {
set %blacklist. $+ $chan $remtok($($+(%,blacklist.,$chan),2), $3, 44)
msg # $3- Has been removed from the blacklist
}
else {
msg # Sorry $nick $+ , you do not have permission to add words to the blacklist
}
}
on *:TEXT:*:#: {
if ($nick isop #) { return }
var %i = 1
while (%i <= $0) {
if ($istok($($+(%,blacklist.,$chan),2), $gettok($1-,%i,32), 44) == $true) {
msg # $nick -> Do not use Blacklisted Words. (Timeout)
msg # .timeout $nick 600
break
}
inc %i
}
}
|
|
|
|
|