; SPELL MOD v1.1 - by entropy & Talon 2026 ; Returns teh correct spelling. ; Commands: !spell(none) ; Help: !spell - Checks to see if the word is spelled correctly. (none) ;================================================== on *:unload:{ cleanupscript spell.mod } ;================================================== on *:signal:spell:{ set -u30 %socknamespell $1 var %host = $mid($2,2) var %nick = $gettok(%host,1,33) var %text = $mid($5-,2) var %chan = $remove($4,:) var %mymodes = $getmodes(%socknamespell,%chan,$botnick(%socknamespell)) var %modes = $getmodes(%socknamespell,%chan,%nick) var %access = $getaccess(%socknamespell,%chan,%host) var %prefix = $iif($hget(%socknamespell,$+(%chan,.prefix)),$v1,!) tokenize 32 $2- if ($1) { if ($2 == PRIVMSG && $left(%chan,1) == $chr(35)) { var %prefix = $iif($hget(%socknamespell,$+(%chan,.prefix)),$v1,!) ; #channel command flood protection ;=============================================== if ($left(%text,1) == %prefix) { inc -u2 $+(%,flood.,%socknamespell,.spell.msg) 1 if ($eval($+(%,flood.,%socknamespell,.spell.msg),2) >= 2) { return } } ;=============================================== ;No Modules... ;=================================================================== if ($istok($hget(%socknamespell,$+(%chan,.nomod)),spell,32)) { return } ;=================================================================== ;No Commands ;================================================ if ($nocommands(%socknamespell,$mid($1,2))) { return } ;================================================ if (?spell iswm $gettok(%text,1,32) && $left(%text,1) == %prefix) { spell %socknamespell %chan $5 } } } } ;================================================== alias -l spell { set %_spellsock $1 set %_spellchan $2 set %_spellword $3 spellAPI $+(https://api.languagetool.org/v2/check?language=en-US&text=,$3) } alias -l spellAPI { noop $urlget($1-,gbi,&fml,processspellAPI) } alias -l processspellAPI { var %id = $1 , %BV = $urlget(%id).target, %code = $gettok($urlget(%id).reply,2,32) if (%code != 200) { sockwrite -n %_spellsock PRIVMSG %_spellchan :[Spell] $c Error code: %code | unset %_spell* | return } var %text = $bvsearch(%BV,"value":,44).inbetween var %output = :[Spell] $c $iif(%text,Correct Spelling: $remove($v1,$chr(125),$chr(93)),$qt(%_spellword) is spelled correctly.) sockwrite -n %_spellsock PRIVMSG %_spellchan $mid(%output,1,400) if ($len(%output) >= 401) { sockwrite -n %_spellsock PRIVMSG %_spellchan $+(:,$mid(%output,401,401),$iif($len(%output) >= 802,$dot)) } unset %_spell* }