Na dann muss ich mal gucken, ob ich noch was finde ![]()
Beiträge von Xenobiologist
-
-
Hi,
sowas sollte auch gehen:
[autoit]#include <Array.au3>
[/autoit][autoit][/autoit][autoit]
Global $re = _getDOSOutput('assoc')Global $fileExtension_A = StringRegExp($re, '\.(.*)=', 3)
[/autoit][autoit][/autoit][autoit]
Global $file_A = StringRegExp($re, '=(\S*)', 3)
Global $assoc_A[UBound($fileExtension_A)][2]For $i = 0 To UBound($fileExtension_A) -1
[/autoit][autoit][/autoit][autoit]
$assoc_A[$i][0] = $fileExtension_A[$i]
$assoc_A[$i][1] = $file_A[$i]
Next
_ArrayDisplay($assoc_A)Func _getDOSOutput($command)
[/autoit]
Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4)
While 1
$text &= StdoutRead($Pid, False, False)
If @error Then ExitLoop
Sleep(10)
WEnd
Return $text
EndFunc ;==>_getDOSOutputMega
-
Hi,
naja das führt auch dazu, dass du eigentlich noch sowas einbauen müßtest.
$aFiles[$aFiles[0]] = StringTrimRight($aFiles[$aFiles[0]], 1), da sonst diese [] dargestellt wird.
Mega
-
-
Edit peethebee: Link einvernehmlich entfernt.
-
Hi,
programmier einfach ein kleines Spiel. Denk an Brettspiele oder Logikspiele. Z.B. Solitär oder sowas.
Mega
-
Hi,
das ist völlig egal. Normalerweise solltest du einen \ benutzen. Aber du kannst auch mehrere oder auch normale / benutzen
[autoit]$p = 'c:\Downloads\\\AutoIt-Skripte//Entwicklung\ForumTests/Times.txt'
[/autoit]
$file = FileOpen($p, 0)
$fileContent = FileRead($file)
MsgBox(0,0, $fileContent)Mega
-
Gaaaanz ruhig. Was ist dein Problem?
-
Hi,
zeig mal den gesamten code. Da liegt ein Logikproblem vor.
Mega
-
Hi,
warum so kompliziert? Wenn du die Datei selbst erstellst, dann weißt du doch wie sie heißt. Ansonsten einfach _FileListToArray mit Filter ini.
Mega
-
Spoiler anzeigen
[autoit]#include <WindowsConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
HotKeySet("{ESC}", "_end")Global $start = MouseGetPos()
[/autoit] [autoit][/autoit] [autoit]$gui = GUICreate("GUI", 30, 30, $start[0] - 15, $start[1] - 15, $WS_POPUP, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
GUISetBkColor(0x00FF00)_GUICreateInvRect($gui, 5, 5, 20, 20)
[/autoit] [autoit][/autoit] [autoit]
GUISetState()While 1
[/autoit] [autoit][/autoit] [autoit]
Sleep(10)
$now = MouseGetPos()
WinMove($gui, "", $now[0] - 15, $now[1] - 15)
WEndFunc _GUICreateInvRect($hwnd, $l, $t, $w, $h)
[/autoit] [autoit][/autoit] [autoit]
$pos = WinGetPos($hwnd)
$1 = 0
$2 = 0
$3 = $pos[2]
$4 = $t
$ret = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
$1 = 0
$2 = 0
$3 = $l
$4 = $pos[3]
$ret2 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
$1 = $l + $w
$2 = 0
$3 = $pos[2]
$4 = $pos[3]
$ret3 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
$1 = 0
$2 = $t + $h
$3 = $pos[2]
$4 = $pos[3]
$ret4 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret2[0], "int", 2)
[/autoit] [autoit][/autoit] [autoit]
DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret3[0], "int", 2)
DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret4[0], "int", 2)
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hwnd, "long", $ret[0], "int", 1)
EndFunc ;==>_GUICreateInvRectFunc _end()
[/autoit]
Exit(0)
EndFunc -
Versuch erstmal ob sowas sichtbar ist.
[autoit]#include<WinAPI.au3>
[/autoit]
While 1
ToolTip('x : ' & _WinAPI_GetMousePosX() & " y : " & _WinAPI_GetMousePosY())
Sleep(10)
WEndMega
-
Spoiler anzeigen
[autoit]main()
[/autoit]
Func OnAutoItStart()
Opt("MustDeclareVars", 1)
EndFunc ;==>OnAutoItStart
Func main()
Local Const $S_CD = "D:"
Local $as_cdc = ""
_CDChanged($S_CD, $as_cdc)
While 1
_CDChanged($S_CD, $as_cdc)
Switch $as_cdc[0]
Case 1
ConsoleWrite($S_CD & " (Tray closed)" & @CR)
Case 2
ConsoleWrite($S_CD & " (Tray opened)" & @CR)
Case 3
ConsoleWrite($S_CD & " (Label changed)" & @CR)
EndSwitch
Sleep(500)
WEnd
EndFunc ;==>main
Func _CDChanged(Const $S_PATH, ByRef $as_cdc)
If IsArray($as_cdc) Then
ReDim $as_cdc[3]
$as_cdc[0] = 0
Local $s_tmp = DriveGetLabel($S_PATH)
If $s_tmp <> $as_cdc[1] Then
$as_cdc[0] = 3
$as_cdc[1] = $s_tmp
EndIf
$s_tmp = DriveStatus($S_PATH)
If $s_tmp <> $as_cdc[2] Then
If $s_tmp = "READY" Then $as_cdc[0] = 1
If $s_tmp = "NOTREADY" Then $as_cdc[0] = 2
$as_cdc[2] = $s_tmp
EndIf
Else
Dim $as_cdc[3] = [0, DriveGetLabel($S_PATH), DriveStatus($S_PATH) ]
EndIf
EndFunc ;==>_CDChangedSpoiler anzeigen
[autoit]; CD-ROM Status
[/autoit] [autoit][/autoit] [autoit]
#cs
Einlesen von Label und Status
wenn Status oder Label sich geändert haben, dann Meldung
#ce_checkCD('D:\', True)
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
Sleep(1000)
If _checkCD('D:\') Then
Switch _checkCD('D:\')
Case 1
ConsoleWrite("Info : opened!" & @CRLF)
Case 2
ConsoleWrite("Info : closed!" & @CRLF)
Case 3
ConsoleWrite("Info : CD gewechselt!" & @CRLF)
EndSwitch
_checkCD('D:\', True)
EndIf
WEndFunc _checkCD($drive, $start = False)
[/autoit]
If $start Then
Global $drive_label = DriveGetLabel($drive)
Global $drive_status = DriveStatus($drive)
Else
If $drive_status <> DriveStatus($drive) And $drive_status = 'READY' Then Return 1
If $drive_status <> DriveStatus($drive) And $drive_status = 'NOTREADY' Then Return 2
If $drive_label <> DriveGetLabel($drive) Then Return 3
EndIf
Return 0
EndFunc ;==>_checkCD -
Hi,
versuch doch mal sowas
Spoiler anzeigen
[autoit]Func _copyProgress($From_dir, $Dest_dir, $filter = '*.*')
[/autoit]
Local $count = 0, $dir = ""
$FileList = _FileListToArray($From_dir, $filter, 0)
If(Not IsArray($FileList)) And(@error = 1) Then SetError(-1)
ProgressOn("Copy", "Files :", "0 files")
For $i = 1 To UBound($FileList) - 1
If FileGetAttrib($FileList[$i]) = "D" Then $dir = "\*.*"
If FileCopy($From_dir & "\" & $FileList[$i] & $dir, $Dest_dir & "\", 9) Then
$count += 1
ProgressSet($count * 100 / $FileList[0], _
"From: " & $From_dir & "\" & @LF & "To: " & $Dest_dir & "\" & @LF & $FileList[$i], _
StringFormat('%05.2f', Round(($count * 100 / $FileList[0]), 2)) & " % " & @TAB & $count & "/" & $FileList[0] & " Done")
EndIf
; Sleep(1)
Next
ProgressSet(100, "Done", "Complete")
Sleep(500)
ProgressOff()
Return 1
EndFunc ;==>_copyProgressMega
-
Wie stellst du dir das denn vor? Mach doch eine eine Schleife um den Funktionsaufruf.
Mega
-
Hi,
oh der Satz war auf das Problem bezogen nicht auf deinen Post.

Mega
-
Hi,
das geht bei mir nicht. Aber so klappt es fast
[autoit]#include <Array.au3>
[/autoit]
$a = '1234567890'
$b = StringRegExp($a, '^.{' & Mod(StringLen($a), 4) & '}|\d{4}', 3)
_ArrayDisplay($b)Mega
-
Hast du meins mal getestet?
-
Ich bin auch davon ausgegangen, dass immer das Code folgt.
Mega
-
[autoit]
#include <Array.au3>
[/autoit][autoit][/autoit][autoit]
$str = 'BlaChBlahbCODEla123bla{CODE"1337"}blablablaaa{CODE"7331"}BlaChBlahbCODEla123bla{CODE"1337"}blablablaaa{CODE"7331"}bla...'$re = StringRegExp($str, '(\w+)\{CODE"(\d{4})', 3)
[/autoit]
_ArrayDisplay($re)Mega