mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#99590 03/10/04 04:17 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Try this here. I forgot a few things, but now I think it's ok.
Code:
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 smile


"All we are saying is give peace a chance" -- John Lennon
#99591 03/10/04 08:14 AM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Okay. Don't worry we all make mistakes smile


Code:
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.

if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99592 03/10/04 03:00 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
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 smile


"All we are saying is give peace a chance" -- John Lennon
#99593 03/10/04 03:17 PM
Joined: May 2004
Posts: 132
N
Vogon poet
Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Okay. So
Code:
    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.

if ($me != geek) { $life is $false }
else { $life is $true }
NoPleX
#99594 03/10/04 03:42 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
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.
Code:
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.
Code:
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 smile

Last edited by Zyzzyx26; 03/10/04 03:43 PM.

"All we are saying is give peace a chance" -- John Lennon
Page 2 of 2 1 2

Link Copied to Clipboard