Sign in to follow this  
Followers 0
Physical

Need help with Monitoring a variable and taking immediate action if it changes

5 posts in this topic

I have a script that runs multiple functions and loops. One of the things i want to do is assign a value to a global variable. Then while the script is running and doing the rest of its stuff i want to have everything be stopped (or just take an additonal action) if the value in this variable changes. I tried to search for interupt ways but all i found were examples using GUI or HotKeySet and required someone to hit a key. I want the script to do it itself without me pressing anything. Thanks for any help.

Share this post


Link to post
Share on other sites



adlib

Share this post


Link to post
Share on other sites

adlib

Unless i dont know how to use it correctly i dont think adlib will work in this case. It worked for my other problem but this time i need it to take an action if the value stored in the variable changes. Basicaly i need the script to monitor a certin thing and if that thing changes then i need it to take an action immediately, not wait for the loop to end then do something. From what i understand (which might be wrong i am still learning) adlib only executes based on time. Is there another way of using it or does anyone have another suggestion? thanks for any help.

Share this post


Link to post
Share on other sites

Unless i dont know how to use it correctly i dont think adlib will work in this case. It worked for my other problem but this time i need it to take an action if the value stored in the variable changes. Basicaly i need the script to monitor a certin thing and if that thing changes then i need it to take an action immediately, not wait for the loop to end then do something. From what i understand (which might be wrong i am still learning) adlib only executes based on time. Is there another way of using it or does anyone have another suggestion? thanks for any help.

It executes in a specific time you set yes.

However, you can check within that function to see if something has changed.

There are no VarOnEvent functions so you'll have to create scenarios within your Loop or your Adlib Func yourself.


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.

Share this post


Link to post
Share on other sites

It executes in a specific time you set yes.

However, you can check within that function to see if something has changed.

There are no VarOnEvent functions so you'll have to create scenarios within your Loop or your Adlib Func yourself.

ok i understand now, thanks very much

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