Jump to content

Recommended Posts

Posted

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

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.

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

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...