Simple spell check script. It has a public trigger -- !spell word and a private alias -- /spell word. There is a on/off switch for the public trigger on the channel menu.
;Spell Check by Ford_Lawnmower irc.GeekShed.net #Script-Help
menu Channel,Status {
.$iif($group(#SpellCheck) == On,$style(1)) SpellCheck Trigger
..$iif($group(#SpellCheck) == On,$style(2)) On: .enable #SpellCheck
..$iif($group(#SpellCheck) == Off,$style(2)) Off: .disable #SpellCheck
}
#SpellCheck on
On $*:Text:/^(\+|-|!|@)Spell(Check)?.*/Si:#: {
var %action $regml(1)
if (%action isin +-) && ($regex($nick($chan,$nick).pnick,/(!|~|&|@)/)) {
if (%action == +) {
if ($istok(%SpellCheckChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is already running the SpellCheck script }
else {
.enable #SpellCheck
Set %SpellCheckChanList $addtok(%SpellCheckChanList,$+($network,$chan),32)
.msg $chan $nick has activated the SpellCheck script for $chan .
}
}
else {
if (!$istok(%SpellCheckChanList,$+($network,$chan),32)) { .msg $chan $nick $chan is not running the SpellCheck script }
else {
Set %SpellCheckChanList $remtok(%SpellCheckChanList,$+($network,$chan),1,32)
.msg $chan $nick has deactivated the SpellCheck script for $chan .
}
}
}
elseif (!$timer($+(SpellCheck,$network,$nick))) && ($istok(%SpellCheckChanList,$+($network,$chan),32)) {
.timer $+ $+(SpellCheck,$network,$nick) 1 6 noop
var %method $iif(%action == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%|\+)/),.msg $chan,.notice $nick))
GetSpellCheck %method $$2
}
}
#SpellCheck end
alias SpellCheck { GetSpellCheck echo -a $1 }
alias -l GetSpellCheck {
$1-2 Searching........
var %sockname $+(SpellCheck,$network,$2,$ticks)
sockopen %sockname www.phigita.net 80
sockmark %sockname $1-2 $+(/spell-check/word-suggest?q=,$3)
}
On *:sockopen:SpellCheck*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0
sockwrite -n $sockname Host: www.phigita.net
sockwrite -n $sockname $crlf
}
else { sockclose $sockname | return }
}
On *:sockread:SpellCheck*: {
if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
else {
var %SpellCheck | sockread %SpellCheck
if ($regex(%SpellCheck,/("[^"]*" is spelled correctly)/i)) {
$gettok($sock($sockname).mark,1-2,32) $regml(1)
;sockclose $sockname
;return
}
elseif ($regex(%SpellCheck,/("[^"]*" is misspelled)/i)) $gettok($sock($sockname).mark,1-2,32) $regml(1)
elseif ($regex(match,%SpellCheck,/q=define:([\w]*)"/gi)) {
$gettok($sock($sockname).mark,1-2,32) Suggestions: $regsubex($str(.,$regml(match,0)),/(.)/g,$+($iif(\n > 1,$chr(44)),$regml(match,\n)))
sockclose $sockname
return
}
elseif (</html> isin %SpellCheck) {
$gettok($sock($sockname).mark,1-2,32) Nothing Found!
sockclose $sockname
}
}
}
Uhhh... nice work... ooO( I didn't expect you to be so fast you no-lifer ;P hehe <3 )
[size=16]BIG THANKs[/size]
Much appreciated Ford....
EDIT
Works just like intended...
Once again thanks for fixing it ooO( SO FAST! ) :D
EDIT 2:
"OFF-TOPIC?/REPLY?"
I'm sure he doesn't do it for gratuity... he does it for all the punani of-cause ???
Haha... joke a side...
I do appreciate it... ( whatever Ford / or others intentions are / where ) and since time isn't something we have...
I think the least I can do... is to take the time to show My appreciation...
ooO( Anybody who takes the time to help others are A-OK in My book )
"BACK-2-TOPIC?/REPLY?"
But yeah... you are absolutely right Jethro_... regarding the no-life'er comment at least, and
[size=16]I apologize for the bad joke[/size] [size=18]<3[/size]
Updated
Basic version of this script with no colors.
+-spell to turn the script off/on in a channel.
@spell word - to message the result to the channel (voices or higher)
!spell word - will notice the user.
Suggestions will be given even if the word is spelled correctly. I will make this an option when I update it tomorrow.
I will also update the description and add some other options.
You could easily make this work for simultaneous usage. You would need to also add additional trigger flood protection. Keeping in mind that each instance of a script like this is opening a socket to the internet, I never make sockets scripts that allow for multiple instances to run at the same time. With the exception, of course, being a real time translation script :)
I tested that $iif Aucun50 , it works :)
;/ I missed that ;/ I changed the spell.spellout. I left the spell.clear global because I added a line to use it from the menu in case it needs reset for some reason.
Just incase the script stopped for some reason before it cleared all the variables.
.$iif((!%spell.inuse),$style(2)) Reset Trigger: spell.clear
It gets lots of use in my chans Aucun50.
Thanks Kirby :) I see lots of scripters using that method, However when I do it, I always end up answering the question "How do you turn the trigger on?" Over and Over.
I think the proper method would be to disable it by default, but..........
No Idea why mIRC makes you reverse Off and On to make a script work properly. It even turns the groups back on when you make a change and save the edited remote ;/
You might want to change
#SpellTrigger On
to
#SpellTrigger Off
because when it is loaded, it is automatically turned on..or did you mean to do that?
(Another) very nice script, but I find it interesting how you use many different local aliases towards a simple socket script. Nice to see different kinds of coders here.