Script works only sometimes

08/02/2016 02:12 xUnbekannt#1

Help^^
08/02/2016 02:23 °Incinerate#2
Dein Skript startet und wird gleich wieder beendet weil du keine Funktion aufrufst.

08/02/2016 02:43 xUnbekannt#3
Habs vergessen zu erwähnen:
Quote:
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
Hatte ich wegen der GUI drin.
Aber es kommt folgendes in der Konsole:
>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Desktop\AutoIT\Bot.au3"

EDIT: Beim texteditor funkt das script, nur bei dem Game halt nur manchmal....
Deswegen habe ich ja WinActiv udn winwait..., fehlt noch ein befehl?
EDIT: Vielleicht auch eine andere Form vom send Befehl?
Die Zahlen werden vom Spiel angenommen, aber send("M") um die Map zu öffnen nicht..., sondern nur manchmal
08/02/2016 11:36 °Incinerate#4
Du kannst ja mal send("{M}") versuchen.
08/02/2016 14:08 xUnbekannt#5
Mach ich, aber was bringt der Befehl?
#Edit geht nicht

Mein nicht funktionierendes Script:
Quote:
Code:
#include <AutoItConstants.au3>
#include <Misc.au3>
#RequireAdmin

HotKeySet("{F1}", "StartlevelingStart")
HotKeySet("{F5}", "CloseBotandWindow")

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 617, 199, 192, 124)
$Label1 = GUICtrlCreateLabel("F1 to start", 24, 26, 90, 29)
GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         EndSwitch
WEnd
Func StartlevelingStart() ;Anfangsgebiet

   start()
   sleep(100)
   co("m")
   sleep(100)

   mouse(1080,628)
   sleep(5000)

   mouse(1100,604)
   sleep(2000)
   send("y")
   sleep(100)

      While 1
         sleep(10)
         send("{TAB}")
         send("1")
         sleep(1000)
         send("2")
         sleep(100)
         send("3")
         sleep(100)
         send("4")
         sleep(100)
         send("2")
         sleep(100)
         send("3")
         sleep(100)
         send("4")
         sleep(5500)
         send("z")
         sleep(50)
      WEnd
EndFunc
Func mouse($x,$y)        ; Mausklick links
   Mouseclick("left",$x,$y,1,5)
EndFunc
Func start(); Muss zum aktivieren davor geschrieben werden(FALLS SPIEL AKTIV SEIN SOLL)
   WinActivate ( "x" )
   WinWaitActive ( "x" )
   sleep(100)
EndFunc
08/04/2016 22:24 [Beatrice]#6
Don't forget to check if the hotkey is not used, that'd cause problems with the hotkey.
08/12/2016 14:48 xUnbekannt#7
It is used for nothing atm...
08/13/2016 13:52 °Incinerate#8
Wenn dein Skript nicht Funktioniert dann spring Scite auch direkt an die Stelle, an der sich den Fehler befindet. Ansonsten hast du unten auch dein DebugLog (heißt das so?) indem du siehst wo genau der Fehler liegt.