mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#210901 29/03/09 04:56 AM
Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
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?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on @*:part:#:{
  if badword isin $1- {
    ban $chan $nick
  }
}


Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
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.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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>


Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
/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 ?

Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
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

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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)
}



Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
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

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
Hi, if notice how?

Just replace the on text to on notice right?

Btw, thank you very much=)

Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
Btw, If i have 2 words together, e.g 'Bad word' any solution for this?

Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
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?

Last edited by sillyboy; 29/03/09 03:14 PM.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Try use the edit button, no need to post 3 post's in a row when you can edit your old one.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
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?

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I guess you can by changing it to:
Code:
.set %badnick-host $address($2,2)

Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
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?

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Try this:
Code:
raw 311:*: { .set %badnick-host *!* $+ @ $+ $4 }

Joined: Mar 2009
Posts: 18
S
Pikka bird
OP Offline
Pikka bird
S
Joined: Mar 2009
Posts: 18
Originally Posted By: Tomao
Try this:
Code:
raw 311:*: { .set %badnick-host *!* $+ @ $+ $4 }


THANKS EVERYONE xD

Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
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


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Page 1 of 2 1 2

Link Copied to Clipboard