; DictIRC v1.0.3 by Riamus 2005 ; #OldGames on irc.undernet.org ; Dictionary Data from http://www.onelook.com/ ; ; The most common types of words (nouns, verbs, etc) have color settings ; that can be set up. Uncommon types like Definite Articles and Conjunctions ; do not have settings for colors and use a default dark grey color. If for ; some reason, anyone wants these to have color settings in the dialog, just ; let me know. If you just want to manually change them, do Ctrl-F and ; search for 14 ... change those to whatever color you want them to be. ; ; Note that depending on the search, this can easily flood a channel with many ; definitions. ; ; Use the flood protection if you don't want words with long definitions to ; fill your channel. Although you won't get all your definitions for each ; word, you may not want to see 36 definitions for a word like "go". ; ; Credits: Indenting idea thanks to XMog on irc.irchighway.net in #Invision. ctcp *:version:*: { .ctcpreply $nick version DictIRC v1.0.3 by Riamus. For more information, contact Riamus on irc.undernet.org in #OldGames. } menu * { - DictIRC Setup: dialog -m DictionarySetup DictionarySetup } on *:load:{ dialog -m DictionarySetup DictionarySetup } alias dictionarysock { set %word $replace($1-,$chr(32),+) sockopen dictionarysock www.onelook.com 80 } on *:sockopen:dictionarysock: { sockwrite -n $sockname GET /?w= $+ %word $+ &ls=a HTTP/1.0 sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) sockwrite -n $sockname Host: www.onelook.com sockwrite -n $sockname Accept-Language: en-us sockwrite -n $sockname Accept-Encoding: gzip, deflate sockwrite -n $sockname Accept: */* $+ $crlf $+ $crlf } on *:sockread:dictionarysock: { if ($sockerr) { echo -a Error. halt } else { var %temptext sockread %temptext if (*Quick definitions* iswm %temptext) { set %dictionary.word $htmlfree($gettok($gettok(%temptext,2,40),1,41)) } if (
$+ %word $+ * iswm %temptext) {
inc %defcnt
set %definitions [ $+ [ %defcnt ] ] $gettok($htmlfree(%temptext),2-,32)
}
if (