Hotkeyset Problem !

    • Hotkeyset Problem !

      Hi Godlikerz
      wenn ich folgendes script mache mit hotkeyset nach einem TuT von xDrago
      kommt immer ein error ich bitte um eure hilfe

      ich habe meinen code mal gepostet aber ich kann euch nochmal erklären , was ich eigentlich nur möchte .
      Also bei mir soll einfach wenn ich F1 drücke alles beendet werden (also das Programm)

      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
    • Werbung zur Unterstützung des Forums ( Bitte AddBlocker deaktivieren )

    • der fehler ist ganz banal.
      eigentlich ists nur ein napfehler
      aber da du nicht lange proggst, kann sowas schon passieren
      und dafür sind wir da
      um zu helfen
      sowas passierte auch schon mir, obwohl ich schon ne zeit lang autoit progge
      also zu deinem error
      du hast ganz einfach vergessen die func richtig zu deklarieren
      hinter den namen einer func gehört ganz einfach ein ()
      also muss das so aussehen
      [COLOR="Lime"]Func _test()
      ;ab hier kommt dein code
      Endfunc;==>_test()[/COLOR]

      du musst dann bei dir einfach noch bei beiden funcs ein () dahintertun
      schon müsste es klappen
      hoffe dir geholfen zu haben
      autoit is echt geil stimmts?
      nich umsonst habe ich dieses bild als signatur

      LG
      internetfreak

      EDIT: hast du das absichtlich gemacht oder warum benutzt du nach dem klick auf die buttons undefinierte funktionen
      das gibt später auch nen error
      habe jetzt mal alles richtig gemacht
      "code"
      #include <ButtonConstants.au3>
      #include <GUIConstantsEx.au3>
      #include <StaticConstants.au3>
      #include <WindowsConstants.au3>

      HotKeySet("{Esc}", "_Exit")
      HotKeySet("{F1}", "_F1")

      #Region ### START Koda GUI section ### Form=
      $Form1 = GUICreate("Upgrader", 258, 242, 450, 285)
      $Group1 = GUICtrlCreateGroup("Upgrader by Fuyo ", 16, 16, 217, 209)
      $Button1 = GUICtrlCreateButton("Fly For Fame", 32, 48, 107, 41, 0)
      $Button2 = GUICtrlCreateButton("Anderer Server", 32, 112, 107, 41, 0)
      $Made = GUICtrlCreateLabel("Made", 168, 64, 31, 17)
      GUICtrlSetState(-1, $GUI_DISABLE)
      $for = GUICtrlCreateLabel("for", 168, 80, 16, 17)
      $Godlikerz = GUICtrlCreateLabel("Godlikerz", 168, 96, 48, 17)
      GUICtrlCreateGroup("", -99, -99, 1, 1)
      GUISetState(@SW_SHOW)
      #EndRegion ### END Koda GUI section ###


      While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
      Case $GUI_EVENT_CLOSE
      Exit
      Case $Button1
      _Exit()
      Case $Button2
      _F1()
      EndSwitch
      WEnd

      Func _Exit()
      While 1
      Sleep(1)
      Opt("WinWaitDelay",100)
      Opt("WinTitleMatchMode",4)
      Opt("WinDetectHiddenText",1)
      Opt("MouseCoordMode",0)
      WinWait("FLYFF","")
      If Not WinActive("FLYFF","") Then WinActivate("FLYFF","")
      WinWaitActive("FLYFF","")
      MouseClick("left",593,315,2)
      MouseClick("left",660,315,2)
      MouseClick("left",629,315,2)
      MouseClick("left",661,315,2)
      WEnd
      Exit
      EndFunc ;==>_Func1


      Func _F1()
      While 1
      Sleep(1)
      MsgBox(0, "Info", "Du hast das Programm beendet.")
      WinWait("FLYFF","")
      If Not WinActive("FLYFF","") Then WinActivate("FLYFF","")
      WinWaitActive("FLYFF","")
      MouseClick("left",598,319,2)
      MouseClick("left",663,319,2)
      WEnd
      Exit
      EndFunc ;==>_Func2