|
Dave4989
|
Dave4989
|
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.
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
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)
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
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 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.
}
}
|
|
|
|
Dave4989
|
Dave4989
|
Thanks it worked. Any chance of putting in some text that would say "<nick> has been warned 1/3 times."
|
|
|
|
Joined: Mar 2005
Posts: 420
Fjord artisan
|
Fjord artisan
Joined: Mar 2005
Posts: 420 |
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) >= 3 {
.kick $chan $2 You have been warned many times.
unset $+(%,warn,.,$2)
}
}
else {
msg $chan $2 is not in the channel.
}
}
}
|
|
|
|
|