Jump to content

Help on Global Variables.


Recommended Posts

By Global, does it mean another AutoIt script can use that variable aswell? I want to have two scripts running and have them communicate with each other. If this isn't possible, then can you have a function constantly running while the script continues working on whatever else its suppose to do?

Oh and, does AutoIt have OCR functions? Like you specify a coordinate box and the color of the text, and then it scans for text? I couldn't find anything in the Help file.

Link to comment
Share on other sites

Global variables are visible to all user-defined functions (UDF's) and non-UDF code in one script. Global variables defined in a script that is then #included into another script are visible to the including script, but two different runs of AutoIt can not see each other's global variables. You need to use some sort of mechanism for passing information from one program to another, such as common .INI files, windows socket messaging, even TCP messages or Sending key strokes to the other process.

The Local variables (as opposed to Global variables) are visible and usable only within the UDF in which they are defined. Globals can use seen and used throughout the entire script.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Link to comment
Share on other sites

  • Moderators

By Global, does it mean another AutoIt script can use that variable aswell? I want to have two scripts running and have them communicate with each other. If this isn't possible, then can you have a function constantly running while the script continues working on whatever else its suppose to do?

Oh and, does AutoIt have OCR functions? Like you specify a coordinate box and the color of the text, and then it scans for text? I couldn't find anything in the Help file.

<{POST_SNAPBACK}>

As far as I know no one has added an OCR function. CyberSlug has gratiously donated his time and efforts of making an ingenious work around but it does require your efforts in finding coords and checksums. If you truly want this option I'm sure that's not a problem.

CyberSlugs OCR

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

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