Jump to content
chain

English Slang Definition Checker

Recommended Posts

  • Administrators

!define dani A person with lots of layers of goodness, like an onion without the crying and the smell. @define Hawkee Hawkee is undefined! !define smart alec 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.

 

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)),\)
  }
}

 

Link to comment
Share on other sites

  • Administrators
on $*:text:/^!define o(n|ff)$/iS:#:{
  if ($nick isop #) {
    if ($regml(1) == n) {
      if (!$istok(%chan,#,44)) {
        set %chan $addtok(%chan,#,44)
        .notice $nick # has been added!
      }
      else .notice $nick the channel $qt(#) has already been added!
    }
    else {
      if ($istok(%chan,#,44)) {
        set %chan $remtok(%chan,#,1,44)
        .notice $nick # has been removed.
      }
      else .notice $nick the channel $qt(#) has already been removed.
    }
  }
  else .notice $nick Access Denied. This command is reserved for OP only.
}
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:%chan,?:{
  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) $regsubex($1,/\Q\r\n\E/g,$chr(32))
  }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...