mIRC Home    About    Download    Register    News    Help

Print Thread
#427 09/12/02 12:51 AM
K
KennyJ
KennyJ
K
These is code for ads, and it works! But everyone type it, and it shun all.
I want it's not to shun when they have OP, oper, and in a specific channel(#staff)
Just these 3 option, then all other will SHUN the nick.

#adver on
on *:text:*:#: {
if (www. isin $1- || http:// isin $1- || irc. isin $1- && webad !isin $1-) {
set %shunnads $nick
shun $nick Please no advertising!
.timer 1 180 unshun %shunnads
}
}
#adver end

#428 09/12/02 02:19 AM
N
Nick
Nick
N
#adver on
on *:text:*:#: {
if (www. isin $1-) || (http:// isin $1-) || (irc. isin $1-) && (webad !isin $1-) || ($nick !isop $chan) || ($nick !ison #staff) {
set %shunnads $nick
shun $nick Please no advertising!
.timer 1 180 unshun %shunnads
}
}
#adver end

that should do it...

#429 09/12/02 06:21 AM
K
KennyJ
KennyJ
K
Hmm.. This make worsier, it will shun everybody that in the room who talk even type "hi"! It will shun everyone on the channel i'm in..

#430 09/12/02 06:57 AM
S
SWV1
SWV1
S
#adver on
on *:text:*:#: {
if (("www." isin $1-) || ("http://" isin $1-) || ("irc." isin $1-) && ("webad" !isin $1-)) && (($nick !isop $chan) || ($nick !ison #staff)) {
set %shunnads $nick
shun $nick Please no advertising!
.timer 1 180 unshun %shunnads
}
}
#adver end

according to your first post , you wanted the script to do nothing if "webad" was included in the text.

This will "shun" any user that types www. or http:// as long as they are not a channel op and are not on #staff

IRC Ops can still be shunned... you need to either check the status of each user before executing the script "/WHOIS <nick>" and then record the "<nick is an IRC Operator" response or you can add IRC Ops to a protect list etc

#431 09/12/02 07:01 AM
Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
Two things come to mind here. Separate the halting function from the spam check code. Also, it's a good idea to strip codes from $1- to make sure you don't miss color-coded spam.
Code:
#adver on
on @*:TEXT:*:#:{
  if (($nick isop $chan) || ($nick ison #staff) || (webad isin $1-)) halt
  if ((www. isin $strip($1-)) || (http:// isin $strip($1-)) || (irc. isin $strip($1-))) {
    shun $nick Please no advertising!
    .timer 1 180 unshun $nick
  }
}
#adver end
For more help with protection script ideas, have a glance at protection scripts.

#432 09/12/02 12:48 PM
Joined: Dec 2002
Posts: 2,958
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Dec 2002
Posts: 2,958
Don't worry about protecting opers with this, they are immune to shuns anyway.

#433 09/12/02 10:41 PM
K
KennyJ
KennyJ
K
I'll give it a try to see what it will do. thx all


Link Copied to Clipboard