First of all, I need AutoIT to check for this IF event ALL THE TIME while the script is running. How would I do that?

Second of all, after WinClose, I need it to go to the beginning of my loop and start over. I read that "GoTo" function has been taken out in v3.

Thank you for listening.

P.S. I got another problem I forgot to mention. I don't have any idea why, but the script sometimes at the end or beginning of it, drags my scrollable window (where the scrip is/should be working in) all the way down. I tried to insert some "Send(" {HOME} "), but all it did was scroll the window all the way up where I wanted it for a milisecond and drags it all the way down again (in an instant), though sometimes it would stay at the top. "MouseWheel( "Up" , 20)" seems to work, but it's a laggy and shitty solution.

Share this post

Link to post

Share on other sites

Bert 1,235

Bert 1,235

In short, what my script does is drag some items in a webpage from one place to another. Do not ask where I use it or why, but it's a monotonous job and tiring when done manually.

Sorry, but I have to ask. The reason is you said the window is a web page. There may be a much easier way to do what you have in mind but knowing the page would help. If for example you are working with excel that is embedded in a web page, then there are commands to make your job simple.

Edited July 30, 2013 by Melba23Amended quoted username to match current username following user's request

b. and/or don't use sleep but let your loop run continuously and use TimerInit() and TimerDiff() to check how much msec has passed

@2: not exactly clear what you mean, but the Continue command skips to the next loop iteration immediately. Ofcourse if you use Sleep(), the script just halts, so all the more reason to use both options above to avoid using Sleep(). You could try having your loop look for some global variabele set to True (by the window checking adlib function) and if it is true, set it to false again and execute Continue and the whole thing starts over...

Roses are FF0000, violets are 0000FF... All my base are belong to you.

b. and/or don't use sleep but let your loop run continuously and use TimerInit() and TimerDiff() to check how much msec has passed

@2: not exactly clear what you mean, but the Continue command skips to the next loop iteration immediately. Ofcourse if you use Sleep(), the script just halts, so all the more reason to use both options above to avoid using Sleep(). You could try having your loop look for some global variabele set to True (by the window checking adlib function) and if it is true, set it to false again and execute Continue and the whole thing starts over...

By "All the time" I meant during all those drag&drop operations (everything inside the loop). Currently my script only checks for the Alert popup box only at the end of these operations (end of all those MouseClickDrag(), but before loop ends), but I need him to check after EVERY operation the script have done. The Sleep() statements only are there so the script would wait before certain images and elements in the page are loaded. They are not there to close any windows.

I've tried using AdlibRegister to check for those Alert boxes, but it doesn't seem to work at all.

Please see if I did something wrong, or maybe you have another idea how to achieve what I need?

Share this post

Link to post

Share on other sites

TropicThunder 0

TropicThunder 0

So, I figured out how to properly use AdlibRegister function and now it's always checking for Alert boxes and automatically closes them. The only problem that remains is, after he closes those Alert boxes, he continues the script. I need him to Restart at the beginning of the LOOP part of my script after the Alert box has been closed.