mIRC Home    About    Download    Register    News    Help

Print Thread
help please with my script #136944 06/12/05 12:36 AM
Joined: Dec 2005
Posts: 22
S
spirit_cro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2005
Posts: 22
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

Re: help please with my script #136945 06/12/05 01:10 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

Re: help please with my script #136946 06/12/05 01:13 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: help please with my script #136947 06/12/05 01:15 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
The /me command needs an On Action event not On Notice.. smile

-Andy

Re: help please with my script #136948 06/12/05 01:17 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Ooops...been tooo long a day
blush

Re: help please with my script #136949 06/12/05 01:28 AM
Joined: Dec 2005
Posts: 22
S
spirit_cro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2005
Posts: 22
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)

Re: help please with my script #136950 06/12/05 02:28 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.