mIRC Homepage
Posted By: sillyboy HELP, On part message - 29/03/09 04:56 AM
I need to create a script once user part the channel with bad message e.g, * Parts: tess (badword) , my script will auto ban.

any idea?
Posted By: RusselB Re: HELP, On part message - 29/03/09 06:01 AM
Code:
on @*:part:#:{
  if badword isin $1- {
    ban $chan $nick
  }
}

Posted By: sillyboy Re: HELP, On part message - 29/03/09 07:25 AM
Hi, if a user pm me with badword, How to get his/her host from his nick.

Its seems like if he/she on the channel then my script can get his/her host. If its from private message, i can't get his/she host.
Posted By: RusselB Re: HELP, On part message - 29/03/09 07:40 AM
You'll want to read up on raw numerics if you plan on using this in a script.

Options:
1) /userhost <nick>
2) /who <nick>
3) /whois <nick>

Posted By: sillyboy Re: HELP, On part message - 29/03/09 07:49 AM
/whois nick is better option?

But I need the script to whois it and won't show in my status window lol. btw, what is raw numerics ?
Posted By: sillyboy Re: HELP, On part message - 29/03/09 07:55 AM
on *:TEXT:*badword*:*:{
.ignore $nick
var %ip = $address($nick,2)
.msg $me %ip test
}

But if user pm me, i can't get the ip. So i need to whois them. lol
Posted By: westor Re: HELP, On part message - 29/03/09 01:49 PM
Originally Posted By: RusselB
Code:
on @*:part:#:{
  if badword isin $1- {
    ban $chan $nick
  }
}


you can make this with variables and add or remove a badword anytime from the list with the /addbadword or /rembadword aliases

e.g:

Code:
on !*:part:#: {
  if ($istok($1-,%badwords,32)) {
    .ban $chan $nick
  }
}

alias rembadword {
  if ($1) {
    if (!$istok(%badwords,$1,32)) { .var %e $input(Can not remove this " $+ $1 $+ " badword is not in the badword list!,houd,Error) | .halt }
    .set %badwords $remtok(%badwords,$1,32)
    .var %k $input(Successfully removed " $+ $1 $+ " from the badword list,oid,Information)
  }
  else .var %e $input(Wrong syntax: try using /rembadword <badword>,houd,Error)
}

alias addbadword {
  if ($1) {
    if ($istok(%badwords,$1,32)) { .var %e $input(Can not add this " $+ $1 $+ " badword is allready in the badword list!,houd,Error) | .halt }
    .set %badwords $addtok(%badwords,$1,32)
    .var %k $input(Successfully added " $+ $1 $+ " into the badword list,oid,Information)
  }
  else .var %e $input(Wrong syntax: try using /addbadword <badword>,houd,Error)
}

Posted By: sillyboy Re: HELP, On part message - 29/03/09 02:01 PM
Oh that good. Thanks!

btw do you have any idea for this,

Hi, if a user pm me with badword, How to get his/her host from his nick.

Its seems like if he/she on the channel then my script can get his/her host. If its from private message, i can't get his/she host.

on *:TEXT:*badword*:*:{
.ignore $nick
var %ip = $address($nick,2)
.msg $me %ip test
}

But if user pm me, i can't get the ip. So i need to whois them. lol
Posted By: westor Re: HELP, On part message - 29/03/09 02:16 PM
Originally Posted By: sillyboy
Oh that good. Thanks!

btw do you have any idea for this,

Hi, if a user pm me with badword, How to get his/her host from his nick.

Its seems like if he/she on the channel then my script can get his/her host. If its from private message, i can't get his/she host.

on *:TEXT:*badword*:*:{
.ignore $nick
var %ip = $address($nick,2)
.msg $me %ip test
}

But if user pm me, i can't get the ip. So i need to whois them. lol

try using this code paste it into your remotes and remove the older

Code:
on !*:TEXT:*:?: {
  if ($istok($1-,%badwords,32)) {
    .msg $nick [ $+ $nick $+ ]: You are now added into my ignore list reason ( $+ $1- $+ )
    .ignore -p $nick | .closemsg $nick
    .timer 1 0 .echo $color(info) -at 4[ $+ $color(info) $+ Warning4] $+ $color(info) $+ : The user  $+ $nick $+  with address ( $+ $address($nick,2) $+ ) just told you the badword ( $+ $1- $+ ) and ignored!
  }
}


ATTENTION: This remote is for private only and the user will be ignored only for sending you private messages!
Posted By: sillyboy Re: HELP, On part message - 29/03/09 03:08 PM
Hi, if notice how?

Just replace the on text to on notice right?

Btw, thank you very much=)
Posted By: sillyboy Re: HELP, On part message - 29/03/09 03:10 PM
Btw, If i have 2 words together, e.g 'Bad word' any solution for this?
Posted By: sillyboy Re: HELP, On part message - 29/03/09 03:14 PM
Originally Posted By: westor
Originally Posted By: sillyboy
Oh that good. Thanks!

btw do you have any idea for this,

Hi, if a user pm me with badword, How to get his/her host from his nick.

Its seems like if he/she on the channel then my script can get his/her host. If its from private message, i can't get his/she host.

on *:TEXT:*badword*:*:{
.ignore $nick
var %ip = $address($nick,2)
.msg $me %ip test
}

But if user pm me, i can't get the ip. So i need to whois them. lol

try using this code paste it into your remotes and remove the older

Code:
on !*:TEXT:*:?: {
  if ($istok($1-,%badwords,32)) {
    .msg $nick [ $+ $nick $+ ]: You are now added into my ignore list reason ( $+ $1- $+ )
    .ignore -p $nick | .closemsg $nick
    .timer 1 0 .echo $color(info) -at 4[ $+ $color(info) $+ Warning4] $+ $color(info) $+ : The user  $+ $nick $+  with address ( $+ $address($nick,2) $+ ) just told you the badword ( $+ $1- $+ ) and ignored!
  }
}


ATTENTION: This remote is for private only and the user will be ignored only for sending you private messages!



Hi, I tested this script, But its seems like i can't get his/her host =>>

[Warning]: The user user_1w with address () just told you the badword (test sucker test) and ignored!



Its seems like, If the user pm me, i can't get his/her host but If the user inside a channel with me, i can get his/her host. any solution?
Posted By: sparta Re: HELP, On part message - 29/03/09 03:15 PM
Try use the edit button, no need to post 3 post's in a row when you can edit your old one.
Posted By: westor Re: HELP, On part message - 29/03/09 03:44 PM
hmm.. yes i didn't think this so paste this and retry:

Code:
on !*:TEXT:*:?: {
  if ($istok($1-,%badwords,32)) {
    .enable #badword
    .whois $nick
    .msg $nick [ $+ $nick $+ ]: You are now added into my ignore list reason ( $+ $1- $+ )
    .ignore -p $nick | .closemsg $nick | .set %badword-nick $nick | .set %badword-say $1-
    .timer 1 3 .badword_inform
  }
}

#badword off
raw 311:*: { .set %badnick-host $3 $+ @ $+ $4 }
#badword end

alias badword_inform {
  .echo $color(info) -ast 4[ $+ $color(info) $+ Warning4] $+ $color(info) $+ : The user  $+ %badword-nick $+  with address ( $+ %badnick-host $+ ) just told you the badword ( $+ %badword-say $+ ) and ignored!
  .unset %badword-*
  .disable #badword
}
Posted By: sillyboy Re: HELP, On part message - 29/03/09 11:19 PM
Originally Posted By: westor
hmm.. yes i didn't think this so paste this and retry:

Code:
on !*:TEXT:*:?: {
  if ($istok($1-,%badwords,32)) {
    .enable #badword
    .whois $nick
    .msg $nick [ $+ $nick $+ ]: You are now added into my ignore list reason ( $+ $1- $+ )
    .ignore -p $nick | .closemsg $nick | .set %badword-nick $nick | .set %badword-say $1-
    .timer 1 3 .badword_inform
  }
}

#badword off
raw 311:*: { .set %badnick-host $3 $+ @ $+ $4 }
#badword end

alias badword_inform {
  .echo $color(info) -ast 4[ $+ $color(info) $+ Warning4] $+ $color(info) $+ : The user  $+ %badword-nick $+  with address ( $+ %badnick-host $+ ) just told you the badword ( $+ %badword-say $+ ) and ignored!
  .unset %badword-*
  .disable #badword
}


Yes, It works now! thanks.
Btw, can i filter the host by $address( $nick, 2 ) any idea?
Posted By: Tomao Re: HELP, On part message - 29/03/09 11:40 PM
I guess you can by changing it to:
Code:
.set %badnick-host $address($2,2)
Posted By: sillyboy Re: HELP, On part message - 29/03/09 11:51 PM
Originally Posted By: Tomao
I guess you can by changing it to:
Code:
.set %badnick-host $address($2,2)


Hmm its didn't work. any idea?
Posted By: Tomao Re: HELP, On part message - 30/03/09 05:55 AM
Try this:
Code:
raw 311:*: { .set %badnick-host *!* $+ @ $+ $4 }
Posted By: sillyboy Re: HELP, On part message - 30/03/09 06:36 AM
Originally Posted By: Tomao
Try this:
Code:
raw 311:*: { .set %badnick-host *!* $+ @ $+ $4 }


THANKS EVERYONE xD
Posted By: jaytea Re: HELP, On part message - 01/04/09 01:07 PM
surprised no-one mentioned this but you don't need to whois someone to get their host if they send you a pm. in the text event their type 2 mask is $wildsite

if you still want the alias called from a timer you'll need to do something like pass $wildsite to the alias as $1
Posted By: BlondeAmbition Re: HELP, On part message - 03/04/09 07:23 AM
Heres my dialog it origionally was ment to warn 2 times before kicking & banning so I edited it for your needs the onpart bans the text events & whisper ignore plus this will make it easier to add the words you do not want, Just add a text file to your main filder of mirc script named badwords (badwords.txt) and your set to go.

Code:
 menu * {
 BadWords Dialog: { /BwdI }
}

alias BwdI {
  { .dialog -m Bwordignore Bwordignore | .splay zip.wav } 
}

dialog Bwordignore {
  title "Bad Word Ignore"
  size -1 -1 244 104
  option dbu
  list 1, 7 11 125 77, sort size vsbar
  box "", 2, 3 3 183 98
  button "Add WORD", 3, 142 12 37 12
  button "Delete WORD", 4, 142 28 37 12
  button "Ok/Cancel", 5, 142 76 37 12, ok cancel
  button "Turn On", 6, 142 44 37 12
  button "Turn Off", 7, 142 60 37 12
  edit $group(#badwords), 10, 154 89 14 10
  edit "Bad Word Kicker - [/BwdK]", 11, 31 89 70 10, center
}

on *:dialog:Bwordignore:init:*: { 
  /loadbuf -ro Bwordignore 1 badwords.txt

  did -ra $dname 10 $group(#badwords)

  dll $mdx SetMircVersion $version
  dll $mdx MarkDialog $dname
  dll $mdx SetFont $dname
  dll $mdx SetColor $dname
  dll mdx.dll SetBorderStyle 10  14 50 Georgia Bold
  dll mdx.dll SetColor $dname 10 text $rgb(%list1colour,%list2colour,%list3colour)
  dll $mdx SetFont $dname 10 14 40 Georgia Bold
  dll $mdx SetColor 10 text $rgb(255,0,0)
} 

alias badwords { 
  set %badwords $$?="Add Kick Words Here" 
  write badwords.txt %badwords 
  loadbuf -ro Bwordignore 1 badwords.txt 
} 

on *:Dialog:Bwordignore:sclick:1: { set %sel.text $did(1).seltext } 
on *:Dialog:Bwordignore:sclick:3: { badwords } 
on *:Dialog:Bwordignore:sclick:4: { write -ds $+ %sel.text badwords.txt | loadbuf -ro Bwordignore 1 badwords.txt }
on *:Dialog:Bwordignore:sclick:*:{ 
  if ($did == 6) { if (False isin %badwords) { halt }
  if ($input(Are you sure you want to Enable Bad Words Kick?,y)) { .enable #badwords | did -ra $dname 10 $group(#badwords) | .echo $active 0,4Bad Words Kick 0,12Enabled } }
} 
if ($did == 7) { if (False isin %badwords) { halt }
  if ($input(Are you sure you want to Disable Bad Words Kick?,y)) { .disable #badwords | did -ra $dname 10 $group(#badwords)  | .echo $active 0,12Bad Words Kick 0,4Disabled | unset %badwords | unset %sel.text }
} 


#badwords off

on @*:TEXT:*:#:{ 
  if ($nick isop $chan) { return }
  var %i = $lines(badwords.txt) 
  while (%i) { 
    if ($read(badwords.txt,%i) isin $1-) { 
      set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1) 
      if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) { 
        { .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
        unset %rl.* 
      } 
    } 
    dec %i 
  } 
} 
on *:ACTION:*:#: { 
  if ($nick isop $chan) { return }
  var %i = $lines(badwords.txt) 
  while (%i) { 
    if ($read(badwords.txt,%i) isin $1-) { 
      set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1) 
      if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) { 
        { .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
        unset %rl.* 
      } 
    } 
    dec %i 
  } 
}
on *:CTCPREPLY:*:#: { 
  if ($nick isop $chan) { return }
  var %i = $lines(badwords.txt) 
  while (%i) { 
    if ($read(badwords.txt,%i) isin $1-) { 
      set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1) 
      if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) { 
        { .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
        unset %rl.* 
      } 
    } 
    dec %i 
  } 
}
on !*:part:#: {
  if ($nick isop $chan) { return }
  var %i = $lines(badwords.txt) 
  while (%i) { 
    if ($read(badwords.txt,%i) isin $1-) { 
      set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1) 
      if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) { 
        { .access $chan add deny $+(*!*, $Ial($nick).addr) 0 : BadWords }
        unset %rl.* 
      } 
    } 
    dec %i 
  } 
}
on !*:TEXT:*:?: {
  if ($nick isop $chan) { return }
  var %i = $lines(badwords.txt) 
  while (%i) { 
    if ($read(badwords.txt,%i) isin $1-) { 
      set -u30 %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] $calc( %rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] + 1) 
      if (%rl. [ $+ [ $+(*!*, $Ial($nick).addr) ] ] >= 1) { 
        { .ignore -p $+(*!*, $Ial($nick).addr) | .closemsg $nick }
        unset %rl.* 
      } 
    } 
    dec %i 
  } 
}

#badwords end

© mIRC Discussion Forums