mIRC Homepage
Posted By: russkris22 Slap's - 20/03/10 04:25 AM
Hello,

I am still kind of new to mIRC.

Just wondering if anyone could help me with some slap commands, so return slaps if someone slaps me.

Or just some good fun commands..
Posted By: russkris22 Re: Slap's - 20/03/10 04:31 AM
I have been to http://www.mircscripts.org/ but that just confused me
Posted By: Tomao Re: Slap's - 20/03/10 05:16 AM
Code:
on $*:action:$(/(slaps? \Q $+ $me $+ \E)/iS):*: {
  describe $iif(#,#,$nick) slaps $nick back with a large trout!
}
Posted By: russkris22 Re: Slap's - 20/03/10 09:58 AM
Thank you very much.

Where do I put that
Posted By: Riamus2 Re: Slap's - 20/03/10 04:08 PM
Be aware that any script like that can be used against you to get you flooded off the network over and over until you get banned. It just takes a few people typing that multiple times and you'll be replying over and over and over. If you absolutely must have such a script (I don't recommend it), you should at least put in some protections to avoid that problem.

Scripts go in Remotes - (Alt-R)
Posted By: Tomao Re: Slap's - 20/03/10 07:10 PM
Script goes in your mirc Remotes - (Alt-R)
I added a flood control to prevent you from being flooded. People can only slap you once every 8 seconds.
Code:
on $*:action:$(/(slaps? \Q $+ $me $+ \E)/iS):*: {
  if (!$hget(fc,$wildsite)) { hinc -mz fc $wildsite 8
    describe $iif(#,#,$nick) slaps $nick back with a large trout!
  }
}
Now it's recommendable to be used without the worry of floods.
Posted By: Tomao Re: Slap's - 20/03/10 08:10 PM
Edit - Changed it to $wildsite instead of $nick
Posted By: chacha Re: Slap's - 20/03/10 09:56 PM
why hinc? why not /hadd -mu2

Code:
on $*:action:$(/(slaps? \Q $+ $me $+ \E)/iS):*:{
  if !$hget(ant,fld) {
    hadd -mu2 ant fld 1
    describe $iif(#,#,$nick) slaps $nick back with a large trout!
  }
}
Posted By: Tomao Re: Slap's - 20/03/10 10:06 PM
Well, is there a difference in functionality? smirk Plus I was attempting to match wildsite per nick...your suggestion halts the script for 2 seconds before every one can use it again.
Posted By: Riamus2 Re: Slap's - 20/03/10 10:13 PM
Why use hash tables at all? If you block it only per nick (or $wildsite), it will still allow a group of people to flood you off. There's not really any benefit to allowing you to display the reply to multiple people at once.

So... just use a variable. It's more efficient than creating a hash table just to see if it's being flooded.

Code:
  if (!%slap.flood) { 
    set -u2 %slap.flood On
    describe ....
  }


Though I'd still recommend more than 2 seconds. It doesn't exactly look good to reply every 2 seconds with slaps. 10 seconds would be a good minimum imo.
Posted By: Tomao Re: Slap's - 20/03/10 10:23 PM
Ok Riamus2 fair enough.
Posted By: russkris22 Re: Slap's - 21/03/10 02:27 AM
Oh dear.. you have confused me// Thanks for the help, but I will leave it out..

Best if I stay away from things that will cause problems
Posted By: Tomao Re: Slap's - 21/03/10 04:16 AM
There's no problem with the code I provided. Riamus2 was then suggesting the possibility of people flooding you out by doing the /me slaps you command repeatedly or by a group of people with a bad intention, while you have the code placed in mirc remote. Then there followed ChaCha's suggestion for me to do it another way.

I don't suppose the chances of that possibility is great anyway, unless you have had a beef with folks that have "real issues" with you, and that they know enough of MSL to tamper with the code.

Other than that, you're relatively safe to use the code the way it is without flood control added.
Posted By: Canario Re: Slap's - 21/03/10 10:20 PM
Originally Posted By: Tomao
Code:
on $*:action:$(/(slaps? \Q $+ $me $+ \E)/iS):*: {
  describe $iif(#,#,$nick) slaps $nick back with a large trout!
}


What is the $ prefix purpose?
Posted By: Wims Re: Slap's - 21/03/10 10:27 PM
Originally Posted By: /help Prefixes
The $ prefix
Indicates that the matchtext section of a definition contains a regular expression.

© mIRC Discussion Forums