/slap - Reinvented

By napalm` on Feb 10, 2009

This snippet slaps a user with anything but a large trout.

Syntax: /slap NickName

If a user is not provided, it slaps the user(s) selected in the nicklist. If no user is selected/provided then nothing happens.

If you use this in a window that is not a channel/query/chat window, do not say it has a bug. You are simply just retarded.

EDIT: 14 JUN 2011
FIXED: 31 OCT 2010
FIXED: 26 MAY 2009

;napalm - 14 JUN 2011

alias slap {
  var %n $iif($1,$1,$$snicks)
  if ($sock(slap)) sockclose slap
  sockopen slap www.watchout4snakes.com 80
  sockmark slap $active %n

alias slap.error echo $color(kick) -at /SLAP: Sock $+ $2 Error. $sock($1).wsmsg 

on *:sockopen:slap:{
  if ($sockerr) || ($sock($sockname).status != active) { slap.error $sockname open | return }
  sockwrite -n $sockname GET /CreativityTools/RandomWord/RandomPhrase.aspx HTTP/1.1
  sockwrite -n $sockname Host: www.watchout4snakes.com
  sockwrite -n $sockname User-Agent: mIRC $version
  sockwrite -n $sockname $crlf

on *:sockread:slap:{
  var %r | sockread %r | tokenize 32 %r
  if ($sockerr) || ($sock($sockname).status != active) { slap.error $sockname read | return }
  elseif ($regex(%r,main_lblPhrase.+>(.+)</span>)) {
    tokenize 32 $sock($sockname).mark $regml(1)
    describe $1 slaps $2 around a bit with $+(a,$iif($regex($left($3,1),[aeiou]),n)) $3-
  elseif ($1 == </HTML>) sockclose $sockname



Sign in to comment.
nap28   -  Jun 21, 2015

Please can someone explain me how to make this work step by step? Please!!!
I'm new on this and I don't have idea how to do it! Where I have to put the code? please help me, I need this feature.
I'm using mIRC 7.38 version.
Please please help me!!

dma  -  Jul 12, 2015

I just wanna know where it goes ? like remotes or what?

Sign in to comment

chachin   -  Dec 17, 2011


Helixx   -  Nov 20, 2011

Can someone make this script so that whenever someone slaps me, it slaps them back using some phrase, so, I don't have to type /slap

napalm`   -  Nov 17, 2011

I'll look into it this weekend.

gasak   -  Nov 16, 2011

it doesn't work anymore

irchainscriptz   -  Jun 30, 2011

yeah when he has a huge boredom episode lol.

napalm`   -  Jun 29, 2011

I just cleaned up a few things.

napa182 - Yeah, I peer in from time to time.

Alrac   -  Jun 15, 2011

my avatar is more OLD school...lol

Jethro   -  Jun 15, 2011

It's funny you two gentlemen use the Hannibal Lecter avatars. :P

If you don't mind my asking, what is the latest update, napalm?

Alrac   -  Jun 15, 2011

thanx jaytea, that suppressed the error i was getting.

jaytea   -  Jun 15, 2011

Alrac, that error shouldn't prevent it from working, since the (single) long line in the page source does not contain the random phrase. mIRC will throw the error then re-trigger the event with the next line ready to be read.

if you want to suppress the error, you can add :error | if (line too long isin $error) reseterror to the bottom of the code, above the last '}'.

napa182   -  Jun 15, 2011

napalm`, about time you updated this =P jk. nice to see you still linger around this site. lol

Alrac   -  Jun 15, 2011

i wish sum1 would update sprjukebox but i'ts beyond my know how.

blackvenomm666   -  Jun 15, 2011

update the code? or find someone who can?

Alrac   -  Jun 15, 2011

i use sprjukebox as my mp3 server script, it works best with 6.21

blackvenomm666   -  Jun 15, 2011

i just tested it and it works fine on 6.32

blackvenomm666   -  Jun 15, 2011

and why can't you upgrade alrac?

Alrac   -  Jun 15, 2011
  • /tokenize: line too long (line 25, slap_Reinvented.mrc)
    is the error i get and fyi, i can't upgrade from 6.21
napalm`   -  Jun 14, 2011


Jethro   -  Apr 07, 2011

RangerMan, you're encouraged to upgrade to the latest mIRC version. You're using a version that's almost 5 years old. The latest build patched various security bugs, fixes, and enhancements. I have no issue running napalm`'s script here using mIRC 7.19.

If, for whatever reason, you refuse to upgrade, at least use v6.35 and try running the script again.

RangerMan   -  Apr 07, 2011

i get this error when i run the /slap

  • /tokenize: line too long (line 24, slap_Reinvented.mrc)
  • /tokenize: line too long (line 24, slap_Reinvented.mrc)
    this is the line in question,
    var %r | sockread %r | tokenize 32 %r

using mirc 6.21

Jethro   -  Mar 29, 2011

Yes, the site has been back to life, but it was dead for a brief period of time.

napalm`   -  Mar 29, 2011

Code still works. :)

Jethro   -  Feb 18, 2011

Yes OnJohnNo, that website's fried now.

OhJohnNo   -  Feb 18, 2011

I feel I should point out that the site the script pulls the words from is down for now (message about a server error coming up). I was wondering why my script wasn't working, and then figured it out.

At least, I hope that's the explanation. It's either that or my mIRC "is epic failure".

napalm`   -  Nov 21, 2010

http://watchout4snakes.com/CreativityTools/RandomWord/RandomPhrase.aspx is the site the 'phrases' are grabbed from. If you will notice the phrases are in the format:

I doubt you are getting verbs. However, if you are, email the administrator of the aforementioned website to inform him that his 'Creativity Tool' has a bug.

chef-   -  Nov 21, 2010

www.watchout4snakes.com isn't giving me nouns.... it's giving me verbs.

i tried to rewrite it using a different site, but i dont know what im doing.

www.desiquintans.com/noungenerator.php is the site i wanted to use

Ghost-writer   -  Oct 04, 2009

/me takes out gun - give me the cookies :|

hsushoe   -  Jul 16, 2009

Thank you sooooo much Jethro_!!!

Dodge   -  Jul 14, 2009

Works Fine. Good One Nap -_- 9/10

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.