Top

Typos !Trigger Protection


mIRC Code
+ 0 likes
Please Register to submit score.
Average Score  7.0
Scores Submitted  7
Date Added  Jul 07, 2008
Last Updated  Jul 18, 2008
Tags  flood  pro  protection  trigger 
  Bookmark and Share

Introduction

Typos !Trigger Protection is a little snippet used to protect any/all of your !Triggers. It works in two ways. *Updated July 9th, see below for info*

When someone activates a !trigger it sets two variables, one is host specific to the user and the other is just to protect the trigger.
The host specific variable stops the user from using the same trigger by making it ununsable for ten seconds for his host. The trigger specific variable stops the trigger itself from being used by any user and will unset in only 3 seconds.

For instance if someone named somenick with the host of User@Host.net types !Example:
"%Triggerpro.!Example.User@Host.net" is increased by "1" (if it doesnt exist it is set to "1")
and
"%Trigger.!Example" is set to "yes".
Using those variables the script determines if the trigger is usable and by who.

To use it you incorporate it into the on text event for the !trigger.
Syntax $TriggerPro($nick,!triggername)

Here is two examples of usage:
With:
Code:
on *:text:*:#testing1234:{ if ($1 == !trigger) { commands } }

you would use:
Code:
on *:text:*:#testing1234:{ if ($1 == !Trigger) && ($TriggerPro($nick,$v2) == go) { commands } }


And with:
Code:
on *:text:!Trigger:#testing1234:{ commands }

you would use:
Code:
on *:text:!Trigger:#testing1234:{ if ($TriggerPro($nick,!Trigger) == go) { commands } }


The main difference is one uses $v2 to set the triggername in the $TriggerPro() call and the other one you just

enter the actuall trigger instead of $v2.

The $TriggerPro() handles the rest from stopping the trigger from functioning if needed to messaging the user about

the flood protection being use.

Example of the Trigger protection in action.
Quote:
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten
-Jul07-08:18PM- <TypoAway> Top Ten list was displayed for the next ten lines but I pulled them.
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten
-Jul07-08:18PM- <TypoAway> Sorry, flood protection is preventing !TopTen from triggering. Try again in about 10 seconds.
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten
-Jul07-08:18PM- <TypoAway> Sorry, flood protection is preventing !TopTen from triggering. Try again in about 10 seconds. Last warning. Any other attempts at triggering !TopTen will be ignored until you wait for atleast a 10 second period.
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten


*Updated July/09/08* to include $cid in the dynamic variables so the trigger protection will be connection specific incase for instance your script is running on two different networks in the same mirc.*
*Updated July/18/08* Fixed small issue where a $1 needed to be a $2. It was stopping the trigger protection from fully working. The individual protection was working so if the same host hammered it within 10 secinds it would protect but the part that stops anyone else from hitting it in that first 3 seconds wasn't working. Sorry bout that but it's fixed now.

Grab the Code

Comments

  (6)  RSS
Typo
Comments: 226
 
mIRC Snippet:  Typos !Trigger Protection
Posted on Jul 7, 2008 10:54 pm
I decided to leave any duration editing in the var -u## up to the user instead of making this a huge code with settings or dialogs.

Any input is welsome.
EL
Comments: 1,382
 
mIRC Snippet:  Typos !Trigger Protection
Posted on Jul 7, 2008 10:55 pm
>_> Nice way to protect all your commands rather then writing 4239048230 separate pros for each command or script.Very nice;p
Jamiie
Comments: 140
 
mIRC Snippet:  Typos !Trigger Protection
Posted on Jul 8, 2008 12:12 am
I'm agree with EL. :P



8/10
^Neptune
Comments: 340
 
mIRC Snippet:  Typos !Trigger Protection
Posted on Sep 26, 2008 2:18 pm
Woah, I actually REALLY love this. You don't have to put some shoot flood protection for every command you do! :O

I'm SO gonna use this on my bot.

10/10, works perfectly.
Typo
Comments: 226
 
mIRC Snippet:  Typos !Trigger Protection
Posted on Sep 26, 2008 2:23 pm
Lol, thanks man, and once again thanks for going mad on all my scripts.

^Neptune
Comments: 340
 
mIRC Snippet:  Typos !Trigger Protection
Posted on Sep 26, 2008 2:24 pm
Just haven't had a chance to look through your previous ones. :P

They really didn't get the attention they deserved.

Please Register or Login to start posting comments.
Bottom