[Help] AutoIt 3 Script funktioniert nicht

02/14/2010 22:10 einkeks95#1
hi,

habe ein Script geschrieben, aber irgendwie beendet sich das immer von selbst.

Script:
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$GUI = GUICreate("macrophono Faker 1.0", 141, 932, 1118, 0)
$Input = GUICtrlCreateInput("      Telefonnummer:", 0, 280, 137, 24)
$Button = GUICtrlCreateButton("Start!", 24, 344, 97, 49, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Hotkey: F9", 40, 392, 68, 20)
GUISetState(@SW_SHOW)
Dim $GUI_AccelTable[1][2] = [["{F1}", $Button]]
GUISetAccelerators($GUI_AccelTable)
#EndRegion ### END Koda GUI section ###

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

		Case $Input
		Case $Button
			GUICtrlRead ($Input)
			Call ("read")
			If $Url = "http://www.marcophono.net/flatrate_13_b.html" Then
			MsgBox (1, "Anruf getätigt", "Anruf an die Nummer: & $Input & getätigt") Else
				Call ("write")
				EndIf
			EndSwitch
WEnd

Func read()
	Opt("WinTitleMatchMode", 2)
	$Url = ControlGetText("Internet Explorer", "", "Edit1")
EndFunc

Func write()
MouseClick("left",33,85,1)
Sleep (50)
MouseClick("left",364,648,1)
Sleep (50)
Send($Input)
Sleep (50)
MouseClick("left",198,768,1)

EndFunc
hoffe ihr könnt mir helfen.

mfg. einkeks95
02/14/2010 22:26 kknb#2
du solltest erstmal lernen die fehlermeldungen die dir der compiler ausgibt zu verstehen und zu beheben..ka was der bot machen soll, habe nur die syntax fehler behoben.

Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$GUI = GUICreate("macrophono Faker 1.0", 141, 932, 1118, 0)
$Input = GUICtrlCreateInput("      Telefonnummer:", 0, 280, 137, 24)
$Button = GUICtrlCreateButton("Start!", 24, 344, 97, 49, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Hotkey: F9", 40, 392, 68, 20)
GUISetState(@SW_SHOW)
Dim $GUI_AccelTable[1][2] = [["{F1}", $Button]]
GUISetAccelerators($GUI_AccelTable)
#EndRegion ### END Koda GUI section ###

Global $url

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button
			GUICtrlRead($Input)
			read()
			If $url = "http://www.marcophono.net/flatrate_13_b.html" Then
			Else
				MsgBox(1, "Anruf getätigt", "Anruf an die Nummer :" & GUICtrlRead($Input) & "getätigt")
				write()
			EndIf
	EndSwitch

Func read()
	Opt("WinTitleMatchMode", 2)
	$url = ControlGetText("Internet Explorer", "", "Edit1")
EndFunc   ;==>read

Func write()
	MouseClick("left", 33, 85, 1)
	Sleep(50)
	MouseClick("left", 364, 648, 1)
	Sleep(50)
	Send(guictrlread($Input))
	Sleep(50)
	MouseClick("left", 198, 768, 1)

EndFunc   ;==>write
bitte.
02/14/2010 22:27 sulak#3
Du hast auch 7 Fehler drinen ist ja klar das es nicht klappt
Quote:
AutoIt3 Syntax Checker v1.54.8 Copyright (c) Tylo 2007

C:\Users\*\Desktop\k.au3(26,12) : WARNING: $Url: possibly used before declaration.
If $Url =
~~~~~~~~^
C:\Users\*\Desktop\k.au3(27,77) : ERROR: syntax error
MsgBox (1, "Anruf getätigt", "Anruf an die Nummer: & $Input & getätigt") Else
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~^
C:\Users\*\Desktop\k.au3(29,5) : ERROR: missing EndSwitch.
EndIf
^
C:\Users\*\Desktop\k.au3(26,65) : REF: missing EndSwitch.
If $Url = "http://www.marcophono.net/flatrate_13_b.html" Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~^
C:\Users\*\Desktop\k.au3(29,5) : ERROR: missing Wend.
EndIf
^
C:\Users\*\Desktop\k.au3(18,14) : REF: missing Wend.
Switch $nMsg
~~~~~~~~~~~~^
C:\Users\*\Desktop\k.au3(29,5) : ERROR: syntax error
EndIf
^
C:\Users\*\Desktop\k.au3(26,12) : ERROR: $Url: undeclared global variable.
If $Url =
~~~~~~~~^
C:\Users\*\Desktop\k.au3(25,16) : ERROR: read(): undefined function.
Call ("read")
~~~~~~~~~~~~^
C:\Users\*\Desktop\k.au3(28,18) : ERROR: write(): undefined function.
Call ("write")
~~~~~~~~~~~~~^
C:\Users\*\Desktop\k.au3 - 7 error(s), 1 warning(s)
>Exit code: 2 Time: 0.440
02/14/2010 22:29 sulak#4
Quote:
Originally Posted by kknb View Post
du solltest erstmal lernen die fehlermeldungen die dir der compiler ausgibt zu verstehen und zu beheben..ka was der bot machen soll, habe nur die syntax fehler behoben.

Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$GUI = GUICreate("macrophono Faker 1.0", 141, 932, 1118, 0)
$Input = GUICtrlCreateInput("      Telefonnummer:", 0, 280, 137, 24)
$Button = GUICtrlCreateButton("Start!", 24, 344, 97, 49, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Hotkey: F9", 40, 392, 68, 20)
GUISetState(@SW_SHOW)
Dim $GUI_AccelTable[1][2] = [["{F1}", $Button]]
GUISetAccelerators($GUI_AccelTable)
#EndRegion ### END Koda GUI section ###

Global $url

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button
			GUICtrlRead($Input)
			read()
			If $url = "http://www.marcophono.net/flatrate_13_b.html" Then
			Else
				MsgBox(1, "Anruf getätigt", "Anruf an die Nummer :" & GUICtrlRead($Input) & "getätigt")
				write()
			EndIf
	EndSwitch

Func read()
	Opt("WinTitleMatchMode", 2)
	$url = ControlGetText("Internet Explorer", "", "Edit1")
EndFunc   ;==>read

Func write()
	MouseClick("left", 33, 85, 1)
	Sleep(50)
	MouseClick("left", 364, 648, 1)
	Sleep(50)
	Send(guictrlread($Input))
	Sleep(50)
	MouseClick("left", 198, 768, 1)

EndFunc   ;==>write
bitte.
Du hast ein WEnd vergessen

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$GUI GUICreate("macrophono Faker 1.0"14193211180)
$Input GUICtrlCreateInput("      Telefonnummer:"028013724)
$Button GUICtrlCreateButton("Start!"243449749$WS_GROUP)
$Label1 GUICtrlCreateLabel("Hotkey: F9"403926820)
GUISetState(@SW_SHOW)
Dim $GUI_AccelTable[1][2] = [["{F1}"$Button]]
GUISetAccelerators($GUI_AccelTable)
#EndRegion ### END Koda GUI section ###

Global $url

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

        Case 
$Input
        
Case $Button
            GUICtrlRead
($Input)
            
read()
            If 
$url "http://www.marcophono.net/flatrate_13_b.html" Then
            
Else
                
MsgBox(1"Anruf getätigt""Anruf an die Nummer :" GUICtrlRead($Input) & "getätigt")
                
write()
            EndIf
        EndSwitch
        
WEnd

Func read
()
    
Opt("WinTitleMatchMode"2)
    
$url ControlGetText("Internet Explorer""""Edit1")
EndFunc   ;==>read

Func write
()
    
MouseClick("left"33851)
    
Sleep(50)
    
MouseClick("left"3646481)
    
Sleep(50)
    
Send(guictrlread($Input))
    
Sleep(50)
    
MouseClick("left"1987681)

EndFunc   ;==>write 
02/14/2010 22:37 kknb#5
verrückt.
02/15/2010 10:46 einkeks95#6
thx