mausuHoldo: MT. ahk_h v1

This commit is contained in:
Hane 2023-06-01 02:16:51 +02:00
commit 9a800d1244

View file

@ -1,7 +1,13 @@
;;eveentos down del teclado no paraban de joder porque paraban el unico hilo, so _h it was, its threading time
;;vaya puto apañazo de mierda, flipas
;;obs lo rompe wtf??????????????? y relive caputrar la pantalla basically
;;TODO ugly af no entrar en el mutex. bro q te pasa, habia prisa pero......
#MaxThreadsPerHotkey 2 #MaxThreadsPerHotkey 2
#HotkeyInterval 10000 #HotkeyInterval 10000
#MaxHotkeysPerInterval 9999 #MaxHotkeysPerInterval 9999
#NoEnv #NoEnv
#WarnContinuableException Off
#Persistent
;;Process, Priority, , R ;;Process, Priority, , R
;;DllCall("mouse_event", "UInt", 1, "UInt", (rightMov + lefMov) , "UInt", upMov + downMov ) ;;DllCall("mouse_event", "UInt", 1, "UInt", (rightMov + lefMov) , "UInt", upMov + downMov )
@ -22,18 +28,19 @@ baseTime := baseTime ;;/ 1.0
mouseActive := 0 mouseActive := 0
rightMov := 0
lefMov := 0
upMov := 0
downMov := 0
rBtnHold := 0 rBtnHold := 0
mBtnHold := 0 mBtnHold := 0
lBtnHold := 0 lBtnHold := 0
speedUp := 1 speedUp := 1
speedUpFactor := 20 speedUpFactor := 20
mouseSpeed := speedUp * speedUpFactor + 3
test1 := 0
test2 := 0
test3 := 0
test4 := 0
share:=CriticalObject({"lefMov" : 0,"rightMov" : 0,"downMov" : 0,"upMov" : 0,"mouseSpeed" : speedUp * speedUpFactor + 3})
;;Toggle speed ;;Toggle speed
RCtrl & ,:: RCtrl & ,::
@ -50,22 +57,57 @@ RCtrl & .::
;;inputCleaning() ;;inputCleaning()
return return
mouseMovement(lefMov, rightMov, upMov, downMov, mouseSpeed) ;;TODO DAVBID Y EL ENTER
{
MouseMove, (rightMov + lefMov) * (mouseSpeed), (upMov + downMov) * (mouseSpeed), 0, R
}
LAlt & RAlt:: LAlt & RAlt::
RAlt & LAlt:: RAlt & LAlt::
;;<^>!LAlt:: ;;<^>!LAlt::
;;LAlt & RAlt:: ;;LAlt & RAlt::
mouseActive := !(mouseActive) mouseActive := !(mouseActive)
#if mouseActive if (mouseActive == 1)
Loop
{
if (mouseActive == 0)
{ {
mouseThread := AhkThread("
(
#Persistent
Process, Priority, , H
DllCall(""SetThreadDpiAwarenessContext"", ""ptr"", -3, ""ptr"")
freqUpdater := DllCall(""GetProcAddress"", ""Ptr"" , DllCall(""GetModuleHandle"", ""Str"", ""kernel32"", ""Ptr""), ""AStr"", ""QueryPerformanceCounter"", ""Ptr"")
;;VarSetCapacity(baseTime, 2334423432128)
;;VarSetCapacity(currentTime, 423523423128)
DllCall(freqUpdater, ""Int64*"" , baseTime)
DllCall(freqUpdater, ""Int64*"" , currentTime)
DllCall(""QueryPerformanceFrequency"", ""Int64*"", updateRate)
updateRate := Floor(updateRate / 1000)
currentTime := currentTime ;;/ 1.0
baseTime := baseTime ;;/ 1.0
obj := CriticalObject(A_Args[1])
lefMov := obj.lefMov
rightMov := obj.rightMov
downMov := obj.downMov
upMov := obj.upMov
mouseSpeed := obj.mouseSpeed
Loop
{
DllCall(freqUpdater, ""Int64*"" , currentTime)
if (currentTime - baseTime >= updateRate) {
MouseMove, (obj.rightMov + obj.lefMov) * (obj.mouseSpeed), (obj.upMov + obj.downMov) * (obj.mouseSpeed), 0, R
;;DllCall(freqUpdater, ""Int64*"" , baseTime)
baseTime := currentTime
}
}
)", &share "")
}
else
{
mouseThread.ahkTerminate()
;;ahkthread_free(mouseThread)
lefMov := 0 lefMov := 0
rightMov := 0 rightMov := 0
upMov := 0 upMov := 0
@ -73,85 +115,57 @@ Loop
lBtnHold := 0 lBtnHold := 0
mBtnHold := 0 mBtnHold := 0
rBtnHold := 0 rBtnHold := 0
break ;;break
} }
DllCall(freqUpdater, "Int64*", currentTime) return
if (currentTime - baseTime >= updateRate)
{
mouseMovement(lefMov, rightMov, upMov, downMov, mouseSpeed)
baseTime := currentTime
}
}
return
#if
return
#if mouseActive == 1
$j:: $j::
if (mouseActive == 1) if (test1 == 0)
{ {
lefMov := -1 test1 := 1
} share.lefMov := -1
else
{
SendInput, j
} }
return return
j Up:: j Up::
if (mouseActive == 1) share.lefMov := 0
{ test1 := 0
lefMov := 0
}
return return
$sc027:: $sc027::
if (mouseActive == 1) if (test2 == 0)
{ {
rightMov := 1 test2 := 1
} share.rightMov := 1
else
{
SendInput, {sc027}
} }
return return
sc027 Up:: sc027 Up::
if (mouseActive == 1) share.rightMov := 0
{ test2 := 0
rightMov := 0
}
return return
$l:: $l::
if (mouseActive == 1) if (test3 == 0)
{ {
upMov := -1 test3 := 1
} share.upMov := -1
else
{
SendInput, l
} }
return return
l Up:: l Up::
if (mouseActive == 1) share.upMov := 0
{ test3 := 0
upMov := 0
}
return return
$k:: $k::
if (mouseActive == 1) if (test4 == 0)
{ {
downMov := 1 test4 := 1
} share.downMov := 1
else }
{
SendInput, k
}
return return
k Up:: k Up::
if (mouseActive == 1) share.downMov := 0
{ test4 := 0
downMov := 0
}
return return
$u:: $u::
@ -283,6 +297,5 @@ $.::
return return
;;#if #if
return
return