[AHK]macro hilfe

09/23/2013 21:49 12agE#1
Hallo Leute

ich brauche eure Hilfe ich habe ein macro von einer gaming maus aber ich benötige dies als ahk (autohotkey).


[Only registered and activated users can see links. Click Here To Register...]

ich habe mir mal was zusammen gebastelt.



#SingleInstance
ActivateScript = 1




~Home::
KeyWait, Home
GetKeyState, HomeState, Home, T
If HomeState = D
{
ActivateScript = 1

}
else
{
ActivateScript = 0

}
return

E::
if ActivateScript = 1
{
Loop

{
if GetKeyState("LButton", "P")
{

sleep,0,003
MouseMove, 0, 3
sleep,0,013
MouseMove, 0, -3
sleep,0,009

}
If EButtonState = U
{

break
}
}

{

}
}


exit

return

Danke schon mal
09/23/2013 22:02 alpines#2
Wo ist jetzt das Problem?
Beim nächsten Mall nimm einen treffenderen Threadnamen sowie erläuter deine Fehler, das hier ist die AutoIt Section, nur die wenigsten werden AHK installiert haben.
09/23/2013 22:04 12agE#3
ich bekomme es nicht hin das die das die xy Achse nativ ist
09/24/2013 13:50 alpines#4
Wenn du die Position relativ der Maus haben willst, dann musst du das einfach nur gegenrechnen.

Position soll -3 von der Maus X sein:

Position von Maus X - 3 = deine Position.

Mouseposition Referenz steht hier [Only registered and activated users can see links. Click Here To Register...]

MouseMove bewegt die Maus absolut (nicht relativ) zum Bildschirm
09/24/2013 14:13 FacePalmMan#5
in AHK kenn ich mich nicht aus.
aber dafür habe ich dir das script in autoit geschrieben (die taste die das auslöst ist die home taste)
Code:
#include <misc.au3>
While 1
	If _IsPressed(24) Then
		MouseDown("Left")
		$TI=TimerInit()
		While $TI<3
		WEnd
		MouseMove(MouseGetPos(0),MouseGetPos(1)-3)
		$TI=TimerInit()
		While $TI<13
		WEnd
		MouseMove(MouseGetPos(0),MouseGetPos(1)-3)
		$TI=TimerInit()
		While $TI<9
		WEnd
		MouseUp("Left")
	EndIf
WEnd
09/24/2013 18:45 12agE#6
Code:
#include <misc.au3>
While 1
	If _IsPressed(01) Then
		MouseDown("Left")
		$TI=TimerInit()
		While $TI<3
		WEnd
		MouseMove(MouseGetPos(0),MouseGetPos(1)-3)
		$TI=TimerInit()
		While $TI<13
		WEnd
		MouseMove(MouseGetPos(0),MouseGetPos(1)-3)
		$TI=TimerInit()
		While $TI<9
		WEnd
		MouseUp("Left")
	EndIf
WEnd
es sollte bei gedrückter Taste immer wiederholt werden.

eins verstehe ich auch nicht das macro soll doch 3 nach oben und -3 nach unten und dein script weißt 2mal nach unten auf bzw in der Praxis nach oben
09/24/2013 18:57 alpines#7
Dir ist aber schon klar, das wenn du das anwendest, der das sehr oft wiederholt weil du keine korrekte Abfrage eingebaut hast?
Code:
#include <Misc.au3>

$bEpressed = False

While 1
	If $bEpressed and _isPressed(24) Then
		$bEpressed = True
		MouseDown("Left")
		$TI=TimerInit()
		While $TI<3
		WEnd
		MouseMove(MouseGetPos(0),MouseGetPos(1)-3)
		$TI=TimerInit()
		While $TI<13
		WEnd
		MouseMove(MouseGetPos(0),MouseGetPos(1)-3)
		$TI=TimerInit()
		While $TI<9
		WEnd
		MouseUp("Left")
	ElseIf $bEpressed = True and Not _isPressed(24)
		$bEpressed = False
	EndIf
WEnd
So sollte das funktionieren, es wiederholt erst wenn der LMB gedrückt wird und nicht die ganze Zeit.
09/25/2013 08:54 Lawliet#8
#closed (as requested)