Sign in to follow this  
Followers 0
cougarelite

Comes Before Code

5 posts in this topic

Hey everyone,

I'm currently working on a script, and I've come across a problem. I need to check if one part of the text comes before the other, if it does, it clicks a certain spot, if it doesn't, it clicks another spot. I'll explain more thoroughly:

I am making the script highlight/copy a page of text. Then I need to make the script check if one thing in the page of text comes before another thing. So say inside this block of text, there are the words 'fat' and 'shoe'. I need to check if fat comes before shoe. If it does, I want to make the script left click on one coord, if it doesn't come first, I want it to click another coord.

So, is there a code that checks if one part comes before another?

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you could read each line in the file, until you get to the line with "shoe" in it.

if fat is in any of the lines before that, then.. well.. you get it.

shloud be really easy to code

assuming the word shoe is on line 100

something like

$i = 1

while $i < 100

$line = FileReadLine(your file)

$i = $i + 1

if StringInStr($line, "fat")

then call somefunction()

wend

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Thanks guys :), I'll try it out asap.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I've got another problem. I have two different scripts, both for different purposes. I need to make the first one check if a certain window exists, and if it does I need it to open the second script. Unfortunately, I just read that the Run ("") command can only run EXE, BAT, COM, or PIF. Therefore I can't use the script to open my .au3 file. What would be the best alternative?

I could copy the second script on to the bottom of the first, and use a Goto: statement. BUT... the Goto command was taken away, so I am out of ideas. Anyone have any ideas?

EDIT: Just did a little snooping around on the help file, and have found two codes that I think will help. I will define the second script (inside of the first) using the func () code. Then I will use the call() code to run it at the right time. Hope it works.

Edited by cougarelite

Share this post


Link to post
Share on other sites

Check the helpfile for #include

That will allow you to do what you are wanting.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0