English Slang Definition Checker
Platform: mIRC
Published Sep 15, 2011
Updated Oct 20, 2012
I see some of the slang checker scripts are not fully functional or unworkable, so I figure I'd give it a shot.
Quote
<Jethro> !define dani
<Bot> A person with lots of layers of goodness, like an onion without the crying and the smell.
<Jethro> @define Hawkee
<Bot> Hawkee is undefined!
<Jethro> !define smart alec
<Bot> A nicer way to say smart ass. You can use this in an office or when kids are around instead of saying smart ass or if you are a stick in the mud and don't cuss.
The command is self-explanatory and can be prefixed with !, @, or . to trigger. PM and channel supported.
- Fixed the line break characters being outputted.
6/15/12 - Updated using urbandictionary.com's API link.
10/20/12 - Updated a bit to remove \ character on *:sockopen:ud*:{
tokenize 32 $sock($sockname).mark
if ($sockerr) {
$5-6 Socket Error!
halt
}
$2-4 GET $+(/v0/define?term=,$1) HTTP/1.0
$2-4 Host: $+($sock($sockname).addr,$str($crlf,2))
$2-4 Connection: close
}
on $*:text:/^[!@.]define( |$)/iS:*:{
if (!$($+(%,-,$site,.,$cid,.,$nick),2)) {
inc -u3 $+(%,-,$site,.,$cid,.,$nick)
var %ud = $+(ud,$str($ticks,3))
$+(sock,$iif($sock(%ud),close,open) %ud api.urbandictionary.com 80)
sockmark %ud $replace($strip($2-),$chr(32),+) $&
sockwrite -nt %ud .msg $iif(#,#,$nick)
}
}
on *:sockread:ud*:{
sockread &ud
tokenize 32 $sock($sockname).mark
if ($sockerr) {
$5-6 Socket Error!
}
elseif (no_results isin $bvar(&ud,1-).text) {
$5-6 $qt($1) is undefined!
}
elseif ($regex($bvar(&ud,1-).text,/"definition":"(.*)/)) {
tokenize 34 $regml(1)
$gettok($sock($sockname).mark,5-6,32) $remove($regsubex($1,/\x5C(r|n{1,2})/gi,$chr(32)),\)
}
}
Can you edit this to work with mods only?
Thanks in advance.