Typos !Trigger Protection is a unique snippet that can be used to protect all of your !Triggers with very little editing to your existing !trigger code.
What it does:
My script works in two ways, it protects the trigger from every individual user by tracking how often they used it in 'x' amount of seconds and making sure that if they do use it more than 'x' times in the set amount of time, that they are blocked for 'x' amount of seconds.
The script has a second protection scheme as well that protects the trigger from overuse by multiple nicknames by limiting the use of the trigger by all users.
Say for instance someone is upset and wants to flood you off. They notice you have flood protection on the triggers so they decide to be sneaky, instead of doing the trigger 100 times with one nickname, they connect 25 nicknames and do it 4 times with each. The answer to this is to protect the trigger itself against floods. This is accomplished by making it so that the trigger is only usable once every 'x' amount of seconds.
This begs the question why not only use the second method and the answer to this is that we need the system to be flexible. I want to make sure the trigger is only used once every 3 seconds period but I also want to make sure that each individual only uses it once every 10 seconds.
I have also incorporated a warning system that lets them know they are being blocked two times before fully ignoring them.
How it works:
When someone activates a !trigger it sets two variables, one is host specific to the user and blocks the user from using that trigger again for ten seconds and the other protects the !trigger from being hammered by multiple users, it makes it so the trigger can only be used once every 3 seconds, this is so a bunch of connections couldn't be used to bypass the flood protection with unique hosts calling the !trigger.
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.
Here is two examples of usage:
With:
on *:text:*:#testing1234:{ if ($1 == !trigger) { commands } }
you would use:
on *:text:*:#testing1234:{ if ($1 == !Trigger) && ($TriggerPro($nick,$v2) == $true) { commands } }
And with:
on *:text:!Trigger:#testing1234:{ commands }
you would use:
on *:text:!Trigger:#testing1234:{ if ($TriggerPro($nick,!Trigger)) { commands } }
Notice how one uses "If ($TriggerPro($nick,$v2) == $true)" and the other uses "If ($TriggerPro($nick,$v2))", these are the same exact thing in the mirc scripting language.
The $TriggerPro() handles the rest by doing nothing at all or by stopping the trigger from functioning and messaging the user about the flood protection being activated.
Example of the Trigger protection in action.
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten
-Jul07-08:18PM- Top Ten list was displayed for the next ten lines but I pulled them.
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten
-Jul07-08:18PM- Sorry, flood protection is preventing !TopTen from triggering. Try again in about 10 seconds.
¤Jul07¤08:18PM¤ {-%TyposBot-} !topten
-Jul07-08:18PM- 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
alias triggerpro {
if (%triggerpro. [ $+ [ $2 ] $+ . $+ [ $address($1,4) ] $+ . $+ [ $cid ] ] >= 1) || (%trigger. [ $+ [ $2 ] ]) {
$iif($v1 isnum 1-2,msg $chan Sorry $+ $chr(44) flood protection is preventing $2 from triggering. Try again in about 10 seconds. $iif($v1 == 2,Last warning. Any other attempts at triggering $2 will be ignored until you wait for atleast a 10 second period.))
inc -u10 %triggerpro. $+ $2 $+ . $+ $address($1,4) $+ . $+ $cid
return $false
}
inc -u10 %triggerpro. $+ $2 $+ . $+ $address($1,4) $+ . $+ $cid
set -u3 %trigger. $+ $2 $ $+ true
return $true
}
Heyas
Ok ive read the info about 10 times now, and tryed about 20 diffent things trying to get this to work.
I havent a clue what to do here at all. ive added the code into remotes.. but as far as all the other code u have posted i dont know. where dose this go??
I refare to this code:
on :text::#testing1234:{ if ($1 == !trigger) { commands } }
on :text::#testing1234:{ if ($1 == !Trigger) && ($TriggerPro($nick,$v2) == $true) { commands } }
on :text:!Trigger:#testing1234:{ commands }
on :text:!Trigger:#testing1234:{ if ($TriggerPro($nick,!Trigger)) { commands } }
I understand that for !triggers i must put: { if ($TriggerPro($nick,!Trigger))
or do i? with or without the 2nd bracket?
and why is there another } now at the end?
and ive still not idea where the line goes
for example
on :TEXT:!calc :#: msg $chan $nick $+ : The answer is $calc($2-)
what do i have to put in there, and where?? with what bracket? and without?
i assume this:
on :TEXT:!calc :#:{ if ($TriggerPro($nick,!Trigger)) msg $chan $nick $+ : The answer is $calc($2-)}}
so that dosent work, nor dose it work anwhere i paste the line, take out or put back brackets.. dosent work.
The thing is, the example you gave is very specific.. every script i have is totaly differnt looking, and i havent a clue where to put that line, am i even ment to put the line in? and what about the first 2 codes? what are they?
I will paste a few sections of differnt scripts so u can get a feel of what i mean.
1.
on :TEXT:!seen:#:{
if (!$2) { halt }
else {
.....etc
2.
on *:TEXT:!meditate:#:{
set %fish $rand(1,100000000000000)
....etc
3.
on :TEXT:!birthday :#:{ If ($read(birthday.txt,s,$2)) { msg # $2 was born on $ifmatch } | else { msg # No Birthday details for $2 } }
on *:text:!today:#:{
var %a = 1, %b = $lines(birthday.txt), %today
...etc
there are 3 examples.. what line do i past in them, where, and what brackets go where.
If i get 3 examples here, i can use them for reference and work the rest out myself.
Would be great if somone could give me a step by step lesson on how to use this.
My channels triggers are suffering badly, and i could do with this, what looks like, amazing god saviour.
happy xmas
pan