cooldude832 Posted March 8, 2007 Share Posted March 8, 2007 (edited) I've made a hangman program and i have a set number of answers (it runs via a php script) I want to make an auto solver for it that can select the play field which looks similar to _ _ _ _ _ _ _ _ _ _ _ _ &_ _ _ _ _ _ _ _ &_ _ _ & _ _ _ _ _& _ _ _ _ _ _ _ & _ _ _ _ _ _ _ It post really bad so i'm gonna replace the double sapces with a & but in real life they are double spaces. The words are seperated bye double spaces and the individual letters are by single splits. To solve the puzzles i have all the known solutions in arrays that are based on the nubmer of words in the puzzle. So it begins by highlighting the field sending that to the clipboard putting it in a variable and then i attempt to split it by every " " (double space) but for some reason its returning a $spacesplit[0] is equal to 58 which is not right. Is there a way i can use a double space as a delimiter for stringsplit without having it split at single spaces, or does someone have a better idea to solving this? This is the script i'm using to see what it spltis like: mousemove(145,742) Mousedown("Left") MouseMove(692,801) MouseUP("Left") sleep(250) send("{CTRLDOWN}c{CTRLUP}") $blank_puzzle = clipGet() $2space = " " $word_count = StringSplit($blank_puzzle, $2space) msgbox(0, "", $word_count[0]) The message box returns something in the 50s Edited March 8, 2007 by cooldude832 Link to comment Share on other sites More sharing options...
McGod Posted March 8, 2007 Share Posted March 8, 2007 You got a link to the hangman? [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
cooldude832 Posted March 8, 2007 Author Share Posted March 8, 2007 No but one similar is aviable here at neopets.com, i just made my own almost identical but semi different.http://www.neopets.com/games/cliffhanger/cliffhanger.phtmlMine is local on my apache Link to comment Share on other sites More sharing options...
cooldude832 Posted March 8, 2007 Author Share Posted March 8, 2007 I guess my real question is can i use a double space as a delimiter without it picking up single spaces? Cause autoit seems to ignore whitespace in excess of 1 Link to comment Share on other sites More sharing options...
McGod Posted March 8, 2007 Share Posted March 8, 2007 I did something like this: Global $sAnswer[3] $sAnswer[0] = StringSplit("BRONTO BITES ARE ALL THE RAGE AND THEY ARE MEATY AND VERY EASY TO CARRY", " ") $sAnswer[1] = StringSplit("WITH THE RIGHT TRAINING TUSKANINNIES CAN BECOME QUITE FEARSOME FIGHTERS", " ") $sAnswer[2] = StringSplit("YOU SHOULD NOT THROW BASEBALLS UP WHEN THE CEILING FAN IS ON", " ") [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
cooldude832 Posted March 8, 2007 Author Share Posted March 8, 2007 I did something like this: Global $sAnswer[3] $sAnswer[0] = StringSplit("BRONTO BITES ARE ALL THE RAGE AND THEY ARE MEATY AND VERY EASY TO CARRY", " ") $sAnswer[1] = StringSplit("WITH THE RIGHT TRAINING TUSKANINNIES CAN BECOME QUITE FEARSOME FIGHTERS", " ") $sAnswer[2] = StringSplit("YOU SHOULD NOT THROW BASEBALLS UP WHEN THE CEILING FAN IS ON", " ") I've got the rest of the script my issue is in looking at the original puzzle and gathering information off it like # of words in it etc etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now