Constantly looking for a graphic change.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
thepenguin99
Newbie
Posts: 8
Joined: Thu Jun 07, 2007 10:45 pm

Constantly looking for a graphic change.

Post by thepenguin99 » Thu Jun 07, 2007 10:53 pm

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.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Fri Jun 08, 2007 1:23 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

thepenguin99
Newbie
Posts: 8
Joined: Thu Jun 07, 2007 10:45 pm

Post by thepenguin99 » Sat Jun 09, 2007 11:24 pm

Thank You. That helped me out a bit I think.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts