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
;Slapper
;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-
return
}
elseif ($1 == </HTML>) sockclose $sockname
}
;EOF
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 '}'.
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.
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.
I just wanna know where it goes ? like remotes or what?