anti flood at it's simplest

By Cheiron on Jan 27, 2008

nice little anti flood system that works on each individual using a set trigger word .. ie !setup or something.

goes into a fresh remote file.

what it does is set a timer (currently the value there is 10 secs) on the nick using the trigger command. if the user tries to use the same trigger within that time period of the timer, it will not function until the timer has expired.

i have left it nice and simple again with no /echo there in favour my dreaded .msg lol. i will get around to using it soon dont worry.

comments and ratings from you nice folk out there?

on *:TEXT:<whatever in here>:#:{
  if ( %test. [ $+ [ $nick ] ] == $null ) {
    set %test. [ $+ [ $nick ] ] 1
    .msg $nick <message or action>
    .timer 1 10 unset %test. [ $+ [ $nick ] ]
  }
}

Comments

Sign in to comment.
EL   -  Jan 30, 2008

I agree that coders should apply them selves as well i was talkin to a dude the other day about coders cause i never was even on a server with any when i stared 7 months back an he said all the networks he went to there was 37498532745892437509432750923 effin chatters most used mIRC an had no idea about codin if they did it was little.Most people aren\'t gunna be all gung HO about a programming language.I see more people askin me how do i make fun stuff or alias or on TEXT or little themes(on INPUT) or ascii designs etc.Most either arent interested in more advanced codin or wanna make a little game something simple an fun to piss with.Im not sayin that thats every one im just sayin a higher ratio arent going to be looking to be doin this long, just something to impress they friends when they chat.But hell if they can use his and understand it an then look at yur ist an understand it later then its not lost time,we all appreciate the comment an help thats why they are posted here after all.Btw the mIRC help file is well to say the least lacking....`-.-

 Respond  
Rebellious   -  Jan 30, 2008

You\'re completely right as to how I explained what my code does. I was brief and too vague. I also agree with you that new scripters would look at that code and be like \"wtf\"? However, I think that scripters should apply themselves. There is a helpfile, there are tutorials. And if some users took the time to experiment and try out the codes I used in different scripts, etc. then they would have an understanding.

I think that users should apply themselves as they would for education or something that they feel to be passionate about. If they can accomplish that, then they become more advanced. They would
probably be given ways to script better when they posted a script for reviewing. Thus, they\'d learn some time.

But, it depends on the way a user takes the pace of learning. So, I can\'t really be too judgmental of this> :O

Anyway, I was just trying to post a way that it could be accomplished cleaner and attempted for users to understand. But I guess that didn\'t work too well XD.

 Respond  
EL   -  Jan 30, 2008

mIRC help file - $wildsite Returns the address of the user who triggered an event in the form !@host.I actually prefer $chan $+ $nick $+ $address($nick,4)) to be safe(alto bypass able with a nick change,channel bot no status other wise i save the full ISP channel and server).`-.-

 Respond  
guest598594   -  Jan 30, 2008

yea i dont know what $wildsite does either Image

 Respond  
EL   -  Jan 30, 2008

@ Rebellious It\'s cool to disagree with ratings sure, and your script is well done not that i tested it yet but remember hes targeting completely new scripters more then likely coders that have yet to get past alias\'s so I don\'t think its unfair to rate this snippet high.One it works plain and simple.Two its simple a new coder can\'t ask for any thing more simple cause staring down the barrel of some of these codes can be intimidating for new coders, trust me i know.Well look at your code above for a sec almost every part of it is just a more advanced way of goin about cheiron\'s which is awesome i take nothing away from it,but to start off coding I personally would want to use his vs yours for the time bein so i have time to learn some things then in time as one gets better to change it to your more advanced ways,but only after they are ready for it.You can call me a n00b for this but i dont use $v1 actually i dunno wat it means and the $iif i dont use those either,most new ppl dont start out usin %var an < > $iif $v1 or $wildsite etc not sayin they are incapable of it im just sayin its hard when u start and discouraging to try an learn it rite away.Even i have a hard time readin your code yet i know $regex and use raw\'s etc.I think for the newer scripters it\'s ace.maybe instead of one posting forum there should be something for simple starter scripts maybe some one to filter these as well,seem these types of scripts get dogged on within the more advanced section of the community,hes trying to help it may not be the more efficient ways according to some but it is a workin code that has the potential to keep the new coders interested an not discouraged to keep codin an gettin better to one day get to where your code stands.And yes he should add comments such as yours sense it is target at new comers as well.Either way i still stand by my rating an no im not commenting outta defense,simply trying to show other opinions.`-.-

 Respond  
Rebellious   -  Jan 30, 2008

I\'ve created an alternative to your script, commentary included:

on *:text:<whatever regex/command here>:#:{ 
  ; the above will match a command like any normal bot script
  var %n $iif($($+(%,command,.,$wildsite,.,#),2),$v1,0)
  ; we use a local variable and a global variable here
  ; I like to store the data of a global variable in a local one
  ; Just so that we can use it later.
  if (%n != 0) { 
    inc -z $+(%,command,.,$wildsite,.,#) 15
    ; inc -z acts a sort of countdown. It will count down from fifteen each second
    ; put all your commands here
  }
  elseif (%n > 5) { msg $nick <message here> }
  ; Remember how I said inc -z counts down? Well, if the user uses the command in a range of 10 seconds
  ; then the command won\'t be used and the user will be notified with what ever the message was
}

You should really tell users to replace .msg with the commands they want to use. As you don\'t include that in your introduction.

I\'ve also read some of the comments on here. The ratings aren\'t very backed up with reason, and the some of the comments are very odd. Cheiron, if you want to improve your scripting and appeal to new scripters, than you should apply the most clean and advanced method as you can; whilst applying yourself in the process. So about the set -u drama, Solo\'s point is true. However, I don\'t agree with him for the most part.

I find that this can be a very useful script, and that your ideas, Cheiron, are excellent and your snippets have a fantastic vision. It\'s just the scripting that needs a bit of reworking.

As to my previous comment on the ratings, I am going to expand on that a bit more. I really believe a well given rating should consist of explanations on your views of error checking, thought/creativity, the documentation, and the scripting style.

As this script is now, I\'d have to give it a 4. The idea has been said in many comments before (Ex: \"add a flood protection\"), and that the scripting style is poor and needs to be redone. I find that the documentation is very poor, as it does not mention vital things to the script. The reason I\'d give this is a 4 and not say.. a 2 is that the idea is directed at the new users and that the author is trying to give users ideas and a simple tutorial.

I hope you can agree with my views on this, and not take this personally in any way.

Good luck!

 Respond  
burford   -  Jan 29, 2008

well said cheiron

 Respond  
Cheiron   -  Jan 29, 2008

i have posted more advanced scripts here on the site and will continue to post the more advanced stuff as i learn it for i am a newcomer to the world of scripting myself.. however, these snippets i am posting are not ripped or copied like a lot of the newer scripts that have been posted of late on here.. at the moment i am trying to learn scripting but you can only digest so much, so quickly. then you have
to understand it. i know what you are getting at Solo... however, it occurs to me i am in the spotlight of a high level scripter that has been doing it for a good while or one at least that is familiar more so in the ways of scripting than i.. be patient.. we were all noobs once. too many people forget that these days. they think just cause they can script better, they can judge. we learn from our mistake and with confidence. as i get more confident, so will my scripts reflect that confidence.. until then, i will post my scripts as i do in the only way i currently know how too

 Respond  
Solo   -  Jan 29, 2008

Not that i want to get into an argument here as it would just go around in circles. But all you are doing is teaching users bad habits, i have made some good suggestions to improve your coding but you have chosen to ignore them with rhetoric. You say a user will only get spammed it they continually access the command? well you better damned make sure that they do not get spammed as your code should be prepared for that especially when all it is, is addding a . infront of the timer so the users don\'t see it triggering and stopping. Also as mentioned using a timer to unset a variable is ugly and a lot more confusing then just using a simple -u switch
It should be important that users see good coding practice how ever simple the code! I am not going to turn this into a flaming war but i do think that the standards of code being submitted to this site has dropped drastically and from other posters i get the idea that i am not the only one.

 Respond  
EL   -  Jan 28, 2008

lol well said again Cheiron.`-.-

 Respond  
Cheiron   -  Jan 28, 2008

it was only intended as a simple snippet for newcomers to see a basic anti flood in operation. it is short, not much code, easy to see what does what and it is functional. that is what i intended it to be. i do have more advanced snippets i have submitted, but this was never made to be one. i know i could have used the -u10 etc,.. or the echo -a but this is about simplicity. as for the spamming.. it will only spam the user if they continually attempt to access the command.. although most people would give up if it did not work again after the 2nd or 3rd time and actually ask in channel why it not working.. well. i say most people lol.. depends how bright they are :)

 Respond  
Solo   -  Jan 28, 2008

i think its terribly written to be honest. and who actually is going to use it, also using a timer is messy, you should use the -u switch that it will unset it, for example set -u10 %var will set a variable for ten seconds. But if you are going to use a timer at least silence it with a . infront of it otherwise it will spam the user especially if there is a lot of text events.

 Respond  
EL   -  Jan 28, 2008

Not probs and i agree completely with your assessments on newcomers an snippet comments.`-.-

 Respond  
Cheiron   -  Jan 28, 2008

many thanks EL. it is always nice to see there are people out there that take the snippet for what it is and rate/review honestly based on how well it works rather on whether it contains half the science journal\'s equations for quantum mechanics heh!!

Everybody..

rememebr there are alot of newcomers and beginners to scripting on this site people and posting stuff like.. there are better scripts than this .. is not gonna encourage these new line of scripters to continue bringing new material in. just take the script, test it, and rate it. if there is a fault, obviously comment and/or put a solve there so the newcomer can see where he/she went wrong, as per the likes of Lindrian and mountaindew do, then at the end of the review.. then you could possibly suggest a simpler way of coding, or point to a few other codes for the new scripter to read so that he can see or learn how a slightly more advanced script works etc etc etc.

it is all to easy to look at these scripts and say.. useless... dont work... why is it this basic... i have seen far better. which defeats the purpose of this site. if there is an issue with the script, let the newcomer know fairly and simply but rate the script according to its working ability. i hold my hands up and admit i still use /\'s on my .msg\'s or use them in favour of echo -a for example. but that should not bias reviews.. the scripts work regardless, so treat them as they work.

 Respond  
water_dragon   -  Jan 28, 2008

well i never said it was handy... to be honest i dont do much with anti floods and all tht but i give it 7/10 is that ok?

 Respond  
EL   -  Jan 28, 2008

I always forget the rating sorry man 8/10.Very Useful versatile clean an simple.`-.-

 Respond  
Cheiron   -  Jan 28, 2008

remember this script is not just limtied to on :TEXT: it can be used with on :JOIN:: or on :NICK: for nick changes.. it is a versatile script considering and i quote...have left it nice and simple again...

this was done for a reason. to show how a bot for example could defend against command attacks to get it flooded off. yes there are better scripts out there, but look how complex they are. this is as simple or as short as about possible without confusing \"new scripters\" as to how the script works whilst still maintaining a good deal of functionality.

any chance of an \"Honest\" rating please people. remember, when these codes are reviewed... it is not about how complex they are, or how long they are, etc... it is how well they work, are they easy to setup, easy to understand, etc

 Respond  
water_dragon   -  Jan 28, 2008

i did read the script... i do test every script i see on my test mirc and see if they any good if not then i move on to the next one. all i said is theres better script for \"anti flood\" witch is more advance then this one right here... is there any harm in putting my opinin or something.

 Respond  
napa182   -  Jan 27, 2008

wow water_dragon you seem like a numb nut to me no offence... but read what the script is first before you comment...

 Respond  
EL   -  Jan 27, 2008

@ water_dragon These types of simple scripts can be used as learning tools aswell.Protects against <!command> floods so is usefull in that reguard.`-.-

 Respond  
water_dragon   -  Jan 27, 2008

to be honest theres no point in submitting these kinder script (no offence) as there is alot better scripts for \"anti Flood\"

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.