Hello,
Im having problems with mouse movement inside a game. Im using Active Window Info to try and get the mouse position but inside the game the mouse position stays the same. I was wondering if there was any other way to accurately move to a certain position inside the game?
MouseGetPos
Re: MouseGetPos
Are you using MouseGetPos to try to actually move the mouse pointer?
Re: MouseGetPos
Are you trying to detect mouse pointer position while playing a mouse-aim FPS game?
If so, you are probably doing it wrong - most mouse-aim FPS games utterly ignore the mouse cursor. If they did use the position of the mouse cursor, then you could only turn until the pointer hit the edge of the screen.
What are you trying to do?
If so, you are probably doing it wrong - most mouse-aim FPS games utterly ignore the mouse cursor. If they did use the position of the mouse cursor, then you could only turn until the pointer hit the edge of the screen.
What are you trying to do?
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
Recoil() ;Recoil
{
Global Auto
IF Auto
{
Loop
{
IF GetKeyState("LButton", "P")
{
MouseXY(1374,561)
sleep 30
}
else
break
}
}
}
return
i'm trying to get these but when i use window spy and get posx and posy it does not work. Am i missing something?
{
Global Auto
IF Auto
{
Loop
{
IF GetKeyState("LButton", "P")
{
MouseXY(1374,561)
sleep 30
}
else
break
}
}
}
return
i'm trying to get these but when i use window spy and get posx and posy it does not work. Am i missing something?
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
@evilC,i'm trying to get this to work?
Lbutton::
PixelSearch, Px, Py, 0, 225, 198, 53, 0xe1c699, 3, Fast
Mousemove, %px%,%py%
Send Lbutton
Sleep 200
Mousemove, %px%,%py%
Return
and this is base i had to start with,im still learning.
Lbutton::
PixelSearch, Px, Py,0,600, 800,0, 0x9d6346, 3, Fast
Mousemove, %px%,%py%
Send Lbutton
Sleep 200
Mousemove, %px%,%py%
Return
Lbutton::
PixelSearch, Px, Py, 0, 225, 198, 53, 0xe1c699, 3, Fast
Mousemove, %px%,%py%
Send Lbutton
Sleep 200
Mousemove, %px%,%py%
Return
and this is base i had to start with,im still learning.
Lbutton::
PixelSearch, Px, Py,0,600, 800,0, 0x9d6346, 3, Fast
Mousemove, %px%,%py%
Send Lbutton
Sleep 200
Mousemove, %px%,%py%
Return
Re: MouseGetPos
One problem is that your search area coordinates are not set up right. The first pair is to be the upper left corner, and the second pair is lower right. Perhaps you mean 0, 53, 198, 225. Your "base" example is also wrong. It would need to be 0, 0, 800, 600.
Note that your color is in BGR format. If you want it to be RGB, you have to add a space and RGB after Fast.
You don't need % signs in the MouseMove command parameters. It already evaluates them as expressions.
Note that your color is in BGR format. If you want it to be RGB, you have to add a space and RGB after Fast.
You don't need % signs in the MouseMove command parameters. It already evaluates them as expressions.
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
Lbutton::
PixelSearch, Px, Py, 0, 0,1080, 1920, 0xe1c699 , 3, Fast, RGB
Mousemove, px, py
Send Lbutton
Sleep 200
Mousemove, px, py
Return
f12::
Pause
Suspend
Return
@boiler,so would this be correct then? and how do i add CapsLock to toggle on/off.
PixelSearch, Px, Py, 0, 0,1080, 1920, 0xe1c699 , 3, Fast, RGB
Mousemove, px, py
Send Lbutton
Sleep 200
Mousemove, px, py
Return
f12::
Pause
Suspend
Return
@boiler,so would this be correct then? and how do i add CapsLock to toggle on/off.
Re: MouseGetPos
Well, I'm thinking that your monitor is 1920x1080, not 1080x1920, so it seems you have those backwards, although I suppose it's possible you're using it in portrait mode. If not, then you should switch those.
You cannot have a space between Fast and RGB. They are the same parameter, not separate ones. Per the documentation, if you want both, you separate them with a space.
If you mean that you want CapsLock to Pause and Suspend your script just like you have F12 doing, just add Capslock:: on the line before F12::.
You cannot have a space between Fast and RGB. They are the same parameter, not separate ones. Per the documentation, if you want both, you separate them with a space.
If you mean that you want CapsLock to Pause and Suspend your script just like you have F12 doing, just add Capslock:: on the line before F12::.
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
Lbutton::
PixelSearch, Px, Py, 0, 0,1920, 1080, 0xe1c699 , 3, Fast RGB
Mousemove, px, py
Send Lbutton
Sleep 200
Mousemove, px, py
Return
Capslock::
f12::
Pause
Suspend
Return
Like this? its strange when i activate it i cant controll my mouse it wont let me click on game?
PixelSearch, Px, Py, 0, 0,1920, 1080, 0xe1c699 , 3, Fast RGB
Mousemove, px, py
Send Lbutton
Sleep 200
Mousemove, px, py
Return
Capslock::
f12::
Pause
Suspend
Return
Like this? its strange when i activate it i cant controll my mouse it wont let me click on game?
Last edited by blueeyiz702 on 26 Dec 2017, 10:55, edited 1 time in total.
Re: MouseGetPos
Yes. Did you try it?
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
when i use it i cant click with Lbutton. pointer goes all overboiler wrote:Yes. Did you try it?
i need way to turn it on and off
Re: MouseGetPos
That’s what F12 and CapsLock are supposed to do. Did you try that?
Actually, you need to put Suspend before Pause so the hotkey is exempt from being suspended.
Actually, you need to put Suspend before Pause so the hotkey is exempt from being suspended.
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
i tried and its not working rite and im trying to make it shoot once it hits that color.
Re: MouseGetPos
Did you put Suspend before Pause?
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
Hmmm,no. let me try that and see what happens.boiler wrote:Did you put Suspend before Pause?
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
i tried and can't really notice if it does or does not. Maybe i need to find the exact color?boiler wrote:Did you put Suspend before Pause?
Its supposed to be light Beige,
I'm going to try window-spy and and take screen shot in game to see if they match up.
Re: MouseGetPos
Yes, the color needs to match within the variation you defined, which is 3. But that has nothing to do with whether Suspend and Pause work or not. Also, I don't think you want to Pause because you just need to suspend the hotkey so you can click normally, so I think you should just remove the Pause.
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
boiler wrote:Yes, the color needs to match within the variation you defined, which is 3. But that has nothing to do with whether Suspend and Pause work or not. Also, I don't think you want to Pause because you just need to suspend the hotkey so you can click normally, so I think you should just remove the Pause.
ill do that and the color is light beige,and let me ask the color code should be RGB Correct?
and whats weird when i use Caplock to pause key. it won't work. everytime i click mouse it makes key unpause then pause
Re: MouseGetPos
It should be RGB if that's the format you used to identify the color 0xe1c699.blueeyiz702 wrote:and the color is light beige,and let me ask the color code should be RGB Correct?
Like I said, don't use Pause. Suspend is what you want in this case.blueeyiz702 wrote:and whats weird when i use Caplock to pause key. it won't work. everytime i click mouse it makes key unpause then pause
- blueeyiz702
- Posts: 20
- Joined: 12 Dec 2017, 20:12
- Location: Las Vegas, Nevada
- Contact:
Re: MouseGetPos
it keeps doing same thing,and when i aim it point at ground or up to sky in game. ugh
Who is online
Users browsing this forum: mikeyww and 29 guests