mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
any one knows how to make a script that detects a certain word in a nick when change nick nd channel join?

example: when a user join/change nick the script will detect if it has the word "fuck" or other word in the nick when the scripts detects that word on the nick it performs a command...

i hope my english is good enough to understand...

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
I've seen this option in some badword scripts, so I suggest that you start by searching through them, additionally, if you are an Op or Founder of the channel, then you can set the channel modes to include +G which will make the channel G-Rated, and will include any nicks, either on join or nick change.

L
LostShadow
LostShadow
L
on @*:join:#YourChannel: { if (fuck isin $nick) { /echo $chan Well heck, the f word is in his nick. } }

on *:nick: { if ($chan == #YourChannel) && ($me isop #YourChannel) && (fuck isin $newnick) { /echo $chan Well heck, the f word is in his new nick. } }

You can also use iswm for *wildcards*, i.e., if (*cussword* iswm $nick) {, etc.

Last edited by LostShadow; 11/08/07 05:20 PM.
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
The ON NICK event, as you have it, wouldn't work, as $chan returns $null in the ON NICK event. Here's how I would change that
Code:
on *:nick:{
  var %a = 1, %b = $comchan($newnick,0)
  while %a <= %b {
    if (fuck isin $newnick) && ($comchan($newnick,%a) == #YourChannel) && ($me isop $v2) { /echo $v2 Well heck, the f word is in $nick $+ 's new nick.
    inc %a
  }
}


Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
i found this but it cant filter swears in a word like "asdswearasd" and on more can this be possible without the onstart thing? i found it great because you can edit how many time you can have a warning kick... can it still be improved? like the speed and the length of the script?
Code:
on *:START: { unset %swear.* }

on *:TEXT:*:#channel: {
  var %swears = swear1,swear2,swear3,swear4,swear5
  var %warns = 1
  var %x = $numtok(%swears,44)
  tokenize 32 $strip($1-)
  while (%x) && ($nick isreg $chan) {
    if ($istok($1-,$gettok(%swears,%x,44),32)) {
      inc $+(%,swear.,$wildsite)
      var %n = $($+(%,swear.,$wildsite),2)
      if (%n <= %warns) {
        .kick # $nick BANG!!! ( $+ $gettok(%swears,%x,44) $+ )
      }
      elseif (%n > %warns) {
        .ban # *!* $+ $address $+ * swearing is not good ( $+ $gettok(%swears,%x,44) $+ )
        unset $+(%,swear.,$wildsite)
      }
    }
    dec %x
  }
}


Link Copied to Clipboard