mIRC Home    About    Download    Register    News    Help

Print Thread
#219480 20/03/10 04:25 AM
R
russkris22
russkris22
R
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..

#219482 20/03/10 04:31 AM
R
russkris22
russkris22
R
I have been to http://www.mircscripts.org/ but that just confused me

#219483 20/03/10 05:16 AM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
Code:
on $*:action:$(/(slaps? \Q $+ $me $+ \E)/iS):*: {
  describe $iif(#,#,$nick) slaps $nick back with a large trout!
}

Tomao #219492 20/03/10 09:58 AM
R
russkris22
russkris22
R
Thank you very much.

Where do I put that

#219499 20/03/10 04:08 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
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)

#219506 20/03/10 07:10 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
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.

Tomao #219510 20/03/10 08:10 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
Edit - Changed it to $wildsite instead of $nick

Tomao #219514 20/03/10 09:56 PM
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
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!
  }
}

chacha #219516 20/03/10 10:06 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
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.

Tomao #219519 20/03/10 10:13 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
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.

Riamus2 #219521 20/03/10 10:23 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
Ok Riamus2 fair enough.

Tomao #219527 21/03/10 02:27 AM
R
russkris22
russkris22
R
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

#219528 21/03/10 04:16 AM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
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.

Tomao #219565 21/03/10 10:20 PM
C
Canario
Canario
C
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?

#219567 21/03/10 10:27 PM
Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
Originally Posted By: /help Prefixes
The $ prefix
Indicates that the matchtext section of a definition contains a regular expression.


Last edited by Wims; 21/03/10 10:27 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard