|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Try this here. I forgot a few things, but now I think it's ok. on @*:text:*:#channel: {
if ($nick isop #) { halt }
if ($strip($1-) != $hget(Repeat,$+($nick,$chan))) || (!$hget(Repeat,$+($nick,$chan))) {
hadd -m Repeat $+($nick,$chan) $strip($1-)
hdel Repeat $+($nick,$chan,.count)
hinc -u[color:red]N[/color] Repeat $+($nick,$chan,.count)
}
elseif ($strip($1-) == $hget(Repeat,$+($nick,$chan))) {
hinc -u30 Repeat $+($nick,$chan,.count)
if ($hget(Repeat,$+($nick,$chan,.count)) >= [color:blue]N[/color]) { [color:orange]kick $chan $nick out![/color] | [color:purple]hdel -w Repeat $+($nick,$chan,*)[/color] }
}
} You just need to change the two N's for the values you wish. The orange command is the one you posted and it is, of course, totally changeable. The other command, on the other hand, it is not. You should leave that one there. It's 1am here and I've been kinda busy for the past 2 hours, so forgive any mistakes I made. Including this last post :P Greetings, Zyzzyx
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
Joined: May 2004
Posts: 132 |
Okay. Don't worry we all make mistakes
on @*:text:*:#channel: {
if ($nick isop #) { halt }
if ($strip($1-) != $hget(Repeat,$+($nick,$chan))) || (!$hget(Repeat,$+($nick,$chan))) {
hadd -m Repeat $+($nick,$chan) $strip($1-)
}
elseif ($strip($1-) == $hget(Repeat,$+($nick,$chan))) {
hinc -u60 Repeat $+($nick,$chan,.count)
if ($hget(Repeat,$+($nick,$chan,.count)) >= 1) {
[color:blue].notice $nick Please do not repeat.[/color]
}
elseif ($hget(Repeat,$+($nick,$chan,.count)) >= 2) {
[color:red].kick $chan $nick Repeat.[/color]
hdel -w Repeat $+($nick,$chan,*)
}
}
}
Now i got this. I want it to give the user a warning after repeating once and then kick him if he does it again. The problem is that if i type "Hello" 2 times it gives me a warning and that's okay. But 3rd time i type "Hello" it gives me a warning again. Can someone see what's wrong with the script?
Last edited by NoPleX; 03/10/04 08:35 AM.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
The thing is here: if ($hget(Repeat,$+($nick,$chan,.count)) [color:Red]>= 1) {[/color] Here you are saying that, if the count is equal or higher then 1, then send the notice. Since the following is an elseif, the script doesn't get there.Try puting == instead of >=, which wil only be equal to one. Zyzzyx
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
Vogon poet
Joined: May 2004
Posts: 132 |
Okay. So
elseif ($hget(Repeat,$+($nick,$chan,.count)) == 2) {
.kick $chan $nick Repeat.
hdel -w Repeat $+($nick,$chan,*)
Needs to be if insted of elseif?
Last edited by NoPleX; 03/10/04 03:20 PM.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
If you want to also warn the person when you kick them, then you use 2 IF's. If you want to warn them once and kick on the 2nd - without a 2nd warning - then you leave IF and ELSEIF. Use this one if you want to warn when you kick. on @*:text:*:#channel: {
if ($nick isop #) { halt }
if ($strip($1-) != $hget(Repeat,$+($nick,$chan))) || (!$hget(Repeat,$+($nick,$chan))) {
hadd -m Repeat $+($nick,$chan) $strip($1-)
}
elseif ($strip($1-) == $hget(Repeat,$+($nick,$chan))) {
hinc -u60 Repeat $+($nick,$chan,.count)
if ($hget(Repeat,$+($nick,$chan,.count)) >= 1) { .notice $nick Please do not repeat. }
if ($hget(Repeat,$+($nick,$chan,.count)) >= 2) {
kick $chan $nick Repeat.
hdel -w Repeat $+($nick,$chan,*)
}
}
} Or use the next one if you want just 1 warning. on @*:text:*:#channel: {
if ($nick isop #) { halt }
if ($strip($1-) != $hget(Repeat,$+($nick,$chan))) || (!$hget(Repeat,$+($nick,$chan))) {
hadd -m Repeat $+($nick,$chan) $strip($1-)
}
elseif ($strip($1-) == $hget(Repeat,$+($nick,$chan))) {
hinc -u60 Repeat $+($nick,$chan,.count)
if ($hget(Repeat,$+($nick,$chan,.count)) == 1) { .notice $nick Please do not repeat. }
elseif ($hget(Repeat,$+($nick,$chan,.count)) >= 2) {
.kick $chan $nick Repeat.
hdel -w Repeat $+($nick,$chan,*)
}
}
} Zyzzy
Last edited by Zyzzyx26; 03/10/04 03:43 PM.
|
|
|
|
|