Hi this my first time writing scripts and i have tried to write a script that moves the mouse in x,y but i don't know how to control the speed of movement is there any way i can set the value of the movement speed? like adding a line or using some sort of command please help me, by the way if i have any problems in this script i would apprecite any help thank you.
Edit: i want to movement speed be Integrated and smooth.
this is what i wrote so far:
#SingleInstance,Force
#NoEnv
SendMode Input
CapsLock::Suspend
Insert::ExitApp
~LButton::
Loop
if GetKeyState("LButton") {
DllCall("mouse_event", int, 1, int, -5, int, 1, int, 0, int, 0)
Sleep 1
}
else
break
return
Need help with DLL(mouse_event)! Topic is solved
-
- Posts: 11
- Joined: 26 Oct 2019, 09:57
Re: Need help with DLL(mouse_event)!
Why not use the MouseMove command, which has a speed parameter?
-
- Posts: 11
- Joined: 26 Oct 2019, 09:57
Re: Need help with DLL(mouse_event)!
@boiler Please read the answer below thanks.
Last edited by amirmasoud47 on 27 Oct 2019, 10:45, edited 1 time in total.
-
- Posts: 11
- Joined: 26 Oct 2019, 09:57
Re: Need help with DLL(mouse_event)! Topic is solved
It's pretty straightforward. The command can be used to move a relative amount instead of to an absolute coordinate by using the R parameter. The line below moves the mouse pointer +10 in X (to the right), -20 in Y (upward), at a speed of 50 (kind of medium, but experiment with it), relative to its current location. Not knowing exactly what you're trying to accomplish, I suppose I would just replace your DLL call with that line. I suppose by no recoil, the mouse moves a certain amount when you click/shoot, and you want it to move back a certain amount. This allows you to control everything you need to do that by changing the 10, -20, and 100 to whatever you want.
Code: Select all
MouseMove, 10, -20, 50, R
-
- Posts: 11
- Joined: 26 Oct 2019, 09:57
Re: Need help with DLL(mouse_event)!
@boiler it works perfectly thank you. +Repboiler wrote: ↑27 Oct 2019, 10:56It's pretty straightforward. The command can be used to move a relative amount instead of to an absolute coordinate by using the R parameter. The line below moves the mouse pointer +10 in X (to the right), -20 in Y (upward), at a speed of 50 (kind of medium, but experiment with it), relative to its current location. Not knowing exactly what you're trying to accomplish, I suppose I would just replace your DLL call with that line. I suppose by no recoil, the mouse moves a certain amount when you click/shoot, and you want it to move back a certain amount. This allows you to control everything you need to do that by changing the 10, -20, and 100 to whatever you want.Code: Select all
MouseMove, 10, -20, 50, R
Who is online
Users browsing this forum: Google [Bot], kingina and 207 guests