Help me improve the script.

Ask gaming related questions
Novelty1
Posts: 10
Joined: 25 Feb 2018, 03:10

Help me improve the script.

25 Feb 2018, 04:47

So i got a script, basically makes my cursor stays in 1 place. But after scripting the mouse did what i want but not perfect. The cursor moves from the center to the lower left side around the center. Anyone to help me fix the cursor to stays in the center but still does it's job. Below is the script i used.


#NoEnv
SendMode Input
~CapsLock::Suspend
Insert::ExitApp


~*$LButton::
Loop
{

GetKeyState, state, Lbutton, P
if state=u
break

mouseXY(-2,5)
sleep 1
mouseXY(2,-5)
sleep 1
}
return

mouseXY(x,y)
{
DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Help me improve the script.

25 Feb 2018, 05:35

Try this. Should work exactly as you wanted it to. Click once to start centering and click again to stop. Capslock for suspend and insert for exit.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

I am your average ahk newbie. Just.. a tat more cute. ;)
Novelty1
Posts: 10
Joined: 25 Feb 2018, 03:10

Re: Help me improve the script.

25 Feb 2018, 07:08

Nwb wrote:Try this. Should work exactly as you wanted it to. Click once to start centering and click again to stop. Capslock for suspend and insert for exit.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Thank you for the reply, it does what i want, but i wanted is when i hold left click, the cursor stays in that position/center. I'm able to move freely while while keeping my cursor centered. As an example, if im in a game i want to move my camera freely while holding that cursor in place.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Help me improve the script.

25 Feb 2018, 07:28

Novelty1 wrote:
Nwb wrote:Try this. Should work exactly as you wanted it to. Click once to start centering and click again to stop. Capslock for suspend and insert for exit.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Thank you for the reply, it does what i want, but i wanted is when i hold left click, the cursor stays in that position/center. I'm able to move freely while while keeping my cursor centered. As an example, if im in a game i want to move my camera freely while holding that cursor in place.


Oh okay so you want the cursor to move to the center, once, when you click lbutton?

Does this work?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

I am your average ahk newbie. Just.. a tat more cute. ;)
Novelty1
Posts: 10
Joined: 25 Feb 2018, 03:10

Re: Help me improve the script.

26 Feb 2018, 06:20

Nwb wrote:
Novelty1 wrote:
Nwb wrote:Try this. Should work exactly as you wanted it to. Click once to start centering and click again to stop. Capslock for suspend and insert for exit.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Thank you for the reply, it does what i want, but i wanted is when i hold left click, the cursor stays in that position/center. I'm able to move freely while while keeping my cursor centered. As an example, if im in a game i want to move my camera freely while holding that cursor in place.


Oh okay so you want the cursor to move to the center, once, when you click lbutton?

Does this work?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


We're getting close, you helped me alot, but there is only one more thing i need. If you run the script i used originally, they cursor kinda shakes around from center to the other point, going back and again and again. All i need is to make that cursor shaking yet shakes to the center while holding Left Click Mouse. my point is to make the crusor shakes like the original script i used but just shakes in 1 point.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Help me improve the script.

26 Feb 2018, 06:30

Like this??

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

I am your average ahk newbie. Just.. a tat more cute. ;)

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 3 guests