mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2010
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2010
Posts: 13
i want to add anti spam to my script, but i am failing every time, PM me or aim me @VJJIGGLER ( dont want to post script publicly) if you can help!

Thanks!

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The easiest way to handle this is to use a temporary variable just after the event.
Eg:
Code:
ON *:TEXT:!command*:#:{
  if !%flood {
    .inc -u5 %flood
    ;rest of script for the specified command
  }
}


Joined: Dec 2010
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2010
Posts: 13
I dont know how to put that in this script, i have tried 2 other anti flood methods nothing would work...

Code:
on *:LOAD:{ guser owner $$?"bot's name" }
on $*:TEXT:/^[!](q(uote)?)/Si:#:{
  if ($2) {
    if ($2 !isnum) { msg $chan 07 $+ $2 14isn't a number. | halt }
    if ($2 isnum) {
      if ($read(Quotes.txt,$2)) {
        msg $chan 14S07elected 14Q07uote14(07 $+ $2 $+ 14/07 $+ $lines(Quotes.txt) $+ 14): $read(Quotes.txt,$2)
      }
      else {
        msg $chan 14No quote on line07 $2 $+ 14.
      }
    }
  }
  else {
    var %x $rand(1,$lines(Quotes.txt))
    msg $chan 14R07andom 14Q07uote14(07 $+ %x $+ 14): $read(Quotes.txt,%x)
  }
}

Last edited by DJJIGGLER; 24/12/10 11:28 AM.
Joined: Jan 2008
Posts: 57
D
Babel fish
Offline
Babel fish
D
Joined: Jan 2008
Posts: 57
Code:
on $*:TEXT:/^[!](q(uote)?)/Si:#:{
  if !%flood {
    inc -u5 %flood
    if ($2) {
      if ($2 !isnum) { msg $chan 07 $+ $2 14isn't a number. | halt }
      if ($2 isnum) {
        if ($read(Quotes.txt,$2)) {
          msg $chan 14S07elected 14Q07uote14(07 $+ $2 $+ 14/07 $+ $lines(Quotes.txt) $+ 14): $read(Quotes.txt,$2)
        }
        else {
          msg $chan 14No quote on line07 $2 $+ 14.
        }
      }
    }
    else {
      var %x $rand(1,$lines(Quotes.txt))
      msg $chan 14R07andom 14Q07uote14(07 $+ %x $+ 14): $read(Quotes.txt,%x)
    }
  }
}

Last edited by DeSync; 24/12/10 01:33 PM.
Joined: Dec 2010
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2010
Posts: 13
Thank you so much, now i can add it to other scripts!
Originally Posted By: DeSync
Code:
on $*:TEXT:/^[!](q(uote)?)/Si:#:{
  if !%flood {
    inc -u5 %flood
    if ($2) {
      if ($2 !isnum) { msg $chan 07 $+ $2 14isn't a number. | halt }
      if ($2 isnum) {
        if ($read(Quotes.txt,$2)) {
          msg $chan 14S07elected 14Q07uote14(07 $+ $2 $+ 14/07 $+ $lines(Quotes.txt) $+ 14): $read(Quotes.txt,$2)
        }
        else {
          msg $chan 14No quote on line07 $2 $+ 14.
        }
      }
    }
    else {
      var %x $rand(1,$lines(Quotes.txt))
      msg $chan 14R07andom 14Q07uote14(07 $+ %x $+ 14): $read(Quotes.txt,%x)
    }
  }
}


Link Copied to Clipboard