I have been working on a macro to automate a game I play for when im sleeping. I need the macro to constantly be doing one thing while checking for something else to happen. For example it needs to constantly be pressing 1,2,3,4,5 but when a certain message pops up or a color in a small portion of the screen it needs to do something different. These messages and colors don't stick around more than a few seconds thats why I say it needs to constantly be looking for them. Could someone give me an example of how this would be managed?
Edit: this probably would have been better in beginners section, sorry.
Constantly looking for a graphic change.
Moderators: Dorian (MJT support), JRL
-
- Newbie
- Posts: 8
- Joined: Thu Jun 07, 2007 10:45 pm
This example should point you in the right direction.
Code: Select all
//Set this to the number of milliseconds to pause between each individual character
//used for Send Character/Text>
Let>SK_DELAY=10
//Sets focus to the specified window. The window_title
//may contain the * symbol at the end to indicate a wildcard.
SetFocus>Game Window Title*
Label>LoopThisPart
//This command makes Macro Scheduler pause for the specified number of seconds.
Wait>1
//Returns the pixel color of the specified screen coordinate.
//Enter the coordinates in X and Y, and specify a variable to store the pixel color in.
GetPixelColor>100,100,COLOR
IF>COLOR=73727,ColorChanged
//Checks to see if the specified window is open.
IfWindowOpen>Popup Message Title*,NewMessage
//This command sends the specified text to the window that currently has the focus.
Send Character/Text>12345
Goto>LoopThisPart
Label>ColorChanged
//Do something different
Goto>LoopThisPart
label>NewMessage
//Do something different
Goto>LoopThisPart
-
- Newbie
- Posts: 8
- Joined: Thu Jun 07, 2007 10:45 pm