Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if RealGetKeyState not reacting to input
#1
I try to create a Macro that moves the mouse to the last clicked position if left Alt + y + NUMBER is pressed.
The Number (from 2 to 7) determines how many times the for is looped. But i dont even get it there.
The Macro simply doesnt recognize the keys as it seems.

Can someone please tell me whats wrong and how to fix it?
That would be great!

Ps.: The next thing i dont know, is how to tab through the amout of windows in the for loop and go to the first window where the VK_LBUTTON is pressed.

For instance:
If i set the number to 3 i got 4 windows. The first one is the one where i do the Alt+y+click, then it should tab through the windows and click on the same spot. After that it should open the first window again. The windows have almost the same name but a little different like: "CHANGINGNAME - Program32"

If one can help me with this, i would be super happy!

Macro Click Mover
 
Code:
Copy      Help
_s.getmacro("" 1)
OnScreenDisplay _s 1
int f
spe 20
opt slowmouse 1
;start
if RealGetKeyState(VK_LMENU) and RealGetKeyState(0x56) and RealGetKeyState(0x32)
,f = 2
,OnScreenDisplay "Zwei Clicks" 1
,out "Zwei Clicks"
if RealGetKeyState(VK_LMENU) and RealGetKeyState(0x56) and RealGetKeyState(0x33)
,f = 3
,OnScreenDisplay "Drei Clicks" 1
,out "Drei Clicks"
if RealGetKeyState(VK_LMENU) and RealGetKeyState(0x56) and RealGetKeyState(0x34)
,f = 4
,OnScreenDisplay "Vier Clicks" 1
,out "Vier Clicks"
if RealGetKeyState(VK_LMENU) and RealGetKeyState(0x56) and RealGetKeyState(0x35)
,f = 5
,OnScreenDisplay "Fünf Clicks" 1
,out "Fünf Clicks"
if RealGetKeyState(VK_LMENU) and RealGetKeyState(0x56) and RealGetKeyState(0x36)
,f = 6
,OnScreenDisplay "Sechs Clicks" 1
,out "Sechs Clicks"
if RealGetKeyState(VK_LMENU) and RealGetKeyState(0x56) and RealGetKeyState(0x37)
,f = 7
,OnScreenDisplay "Sieben Clicks" 1
,out "Sieben Clicks"
if RealGetKeyState(VK_LMENU) and RealGetKeyState(0x56) and RealGetKeyState(VK_LBUTTON)
;Alt + Linksklick
,int mX(xm)
,int mY(ym)
,int i
,for i 0 f
,,ifk(F12) break
,,key AT
,,wait RandomInt(0.1 0.3)
,,mou mX mY
,,lef
else
,goto start
#2
Macro Macro3260
Code:
Copy      Help
if RealGetKeyState(VK_LMENU) and RealGetKeyState('Y') and RealGetKeyState('2')
,out "all pressed"
#3
Code:
Copy      Help
[code]if RealGetKeyState(VK_LMENU) and RealGetKeyState('Y') and RealGetKeyState(VK_LBUTTON)
;Alt + Linksklick
,int mX(xm)
,int mY(ym)
,int i
,i = 1
,for i 1 f
,,ifk(F12) break
,,int w1=win("*.txt - Editor" "Notepad" 1)
,,act w1
,,wait RandomInt(0.3 0.6)
,,mou mX mY
,,lef
,,out i
,,if i = f
,,,goto start
[/code]

Thank you Gintiaras! Pressing the Buttons works now.

Can you please tell me how to switch to the next window with a Wildcard in the name?
For instance if i got a few notepad windows and i want to open the next one each time the for loop is looping.

I was already searching in the forums but i cant get the wildcard or tabbing to the next window to work.
Also my for loop doesnt seem to stop. After the loop it looks like its hanging in the loop and not reacting to buttons anymore.

Also the Wildcard doesnt work. QM says:
Error (RT) in Click Mover:  window not found (the handle is 0).


Forum Jump:


Users browsing this thread: 1 Guest(s)