Autoit Problem :(

07/26/2012 02:09 dussel112#1
Hallo Liebe Member ^^,
Ich habe ein Problem undzwar Scripte ich nicht sehr lange und mein NosTale Bot will irgendwie nicht werden :(.
Immer kommt der Fehler

"Error:Badly formatted "Func" statement."

Ich hoffe ihr könnt mir helfen das hier habe ich schon mal so hingekleistert.

Ich Danke schonmal :)

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("NosTale Boter", 623, 210, 192, 124)
GUISetBkColor(0x3B98D3)
$Button1 = GUICtrlCreateButton("Jobben", 32, 24, 555, 25,)
$Button2 = GUICtrlCreateButton("Pause", 32, 72, 555, 25)
$Button3 = GUICtrlCreateButton("Ende", 32, 120, 555, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit

    EndSwitch
WEnd


While 1
    Sleep
(100)
WEnd

Func $Button1
()
    While 
1
        Sleep
(100)
ControlSend("NosTale","{Space}")
ControlSend("NosTale","{X}")
     
WEnd
 EndFunc


Func $Button2
()
    While 
True
        Sleep
(10000)
    
WEnd
EndFunc

Func $Button3
()
    Exit
EndFunc 
07/26/2012 02:59 Miichiii#2
Quote:
Originally Posted by dussel112 View Post
"Error:Badly formatted "Func" statement."

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("NosTale Boter", 623, 210, 192, 124)
GUISetBkColor(0x3B98D3)
$Button1 = GUICtrlCreateButton("Jobben", 32, 24, 555, 25,)
$Button2 = GUICtrlCreateButton("Pause", 32, 72, 555, 25)
$Button3 = GUICtrlCreateButton("Ende", 32, 120, 555, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit

    EndSwitch
WEnd


While 1
    Sleep
(100)
WEnd

Func $Button1
()
    While 
1
        Sleep
(100)
ControlSend("NosTale","{Space}")
ControlSend("NosTale","{X}")
     
WEnd
 EndFunc


Func $Button2
()
    While 
True
        Sleep
(10000)
    
WEnd
EndFunc

Func $Button3
()
    Exit
EndFunc 
ohje :D
versuchs mal so:

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("NosTale Boter", 623, 210, 192, 124)
GUISetBkColor(0x3B98D3)
$Button1 = GUICtrlCreateButton("Jobben", 32, 24, 555, 25,)
$Button2 = GUICtrlCreateButton("Pause", 32, 72, 555, 25)
$Button3 = GUICtrlCreateButton("Ende", 32, 120, 555, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            
While 1
                Sleep
(100)
                
ControlSend("NosTale","{Space}")
                
ControlSend("NosTale","{X}")
            
WEnd
        
Case $Button2
            
While 1
                Sleep
(100)
                
ControlSend("NosTale","{Space}")
                
ControlSend("NosTale","{X}")
            
WEnd
        
Case $Button3
            
Exit
    EndSwitch
WEnd 
oder du nimmst statt $Button1,2,3 in deinen Funktionen die Namen (Beispiel) Funktion1, Funktion2 und 3, und dann in den Switch Case $Button1 Funktion1() usw..
07/26/2012 03:27 omer36#3
Der Inhalt vom ControlSend() ist nicht komplett, kann sein dass es nicht klappt..

PHP Code:
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("NosTale Boter", 623, 210, 192, 124)
GUISetBkColor(0x3B98D3)
$Button1 = GUICtrlCreateButton("Jobben", 32, 24, 555, 25)
$Button2 = GUICtrlCreateButton("Pause", 32, 72, 555, 25)
$Button3 = GUICtrlCreateButton("Ende", 32, 120, 555, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Dim $run = False, $timer

While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
        
Case -3
            
Exit
        Case 
$Button1
            $run 
= True
        
Case $Button2
            $run 
= False
        
Case $Button3
            
Exit
    EndSwitch
    If 
$run And TimerDiff($timer) >= 100 Then
        ControlSend
("NosTale", "", "", "{Space}")
        
ControlSend("NosTale", "", "", "x")
        
$timer = TimerInit()
    EndIf
WEnd 
07/26/2012 16:08 dussel112#4
Thx ^^ es funkt