mIRC Home    About    Download    Register    News    Help

Print Thread
[HELP!] Word Blacklist Error #247347 30/07/14 11:37 PM
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
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
}
}

Re: [HELP!] Word Blacklist Error [Re: Khonor] #247350 31/07/14 02:44 AM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
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.

Last edited by Belhifet; 31/07/14 02:46 AM.
Re: [HELP!] Word Blacklist Error [Re: Belhifet] #247376 31/07/14 06:52 PM
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
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.

Re: [HELP!] Word Blacklist Error [Re: Khonor] #247390 31/07/14 11:21 PM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
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.

Last edited by Belhifet; 31/07/14 11:29 PM.
Re: [HELP!] Word Blacklist Error [Re: Belhifet] #247396 01/08/14 01:09 AM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
please
[ code]scripts here[/code]

(remove space)


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: [HELP!] Word Blacklist Error [Re: Belhifet] #247856 01/09/14 03:13 PM
Joined: Sep 2014
Posts: 6
H
heady Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
H
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?

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
  }
}