Anagram Solver (Unscrambler)

By Kirby on Dec 22, 2008

Another little dialog for solving scrambled text.

To launch it, either type in /anagram or right-click a window and hit 'Anagram Solver'.

Type in a word (as shown below) into the edit box, and hit 'Solve!' to unscramble the text.
All possible results will be listed in the list box.
Scrambled text can be left separated, for example, T A E, instead of TAE.

Here's a picture:
Image

Enjoy! :D

alias -l solve { if (!$sock(anagram)) { sockopen anagram www.ssynth.co.uk 80 | sockmark anagram $replace($1-,$chr(32),$chr(43)) } }
alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;) | return %x }
dialog anagram {
  title "Anagram Solver"
  size -1 -1 100 122
  option dbu
  edit "", 1, 10 11 79 10, autohs
  box "Anagram:", 2, 6 4 87 20
  list 3, 12 34 75 61, size
  box "Possible Words:", 4, 6 26 87 75
  button "Solve!", 5, 12 106 37 12
  button "Close", 6, 52 106 37 12
}
alias anagram dialog $iif($dialog(anagram),-v,-m) anagram anagram
menu * {
  Anagram Solver : anagram
}
on *:dialog:anagram:*:*: { if ($devent == sclick) { if ($did == 5) { did -b $dname 5 | solve $did(1) } | if ($did == 6) { dialog -x $dname $dname | unset %anagram* } } | if ($devent == edit) && ($did == 1) { did $iif($did(1).text,-e,-b) $dname 5 | did -r $dname 3 } }
on *:sockopen:anagram: { sockwrite -n $sockname GET http://www.ssynth.co.uk/~gay/cgi-bin/nph-an?line= $+ $sock($sockname).mark $+ &words=1&dict=antworth&doai=on HTTP/1.0 | sockwrite -n $sockname Host: www.ssynth.co.uk $+ $crlf $+ $crlf }
on *:sockread:anagram: { if ($sockerr) { echo -a * There was a problem retrieving data from the website. Please try again. } | else { window -h @anahide | sockread %anagram | if (<pre> isin %anagram) { while (</pre> !isin %anagram) { didtok anagram 3 32 $htmlfree(%anagram) | echo @anahide $htmlfree(%anagram) | sockread %anagram } } } | window -C @anahide }
on *:sockclose:anagram: { if ($dialog(anagram)) { did -e anagram 1 } }

Comments

Sign in to comment.
Jethro   -  May 21, 2011

The script may be nifty but the author may not have been so alive...

 Respond  
dsabecky   -  May 20, 2011

It's definitely a nifty script.

I agree about the pipes though, just line break for cleaner code.

 Respond  
Dani_l11   -  May 20, 2011

Why didn't you just use enters? Those | are horrible.

 Respond  
Kirby   -  Mar 02, 2009

Eh, maybe it doesn't increase the speed to a noticeable amount, but I have removed some variables and the use of tokens that should make it faster.

My computer is slow, but I like it. :( :)

 Respond  
Aucun50   -  Mar 02, 2009

My comp is fast so

 Respond  
Kirby   -  Mar 02, 2009

Really?
I tried the old one on a broken mIRC running on Wine and took about 10 seconds to finish.
This one now takes only 1 or 2 seconds.

Oh well.

 Respond  
Aucun50   -  Mar 01, 2009

I don't see a difference

 Respond  
Kirby   -  Mar 01, 2009

Made some drastic changes to it.
The script should work twice as fast now.

 Respond  
Kirby   -  Jan 19, 2009

Changed edit-box so it automatically scrolls horizontally since some words may be longer than others.

 Respond  
Kirby   -  Jan 12, 2009

This could be easily done without sockets in about 50% less lines.That's great. If you think it could be easily done, show me.

 Respond  
Noutrious   -  Jan 12, 2009

This could be easily done without sockets in about 50% less lines.

 Respond  
CharltonJ   -  Dec 24, 2008

Works good, good job =]

 Respond  
Aucun50   -  Dec 23, 2008

The script works fine still just wont to point that out, Good job btw.

 Respond  
Blitzjager   -  Dec 23, 2008

I'm using 6.31 and using "wrodasps" I don't get an error. :X
Guess it could be annoying but it doesn't stop the the script from working, right?

 Respond  
Aucun50   -  Dec 23, 2008

I'm using 6.32.

 Respond  
Kirby   -  Dec 23, 2008

Aucun50 said:

I found a problem:

  • /echo: insufficient parameters (line 65, script4.txt)

I tried using "wrodasps" it gave me password but that error.
I had two other people test this and they didn't have that error.
What version of mIRC are you using Aucun?

 Respond  
Aucun50   -  Dec 22, 2008

I found a problem:

  • /echo: insufficient parameters (line 65, script4.txt)

I tried using "wrodasps" it gave me password but that error.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.