mIRC Home    About    Download    Register    News    Help

Print Thread
whts wrong with this commnd #235710 06/01/12 02:44 PM
Joined: Jan 2012
Posts: 2
J
JASIM Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
J
Joined: Jan 2012
Posts: 2
hi there
this is my first post
am trying to make a script
but there is a code that am not able to make it work
i tried every thing you can think of
but noting seems to be right
anyway this is the code (hope you can help me with it)

Code:
on *:Text:*:#:{
  if ($me isop chan) && (http:// isin $1-) && (%warn $+ $nick == 1) { goto firstwarn } 
  elseif ($me isop $chan) && (http:// isin $1-) && (%warn $+ $nick >= 2) {
    .disable #FilterBan
    .mode $chan +b $wildsite 
    .kick $chan $nick 14We06 warned14 you b406.14 You should obey the 06channel rules14.
    //timerfirstwarn 1 15 //enable #FilterBan
    inc %warn $+ $nick 1
    halt
    :firstwarn
    .kick $chan $nick 06*14web*site*adv06*14 iS not allowed06.14 This time we`ll allowe u 2 join us. Next time u`ll be 06BANNED14.
    inc %warn $+ $nick 1
    halt  
  }
}



thanks in advance

Re: whts wrong with this commnd [Re: JASIM] #235711 06/01/12 03:22 PM
Joined: Jan 2004
Posts: 1,282
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,282
Code:
on @$*:text:/http\x3A\/\//iS:#:{
  if ($nick isop #) return
  inc $+(%,warn,.,$nick)
  if ($($+(%,warn.,$nick),2) > 1) {
    mode # +b $wildsite
    kick # $nick ban message $v1
  }
  else {
    kick # $nick this is a warning
  }
}


I'm not sure what you were doing with the #filterban so I didn't include it. You can put it back in where you want.

Explanations:
  • You had: ($me isop chan), I have prefixed the event with @ so the event only fires if you are op on the channel.
  • You had: (http:// isin $1-), I moved this to a regex in the event definition with a $ prefix. /http\x3A\/\// is the pattern which matches http://
  • You had: (%warn $+ $nick == 1), when referencing dynamically named variables you need to evaluate it after you've composed the name. You can do this with $() or [ ]. $($+(%,warn.,$nick),2) - evaluated one time the text %warn.bob (for example) is returned. Evaluted 2 times, the value of %warn.bob is returned.
  • A simple if/else is better suited than your goto and halts, so I did a bit of restructuring.
  • if ($nick isop #) return - this will prevent you from kicking other ops in the channel
  • The . prefix has no affect on /mode and /kick
  • $v1 in the kick message is the result from the last if statement, here it will display how many times the user has been kicked by this script

Last edited by Loki12583; 06/01/12 04:16 PM.
Re: whts wrong with this commnd [Re: Loki12583] #235714 06/01/12 09:23 PM
Joined: Jan 2012
Posts: 2
J
JASIM Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
J
Joined: Jan 2012
Posts: 2
thanks..
i made a little change
i just add if ($nick isreg #) && (www. isin $1-) || (http:// isin $1-) {
and its work grat for me
thanks again you`v been verey helpful to me smile