mIRC Homepage
Posted By: partypills need help with a set mode script :) - 17/12/14 07:34 AM
Hi i am new to scripting, i am trying to make a script that sets the channel mode to +m through a timer when a user leaves the channel with a spam message with "http"in their /part message, i think i got the first part right but i am stuck in the set mode chanel part here is the script:

;//this is when the script checks for the part message containing the word http.
on @*:PART:#:{
IF ( e isin $strip($1-)) {
:// this is the part that works
mode +m -u300 $chan #
}
}
i am stuck in the second 'set mode' part confused
the command i am using now is not working.
Any suggestions or help is appreciated. grin





Posted By: JuanAm Re: need help with a set mode script :) - 18/12/14 02:13 AM
To control spam in part, you only have to put +u mode in your channel.
This prevents custom messages are displayed on the quit or part event.
But if you still want that code, study identifiers $regex and $regml, they allow you to more accurately detect URLs in messages. See this Wiki

Also, put the channel in moderate mode after a user part with spam, you may not be as convenient.
Because every time it happens this event, you'd be putting your channel moderate way, and thus mutes users who have no voice or arroba.
Think about it.
Posted By: partypills Re: need help with a set mode script :) - 18/12/14 03:56 AM
Unfortunately the server i am on does not support +u.
The Detecting part on that script works ok, just the set mode +m does not seem to work.
Posted By: KindOne Re: need help with a set mode script :) - 18/12/14 04:31 AM
Code:
mode +m -u300 $chan #


What are you trying to do? make the channel +m for only 300 seconds?
Posted By: partypills Re: need help with a set mode script :) - 18/12/14 04:46 AM
300 sec or any other timing , i just want to +m the channel for a given time if somebody /part the channel with some message. There are some flooders ,spammers who join/part quickly with a part message i dont want to ban reach clone flooder but rather +m the channel for a short time after receiving the first /part message.Right now the script i use bans the ips
on @*:PART:#:{
IF ( e isin $strip($1-)) {
ban -u999960 # $nick 11
}
}
but i want to +m with a timer l after IF ( e isin $strip($1-)) is received
Posted By: JuanAm Re: need help with a set mode script :) - 18/12/14 05:10 AM
Do it with timer
Code:
mode $chan +m | .timermode 1 300 mode $chan -m 
Posted By: partypills Re: need help with a set mode script :) - 18/12/14 05:12 AM
I already solved it with a smiliar syntax like yours JuANaM,THANKS.
Posted By: JuanAm Re: need help with a set mode script :) - 18/12/14 05:18 AM
Try this:

Code:
on @*:PART:#:{
  if (http:// isin $strip($1-)) {
    ban -u60 # $nick No spam!
     mode $chan +m
     .timermode 1 300 mode $chan -m
  }
}


Posted By: JuanAm Re: need help with a set mode script :) - 18/12/14 05:22 AM
Originally Posted By: partypills
I already solved it with a smiliar syntax like yours JuANaM,THANKS.


OK smile

Also, you can add another condicional:

Code:
if (http:// isin $strip($1-)) || (www. isin $strip($1-)) {
© mIRC Discussion Forums