;***
;***
;Simple spell Script by Ford_Lawnmower
;Checks Spellings @ spellcheck.net. If the spelling is incorrect, it gives several suggestions.
;Syntax is !spell word || /spell word
;There is a On/Off switch for the public trigger on the right-click channel menu
;Questions, Comments, You can find me on WyldRyde #Script-Help
;SwiftIRC #Technical, Abjects #Technical,#AtomReactor and
;Mindforge #Technical,#AtomReactor,#Hollywood,#USA,#War
;***
;***
alias spell.spellout {
if (%spell.nick == ECHO) { echo -at >error< Connection Timed Out }
else { .msg %spell.chan No match was found for your search criteria %spell.nick :( }
spell.clear
}
alias spell.clear {
unset %spell*
sockclose spell
.timer-spell off
halt
}
alias spell {
if (%spell.inuse == 1) { echo -at >spell in use< Reset in Progress | spell.clear }
if (!$1) { echo -at Please provide a Word!!! Syntax /spell word }
if ($2) { echo -at The Spell checker will only check one word at a time. "Syntax" /spell word }
set %spell.search $1
set %spell.inuse 1
set %spell.nick $me
set %spell.chan ECHO
set %spell.i 0
sockclose spell
set %spellurl /cgi-bin/spell.exe?action=CHECKWORD&string= $+ %spell.search
set %spellsite www.spellcheck.net
sockopen spell %spellsite 80
.timer-spell 1 15 spell.spellout
}
#SpellTrigger On
on *:TEXT:!sp*:#: {
if (%spell.inuse == 1) { .notice $nick Sorry, But Somebody else is already looking up a their spell. | halt }
if (!$2) { .msg $chan You must provide a word!! Syntax !spell Word }
if ($3) { .msg $chan $nick The Spell checker will only check one word at a time. "Syntax" !spell word }
set %spell.search $2
set %spell.inuse 1
set %spell.nick $nick
set %spell.chan $chan
set %spell.i 0
sockclose spell
set %spellurl /cgi-bin/spell.exe?action=CHECKWORD&string= $+ %spell.search
set %spellsite www.spellcheck.net
sockopen spell %spellsite 80
.msg $chan 4 $chan 5spell Search... 7Searching for4 Your spelling 3Please Wait.....
.timer-spell 1 15 spell.spellout
}
#SpellTrigger End
on *:sockopen:spell: {
sockwrite -n $sockname GET %spellurl HTTP/1.1
sockwrite -n $sockname Host: %spellsite $+ $CRLF $+ $CRLF
}
on *:sockread:spell: {
if ($sockerr > 0) { .notice %spell.nick There has been an error... We could not retrive your Spelling. Sorry | spell.clear }
else {
var %spellvar | sockread %spellvar
inc %spell.i
if (<BR><font color=#990033><B> isin %spellvar) { set %spell.top %spell.i }
if (%spell.top == %spell.i) { set %spell.max %spell.i + 8 }
if (correctly isin %spellvar) {
if (%spell.chan == ECHO) { echo -at 6 %spell.nick -->> 7 $httpstrip(%spellvar) }
else { .msg %spell.chan 6 %spell.nick -->> 7 $httpstrip(%spellvar) }
spell.clear
}
if (%spell.max > %spell.i) { set %spell.result %spell.result $+ 3-->>7 $httpstrip(%spellvar) }
if (%spell.max = %spell.i) {
if (%spell.chan == ECHO) { echo -at 4,1 %spell.result }
else { .msg %spell.chan 4,1 %spell.result }
sockread %spellvar
spell.clear
}
}
}
menu Channel {
$iif($group(#SpellTrigger) == On,$style(1)) Spell Trigger
.$iif($group(#SpellTrigger) == On,$style(2)) On: .enable #SpellTrigger
.$iif($group(#SpellTrigger) == Off,$style(2)) Off: .disable #SpellTrigger
}
alias -l httpstrip {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}