mIRC Homepage
Posted By: Khonor [HELP!] Word Blacklist Error - 30/07/14 11:37 PM
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
}
}
Posted By: Belhifet Re: [HELP!] Word Blacklist Error - 31/07/14 02:44 AM
Code:
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.
Posted By: Khonor Re: [HELP!] Word Blacklist Error - 31/07/14 06:52 PM
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.
Posted By: Belhifet Re: [HELP!] Word Blacklist Error - 31/07/14 11:21 PM
Code:
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.
Posted By: judge2020 Re: [HELP!] Word Blacklist Error - 01/08/14 01:09 AM
please
[ code]scripts here[/code]

(remove space)
Posted By: heady Re: [HELP!] Word Blacklist Error - 01/09/14 03:13 PM
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?

Code:
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
  }
}
© mIRC Discussion Forums