mIRC Home    About    Download    Register    News    Help

Print Thread
#154673 31/07/06 02:34 AM
Joined: Apr 2006
Posts: 43
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Well first off i did look for this on search but those scripts didnt work. Perhaps i didnt do something im not sure...

Anyways, Im trying to make a script that after 3 warns the user gets kicked out of the channel.

on *:text:!warn*:#BlackIntel: {
if ($nick isop $chan) && ($nick isin $chan) {
msg $chan $2 $+ , You have been warned by $nick for: $3-
}
else {
msg $chan $2 is not in the channel.
}
}

(Sorry about not putting this in code but i kept getting a javascript error and it wont allow me too.)


Well i came up with that but i couldnt get the warning part. Any help???

Last edited by Dave4989; 31/07/06 02:36 AM.
#154674 31/07/06 03:10 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on @*:text:!warn*:#BlackIntel: {
  if ($nick isop $chan) && ($2 isin $chan) {
    msg $chan $2 $+ , You have been warned by $nick for: $3-
    set $+(%,warn,.,$2) $iif(!$($+(%,warn,.,$2),2),1,$calc($v1 + 1))
    if $($+(%,warn,.,$2),2) == 3 {
      .kick $chan $2
      unset $+(%,warn,.,$2)
    }
  }
  else {
    msg $chan $2 is not in the channel.
  }
} 
 

The problem was that you weren't checking to see if $2 (the person being warned) was in the channel.
I also included an example of how the number of warnings could be tracked and the kick command (after three warnings)

#154675 31/07/06 03:27 AM
Joined: Apr 2006
Posts: 43
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Its not doing anything.

#154676 31/07/06 04:09 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Part of the problem is the fact that you're using isin rather than ison (and I missed it). Here's a re-write of the code that has been tested
Code:
 on @*:text:!warn*:#: {
  if ($nick isop $chan) && ($2 ison $chan) {
    msg $chan $2 $+ , You have been warned by $nick for: $3-
    set $+(%,warn,.,$2) $iif(!$($+(%,warn,.,$2),2),1,$calc($($+(%,warn,.,$2),2) + 1))
    if $($+(%,warn,.,$2),2) == 3 {
      .kick $chan $2
      unset $+(%,warn,.,$2)
    }
  }
  else {
    msg $chan $2 is not in the channel.
  }
} 
 

#154677 31/07/06 04:37 AM
Joined: Apr 2006
Posts: 43
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Apr 2006
Posts: 43
Thanks it worked. Any chance of putting in some text that would say "<nick> has been warned 1/3 times."

#154678 31/07/06 07:43 AM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Code:
 on @*:text:!warn*:#: {
  if ($nick isop $chan) {
    if ($2 ison $chan) {
      inc $+(%,warn,.,$2)
      msg $chan $2 $+ , You have been warned by $nick for: $3- $+([,$($+(%,warn,.,$2),2),/,3,$chr(32),times])
      if $($+(%,warn,.,$2),2) &gt;= 3 {
        .kick $chan $2 You have been warned many times.
        unset $+(%,warn,.,$2)
      }
    }
    else {
      msg $chan $2 is not in the channel.
    }
  }
}  


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!

Link Copied to Clipboard