$spellcheck
Platform: mIRC
Published Dec 21, 2007
Updated Dec 21, 2007
Very simple spell checker using basic sockets to spellcheck a word. $spellcheck(<word>)
; -------------------------------------
; $spellcheck()
; Spell checks a word based on data from www.spellchecker.net
; $spellcheck(<word>)
; -------------------------------------
alias spellcheck {
if ($1) && ($1 isalpha) {
set %spell.input $1
sockopen SPELLCHECKING www.spellcheck.net 80
return %spelling.output
}
var %e = .echo -ac info * $!spellcheck:
if (!$1) %e no parameters
elseif ($1 !isalpha) %e insufficient parameters
halt
}
on *:sockopen:SPELLCHECKING:{
unset %spell.output
sockwrite -nt SPELLCHECKING GET /cgi-bin/spell.exe?action=CHECKWORD&string= $+ %spell.input HTTP/1.0
sockwrite -n SPELLCHECKING
}
on *:sockread:SPELLCHECKING: {
var %t
sockread %t
if (*is misspelled* iswm $nohtml(%t)) {
set %spelling.output FALSE
.echo -q $spelling.output
sockclose SPELLCHECKING
halt
}
if (*spelled correctly* iswm $nohtml(%t)) {
set %spelling.output TRUE
sockclose SPELLCHECKING
}
}
on *:sockclose:SPELLCHECKING:unset %spell.input
alias nohtml {
var %o, %temp = $regsub($1-,/(<[^>]+>)/g,$null,%o)
return %o
}