Sign in to follow this  
Followers 0
Winged-Weasel

Problem with windows within windows

6 posts in this topic

Hello,

Awkward question to phrase, and I am sure there is a simpler way to explain it than I am going to but here goes:

I am sure those who read this will be at least somewhat familiar with either magic the gathering online (the trade prompt), any kind of internet movie/clip that has a loading screen and then a play button or something similar to these which after some time prompts you to click on something to trigger it to go on with what it's doing.

My question is, how do you detect that? I want to write a script that will loop continuously, which will wait for the application to present this "window" and then click on it so the program will go on with what it's doing. THe issue is that the amount of time that is in between when the loop starts and how long until prompted is not exact so I can't just set the loop on a timer.

I am having trouble getting my head around the idea mainly because the background application will be continuously running, however I can't think of a way to have the script recognize that it is being asked to do something.

Thanks in advance for any help, if people can't really understand what I am trying to get across I will attempt to get some screenshots of examples so it can be more easily understood.

Share this post


Link to post
Share on other sites



Hello,

Awkward question to phrase, and I am sure there is a simpler way to explain it than I am going to but here goes:

I am sure those who read this will be at least somewhat familiar with either magic the gathering online (the trade prompt), any kind of internet movie/clip that has a loading screen and then a play button or something similar to these which after some time prompts you to click on something to trigger it to go on with what it's doing.

My question is, how do you detect that? I want to write a script that will loop continuously, which will wait for the application to present this "window" and then click on it so the program will go on with what it's doing. THe issue is that the amount of time that is in between when the loop starts and how long until prompted is not exact so I can't just set the loop on a timer.

I am having trouble getting my head around the idea mainly because the background application will be continuously running, however I can't think of a way to have the script recognize that it is being asked to do something.

Thanks in advance for any help, if people can't really understand what I am trying to get across I will attempt to get some screenshots of examples so it can be more easily understood.

I'm not much of a gamer myself, but others on this forum seem to use PixelChecksum() for that. Get the checksum of the part of the screen you want to watch for, then the loop continually gets checksums of that same area until it matches. At least, I think that's what they're doing... :D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the help! Would've replied sooner but work is bogging me down. I am going to look into using pixelchecksum to solve the problem. Does anyone else have any methods on achieving this end, or is that the most efficient method? I have attached a screenshot to better explain what I mean.

In the screenshot, all the windows are contained within the one program. When someone initiates a trade you are presented with a "pop-up" (for lack of a better term) that asks if you would like to trade with a check or an X for yes or no respectively.

My dilemma is, how can I get my script to recognize that this messege was presented (currently it is set to loop merely sending a specified messege to a given chat box), taking it out of said loop to a new set of instructions? I would like to have it then resume performing the original actions, but I think once I can figure this part out I will be able to manage that.

Secondly, this question came up while testing part of anoter script and rather than make a new post I'll put it here:

Using the same screenshot to make things simple: Say that I have the specified messege being sent repeatedly. However, I would like to...you know actually use my computer in the mean time. Is it possible to continue sending the desired messege to a specific window (within the larger one) while the parent window is minimized? Or even for that matter while the child "window" is minimized? So far I have been unable to find anything sifting through the commands that gives me the idea that it would fit this purpose.

Again, thanks to PsaltyDS for his/her help, and thanks in advance for any future help from anyone that does!

Edit: Hrm...seems I can't upload the screenshot...I am assuming because my post count and time on the boards is so low?

Edited by Winged-Weasel

Share this post


Link to post
Share on other sites

So I understand your post is you want to react on an event out of a loop.

Maybe 'AdlibEnable()' can do what you want.

AdlibEnable ( "function" [, time] )

Sorry because of my bad english, I can't do it better. :D

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I'm not much of a gamer myself, but others on this forum seem to use PixelChecksum() for that. Get the checksum of the part of the screen you want to watch for, then the loop continually gets checksums of that same area until it matches. At least, I think that's what they're doing... :D

'

I've used this for a terminal session. Thats also a window in another window. I must say that it works fine. I have a check for 2 pixels, just to be shure.

While (255 <> PixelGetColor(425, 920)) Or (3829413 <> PixelGetColor(425, 890))      
  sleep(500)
WEnd
Edited by Lempke

Share this post


Link to post
Share on other sites

Thanks for the help everyone, I am going to try and get some work done on this today or tomorrow and I'm sure I'll be back with more questions :D

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