Problem with in game macro

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Guest

Problem with in game macro

Post by Guest » Fri Dec 24, 2004 11:50 am

I want a macro that presses the key up and then the key down .. after 5 seconds up then after 5 seconds down.. Its for a game called Faldon.. The window name changes every second so I dont know what to do?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Dec 24, 2004 3:59 pm

Untested structure, fix syntax

Label>Start
GetActiveWindow>window_title,X,Y[,Width,Height]
SetFocus>%window_title%
Press Up
Wait>5
GetActiveWindow>window_title,X,Y[,Width,Height]
SetFocus>%window_title%
Press Down
Wait>5
Goto>Start
===============
Possible that if you maximize full screen window, then you may not need to get name, because focus will still be in window even if name changed.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Fri Dec 24, 2004 7:09 pm

If the first part of the window name is the same, you can use that, followed by an asterisk.

You could also do something that told the macro which window it was and obtain the windowhandle, instead of the title, and try to use that.
MessageModal>After you click OK, set focus to a window. I will obtain it's handle in 5 seconds.
Wait>5
Let>WF_TYPE=2
Let>WIN_USEHANDLE=1
GetActiveWindow>sWinHandle,iWinLeft,iWinTop,iWinWidth,iWinHeight
' then in your loop, use...
SetFocus>%sWinHandle%

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