mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
Good night everyone, i have this script:

Code:
on *:text:!rembadword *:#:{
  if ($nick isop $chan) {
    /remini sysbadword.ini $chan $2
    /notice $nick < $2 > sucessfuly removed
  }
}
on *:text:!addbadword *:#:{
  if ($nick isop $chan) {
    /writeini -n sysbadword.ini $chan $2 $3-
    /notice $nick The Badword $2 should be added to $chan $+ .
  }
}
on *:text:!listbadword:#:{
  if ($nick isop $chan) {
    var %t.bword = $ini(sysbadword.ini,$chan,0)
    while %t.bword > 0 {
      if %n.bword == $null { var %n.word = $ini(sysbadword.ini,$chan,%t.bnick) }
      else { set %n.bword %n.bword $ini(sysbadword.ini,$chan,%t.bnick) }
      dec %t.bword
    }
    while %t.bword == 0 {
      notice $nick %n.bword
      dec %t.bword
    }
  }
}
on *:text:!badwordhelp:#:{
  if ($nick isop $chan) {
    /notice $nick To add badword: !addbadword word reason
    /notice $nick list: !listbadword ; rem: !rembadword word
  }
}
on *:text:*:#:{
  if ($me isop $chan) {
    var %a = 1
    var %b = $ini(sysbadword.ini,$chan,0)
    var %c = $ini(sysbadword.ini,$chan,%a)
    while (%a <= %b) {
      if (%c isin $1-) {
        kick $chan $nick $readini(sysbadword.ini,$chan,%c) ( $+ %c $+ )
        /set %a $calc(%b + 1)
      }
      else { halt }
    }
    inc %a
  }
}


However the !listbadword is not working, can anyone help me fixing it??

thanks smile

Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
well, there's no "notice $nick" or "msg $nick" in there, I just looked at the script and noticed it, don't know where you would put it though, but, it seems like you know what you're doing in scripting. If you need any more help, please ask.


-Kurdish_Assass1n
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
yes there is:

on *:text:!listbadword:#:{
if ($nick isop $chan) {
var %t.bword = $ini(sysbadword.ini,$chan,0)
while %t.bword > 0 {
if %n.bword == $null { var %n.word = $ini(sysbadword.ini,$chan,%t.bnick) }
else { set %n.bword %n.bword $ini(sysbadword.ini,$chan,%t.bnick) }
dec %t.bword
}
while %t.bword == 0 {
notice $nick %n.bword
dec %t.bword
}
}
}

in the last lines:

notice $nick %n.bword


But it doesn't work man!!!

the bot says: * /notice: insufficient parameters (line 22, script2.mrc)

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
Typos. You're calling undefined variables %n.word and %t.bnick.

try this (untested)

Code:
 on *:text:!listbadword:#:{
  if ($nick isop $chan) {
    var %t.bword = $ini(sysbadword.ini,$chan,0)
    while %t.bword > 0 {
      set -u0 %n.bword $addtok(%n.bword,$ini(sysbadword.ini,$chan,%t.bword),32)
      dec %t.bword
    }
    notice $nick %n.bword
  }
}

hth
--------------------
LonDart


LonDart
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
thanks, it worked!!!

Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
another doubt

i would like he banned when the user said a badword the second time

for example

<Fill> you're gay
Fill was kicked by Bot (No badwords)

then eventually the user would be back

and said for example

<Fill> go shit

As this is the second time i say a badword, the bot bans me for 5 hours and kicks me ...

any ideas?? i tried to do this but i've done a code that completely blocks mIRC (is stops responding and i have to end mIRC in Ctrl+Alt+Del) so please!!!

Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
i've done it!!!!!

Finally i could do it ... just fixed a few bugs, for the curious ones, grab the new code:

on *:text:*:#:{
inc %asn. [ $+ [ $nick ] ]
if ($me isop $chan) && ($nick !isop $chan) {
var %a = 1
var %b = $ini(sysbadword.ini,$chan,0)
var %c = $ini(sysbadword.ini,$chan,%a)
while (%a <= %b) {
if (%c isin $1-) {
if (%asn. [ $+ [ $nick ] ] == 1) { kick $chan $nick $readini(sysbadword.ini,$chan,%c) ( $+ %c $+ ) }
if (%asn. [ $+ [ $nick ] ] == 2) {
/mode $chan +b $address($nick,1)
/kick $chan $nick $readini(sysbadword.ini,$chan,%c) ( $+ %c $+ )
/timerlavaaboca 1 18000 /mode $chan -b $address($nick,1)
}
/set %a $calc(%b + 1)
}
else { halt }
}
inc %a
}
}

Joined: Mar 2006
Posts: 8
A
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
A
Joined: Mar 2006
Posts: 8
Instead of $nick, use $wildsite when inc'ing.

You can also use:

Code:
on @*:text:...


So that you don't have to put the "if ($me isop $chan)"..

I also suggest that you use ban -ku or use $lf to join raw commands. Example:

Code:
.raw MODE $chan +b $wildsite $+ $lf $+ KICK $chan $nick :kick message

Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
help!!!!!!!!!

it's not working well.
if i type

!addbadword shit No badwords plz

then the !listbadword will tells me that the badwords are "shit"

then i type

!addbadword gay Hey!!! There's no gay in here

then the !listbadword tells me that the badwords are gay and shit

but the word shit is the last word in the list, and the bot only kicks the user if he spells the word that is the last on the list!!!!

If he says shit, he's kicked, but if he says gay, he's not kicked. He is only kicked if he spells the last badword in the list

any suggestions??

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
I believe the main problem is that your %a var is not incrementing correctly. You need to remove the line /set %a $calc(%b + 1)

Here I've rearranged a few things and taken the liberty of changing $nick to $wildsite ( which is equivalent to $address(nick,2) )
to prevent a simple nick change from getting around your counter.

Code:
on @*:text:*:#:{
if ($nick !isop $chan) {
  var %a = 1
  var %b = $ini(sysbadword.ini,$chan,0)
  var %c = $ini(sysbadword.ini,$chan,%a)
  while (%a <= %b) {
    if (%c isin $1-) {
      inc %asn. [ $+ [ $wildsite ] ]
      if (%asn. [ $+ [ $wildsite ] ] == 1) { kick $chan $nick $readini(sysbadword.ini,$chan,%c) ( $+ %c $+ ) }
      if (%asn. [ $+ [ $wildsite ] ] == 2) { 
        mode $chan +b $address($nick,2)
        kick $chan $nick $readini(sysbadword.ini,$chan,%c) ( $+ %c $+ )
        timerlavaaboca 1 18000 /mode $chan -b $address($nick,2)
      }
    inc %a
  }
} 

Note that the %asn.$wildsite variable is never unset. This could cause the script to fail for a frequent abuser.
You may want to unset it after banning, to give 2 more chances, or add a permanent ban for a count of 3 or more.
If you'd simply like to continue to ban for 5 hours for each subsequent offense, just change

Code:
if (%asn. [ $+ [ $wildsite ] ] == 2) { 


to

Code:
if (%asn. [ $+ [ $wildsite ] ] >= 2) { 



LonDart
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
sorry, i did not answer.

I've done a new one ... now it does not work with *.ini files, it works with *.txt files

Code:
On *:TEXT:!addbadword*:#: {
  %badword.a.adicionar = $2-
  if (($nick isop $chan) || ($nick ishop $chan)) {
    /write Badwords\Badwords_ $+ $chan $+ .txt %badword.a.adicionar
    /notice $nick $2 adicionado à lista de badwords do canal $chan com sucesso.
  }
}

On *:TEXT:!rembadword*:#: {
  var %badword.a.remover = $2
  if (($nick isop $chan) || ($nick ishop $chan)) {
    /write -ds %badword.a.remover Badwords\Badwords_ $+ $chan $+ .txt
    /notice $nick $2 removido da lista de badwords do canal $chan com sucesso.
  }
}

On *:TEXT:!listbadword*:#: {
  if (($nick isop $chan) || ($nick ishop $chan)) {
    var %conta.linhas = $lines(Badwords\Badwords_ $+ $chan $+ .txt)
    var %while.1 = 1
    var %while.2 = 41
    var %while.3 = 81
    var %while.4 = 121
    var %while.5 = 161
    var %while.6 = 201
    while ( %while.1 <= 40 ) {
      var %ler.linha1 = $gettok($read(Badwords\Badwords_ $+ $chan $+ .txt,%while.1),1,32)
      var %msg.linha1 = %msg.linha1 %ler.linha1
      inc %while.1
    }
    notice $nick Badwords: %msg.linha1
    while ( %while.2 <= 80 ) {
      var %ler.linha2 = $gettok($read(Badwords\Badwords_ $+ $chan $+ .txt.txt,%while.2),1,32)
      var %msg.linha2 = %msg.linha2 %ler.linha2
      inc %while.2
    }
    notice $nick %msg.linha2
    while ( %while.3 <= 120 ) {
      var %ler.linha3 = $gettok($read(Badwords\Badwords_ $+ $chan $+ .txt,%while.3),1,32)
      var %msg.linha3  = %msg.linha3 %ler.linha3
      inc %while.3
    }
    notice $nick %msg.linha3
    while ( %while.4 <= 160 ) {
      var %ler.linha4 = $gettok($read(Badwords\Badwords_ $+ $chan $+ .txt,%while.4),1,32)
      var %msg.linha4 = %msg.linha4 %ler.linha4
      inc %while.4
    }
    notice $nick %msg.linha4
    while ( %while.5 <= 200 ) {
      var %ler.linha5 = $gettok($read(Badwords\Badwords_ $+ $chan $+ .txt,%while.5),1,32)
      var %msg.linha5 = %msg.linha5 %ler.linha5
      inc %while.5
    }
    notice $nick %msg.linha5
    while ( %while.6 <= %conta.linhas ) {
      var %ler.linha6 = $gettok($read(Badwords\Badwords_ $+ $chan $+ .txt,%while.6),1,32)
      var %msg.linha6 = %msg.linha6 %ler.linha6
      inc %while.6
    }
    notice $nick %ler.linha6
  }
}

On *:TEXT:*:#: {
  inc %asn. [ $+ [ $nick ] ]
  var %outro.trigger = $lines(Badwords\Badwords_ $+ $chan $+ .txt)
  var %outro1.trigger = 1
  while (%outro1.trigger <= %outro.trigger) {
    var %txt.trigger = $read(Badwords\Badwords_ $+ $chan $+ .txt,%outro1.trigger)
    var %txt1.trigger = $gettok(%txt.trigger,1,32)
    var %mensagem.trigger = $gettok(%txt.trigger,2-200,32)
    if ( %txt1.trigger isin $1- ) {
      if (%asn. [ $+ [ $nick ] ] == 1) { kick $chan $nick %mensagem.trigger ( $+ %txt1.trigger $+ ) }
      if (%asn. [ $+ [ $nick ] ] == 2) {
        mode $chan +b $address($nick,2)
        kick $chan $nick %mensagem.trigger ( $+ %txt1.trigger $+ )
        timerlavaaboca 1 18000 /mode $chan -b $address($nick,2)
      }
    }
    inc %outro1.trigger
  }
}


it works fine but i've got a doubt

i wanted to improve it so i could do for example

!addbadword * shit * No badwords please

and the bot would only kick the user when he said shit with two spaces

<test> Oh man this is a shit isn't it?

like that...

but if he said

<test> Oh manwhatashitisn't it

as the badword i added was * shit * the bot would not kick him.

Or i could do !addbadword *shit * No badwods

and if he said

thisisashit man

the bot kicked him

all depended on the *

!addbadword *gay* Test

when the bot detected the letters g a y, kick

<test> youaregay!

did you understand?

i don't know how to do it

Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
no one?

Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
Not sure what you are asking. What you're describing is exactly how wildcards work.
This is why there are no swear kickers that aren't problematic.
It is basically impossible to make one that catches all possible offensive statements,
without also kicking on legitimate statements.

There are also offensive phrases that contain no 'bad' words, e.g. "Sit on my face"
And don't forget the wiseguy who substitutes symbols for letters, like $ for S, or | for I or l.

It is 'safest' to auto-kick on the most obvious nasty words, and rely on a watchful
human eye for the rest.


LonDart
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Exactly. You can make it very intuitive with a LOT of checks, but in the end, people can still be clever enough to get around it.

Some swear words aren't ever seen inside other words, so you can just ban those automatically as *word* . For other words, see if there is any chance that a legitimate word would have that word in it at the beginning of the word or at the end of the word. If there aren't any that are like that, then you can use *word or word* . Don't forget that you may also want to include punctuation if you do something like *word ... include all punctuation that would normally be attached, such as *word. and *word, and *word! etc. And, like mentioned, include the typical replacement characters, such as 1 for l and $ for s and 5 for s and @ for a.

Honestly, though... I find that the best defense against people swearing in the channel is to have ops regularly in the channel to monitor it. They can warn people and then ban them if they continue to swear. It works well. We have very few people swearing in our channel (my main one, not the one listed below that has very few in it) and usually the few who do will stop if asked once, or the swearing is of such a minor nature that we allow it.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
hey ... ok, thanks smile

you're right ... ^^ having ops monitoring the chan is the best way.

Thanks for the help ...


Link Copied to Clipboard