Top

!spell


mIRC Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  8.0 (of 1 scores)
Date Added  Mar 21, 2009
Last Updated  Mar 22, 2009
Tags  dictionary  socket  spell 

Introduction

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.


Grab the Code

;***
;***
;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, Mindforge #Technical,#Hollywood,#USA,#Atomreactor,#War
;***
;***
alias -l 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,&nbsp;)
  return %x
}
 

Comments

  (11)  RSS
Aucun50
Comments: 548
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 12:03 am
Looks handy
Kirby
Comments: 475
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 11:35 am
You might want to change
Code:
#SpellTrigger On
to
Code:
#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.
FordLawnmower
Comments: 412
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 1:07 pm
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 ;/
Kirby
Comments: 475
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 1:13 pm
You also might want to add the -l (meaning local) switches in
Code:
alias spell.spellout
and
Code:
alias spell.clear
, and perhaps put the alias /spell in front so that people (who don't read descriptions) don't confuse themselves with the proper alias.
FordLawnmower
Comments: 412
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 4:27 pm
;/ 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.
Code:

  .$iif((!%spell.inuse),$style(2)) Reset Trigger: spell.clear
Aucun50
Comments: 548
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 5:44 pm
Not sure that $iif statement will work.
ataraxia
Comments: 11
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 5:49 pm
Perhaps the global variables could be replaced with a more dynamic data type, so that you could allow multiple simultaneous users? Just my two cents. :]
FordLawnmower
Comments: 412
 
mIRC Snippet:  !spell
Posted on Mar 22, 2009 10:04 pm
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 :)
napalm`
Comments: 182
 
mIRC Snippet:  !spell
Posted on Mar 23, 2009 5:24 pm
Nick = Fool :]
ataraxia
Comments: 11
 
mIRC Snippet:  !spell
Posted on Mar 23, 2009 7:30 pm
sif, joshface. A simple per-nickname flood protection would make the script more useful. Josh = fool.
FordLawnmower
Comments: 412
 
mIRC Snippet:  !spell
Posted on Sep 20, 2009 1:56 pm
It's a really old script ataraxia. I had completely forgotten I wrote it ;/
I'll add it to my list of scripts to be re-written and I'll change the flood protection in the re-write.

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom