Problem with in game macro
Moderators: JRL, Dorian (MJT support)
Problem with in game macro
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?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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.
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!
Bob
A humble man and PROUD of it!
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%
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%