[Guide] Wie benutze ich das HotKeySet!

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • [Guide] Wie benutze ich das HotKeySet!

      Tag GodLikerz & Coderz

      Ich zeige euch jetzt mal wie das HotKeySet funktioniert.:wink:

      Nehmen wir mal zum Beispiel einen leeren Gui Script:

      Quellcode

      1. #include <GUIConstants.au3>
      2. #Region ### START Koda GUI section ### Form=
      3. $Form1 = GUICreate("Form1", 624, 444, 193, 125)
      4. GUISetState(@SW_SHOW)
      5. #EndRegion ### END Koda GUI section ###
      6. While 1
      7. $nMsg = GUIGetMsg()
      8. Switch $nMsg
      9. Case $GUI_EVENT_CLOSE
      10. Exit
      11. EndSwitch
      12. WEnd
      Alles anzeigen


      Langweiliges Script oder? xD
      Dient ja nur als Beispiel

      So nun bauen wir mal als HotKeySet ein, das wenn man ESCAPE drückt sich das programm beendet.

      Quellcode

      1. #include <GUIConstants.au3>
      2. HotKeySet("{Esc}", "_Exit") ;Hier der HotKey...
      3. #Region ### START Koda GUI section ### Form=
      4. $Form1 = GUICreate("Form1", 624, 444, 193, 125)
      5. GUISetState(@SW_SHOW)
      6. #EndRegion ### END Koda GUI section ###
      7. Func _Exit ;Anfang der Funktion.
      8. Exit ;Beendet das Programm.
      9. Endfunc ;Ende der Funktion.
      10. While 1
      11. $nMsg = GUIGetMsg()
      12. Switch $nMsg
      13. Case $GUI_EVENT_CLOSE
      14. Exit
      15. EndSwitch
      16. WEnd
      Alles anzeigen


      Hmm wie wärs bauen wir noch eine MsgBox Funktion ein? Na Klar doch!

      Quellcode

      1. #include <GUIConstants.au3>
      2. HotKeySet("{Esc}", "_Exit") ;Hier der HotKey... Wenn man Escape drückt.
      3. HotKeySet("{F1}", "_F1") ;Hier der HotKey... Wenn man F1 drückt.
      4. #Region ### START Koda GUI section ### Form=
      5. $Form1 = GUICreate("Form1", 624, 444, 193, 125)
      6. GUISetState(@SW_SHOW)
      7. #EndRegion ### END Koda GUI section ###
      8. Func _Exit ;Anfang der Funktion.
      9. Exit ;Beendet das Programm.
      10. Endfunc ;Ende der Funktion.
      11. Func _F1 ;Anfang der Funktion.
      12. MsgBox(0, "Info", "Du hast es geschafft eine MsgBox zu öffnen!, Herzlichen Glückwunsch.") ;Beendet das Programm.
      13. Endfunc ;Ende der Funktion.
      14. While 1
      15. $nMsg = GUIGetMsg()
      16. Switch $nMsg
      17. Case $GUI_EVENT_CLOSE
      18. Exit
      19. EndSwitch
      20. WEnd
      Alles anzeigen


      So viel Spass damit, Hofe ich kann helfen

      MFG xDrago
    • Werbung zur Unterstützung des Forums ( Bitte AddBlocker deaktivieren )

    • Bei mir klappt das nicht es kommt immer ein Error

      /edit :
      mein code ist folgender
      code


      C-Quellcode

      1. #include <ButtonConstants.au3>
      2. #include <GUIConstantsEx.au3>
      3. #include <StaticConstants.au3>
      4. #include <WindowsConstants.au3>
      5. HotKeySet("{Esc}", "_Exit")
      6. HotKeySet("{F1}", "_F1")
      7. #Region ### START Koda GUI section ### Form=
      8. $Form1 = GUICreate("Upgrader", 258, 242, 450, 285)
      9. $Group1 = GUICtrlCreateGroup("Upgrader by Fuyo ", 16, 16, 217, 209)
      10. $Button1 = GUICtrlCreateButton("Fly For Fame", 32, 48, 107, 41, 0)
      11. $Button2 = GUICtrlCreateButton("Anderer Server", 32, 112, 107, 41, 0)
      12. $Made = GUICtrlCreateLabel("Made", 168, 64, 31, 17)
      13. GUICtrlSetState(-1, $GUI_DISABLE)
      14. $for = GUICtrlCreateLabel("for", 168, 80, 16, 17)
      15. $Godlikerz = GUICtrlCreateLabel("Godlikerz", 168, 96, 48, 17)
      16. GUICtrlCreateGroup("", -99, -99, 1, 1)
      17. GUISetState(@SW_SHOW)
      18. #EndRegion ### END Koda GUI section ###
      19. While 1
      20. $nMsg = GUIGetMsg()
      21. Switch $nMsg
      22. Case $GUI_EVENT_CLOSE
      23. Exit
      24. Case $Button1
      25. _Func _Exit
      26. Case $Button2
      27. _Func2()
      28. EndSwitch
      29. WEnd
      30. Func _Exit
      31. While 1
      32. Sleep(1)
      33. Opt("WinWaitDelay",100)
      34. Opt("WinTitleMatchMode",4)
      35. Opt("WinDetectHiddenText",1)
      36. Opt("MouseCoordMode",0)
      37. WinWait("FLYFF","")
      38. If Not WinActive("FLYFF","") Then WinActivate("FLYFF","")
      39. WinWaitActive("FLYFF","")
      40. MouseClick("left",593,315,2)
      41. MouseClick("left",660,315,2)
      42. MouseClick("left",629,315,2)
      43. MouseClick("left",661,315,2)
      44. WEnd
      45. Exit
      46. EndFunc ;==>_Func1
      47. Func _F1
      48. While 1
      49. Sleep(1)
      50. MsgBox(0, "Info", "Du hast das Programm beendet.")
      51. WinWait("FLYFF","")
      52. If Not WinActive("FLYFF","") Then WinActivate("FLYFF","")
      53. WinWaitActive("FLYFF","")
      54. MouseClick("left",598,319,2)
      55. MouseClick("left",663,319,2)
      56. WEnd
      57. Exit
      58. EndFunc ;==>_Func2
      Alles anzeigen


      und dann kommt folgender error :



      hoffe du kannst mir helfen

      btw kommt selbst wenn ich deinen code kopiere !

      lg Fuyo

    • ....

      Quellcode

      1. #include <GUIConstants.au3>
      2. HotKeySet("{Esc}", "_Exit") ;Hier der HotKey... Wenn man Escape drückt.
      3. HotKeySet("{F1}", "_F1") ;Hier der HotKey... Wenn man F1 drückt.
      4. #Region ### START Koda GUI section ### Form=
      5. $Form1 = GUICreate("Form1", 624, 444, 193, 125)
      6. GUISetState(@SW_SHOW)
      7. #EndRegion ### END Koda GUI section ###
      8. Func _Exit[COLOR="Red"]()[/COLOR] ;Anfang der Funktion.
      9. Exit ;Beendet das Programm.
      10. Endfunc ;Ende der Funktion.
      11. Func _F1[COLOR="Red"]()[/COLOR] ;Anfang der Funktion.
      12. MsgBox(0, "Info", "Du hast es geschafft eine MsgBox zu öffnen!, Herzlichen Glückwunsch.") ;Beendet das Programm.
      13. Endfunc ;Ende der Funktion.
      14. While 1
      15. $nMsg = GUIGetMsg()
      16. Switch $nMsg
      17. Case -3 ;$GUI_EVENT_CLOSE brauchtman nicht !
      18. Exit
      19. EndSwitch
      20. WEnd
      Alles anzeigen


      So viel Spass damit, Hofe ich kann helfen

      MFG xDrago


      nja verbessert hab ichsma weitgehend.

      Ein paar Regeln muss man schon einhalten und zwar packt man Funktionen etweder an den Anfang eines scripts oder ans ende. In die mitte ist einfach nur unordnung.

      Das $GUI_EVENT_CLOSE ist eine anfängerhilfe die man sich mit der zeit abgewöhnen sollte nämlich hat das X oben in der ecke den wert -3



      Vorallem verstehe ich nicht warum du für eine Hotkey Guide eine GUI brauchst. Ein einfaches:

      Quellcode

      1. HotKeySet("{F1}","_LOL")
      2. Func _LOL()
      3. MsgBox(0,"HotKey","Du hast F1 gedrückt!")
      4. EndFunc


      tuts auch :P
    • $GUI_EVENT_CLOSE
      ist die fertig deklarierte Variable in dem Include
      sie hat den wert "-3"

      Und wenn du nur diese Variable aus dem Include nutzt wäre es besser wenn du das include weglässt und "-3" verwendedn würdest oder die Variable selbst noch einmal deklarierst.

      So kann man ressourcen sparen und das programm wird auch kleiner, auch wens nur 1mb sind ;)
      wenn du es obfuscatest ist es auch so bessser da es bim obfuscaten noch größer wird.

      gez :: *electriZer*