Windows-Taste + F drücken (Windows-Suche), suchen nach Dateien und Ordnern, Diablo2.ini eingeben und lokale Festplatten durchsuchen
Beiträge von funkey
-
-
Jetzt gibt's aber keine Ausreden mehr!!
[autoit]#include <GUIConstantsEx.au3>
[/autoit][autoit][/autoit][autoit]
#Include <Date.au3>
#include <ButtonConstants.au3>HotKeySet("{Enter}", "Click")
[/autoit][autoit][/autoit][autoit][/autoit][autoit]$main_form_1 = GUICreate("abspeichern", 378, 550, 252, 152)
[/autoit][autoit][/autoit][autoit]
$lbl_barcode = GUICtrlCreateLabel("barcodes:", 40, 40, 51, 17)
$lbl_movedate = GUICtrlCreateLabel("moved date:", 32, 363, 63, 17)
$lbl_movedby = GUICtrlCreateLabel("moved by:", 37, 394, 53, 17)
$lbl_moveto = GUICtrlCreateLabel("moved to:", 38, 426, 51, 17)
$inp_barcode = GUICtrlCreateEdit("", 104, 40, 225, 281)
$inp_movedate = GUICtrlCreateDate(_NowCalc(), 104, 364, 193, 25)
$inp_movedby = GUICtrlCreateInput("", 104, 395, 220, 21)
$inp_moveto = GUICtrlCreateCombo("", 104, 425, 220, 25)
$btn_save = GUICtrlCreateButton("save", 216, 480, 113, 25, 0)
$btn_reset = GUICtrlCreateButton("reset", 16, 480, 113, 25, 0)
$lbl_total = GUICtrlCreateLabel("total barcodes:", 109, 328, 74, 17)
$lbl_show_total = GUICtrlCreateLabel("0", 306, 326, 15, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Fil = GUICtrlCreateMenu("&File")
$men_settings = GUICtrlCreateMenuItem("Settings", $Fil)
$men_refresh = GUICtrlCreateMenuItem("Refresh", $Fil)
$men_exit = GUICtrlCreateMenuItem("Exit", $Fil)
GUISetState(@SW_SHOW)While 1
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
$msg = GUIGetMsg()
If $msg = $btn_save Then MsgBox(0,"","Button gedrückt")
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEndFunc Click()
[/autoit]
If ControlGetFocus("abspeichern","") = "Edit3" Then
ControlClick("abspeichern","",$btn_save)
Else
HotKeySet("{Enter}")
Send("{Enter}")
HotKeySet("{Enter}", "Click")
EndIf
EndFunc -
Ich würde es so machen
[autoit]
[/autoit][autoit][/autoit][autoit]
#include <GUIConstantsEx.au3>
#Include <Date.au3>
#include <ButtonConstants.au3>HotKeySet("^{Enter}", "Click")
[/autoit][autoit][/autoit][autoit][/autoit][autoit]$main_form_1 = GUICreate("abspeichern", 378, 550, 252, 152)
[/autoit][autoit][/autoit][autoit]
$lbl_barcode = GUICtrlCreateLabel("barcodes:", 40, 40, 51, 17)
$lbl_movedate = GUICtrlCreateLabel("moved date:", 32, 363, 63, 17)
$lbl_movedby = GUICtrlCreateLabel("moved by:", 37, 394, 53, 17)
$lbl_moveto = GUICtrlCreateLabel("moved to:", 38, 426, 51, 17)
$inp_barcode = GUICtrlCreateEdit("", 104, 40, 225, 281)
$inp_movedate = GUICtrlCreateDate(_NowCalc(), 104, 364, 193, 25)
$inp_movedby = GUICtrlCreateInput("", 104, 395, 220, 21)
$inp_moveto = GUICtrlCreateCombo("", 104, 425, 220, 25)
$btn_save = GUICtrlCreateButton("save", 216, 480, 113, 25, 0, $BS_DEFPUSHBUTTON)
$btn_reset = GUICtrlCreateButton("reset", 16, 480, 113, 25, 0)
$lbl_total = GUICtrlCreateLabel("total barcodes:", 109, 328, 74, 17)
$lbl_show_total = GUICtrlCreateLabel("0", 306, 326, 15, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
$Fil = GUICtrlCreateMenu("&File")
$men_settings = GUICtrlCreateMenuItem("Settings", $Fil)
$men_refresh = GUICtrlCreateMenuItem("Refresh", $Fil)
$men_exit = GUICtrlCreateMenuItem("Exit", $Fil)
GUISetState(@SW_SHOW)While 1
[/autoit][autoit][/autoit][autoit][/autoit][autoit]
$msg = GUIGetMsg()
If $msg = $btn_save Then MsgBox(0,"","Button gedrückt")
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEndFunc Click()
[/autoit][autoit][/autoit][autoit][/autoit]
ControlClick("abspeichern","",$btn_save)
EndFunc -
Aus der Hilfe
#include <ButtonConstants.au3>
$BS_DEFPUSHBUTTON 0x0001 Creates a push button with a heavy black border. If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful for enabling the user to quickly select the most likely option, or default.EDIT_1 : Sorry, geht wohl doch nicht so leicht, Vielleicht Umweg über Hotkey (z.B. Strg+Enter) und ControlClick machen.
-
Wieso sollte das nicht funktionieren? Bei mir geht's!
[autoit]FileCopy("ARIALUNI.TTF",@WindowsDir&"/Fonts")
[/autoit] -
[autoit]
#include <GUIConstantsEx.au3>
[/autoit][autoit][/autoit][autoit]$Form1 = GUICreate("AngelAndi", 290, 175, 250, 300)
[/autoit][autoit][/autoit][autoit]
FileInstall("C:\angel.gif", @ScriptDir & "\angel.gif")
GUICtrlCreatePic(@ScriptDir & "\angel.gif",23 ,33, 0 ,0)
$label1=GuiCtrlCreateLabel("PickUpBot by AngelAndi",162,29,121,15)
$Button1 = GUICtrlCreateButton("On/An", 165, 57, 54, 86, 0)
$Button2 = GUICtrlCreateButton("Off/Aus", 227, 57, 54, 86, 0)Global $Status = 0
[/autoit][autoit][/autoit][autoit]GUISetState(@SW_SHOW)
[/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]
$msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$Status = 1
Case $Button2
$Status = 0
EndSwitchIf $Status Then
[/autoit]
ToolTip("Eingeschaltet")
Send ( "{y down}")
Send ( "{y up}")
Else
ToolTip("Ausgeschaltet")
EndIf
Sleep(10)
WEndDas mit dem Send gefällt mir auch nicht, da beim Ein- und Ausschalten das falsche Fenster aktiv ist, ControlSend wäre besser.
-
So vielleicht?
[autoit]While 1
[/autoit][autoit][/autoit][autoit]
While PixelGetColor(432, 57) = 0xB88310
ToolTip ( "Falsche Farbe --> Neustart Schleife" , 1, 1)
Sleep(10)
WEndToolTip ( "123" , 1, 1)
[/autoit]
Send ( "{2}" )
sleep (500)
If PixelGetColor ( 408, 34) = 0x871D18 Then Send ( "{3}" )
If PixelGetColor ( 408, 34) = 0x871D18 Then sleep (2000)
If PixelGetColor ( 408, 34) = 0x871D18 Then sleep (2000)
Wend -
Ich habe ein altes Skript von mir wiederentdeckt. Wahrscheinlich gibt es solche aber schon viele. Außerdem sollte ich es noch ein bischen optimieren, aber egal erst mal.
Das einfache Skript ordnet Dateien mit der Endung *.mp3 und der Bezeichnung 'Artist - Titel - ???.mp3' in Unterordner ein.
Beispiel 'Michael Jackson - Black or White.mp3'. Hier wird zuerst ein Ordner 'M' erstellt, darunter ein Unterordner 'Michael Jackson' in den die Datei verschoben wird.
Das Skript muss im gleichen Ordner liegen wie die MP3's.
[autoit]$sicherheit = MsgBox(33,"Sicherheitsabfrage","Bist du sicher, dass du alle MP3's aus diesem Ordner automatisch einordnen lassen willst?"&@crlf&"Das Programm wurde zwar sorgfältig getestet, aber durch einen unvorhergesehenen"&@crlf&"Dateinamen könnte sich ein unerwartetes Ergebnis einstellen.")
[/autoit][autoit][/autoit][autoit]
If $sicherheit = 2 Then
Exit
EndIf$search = FileFindFirstFile("*.mp3")
[/autoit][autoit][/autoit][autoit]If $search = -1 Then
[/autoit][autoit][/autoit][autoit]
MsgBox(16, "Fehler", "Keine MP3's zum einordnen gefunden")
Exit
EndIf$rest=0
[/autoit][autoit][/autoit][autoit]
$format=0While 1
[/autoit][autoit][/autoit][autoit]
$file = FileFindNextFile($search)
If @error Then ExitLoop
$finden=StringInStr($file," -")
If $finden>1 Then
$grob=StringLeft($file,1)
if Not FileExists($grob) Then DirCreate($grob)
$Interpret = StringLeft($file, $finden - 1)
if Not FileExists($grob&"/"&$Interpret) Then DirCreate($grob&"/"&$Interpret)
$move_ok=FileMove($file,$grob&"/"&$Interpret,0)
if $move_ok=0 Then $rest=$rest+1
Else
$format=$format+1
EndIf
WEnd
FileClose($search)if $rest=1 Then MsgBox(64,"Warnung","Es konnte eine Datei nicht verschoben werden,"&@CRLF&"da sie schon vorhanden (doppelt) ist!")
[/autoit]
if $rest>1 Then MsgBox(64,"Warnung","Es konnten "&$rest&" Dateien nicht verschoben werden,"&@CRLF&"da sie schon vorhanden (doppelt) sind!")
if $format=1 Then MsgBox(64,"Warnung","Es konnte eine Datei nicht verschoben werden,"&@CRLF&"da sie das falsche Format hat (keinen Bindestrich)!")
if $format>1 Then MsgBox(64,"Warnung","Es konnten "&$format&" Dateien nicht verschoben werden,"&@CRLF&"da sie das falsche Format haben (keinen Bindestrich)!") -
Und wie sieht's jetzt aus
[autoit]#include <ButtonConstants.au3>
[/autoit][autoit][/autoit][autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>Global $Pause = 0
[/autoit][autoit][/autoit][autoit]
$send = False$Form1 = GUICreate("Form1", 214, 244, 193, 125)
[/autoit][autoit][/autoit][autoit]
$Input2 = GUICtrlCreateInput("Interval", 40, 48, 121, 21)
$Input1 = GUICtrlCreateInput("Titel", 40, 88, 121, 21)
$Button1 = GUICtrlCreateButton("Send Blahs", 56, 136, 75, 25, 0)
GUISetState(@SW_SHOW)While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If WinExists(GUICtrlRead($Input1)) = False Then
ToolTip('Es wurde kein Fenster mit dem eingegebenen Titel gefunden!', 0, 0)
Sleep(1500)
ToolTip("")
Else
If Not WinActive(GUICtrlRead($Input1)) Then WinActivate(GUICtrlRead($Input1))
WinWaitActive(GUICtrlRead($Input1))
ControlFocus(GUICtrlRead($Input1), "", "")
$fucus = ControlGetFocus(GUICtrlRead($Input1))
$send = Not $send
If $send Then
GUICtrlSetData($Button1, "Aufhörn")
ControlSend(GUICtrlRead($Input1), "", $fucus, "Blah")
$Start= TimerInit()
Else
GUICtrlSetData($Button1, "Send Blahs")
EndIf
EndIf
EndSwitch
If $send Then
$Dif = TimerDiff($Start)
If $Dif > GUICtrlRead($Input2) Then
ControlSend(GUICtrlRead($Input1), "", $fucus, "Blah")
$Start= TimerInit()
EndIf
EndIf
WEnd -
Ja der SLEEP ist Schuld. Probier's mal so:
[autoit]#include <ButtonConstants.au3>
[/autoit][autoit][/autoit][autoit]
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>Global $Pause = 0
[/autoit][autoit][/autoit][autoit]
$send = False$Form1 = GUICreate("Form1", 214, 244, 193, 125)
[/autoit][autoit][/autoit][autoit]
$Input2 = GUICtrlCreateInput("Interval", 40, 48, 121, 21)
$Input1 = GUICtrlCreateInput("Titel", 40, 88, 121, 21)
$Button1 = GUICtrlCreateButton("Send Blahs", 56, 136, 75, 25, 0)
GUISetState(@SW_SHOW)While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
If WinExists(GUICtrlRead($Input1)) = False Then
ToolTip('Es wurde kein Fenster mit dem eingegebenen Titel gefunden!', 0, 0)
Sleep(1500)
ToolTip("")
Else
If Not WinActive(GUICtrlRead($Input1)) Then WinActivate(GUICtrlRead($Input1))
WinWaitActive(GUICtrlRead($Input1))
ControlFocus(GUICtrlRead($Input1), "", "")
$fucus = ControlGetFocus(GUICtrlRead($Input1))
$send = Not $send
If $send Then
GUICtrlSetData($Button1, "Aufhörn")
ControlSend(GUICtrlRead($Input1), "", $fucus, "Blah")
Else
GUICtrlSetData($Button1, "Send Blahs")
EndIf
EndIf
EndSwitch
If $send Then
If $Pause > GUICtrlRead($Input2) Then
ControlSend(GUICtrlRead($Input1), "", $fucus, "Blah")
$Pause = 0
EndIf
Sleep(10)
$Pause += 10
EndIf
WEnd -
Vielleicht hilft dier das irgendwie
[autoit]$sHotkey += @HotKeyPressed
[/autoit] -
Ich habe zwar die Software nicht installiert, aber warscheinlich wird der Button erst nach dem Erzeugen des Fensters erstellt, genauso wie der Text 'panel'. Wenn also der Text noch nicht vorhanden ist, ist auch vielleicht der Button noch nicht da und der ControlClick geht ins Leere. Was mir noch aufgefallen ist: War es jetzt 'Button1' oder 'Button2'???
-
If ProcessExists(...)
oder
If WinExists(...) -
Wenn nicht die Funktion SetConsole() die Variable $Restart auf 1 setzt, dann kann's nicht funktionieren, da nach dem ersten RUN der Befehl $Restart = 0 kommt.
ansonsten weiss ich nich was nicht funktionieren soll, bis auf dass dieses Skript generell komisch aussieht
Vielleicht brauchst du beim ersten Programm ein RUNWAIT?If $Restart = 1 Then
Run ($CRoadPath & "\" & $CRoadExe)
Run ($SRoadPath & "\" & $SRoadExe)
EndIf -
Senden
[autoit]$Empfaenger_IP = "192.168.2.10"
[/autoit][autoit][/autoit][autoit]
$Port = 33891
$Text = InputBox("Text senden","Text eingeben, der gesendet werden soll","")
If @error = 1 Then Exit
TCPStartUp()$ConnectedSocket = TCPConnect($Empfaenger_IP, $Port)
[/autoit][autoit][/autoit][autoit]
TCPSend($ConnectedSocket, $Text)TCPShutdown ()
[/autoit]Empfangen
[autoit]$Port = 33891
[/autoit][autoit][/autoit][autoit]
TCPStartUp()While 1
[/autoit][autoit][/autoit][autoit]
$MainSocket = TCPListen(@IPAddress1, $Port, 100 )Do
[/autoit][autoit][/autoit][autoit]
$ConnectedSocket = TCPAccept($MainSocket)
Until $ConnectedSocket <> -1If $ConnectedSocket <> -1 Then
[/autoit]
$recv = TCPRecv($ConnectedSocket, 10)
MsgBox(0,"Empfangen",$recv)
TCPShutdown()
TCPStartUp()
EndIf
Wend -
[autoit]
#include <GUIConstantsEx.au3>
[/autoit][autoit][/autoit][autoit]Dim $New_hotkey = "{F11}"
[/autoit][autoit][/autoit][autoit]$Form2 = GUICreate("Form2", 413, 298, 303, 219)
[/autoit][autoit][/autoit][autoit]
$i_hotkey = GUICtrlCreateInput($New_hotkey, 72, 40, 81, 21)
$i_text = GUICtrlCreateInput("Hotkey_Test", 160, 40, 81, 21)
$Label = GUICtrlCreateLabel("", 72, 80, 200, 20)HotKeySet($New_hotkey, "Test_Func")
[/autoit][autoit][/autoit][autoit]GUISetState()
[/autoit][autoit][/autoit][autoit]While 1
[/autoit][autoit][/autoit][autoit]
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $i_hotkey
HotKeySet($New_hotkey)
$New_hotkey = GUICtrlRead($i_hotkey)
MsgBox(0,"Neuer HotKey",$New_hotkey)
HotKeySet($New_hotkey, "Test_Func")
EndSelect
WEndFunc Test_Func()
[/autoit]
$Text = GUICtrlRead($i_text)
MsgBox(0,"",$Text)
GUICtrlSetData($Label, $Text)
EndFunc -
#include <GUIConstantsEx.au3>
$Hotkey_Variable = "{F11}"
HotKeySet($HotKey_Variable, "Test")$Form2 = GUICreate("Form2", 413, 298, 303, 219)
$i_hotkey = GUICtrlCreateInput("F11", 72, 40, 81, 21)GUISetState()
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEndFunc Test()
;~ send ("Hotkey_Test")
;~ oder besser
GUICtrlSetData($i_hotkey, "Hotkey_Test")
EndFunc -
Ich würde den Befehl ControlGetFocus verwenden. Sollte funktionieren!
-
HotKeySet("s", "bla")
While 1
Sleep(10)WEnd
Func bla()
MsgBox(64,"","Du hast 's' gedrückt.")
EndFuncOhne Schleife beendet sich das Programm sofort wieder.
-
Anstelle von
MouseClick("left", [X-Koordinate], [Y-Koordinate], 1, 0)
solltest du
ControlClick("Titel","Text", "ControlID")
verwenden. Die ControlID erhälst du über das Autoit-Info-Tool.