mIRC Home    About    Download    Register    News    Help

Print Thread
Excessive Advertising #120150 14/05/05 01:43 PM
Joined: Sep 2004
Posts: 44
T
Thermal Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Sep 2004
Posts: 44
hello, maybe someone can help me with this. it kinda works, if they post a link 2 times in 5 min's , it warns them, but after it warns them, if they say hi, or something like that, it gives them another warning. so i was hoping maybe someone could take a look at it and tell me how to fix that.

on *:start: {
hmake flood 100
}
on $@*:text:*:#Channel: {
if ($nick !isop #) {
if (*http://* iswm $1-) || (*www.* iswm $1-) {
hinc -mu300 flood $+(flood,$nick)
}
if ($hget(flood,$+(flood,$nick)) == 2) {
msg $chan $nick You Have Been Warned once for Flooding Links, Next Warning Will Result In A Kick
}
elseif ($hget(flood,$+(flood,$nick)) > 3 ) {
kick $chan $nick No Advertise Flooding *2nd Warning*
hdel flood $+(flood,$nick)
}
}
}

Thanks in advance smile

Re: Excessive Advertising #120151 14/05/05 02:20 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hey Thermal just a couple of things I spotted:

[*]You had the $ prefix meaning the matchtext section of a definition contains a regular expression, and I didn't see any patterns being checked, I'm not sure if that statement is entirely true as I don't deal with Regex side.

[*]You are checking for http:// and www. but make sure you put the IF statements nested inside the parent if you will.

Example:

Code:
if (*test* iswm this is a test.) {
  inc %test
  if (%test == 2) { echo %test }
  elseif (%test >= 4) { echo %test }
}


If that made any sense I don't know, but this seems to work for me.

Code:
on *:start: {
  hmake flood 100
}

on @*:text:*:#: {
  if ($nick !isop #) {
    if (*http://* iswm $1-) || (*www.* iswm $1-) {
      hinc -mu300 flood $+(flood,$nick)
      if ($hget(flood,$+(flood,$nick)) == 2) {
        msg $chan $nick You Have Been Warned once for Flooding Links, Next Warning Will Result In A Kick
      }
      elseif ($hget(flood,$+(flood,$nick)) >= 3) {
        kick $chan $nick No Advertise Flooding *2nd Warning*
        hdel flood $+(flood,$nick)
      }
    }
  }
}


All the best,

-Andy

Re: Excessive Advertising #120152 14/05/05 03:47 PM
Joined: Sep 2004
Posts: 44
T
Thermal Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Sep 2004
Posts: 44
works great, thanks , also, how would i get it to ban them if they came back and did it after they got kicked? and also, can i get u to look at another code for me?

Re: Excessive Advertising #120153 14/05/05 03:50 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
1. If they did it again it'd be >= 4 wouldn't it?

2. Course you can, can make any promises I'll be able to sort it for you, but I'll try my best as will the others on the boards.

-Andy

Re: Excessive Advertising #120154 14/05/05 03:55 PM
Joined: Sep 2004
Posts: 44
T
Thermal Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Sep 2004
Posts: 44
yeah, should be =4
heres the other script

on $@*:TEXT:m/[^\w\s]{5,}|(\S)\1{4,}|\s{15,}/iS:#channel: {
inc -u86400 $+(%,punctuation.,$network,.,$chan,.,$nick)
var %v = $($+(%,punctuation.,$network,.,$chan,.,$nick),2)
if (%v == 1) {
msg $chan $nick Please dont excessively repeat characters. $&
This is your First warning. Next Warning Will Be Followed By A Kick Please Read The Rules
}
elseif (%v == 2) {
kick $chan $nick Please stop with the excessive characters Next will be a 3 hour ban

}
elseif (%v == 3) {
ban -ku10800 $chan $nick 2 3rd Warning Stop with the excessive characters *3 hour ban*
}
elseif (%v == 4) {
ban -ku86400 $chan $nick 2 4th and final warning *24 hour ban*
}
else ban -ku86400 $chan $nick 2 Punctuation kick *24 hour ban*
}
on $@*:action:m/[^\w\s]{5,}|(\S)\1{4,}|\s{15,}/iS:#channel: {
inc -u86400 $+(%,punctuation.,$network,.,$chan,.,$nick)
var %v = $($+(%,punctuation.,$network,.,$chan,.,$nick),2)
if (%v == 1) {
msg $chan $nick Please dont excessively repeat characters. $&
This is your First warning. Next Warning Will Be Followed By A Kick Please Read The Rules
}
elseif (%v == 2) {
kick $chan $nick Please stop with the excessive characters Next will be a 3 hour ban

}
elseif (%v == 3) {
ban -ku10800 $chan $nick 2 3rd Warning Stop with the excessive characters *3 hour ban*
}
elseif (%v == 4) {
ban -ku86400 $chan $nick 2 4th and final warning *24 hour ban*
}
else ban -ku86400 $chan $nick 2 Punctuation kick *24 hour ban*
}
on *:NICK:{
var %i = 1
while ($var($+(%,punctuation.,$network,.,*,.,$nick),%i)) {
if ($($v1,2) > $($+(%,punctuation.,$network,.,$chan,.,$newnick),2)) {
set $+(%,punctuation.,$network,.,$chan,.,$newnick) $v1
}
inc %i
}
}
menu nicklist {
$iif($snick(#,0) == 1,punctuation)
. $style(2) level = $calc(0 + $($+(%,punctuation.,$network,.,$chan,.,$1),2)):.
.set...:set $+(%,punctuation.,$network,.,$chan,.,$1) $$?="New level?"
.unset:unset $+(%,punctuation.,$network,.,$chan,.,$1)
.inc:inc $+(%,punctuation.,$network,.,$chan,.,$1)
.dec:dec $+(%,punctuation.,$network,.,$chan,.,$1)
}

on *:START: .unset %punctuation*

it works, but i would like for it to pick up on the $address of the nick , instead of the $nick itself, and for the script not to go off on ops

Thanks in advance smile

Re: Excessive Advertising #120155 14/05/05 11:27 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on $@*:TEXT:m/[^\w\s]{5,}|(\S)\1{4,}|\s{15,}/iS:#channel: {
if $nick !isop $chan {
inc -u86400 $+(%,punctuation.,$network,.,$chan,.,$address)
var %v = $($+(%,punctuation.,$network,.,$chan,.,$address),2)
if (%v == 1) { 
msg $chan $nick Please dont excessively repeat characters. $&
This is your First warning. Next Warning Will Be Followed By A Kick Please Read The Rules 
}
elseif (%v == 2) { 
kick $chan $nick Please stop with the excessive characters Next will be a 3 hour ban

}
elseif (%v == 3) { 
ban -ku10800 $chan $nick 2 3rd Warning Stop with the excessive characters *3 hour ban*
}
elseif (%v == 4) {
ban -ku86400 $chan $nick 2 4th and final warning *24 hour ban*
}
else ban -ku86400 $chan $nick 2 Punctuation kick *24 hour ban*
}
}
on $@*:action:m/[^\w\s]{5,}|(\S)\1{4,}|\s{15,}/iS:#channel: {
if $nick !isop $chan {
inc -u86400 $+(%,punctuation.,$network,.,$chan,.,$address)
var %v = $($+(%,punctuation.,$network,.,$chan,.,$address),2)
if (%v == 1) { 
msg $chan $nick Please dont excessively repeat characters. $&
This is your First warning. Next Warning Will Be Followed By A Kick Please Read The Rules 
}
elseif (%v == 2) { 
kick $chan $nick Please stop with the excessive characters Next will be a 3 hour ban

}
elseif (%v == 3) { 
ban -ku10800 $chan $nick 2 3rd Warning Stop with the excessive characters *3 hour ban*
}
elseif (%v == 4) {
ban -ku86400 $chan $nick 2 4th and final warning *24 hour ban*
}
else ban -ku86400 $chan $nick 2 Punctuation kick *24 hour ban*
}
}
/*
on *:NICK:{
var %i = 1
while ($var($+(%,punctuation.,$network,.,*,.,$nick),%i)) {
if ($($v1,2) > $($+(%,punctuation.,$network,.,$chan,.,$newnick),2)) {
set $+(%,punctuation.,$network,.,$chan,.,$newnick) $v1
}
inc %i
}
}
*/
menu nicklist {
$iif($snick(#,0) == 1,punctuation)
. $style(2) level = $calc(0 + $($+(%,punctuation.,$network,.,$chan,.,$gettok($address($1,5),2,33)),2)):.
.set...:set $+(%,punctuation.,$network,.,$chan,.,$gettok($address($1,5),2,33)) $$?="New level?"
.unset:unset $+(%,punctuation.,$network,.,$chan,.,$gettok($address($1,5),2,33))
.inc:inc $+(%,punctuation.,$network,.,$chan,.,$gettok($address($1,5),2,33))
.dec:dec $+(%,punctuation.,$network,.,$chan,.,$gettok($address($1,5),2,33))
}

on *:START: .unset %punctuation*
 


Changed $nick to $address in the appropriate locations in the ON TEXT & ON ACTION events, also added a check to see if nick is an op in the room. remarked out the ON NICK event, as using $address (should) eliminate the need for that event

Re: Excessive Advertising #120156 15/05/05 01:51 AM
Joined: Sep 2004
Posts: 44
T
Thermal Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Sep 2004
Posts: 44
Thanks, it works great, yall are awesome smile