Hi Leute.
Ich wollte Maus als hotkey benutzen aber hab nirgends was dafür gefunden. Kann mir bitte jemand ein Tipp geben oder eine Lösung?
Maus als Hotkey bestimmen
-
- [ offen ]
-
igromanru -
23. November 2008 um 11:03 -
Geschlossen -
Erledigt
-
-
- Offizieller Beitrag
Wie meinst du das mit dem Hotkey? Mausklick links, Mausklick rechts ? Beschreib mal genauer wie du des haben willst .
-
Ich will als hotkey eine Maustaste bestimmen. Also z.B. ich drücke Linkemaustaste und eine Funktion wird ausgeführt.
-
Hi,
dann musst du auf _Ispressed umsteigen, aber das ist etwas CPU-lastiger.Beispiel:
Spoiler anzeigen
[autoit]#include <Misc.au3>
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
If _IsPressed("01") Then
While _IsPressed("01")
sleep(10)
WEnd
_testfunc()
EndIf
sleep(50)
WEndFunc _testfunc()
[/autoit]
ConsoleWrite("hallo" & @CRLF)
EndFunc -
So etwa?
Spoiler anzeigen
[autoit]#Include <Misc.au3>
[/autoit] [autoit][/autoit] [autoit]
AdlibEnable("Mouse")While 1
[/autoit] [autoit][/autoit] [autoit]
Sleep(10)
WEndFunc Mouse()
[/autoit] [autoit][/autoit] [autoit]
If _IsPressed(01) Then Mouse_Links()
If _IsPressed(02) Then Mouse_Rechts()
EndFunc
Func Mouse_Links()
MsgBox(0,"","links")
EndFuncFunc Mouse_Rechts()
[/autoit]
MsgBox(0,"","rechts")
EndFuncWar wohl zu langsam
-
- Offizieller Beitrag
Wenn Du den OnEvent-Mode benutzt:
GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, 'Beispiel') wird die Funktion 'Beispiel' aufgerufen, wenn Du die linke Maustaste drückst.Oder, wenn Du den MessageLoop-Mode benutzt, erstelle ein: Case $GUI_EVENT_PRIMARYDOWN
-
Danke für die tollen Antworte.
Ich glaube das passt mir am besten:Spoiler anzeigen
[autoit]#include <Misc.au3>
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
If _IsPressed("01") Then
While _IsPressed("01")
sleep(10)
WEnd
_testfunc()
EndIf
sleep(50)
WEndFunc _testfunc()
[/autoit]
ConsoleWrite("hallo" & @CRLF)
EndFunc -
Oscar hat die beste Lösung, du hast sie nur nicht genommen weil kein Beispiel dabei war, stimmts?
-
Oscar hat die beste Lösung, du hast sie nur nicht genommen weil kein Beispiel dabei war, stimmts?
Eigentlich nicht. Ich kenne mich noch nicht so gut aus. Dachte mir reicht die von anno2008. Aber ist doch nichts draus geworden, ich werde jetzt mal versuchen so wie Oscar gesagt hat.
Um genau zu sagen will ich folgedes machen:
Will ich das der script die linke Maustaste unendlich lang anklickt solange ich die linke Maustaste gedrückt halte.Ich hoffe ihr versteht was ich meine.^^
EDIT:
Ich habe folgendes geschrieben:Spoiler anzeigen
[autoit]#include <GUIConstants.au3>
[/autoit] [autoit][/autoit] [autoit]GUISetOnEvent($GUI_EVENT_PRIMARYDOWN,"_shoot")
[/autoit] [autoit][/autoit] [autoit]
GUISetOnEvent($GUI_EVENT_PRIMARYUP,"_pausa")While 1
[/autoit] [autoit][/autoit] [autoit]
Sleep(100)
WEnd
Func _shoot()
While 1
MouseClick("left")
WEnd
EndFuncFunc _pausa()
[/autoit]
While 1
Sleep(200)
WEnd
EndFunc
Aber es funktioniert nicht so wie ich es will. Kann mir bitte jemand ein Tipp geben? -
-push-
Tut mir leid das ich pushe aber keiner hat auf meinen letzen Beitrag geantwortet und er kommt ganze Zeit nach hinten, so das es auch kein beantworten wird wenn er ganz hinten bleibt. -
- Offizieller Beitrag
Was soll das denn werden?
Mfg Spider
-
- Offizieller Beitrag
Was willst du genau damit sagen . z.B. das : Wenn du die linke Maustaste drückst dann sollen ständig linke Mausklicks gesendet werden ? Hört sich irgendwie nach nem Bot an . Zumindest denk ich das wenn du ne Func _Shoot hast .
-
- Offizieller Beitrag
Nun, vielleicht hat keiner geantwortet, weil wir gemerkt haben, dass das sowieso wieder nur ein Bot (bitte Forenregeln beachten!) werden soll.
-
Dazu hab ich ma ne Frage, wenn ich Case $GUI_EVENT_PRIMARYDOWN mach und dann nen MouseClick ( "" ) sende, zählt das dann auch wieder als richter Mausklick und die Funktion führt sich neu aus?
Also
[autoit]Case $GUI_EVENT_PRIMARYDOWN
[/autoit]
MouseClick ( "" )
Wird es dann gerade wieder ausgeführt? -
das wird nicht funktionieren, wenn du die maus links gedrückt hällst ist das das gleiche wie MouseDown("left") -> autoit erkennt das drücken und führt MouseClick('left') aus, was soviel bedeutet wie MouseDown('left') und MouseUp('left') -> autoit erkennt nun die maus als nicht gedrückt und macht dadurch auch keine weiteren klicks mehr
wie das mit GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, 'Beispiel') ist habe ich noch nicht ausprobiertBeispiel
[autoit]#Include <Misc.au3>
[/autoit]
While 1
If _IsPressed("01") Then
MouseClick("left")
ToolTip("Maus wurde gedrückt")
sleep(500)
Else
ToolTip("Maus wird NICHT gedrückt")
EndIf
If _IsPressed("02") Then Exit
sleep(25)
WEnd
ausserdem sieht das auch für mich aus wie ein bot (zb fürs G3 im cod4 multiplayer) -
Am Anfang hab ich mir es so vorgestellt: Wenn ich die linke Maustaste drücke, dann fängt der script das ab und macht daraus paar Klicks. So wie bei HotKeySet, da werden die Tasten auch abgefangen.
Shoot hab ich eigentlich geschrieben weil bei While wird ganze Zeit geklickt und es ist so als wurde man schießen. Ich hätte auch clicksattack schreiben können aber das war mir zu lang. Und wenn man die Sache so sieht das shoot im Spiel schießen bedeutet was soll dann "pausa" bedeuten? Das soll ja nicht heißen ich das Wort Pause nicht schreiben kannm hab einfach so zum spaß geschrieben.
Und wie soll man es im Spiel benutzen? Da haben die Gewehre auch ohne scripts solche Funktion. -
- Offizieller Beitrag
Weißt Du, den Botvorwurf könntest Du ganz einfach dadurch entkräften, indem Du uns mitteilst, wozu Du das brauchst. Vielleicht findet sich auf diesem Weg auch eine ganz andere (bessere) Lösung für Dein Problem?!
Mit dem, was Du bisher gepostet hast, muss man davon ausgehen, dass Du eine Art Dauerfeuer für irgendein Game programmieren willst, was dann einem Bot schon verdammt nahe kommt.
Also...es liegt an Dir...