mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Hi, I currently have this script:
Code:
on *:TEXT:*:#: {
  if ($me == no-nick) {
    if ($1 == !invite) && ($2 != $null) { /Invite $2 $chan }
    elesif ($1 == !inv) && ($2 != $null) { /invite $2 $chan }
  }
}


However, after someone mis-using it... I was warred for mass-inviting, even though I wasn't doing it...
I am wondering if there is a way I can make it so that there can only be 5 invites in 5 minutes for each network.
Then, if the flood setting has been set-off... and someone tries it... I would like my bot to say something like:
Quote:
<user> !invite rawr
<no-nick> Sorry, please try inviting rawr again in 4.32.


Last edited by seanturner70; 13/01/09 08:03 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on *:text:!inv* &:#:{
  if ($me == no-nick) {
    if !%invite {
      .invite $$2 $chan
      .set %invite 300
      .dec -cze %invite
    }
    else {
      .msg $chan Try again in $duration(%invite)
    }
  }
}


Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I thought the -c switch increased the variable once per second. I notice that will produce a negative value and never be unset?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
With /inc the -c switch increases once per second.
With /dec the -c switch decreases once per second.

Additionally, the other switches that I included will unset the variable once it hits 0, and if the client exits.

/help /dec

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Thanks for your pointer. I had inc and dec baffled unbeknownst to me.


Link Copied to Clipboard