Hello,
I am trying to figure out a way I can make this program work, if possible. What I would like to do is have a dialog box with an option to type in a song that is located in the users iTunes library, and after typing the song in they hit "Search" and it will open iTunes, type the song in, and play it. Is this possible? If so how would I go about doing this?
Thanks!
Open iTunes / request song
Moderators: JRL, Dorian (MJT support)
- aboredprogrammer
- Junior Coder
- Posts: 40
- Joined: Wed Jan 27, 2010 6:31 am
Hi aboredprogrammer,
It is not necessary to move the game to the 0,0 location. As long as the game is fully displayed it can be anywhere on the screen.
The window commands GetActiveWindow, GetWindowPos, and GetWindowSize will tell you the location of the window without moving the cursor. Also, a "window" can also be a control such as a button.
The FindImagePos command will tell you the location(s) of images representing buttons and other controls, also without moving the cursor.
Of course, to actually play the game you must activate the game window and move cursor (whether visible or not) and click the mouse.
How do you prevent boredom while the script plays the game for you?
Gale
It is not necessary to move the game to the 0,0 location. As long as the game is fully displayed it can be anywhere on the screen.
The window commands GetActiveWindow, GetWindowPos, and GetWindowSize will tell you the location of the window without moving the cursor. Also, a "window" can also be a control such as a button.
The FindImagePos command will tell you the location(s) of images representing buttons and other controls, also without moving the cursor.
Of course, to actually play the game you must activate the game window and move cursor (whether visible or not) and click the mouse.
How do you prevent boredom while the script plays the game for you?
Gale
- aboredprogrammer
- Junior Coder
- Posts: 40
- Joined: Wed Jan 27, 2010 6:31 am
Hello,
I believe you posted on the wrong thread of mine, but that's perfectly fine. I was looking for this answer as well! This is what I exactly want to do. I am writing a program that will automatically play an online game for you. Instead of moving the screen to 0,0. I haven't used Macro Sched since 2004, so I'm kinda back at the beginning with everything. So how exactly would I be able to find the game screen/button? I'm sorry for any inconveniences.
aboredprogrammer
I believe you posted on the wrong thread of mine, but that's perfectly fine. I was looking for this answer as well! This is what I exactly want to do. I am writing a program that will automatically play an online game for you. Instead of moving the screen to 0,0. I haven't used Macro Sched since 2004, so I'm kinda back at the beginning with everything. So how exactly would I be able to find the game screen/button? I'm sorry for any inconveniences.
aboredprogrammer
My favoritye method that almost always works is Image Recognition, introduced in version 9, so you may need to upgrade.
This might get you started:
http://www.mjtnet.com/blog/2007/02/20/h ... cognition/
The GetWindowPos and GetWindowSize methods depend on the the availablility of the Windows properties for the control in question. Once you get the coordinates you use the same methods as outlined in the image recognition article.
If the game is web based and windows properties are not available, you may need to use the web recorder.
JRL wrote a lot of articles on your question concerning dialogs. Try searching the forums for the word "dialog".
Gale
This might get you started:
http://www.mjtnet.com/blog/2007/02/20/h ... cognition/
The GetWindowPos and GetWindowSize methods depend on the the availablility of the Windows properties for the control in question. Once you get the coordinates you use the same methods as outlined in the image recognition article.
If the game is web based and windows properties are not available, you may need to use the web recorder.
JRL wrote a lot of articles on your question concerning dialogs. Try searching the forums for the word "dialog".
Gale
- aboredprogrammer
- Junior Coder
- Posts: 40
- Joined: Wed Jan 27, 2010 6:31 am
Thanks a lot Gale! I watched some of the video tutorials and they helped a lot. One more question though.. I plan on distributing my finished products to customers. In order for the image recognition to be successful, wouldn't my customers have to have (ex.) image.bmp on their computers? Therefore, if they don't it will only work on mine, correct? What would be a way to have this work on their computers?
aboredprogrammer
aboredprogrammer