mIRC Homepage
Posted By: spirit_cro help please with my script - 06/12/05 12:36 AM
Hello i got a spam kick script so if someone advertise it bans them for 15 minutes then unbans them after 15minutes also. It also doesnt ban them if they are voice/opped. also if the word 'pug' is in the channe advertisement thats ok and if '5' and 'server' are in the line with a advertisement thats ok.
The prob is when people advertise with /me #channelname it doesnt ban them or if they use bold text or colours it also doesnt pick it up and ban them and i dont understand why. here is my script.

on @*:TEXT:*:#findscrim:{
var %x $0
var %i 1
While (%i <= %x) {
If (($left($eval($+($chr(36),%i),2),1) == $chr(35)) && ($len($eval($+($chr(36),%i),2)) > 1) && ($nick isreg #)) && (pug !isin $1-) && (5 !isin $1- && server !isin $1-) {
ban -ku900 $chan $nick 1 15 Minute Ban (No Advertising)
halt
}
inc %i
}
}

any help appreciated. thanks
Posted By: SladeKraven Re: help please with my script - 06/12/05 01:10 AM
Code:
On @*:Text:*:#: {
  set -u5 %adv.nick $nick
  advertise $1-
}

On @*:Action:*:#: {
  set -u5 %adv.nick $nick
  advertise $1-
}

alias advertise {
  var %str = $strip($1-)
  if ($wildtok(%str,#*,0,32)) {
    if (%adv.nick isreg #) &amp;&amp; (pug !isin %str) &amp;&amp; (5 !isin %str) &amp;&amp; (server !isin %str) {
      ban -ku900 $chan %adv.nick 1 15 Minute Ban (No Advertising)
    }
  }
}


-Andy
Posted By: RusselB Re: help please with my script - 06/12/05 01:13 AM
Please use the Code Tags when posting code.
Scripts don't recognize information sent that is coloured, bolded, etc. The easy way to handle this is to use /strip +burc
That will strip the Bold, Underline, Reverse, & Colours from text entered.

When people use the /me command, that changes it from a TEXT to a NOTICE. Just duplicate your code, changing the ON TEXT event to ON NOTICE. Fortunately the only change required is that of changing the word TEXT to NOTICE.
Posted By: SladeKraven Re: help please with my script - 06/12/05 01:15 AM
The /me command needs an On Action event not On Notice.. smile

-Andy
Posted By: RusselB Re: help please with my script - 06/12/05 01:17 AM
Ooops...been tooo long a day
blush
Posted By: spirit_cro Re: help please with my script - 06/12/05 01:28 AM
thanks for the help but for this bit

if (%adv.nick isreg #) && (pug !isin %str) && (5 !isin %str) && (server !isin %str) {

cant i just do this

if (%adv.nick isreg #) && (pug !isin %str) && (5 !isin %str && server !isin %str) {

cause '5' and 'server' must be in the same line to not get banned.

example: i got 5 and a server pm4w #furious ( that = ok)
it cant just be i got no server #furious ( that = ban)
Posted By: RusselB Re: help please with my script - 06/12/05 02:28 AM
close, but instead make it
if (%adv.nick isreg #) && (pug !isin %str) && ((5 !isin %str) && (server !isin %str)) {

That way you know that mIRC will parse the line properly, since the ( ) help control the parsing process.
© mIRC Discussion Forums