mIRC Home    About    Download    Register    News    Help

Print Thread
#427 09/12/02 12:51 AM
Joined: Dec 2002
Posts: 25
K
KennyJ Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Dec 2002
Posts: 25
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
Joined: Dec 2002
Posts: 2
N
Bowl of petunias
Offline
Bowl of petunias
N
Joined: Dec 2002
Posts: 2
#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
Joined: Dec 2002
Posts: 25
K
KennyJ Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Dec 2002
Posts: 25
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
Joined: Dec 2002
Posts: 4
S
Self-satisified door
Offline
Self-satisified door
S
Joined: Dec 2002
Posts: 4
#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,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
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.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#432 09/12/02 12:48 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
Don't worry about protecting opers with this, they are immune to shuns anyway.

#433 09/12/02 10:41 PM
Joined: Dec 2002
Posts: 25
K
KennyJ Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Dec 2002
Posts: 25
I'll give it a try to see what it will do. thx all


Link Copied to Clipboard