Jump to content

Mouse events don't work inside the target application.


Recommended Posts

AdlibRegister is not really a loop.

Your reset function should not be calling the main function it was called from, that is called recursion. The called function will return to the calling function itself.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

well since main() has another function in it that calls main() again it runs endlessly

so if my reset() function calls on main() function when I use AdlibRegister("reset",60000) adlib never ends one full run .

but I managed to work around that by using a compiled outside script so instead of calling main() function now AdlibRegister sends a hotkey for the other script to start wich sends another hotkey back that starts my reset() function.

   so this way the adlibregister reaches the end and actualy starts over again but it's trublesome having 2 scripts .

do you know any way of doing the same thing without having 2 scripts ?

Link to comment
Share on other sites

nevermind that i figured out what the problem was this old version of blue stacks has massive freezes that's why it jumps steps the script does the steps but blue stacks is not responding

 

So because this version isn't that good i get alot of lag spikes and then an mesage pops up telling me "Waiting for server" that brakes my script .

my question is : can i make like a function that runs in paralel with my main script and constantly checks for that mesage to popup and pause my main script while it's waiting for server ?

 

The example I provided will do exactly that, the pixelsearch I assume is looking for the "Waiting for server" window.

The adlib function will see that and wait until it's gone so your code can continue without "Breaking".

Unless you have moved the goalposts.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Yeah I gave up my ideea with the waiting because lag spikes also come as freezes without the popup "Waiting for server" to come immediately .

So now I'm trying to use AdlibRegister to reset my script to the starting poin and start over at a certain amount of time or when the script failed to find one of the pixels im searching for more than 10 consecutive tries .

All is good in the code except I can't call the main() function inside the AdlibRegister because it will run inside AdlibRegister forever . I worked around it with a second script and hotkeys but I don't really like having 2 scripts sending hotkeys one to the other . But that's the best I could come up with.

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