Page 1 of 1

how to change turning speed in 360 deggre turn script

Posted: 16 Jun 2018, 14:59
by Cone19
i want to change turning speed in this script:
F12::
Loop 1000 {
DllCall("mouse_event", "UInt", 0x01, "UInt", 8, "UInt", 0) ; move 1 unit right
Sleep 10
}
return
but i dont know anything about ahk coding show can someone plz explain me how to do it, thanks :D .

Re: how to change turning speed in 360 deggre turn script

Posted: 16 Jun 2018, 16:34
by Qysh
Try a higher Sleep time :)

Re: how to change turning speed in 360 deggre turn script

Posted: 16 Jun 2018, 16:37
by Flipeador
I'm not sure what you want, could you explain better?.
This is a version with SendInput (Escape=Exit):

Code: Select all

~Esc:: ExitApp

F12::
Loop
{
    MoveMouse(-8, 0)
    Sleep 1
}
return

MoveMouse(x, y)
{
    ; INPUT structure
    ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx
    Local INPUT := "", Size := A_PtrSize == 8 ? 40 : 28
    VarSetCapacity(INPUT, Size, 0)

    ; MOUSEINPUT structure
    ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms646273(v=vs.85).aspx
    NumPut(x, &INPUT + A_PtrSize, "Int")
    NumPut(y, &INPUT + A_PtrSize + 4, "Int")
    NumPut(1, &INPUT + A_PtrSize + 4 + 8, "UInt")

    ; SendInput function
    ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
    Return DllCall("User32.dll\SendInput", "UInt", 1, "UPtr", &INPUT, "Int", Size, "UInt")
}
btw: the function should be DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", X, "UInt", Y, "UInt", 0, "UPtr", 0).

Re: how to change turning speed in 360 deggre turn script

Posted: 16 Jun 2018, 17:15
by Cone19
Qysh wrote:Try a higher Sleep time :)
nope its not working

Re: how to change turning speed in 360 deggre turn script

Posted: 16 Jun 2018, 17:32
by Cone19
Flipeador wrote:I'm not sure what you want, could you explain better?.
This is a version with SendInput (Escape=Exit):

Code: Select all

~Esc:: ExitApp

F12::
Loop
{
    MoveMouse(-8, 0)
    Sleep 1
}
return

MoveMouse(x, y)
{
    ; INPUT structure
    ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx
    Local INPUT := "", Size := A_PtrSize == 8 ? 40 : 28
    VarSetCapacity(INPUT, Size, 0)

    ; MOUSEINPUT structure
    ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms646273(v=vs.85).aspx
    NumPut(x, &INPUT + A_PtrSize, "Int")
    NumPut(y, &INPUT + A_PtrSize + 4, "Int")
    NumPut(1, &INPUT + A_PtrSize + 4 + 8, "UInt")

    ; SendInput function
    ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
    Return DllCall("User32.dll\SendInput", "UInt", 1, "UPtr", &INPUT, "Int", Size, "UInt")
}
btw: the function should be DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", X, "UInt", Y, "UInt", 0, "UPtr", 0).
i want a faster 360 degree turn thats it, and thanks for trying to help me!

Re: how to change turning speed in 360 deggre turn script

Posted: 17 Jun 2018, 15:15
by Qysh

Code: Select all

F12::
Loop 500 {
DllCall("mouse_event", "UInt", 0x01, "UInt", 16, "UInt", 0) ; move 1 unit right
Sleep 1
}
return