Tratsch rund um Autoit / Autoit Talk | kleinere Fragen

07/11/2013 21:09 [becky]#1471
hallo. wie muss ein GUICtrlSetData fur label ausschauen? in welche Aufbau muss es stehen?
07/11/2013 21:14 omer36#1472
Quote:
Originally Posted by [becky] View Post
hallo. wie muss ein GUICtrlSetData fur label ausschauen? in welche Aufbau muss es stehen?
GUICtrlSetData($label, "blablubb")

?
07/11/2013 21:15 [becky]#1473
Quote:
Originally Posted by omer36 View Post
GUICtrlSetData($label, "blablubb")

?
funktioniert nicht. ihc habe gemerkt dass es im "While 1" vonGUI funktioniert

so funktioniert:

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

Case $Button1
_Main()
EndSwitch
GUICtrlSetData($label4, "troloro")
WEnd

aber anstatt "troloro" brauche ich eine variable. wo soll ich sie deklarieren?
07/11/2013 21:42 Achat#1474
[code]Und hier schreibst du bitte deinen AutoIt Code rein. Vielen Dank.[/code]

Code:
Und hier schreibst du bitte deinen AutoIt Code rein. Vielen Dank.
Hier findest du Beispiele und eine Funktionsreferenz in Deutsch:
[Only registered and activated users can see links. Click Here To Register...]

MfG
07/11/2013 21:57 [becky]#1475
Quote:
Originally Posted by Achat View Post
[code]Und hier schreibst du bitte deinen AutoIt Code rein. Vielen Dank.[/code]

Code:
Und hier schreibst du bitte deinen AutoIt Code rein. Vielen Dank.
Hier findest du Beispiele und eine Funktionsreferenz in Deutsch:
[Only registered and activated users can see links. Click Here To Register...]

MfG
danke, aber nicht geholfen
07/11/2013 21:58 Der-Eddy#1476
Man könnte dir besser helfen wenn du deinen derzeigen Code posten könntest und was du genau vorhast
07/11/2013 22:13 [becky]#1477
also mein code ist ganz merkwurdig, ich wiess dass niemand ein solches skript braucht, aber so lerne ich neue funktionen (ich bin ziemlich neu in autoit)

hier ist mein ganzes code:

Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=E:\E Media\shutdown.ico
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Global $MSGBOX, $action, $time, $time_progress, $nummer, $i, $timing

#include <wait.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=e:\d diverse\autoit\koda\saves\form1.kxf
$Form1_1 = GUICreate("Shutdown", 318, 160, 201, 129)
$Label1 = GUICtrlCreateLabel("Select the operation:", 8, 32, 102, 17)
$Combo1 = GUICtrlCreateCombo("Shutdown", 112, 32, 129, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Shutdown|Reboot|Force|Power down|Force if hung|Standby|Hibernate|Logoff")
$Button1 = GUICtrlCreateButton("GO!", 216, 64, 73, 33)
$Label2 = GUICtrlCreateLabel("Set time:", 8, 72, 45, 17)
$Input1 = GUICtrlCreateInput("", 64, 72, 65, 21)
$Label3 = GUICtrlCreateLabel("Minutes!", 136, 72, 44, 17)
$Progress1 = GUICtrlCreateProgress(8, 112, 209, 25, $PBS_SMOOTH)
GUICtrlSetColor(-1, 0x3399FF)
$Label4 = GUICtrlCreateLabel("Time", 232, 112, 64, 32)
GUICtrlSetFont(-1, 16, 400, 0, "News Gothic MT")
GUICtrlSetColor(-1, 0x000000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###




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

		Case $Button1
			_Main()
	EndSwitch
WEnd


Func _Main()
	$time = GUICtrlRead($Input1)
	$time = $time * 60000
	$time_progress = $time / 100
	$action = GUICtrlRead($Combo1)
	If $action == "Shutdown" Then
		$action = 1
	EndIf
	If $action == "Reboot" Then
		$action = 2
	EndIf
	If $action == "Power down" Then
		$action = 8
	EndIf
	If $action == "Standby" Then
		$action = 32
	EndIf
	If $action == "Hibernate" Then
		$action = 64
	EndIf
	If $action == "Logoff" Then
		$action = 0
		EndIf
	If $time = "" Then
		MsgBox(16, "Error", "No value inserterd")
		GUISetState(@SW_SHOW)
	Else
	;GUISetState(@SW_HIDE)
	EndIf
	$MSGBOX = MsgBox(1, GUICtrlRead($Combo1) , "Your computer will " & GUICtrlRead($Combo1) & " in " & GUICtrlRead($Input1) & " minutes")
	If $MSGBOX = 1 Then
		_Action()
	Else
		GUISetState(@SW_SHOW)
	EndIf
	EndFunc

#cs das habe ich versucht, funtioniert aber nicht
Func _Timing()
	$timing = GUICtrlRead($Input1)
	$timing = $timing - 1
	GUICtrlSetData($Label4, $timing)
	wait(60000)
	EndFunc
#ce

	Func _Action()
		If $nMsg = $GUI_EVENT_CLOSE Then Exit

$nummer = 0
	$sleep = $time ; wie lange es schlafen soll
	GUICtrlSetLimit($Progress1,$sleep,0)
	$i = 0
	$Timer = TimerInit()
	Do
		wait($time_progress)
		$nummer = $nummer + 1.09
		GUICtrlSetData($Progress1,$nummer) ; GuiCtrlSetData(Gui object,wert / data)
		$diff = TimerDiff($Timer)
	Until $diff > $sleep

MsgBox(0, GUICtrlRead($Combo1), GUICtrlRead($Combo1)) ; nur zu uberprufen
;Shutdown($action)

Exit
EndFunc
mein skript schaltet das PC aus (oder restart, logoff und andere), in einer zeit. ich habe eine progressbare gemacht, und neben sie will ich die gebliebene zeit anzeigen, die sich von minute zur minute verkleinert.
07/12/2013 17:12 evoh12#1478
Hallo,

ich habe auch noch einmal eine Frage zur FF.au3.

Ich möchte diese beiden Buttons drücken nur ich weiß nicht mit welcher Funktion:


PHP Code:
<form method="post" onsubmit="window.open('http://www.beispiel1.html');">
<
input class="btn2" type="submit" name="submit" value="Test Seite 1"/>
</
form>
<
br><br>

<
form method="post" onsubmit="window.open('http://www.beispiel2.htm');">
<
center><input class="btn2" type="submit" name="submit" value="Test Seite 2" /></center>
</
form><br>
<
p

Ich habe es bereits mit diesen Befehlen versucht nur ohne Erfolg:

PHP Code:
_FFFormSubmit(0"submit""auto")
_FFFormSubmit(1"submit""auto"
Danke für eure Hilfe :)
07/12/2013 17:51 YatoDev#1479
Die FF.au3 ist noch schlimmer als die IE.au3

Am besten machst du es mit der winhttp.au3
die ist genauso einfach zu benutzen .
07/12/2013 17:58 evoh12#1480
Mit der IE.au3 habe ich es ja schon nur Firefox gefällt mir besser deshalb will ich das ganze nochmal mit FF.au3 machen.
07/12/2013 18:15 YatoDev#1481
du weist das beim firefox dafür ein addon installieren musst ?
07/12/2013 18:19 evoh12#1482
Ja, das funktioniert auch alles... nur wie drücke ich diese Buttons?
Die haben ja keine richtige ID...

EDIT: ICh versuch es mal mit Xpath
Nur damit funktioniert es auch nicht :/

PHP Code:
_FFClick(_FFXpath("id('left_content')/x:center/x:form[2]/x:center/x:input","",9) ) 
Xpath gibt das aus :
PHP Code:
id('left_content')/x:center/x:form[1]/x:center/x:input
id
('left_content')/x:center/x:form[2]/x:center/x:input 
07/13/2013 00:48 ѕуѕтємαтι¢#1483
Quote:
Run ("C:\x\c.exe")
WinWaitActive ("z")
While 1
Send ("{beliebige Taste1}")
Sleep (10000)
Send ("{beliebige Taste2}")
Sleep (10000)
WEnd
x steht für einen Ordner Namen
c für den Namen der Exe
und z für das Fenster

Es sollte alle 10 Sekunden "beliebige Taste 1" und nach 10 Sekunden "beliebige Taste 2" drücken, nach 10 Sekunden wieder "beliebige Taste 1" usw, das allerdings in einer Endlosschleife =)

Wäre nett ob mir jemand sagen könnte, ob das so stimmt, und wenn nicht was ich falsch gemacht habe.
07/13/2013 12:53 Cpt.Cock#1484
Quote:
Originally Posted by ѕуѕтємαтι¢ View Post
Run ("C:\x\c.exe")
WinWaitActive ("z")
While 1
Send ("{beliebige Taste1}")
Sleep (10000)
Send ("{beliebige Taste2}")
Sleep (10000)
WEnd

x steht für einen Ordner Namen
c für den Namen der Exe
und z für das Fenster

Es sollte alle 10 Sekunden "beliebige Taste 1" und nach 10 Sekunden "beliebige Taste 2" drücken, nach 10 Sekunden wieder "beliebige Taste 1" usw, das allerdings in einer Endlosschleife =)

Wäre nett ob mir jemand sagen könnte, ob das so stimmt, und wenn nicht was ich falsch gemacht habe.
Schreib den Code in Zukunft doch bitte zwischen die
Code:
Code Tags, einfach auf die Raute klicken wenn du eine Nachricht schreibst :)
07/13/2013 16:27 ѕуѕтємαтι¢#1485
Ja und jetzt wäre noch ne Antwort auf meine Frage nett...