mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
Code:
ON *:TEXT:!command:*:{
  if (%4ignore $+ $nick == $null) {
    /set %4ignore $+ $nick 1
  }
  elseif (%4ignore $+ $nick !== $null) {
    if (%4ignore $+ $nick > 10) {
      /msg $nick Maxed out. You have gone over the allotted msgs
      /msg $nick Ignoring your messages for 5 minutes.
      /ignore -pcntikdu10 $nick $+ !*@*
      /unset %4ignore $+ $nick
      /echo MAX for $nick 
    }
    elseif (%4ignore $+ $nick < 10) {
      /inc -u30 %4ignore $+ $nick 1     
    }
  }
}


It is supposed to ignore a user if they send a !command too many times, but for some reason, the variable gets up past the limit, but it doesn't do anything.. =/

Joined: Dec 2002
Posts: 332
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
try /inc before the other commands ?

Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
You have to evaluate the variables to check the value.
Code:
on *:TEXT:!command:*:{
  if $eval($+(%,4ignore,$nick),2) > 10 {
    msg $nick Maxed out. You have gone over the allotted msgs
    msg $nick Ignoring your messages for 5 minutes.
    .ignore -u10 $nick
    unset $+(%,4ignore,$nick)
    echo MAX for $nick
    return
  }
  ; Check to see if the -u switch should be used or not.
  if $eval($+(%,4ignore,$nick),2) { inc $+(%,4ignore,$nick) }
  else inc -u30 $+(%,4ignore,$nick)
  ;
  ; Here you would put your commands for this event.
  ;
}

The second-last line checks if the var exists, if it does it /inc's it, else the next line does /inc -u30. This is because /inc -u30 adds 30 secs to the unset time each time it is set. If someone were to send !command 10 times, at 20 seconds apart, the vars value will be 10, even though they only used !command twice in any 30 second period.

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
When you combine the variables and a value (such as $nick) u either need an eval or the []'s. Also, your delay for ignore time is set to 10 (meanign seconds, not minutes.. From the help:

The -u# switch specifies a delay in seconds after which the ignore is automatically removed.

Try this..

Code:
ON *:TEXT:!command:*:{
  [color:green]; ths "if null" is pointless from the variable perspective.[/color]
  [color:green]; The /inc will make null values default to 1 after being executed[/color]
  /inc -u10 %4ignore [color:red][[/color] $+ [color:red][[/color] $nick [color:red]] ][/color] 1

  [color:green]; check for limit[/color]
  if (%4ignore [color:red][[/color] $+ [color:red][[/color] $nick [color:red]] ][/color] >= 10) {
      /msg $nick Maxed out. You have gone over the allotted msgs
      /msg $nick Ignoring your messages for 5 minutes.
      [color:green]; using address 1 is the same as nick!*@*[/color]
      /ignore -pcntikdu[color:red]300[/color] $address($nick, 1)
      /unset %4ignore [color:red][[/color] $+ [color:red][[/color] $nick [color:red]] ][/color]
      /echo MAX for $nick
    }
  }
}

i Didnt debug, so if you find an error, let me know, and I'll fix it.


-KingTomato
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
Thanks everyone!


Link Copied to Clipboard