Jump to content

Recommended Posts

Posted (edited)

You are still thinking too difficult. If that is the only thing you are trying to do, it can be done in a single line.

;$ClipGet = ClipGet()
$ClipGet = "_ _ _ _ _   H _ _ _   B _ _ _   _ _ _ _ _   _ _   B _   _ _   _ _ _ _ _ G   _ _   F _ _ _   G _ _ _ _   _ _ _ P _ _ _"

MsgBox(0, "String obtained is:", $ClipGet) ;To be removed later on!!!

$sReturn = StringTrimRight(StringReplace(StringReplace($ClipGet,"_ ", "*"),"  ", " "),1)&"*"

MsgBox(0, "Final result is:", $sReturn)

Edit: By the way, let's leave this behind us. And let's move on to step: 3.Change the cllue into a form that can be compared with other strings opened from a text file

Do you have a text file that illustrates what to expect? So I may be able to help out here.

Edited by Manadar
Posted (edited)

Do you have a text file that illustrates what to expect? So I may be able to help out here.

I really appreciate you taking the time to help me!

Okay, so let's say that I give the input as follows:

_ _ _ _ _   O _   _   F _ _ _ _ _ _   F _ O _ _   _ O _ _ _ _ _ _

My script now changes it into the following as required

*****.O*.*.F******.F*O**.*O******

Now, my text file actually divides the answers in terms of number of words, so it looks something like this:

3

Hi.to.everyone

4

This.is.a.test

Welcome.to.the.solutions

[\code]

This carries on all the way down to around 15 word solutions.

What my script can do is count the number of words in the string (I did this by counting the number of replacements of three spaces needed and then added 1).

So, as I see it, there are two ways to get the solution:

1.Test each and EVERY line and see if it matches the string required. I think this is quite inefficient.

2.Count the number of words, and find the line in the text file that has that number, and just read below that line.

Either way, I need it to use the *'s as wildcards that can contain any letter.

Edit: I just slightly changed the format of the text file. I noticed that when using stringcompare, autoit tends to ignore spaces. So, what I intend to is, is that when autoit has got the right solution, it just substitutes spaces into where the .'s should be.

How would I go about doing this?

Edited by aommaster
Posted

*slaps self*

I just cannot believe I didn't think of that!

It works PERFECTLY! Thank you very much!

It DOES HELP when you have the right input AND the right instucrions !!! :P

And Yes in that case I agree: it is basics stuff !!! :)

(when you are not too tired!!!)

:

Posted

It DOES HELP when you have the right input AND the right instucrions !!!

And Yes in that case I agree: it is basics stuff !!!

(when you are not too tired!!!)

I agree, and I owe you an apology for leading you on the wrong track.

I've been working on fixing the input for around 5 hours yesterday, so, I was kinda irritated.

Now, I'm up for the next hurdle, which is to actually compare the strings read from the text file to the input string using wild cards, which I am not really sure how to do...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...