-
Posts
76 -
Joined
-
Last visited
Everything posted by mucitbey
-
Hello friends, I shortened the script so that it is executable and you can see the problem more clearly. In its simplest form, Scrip copies a folder and its content to another location, and I designed a visual interface until this process is completed. What I want you to help me with is that the script works without any problems when it runs, but when the copy function starts, the movement of the visual interface stops until the "operation completed" message. How can I make the animated visual interface work until the copying process is completed and close it when the copying process is completed. I would like to thank those who can help in this matter in advance and wish you healthy days. #NoTrayIcon #include <Misc.au3> #include <Date.au3> #include <WinAPI.au3> #include <GUIConstantsEx.au3> #Include <StaticConstants.au3> #include <WindowsConstants.au3> _Singleton(@ScriptName, 0) Global Const $WS_EX_LAYERED_BIT = 0x80000 Global Const $NUM_BUTTONS = 8 Global $Gui, $Buttons[$NUM_BUTTONS] Global $currentIndex = 0 Global $direction = 1 Global $color1 = 0x000000 Global $color2 = 0xFF0000 _KnRd() Func _Send() Local $BackUp = DirCopy("D:\Music\", "C:\PDKSSS\", 1) If $BackUp = 1 Then MsgBox(0, "COMPLETED", "Copying all data Completed...", 3) Exit EndIf EndFunc Func _LED01() GUICtrlSetBkColor($Buttons[$currentIndex], $color1) $currentIndex += $direction If $currentIndex >= $NUM_BUTTONS Or $currentIndex < 0 Then $direction *= -1 $currentIndex += $direction * 2 EndIf GUICtrlSetBkColor($Buttons[$currentIndex], $color2) Local $exStyle = _WinAPI_GetWindowLong($Gui, $GWL_EXSTYLE) If $direction = -1 Then $alpha = BitShift($exStyle, -$WS_EX_LAYERED_BIT) $alpha -= 10 If $alpha <= 0 Then $alpha = 0 $exStyle = BitAND($exStyle, BitNOT($WS_EX_LAYERED)) $exStyle = BitOR($exStyle, BitShift($alpha, $WS_EX_LAYERED_BIT)) Else $alpha = BitAND($exStyle, $WS_EX_LAYERED) $alpha = BitShift($alpha, -$WS_EX_LAYERED_BIT) $alpha += 10 If $alpha >= 255 Then $alpha = 255 $exStyle = BitAND($exStyle, BitNOT($WS_EX_LAYERED)) $exStyle = BitOR($exStyle, BitShift($alpha, $WS_EX_LAYERED_BIT)) EndIf _WinAPI_SetWindowLong($Gui, $GWL_EXSTYLE, $exStyle) _WinAPI_SetLayeredWindowAttributes($Gui, 0, $alpha, $LWA_ALPHA) EndFunc Func _KnRd() $Gui = GUICreate("", 360, 100, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($Gui, 0xABCDEF, 255) $LB01 = GUICtrlCreateLabel("DATA IS SENT TO THE SERVER...", 5, 5, 350, 30, BitOR($SS_CENTER, $SS_SUNKEN, $SS_CENTERIMAGE)) GUICtrlSetFont($LB01, 16, 400, 0, "Myriad Pro") $LB02 = GUICtrlCreateLabel("PLEASE WAIT...", 5, 65, 350, 30, BitOR($SS_CENTER, $SS_SUNKEN, $SS_CENTERIMAGE)) GUICtrlSetFont($LB02, 16, 400, 0, "Myriad Pro") $ButtonX = 20 $ButtonY = 40 $ButtonWidth = 40 $ButtonHeight = 20 For $i = 0 To $NUM_BUTTONS - 1 $Buttons[$i] = GUICtrlCreateButton("", $ButtonX, $ButtonY, $ButtonWidth, $ButtonHeight) GUICtrlSetBkColor($Buttons[$i], $color1) $ButtonX += 40 Next GUISetState() AdlibRegister("_LED01", 100) AdlibRegister("_Send", 250) While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc
-
Hello, The "|" read in Value07 that I want to do about the code and sample ini file I shared. by finding the total of each data number between and creating columns in the form of R-001, R002 as much as this number, and writing each data in these columns, and writing this total value in the last total column. The number of data in Value07 can be variable, that is, "1" or "40". But other than that, Value01, 02, 03 ,04, 05, 06 are all single values. Thanks in advance to anyone who can help with this. #include <File.au3> #include <Array.au3> #include <GUIConstants.au3> Global $aArr, $aSect = "" $File = FileOpenDialog("Select ini file", @ScriptDir&"\", "(*.ini)") _FileReadToArray($File, $aArr) $gui = GUICreate("ListView", 800, 300, 80, 5) $Lview = GUICtrlCreateListView("DATE&VALUE|R-001|R-002|R-003|R-004|R-005|R-006|R-007|R-008|R-009|R-010|TOTAL", 10, 10, 780, 280) GUICtrlSetState($Lview, $GUI_DROPACCEPTED) GUISetState() For $i = 1 To $aArr[0] Step 1 GUICtrlCreateListViewItem($aArr[$i], $Lview) Next GUICtrlSendMsg($Lview, $LVM_SETCOLUMNWIDTH, 0, 100) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE 18.08.2023.ini file content
-
Open the jpg file containing the date and time.
mucitbey replied to mucitbey's topic in AutoIt General Help and Support
Hello, First of all, thank you all for your help and guidance. I solved the problem in a different way. I went back to the codes I wrote first, there was something I missed at first, when I fixed it, the problems were solved. Therefore, this procedure is no longer necessary. In short, my mistake was that I tried to write the ":" character in the filename. -
Open the jpg file containing the date and time.
mucitbey replied to mucitbey's topic in AutoIt General Help and Support
When the record is entered, it first writes the data as Date (07.08.2023) and Time (17.32.40) in an ini file, and takes a picture of the document with a webcam after saving it (07.08.2023_17.32.41.jpg). When the webcam creates a file, it records with a delay of 1 second. therefore, while matching the image file with the data in the ini program (07.08.2023) and Clock (17.32.40) it tries to merge and open the jpg file. But it can't find the file because of the delay. I also save the image with this udf. Webcam UDF -
Open the jpg file containing the date and time.
mucitbey replied to mucitbey's topic in AutoIt General Help and Support
Data is not generated in an orderly fashion. The data is recorded in an ini file with date and time data, and when this process is completed, a jpg file taken with the webcam is recorded. However, when I want to match the ini file with the jpg data, I cannot match because of the difference in the file name between the read data and the data to be retrieved, since the jpg file is usually written with a 1-2 second delay, although not always. I hope I was able to explain the problem. -
Hello, I needed your help with a code I wrote. The problem is; based on the data read and the date and time of the file to be opened. There is a difference of 1 second (very rarely 2 seconds) between the data read and the file to be opened. Let me exemplify like this. The problem "0010171588\07.08.2023_17.32.40.jpg" pops up. but sometimes the file name to be opened can be "0010171588\07.08.2023_17.32.41.jpg" due to the network write delay, then the file cannot be opened. (although very rarely it can be 010171588\07.08.2023_17.32.42.jpg) GUICtrlCreateGroup("QUIT PHOTO", 455, 280, 330, 260) GUICtrlSetFont(-1, 10, 800, 0, "Righteous") $Tim02a = StringRegExpReplace($Read24, "\A(\d*):(\d*):(\d*)", "$1.$2.$3") $Tim02b = $Read21 & "\" & $Read22 & "_" & $Tim02a & ".jpg" If FileExists($Tim02b) Then $Pict02 = GUICtrlCreatePic($Tim02b, 460, 295, 320, 240) ConsoleWrite($Tim02b & @CR) Else Local $Tim03a = StringRegExpReplace($Tim02a, "_(\d+)\.", "_" & IncrementSecond("$1") & ".") $Tim03b = $Read21 & "\" & $Read22 & "_" & $Tim03a & ".jpg" $Pict02 = GUICtrlCreatePic($Tim03b, 460, 295, 320, 240) ConsoleWrite($Tim03b & @CR) EndIf Func IncrementSecond($match) Return "_" & (Int($match) + 1) & "." EndFunc
-
He really noticed the speed in both converting and creating files. It took 2-3 seconds to convert about 850 rows of data, Great. Thanks again for your hard work.
-
You're right, it's my fault I didn't read any of the descriptions as I got excited and immediately started testing the innovations.
-
Thanks again for your interest and support. I ran into a little problem when I ran it integrated with my other programs. While your code divides in ini format, when it converts to day.month.year.ini format, it divides as (8.05.2023). Is it possible to change it to call it (08.05.2023) (ie "0" at the beginning of the day digit)? My other programs all generate the filename as (08.05.2023.ini).
-
Congratulations #ioa747 both problems solved. You're really great, I can't fault it for now.
-
Thanks for sharing, the design and visuality are very nice, it is very useful in the updates you add. But after a short trial, I detected two errors. In the Users.txt file I am using now (as 00000104=Diego MARADONA), only the data with the registration number is written to the Date ini file with the username "2". Also, Select USER shows only 29 records in the ComboBox. There are more than 100 data in the Users.txt file that I am currently using as an example.
-
#pixelsearch I did as you said, the result is as you said. Good luck with your spirit. It's nice that #ioa747 shows the check-in time and check-out time in the same column. I like this look a little more. Is it possible to change the time(input) time(output) in the listview for this script of yours?
-
I haven't had a chance to try it extensively yet, but I didn't encounter any problems in my first attempts. Your code does its job just fine.
-
Thanks #pixelsearch. Let's see how much of your redirects I can code. 😁
-
Thanks again for your attention #pixelserach and #ioa747. As always, you understood very well what I wanted to say. There was a misunderstanding caused by me only in the last part. I forgot to delete some erroneous data in the sample files I shared during the transfer. I solved this problem. So even though it is in my sample share, there is no id in the Datalar.txt file but not defined in the Users.txt file. Accordingly, the #pixelserach I tried to do solved the process. By the way, I use the Datalar.txt file in the format of the data read directly from the device, not from any database, and because the database cannot be run in the systems we use, storing the data in ini files does not cause problems in subsequent transfers and transformations. This is the correct format:
-
First of all thanks #ioa747 I'm trying to explain what I want to do. Datalar.txt dosyasındaki ilk satırı verilerini örnek olarak açıklayayım. Datalar.txt satırı örnek 001,00000098,00,1.04.2023 08:12:27 001 : Bu sütündaki veriler kullanılmayacak. 00000098 : Bu veri Users.txt dosyasında ilk sütun ile karşılaştırarak Bu ıd sahininin kullanıcı adını bulur ve [User Name] Id ise (Value01) olarak kaydedilir. 00 : Bu sütündaki veriler kullanılmıyacak. 1.04.2023 : ıd kaydına göre olunan veri tarih bilgisi (Value02) olarak kaydedilir. 08:12:27 : The time information of the id record. The first data in this figure (Value 03) is saved as a separate data in the second time data (Value04) with the same date and id. Description of the Users.txt file 00000001=Adriana Francesca Lima 00000001 : Id no Adriana Francesca Lima : Id user name I want to find the id name in the Datalar.txt file from the Users.txt file and separate this data into files in the form of day.month.year.ini according to date information. I am trying to write the id owner information in the Users.txt file but the date and time information in the Datalar.txt file, and the date information in the day.month.year.ini file and print the time information as "blank". By the way, I shared only a portion of the much longer contents of the Datalar.txt file and Users.txt files in the first prefix. The name and output of the ini file created using these two file examples should be as in the following example. 05.04.2023.ini file contains [Alessandra Corine Ambrósio] Value01=00000002 Value02=5.04.2023 Value03=07:37:11 Value04=16:58:53 [Ana Beatriz Barros] Value01=00000005 Value02=5.04.2023 Value03=Null Value04=Null [Adriana Francesca Lima] Value01=00000001 Value02=5.04.2023 Value03=07:38:17 Value04=17:11:43 [Bar Refaeli] Value01=00000005 Value02=5.04.2023 Value03=07:54:15 Value04=Null [Ana Beatriz Barros] Value01=00000004 Value02=5.04.2023 Value03=07:40:10 Value04=17:01:41 [Alyssa Miller] Value01=00000003 Value02=5.04.2023 Value03=Null Value04=16:40:08 I hope it was descriptive enough. Thanks in advance to all the members who are helping and guiding.
-
Dear admins, please delete this message. I gathered them all in one post.
-
Dear admins, please delete this message. I gathered them all in one post.
-
#include <Misc.au3> #include <File.au3> #include <Array.au3> #include <GUIConstantsEx.au3> _Singleton(@ScriptName, 0) Global $aFile,$bFile,$aAbsent _FileReadToArray("Datalar.txt", $aFile, $FRTA_NOCOUNT) _FileReadToArray("Users.txt", $bFile, $FRTA_NOCOUNT, "=") Global $iLines = UBound($aFile) GUICreate("_ank_ File Splitting", 430, 500, -1, -1) $lv = GUICtrlCreateListView("CART ID |DATE |TIME-1 |NAME AND SURNAME ", 10, 10, 410, 480) $sDate = '' For $i = 0 To $iLines - 1 $aTemp = StringSplit($aFile[$i], ", ", $STR_NOCOUNT) $user = GetUser($aTemp[1]) $sLine = $aTemp[1] &"|"& $aTemp[3] &"|"& $aTemp[4] &"|"& $user GUICtrlCreateListViewItem($sLine, $lv) If $aTemp[4] > "08:10:00" And $aTemp[4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $sDate <> $aTemp[3] Then $sDate = $aTemp[3] If IniRead(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01","Non-existing key") = "Non-existing key" Then IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1]) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3]) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4]) Else IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value04",$aTemp[4]) EndIf Next $aAbsent = _ArrayFindAll($bFile, 0, Default, Default, Default, Default, 2) For $i = 0 To UBound($aAbsent) - 1 GUICtrlCreateListViewItem($bFile[$aAbsent[$i]][0] &"|"& $aTemp[3] &"|"& "Empty" &"|"& $bFile[$aAbsent[$i]][1], $lv) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$bFile[$aAbsent[$i]][0]) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$sDate) Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd Func GetUser($ID) $iIndex = _ArraySearch($bFile, $ID) If $iIndex <> -1 Then Return $bFile[$iIndex][1] Else Return "" EndIf EndFunc Hello guys, I need your help as I can't solve a problem again. What I'm trying to do is to save this person and the date as "Empty" if there is no data of that user in the file that is recorded in the User.txt file but separated as a date. Listwiew also takes only the latest date, does not take other dates and does not save this information in the ini file. I hope I was able to explain my problem with my bad English. One more thing I would like to point out, the format of the Datalar.txt file cannot be changed. I wonder if things would be easier if we changed the Users.txt file to Users.ini format? Example: Users.ini
-
Many thanks for your help @pixelsearch. I also asked this question to artificial intelligence yesterday, after two hours of mutual conversation, it turned into a ridiculous code that had nothing to do with the script I gave and started giving an error. This means that artificial intelligence can never replace real intelligence like you. Even I started to doubt myself, I wonder if I didn't explain exactly what I wanted. But our clever Autoit-loving friends got it right away. with a single message.
-
By finding the user name corresponding to the Card ID in the Datalar.txt file and creating a separate configuration file (For example 10.04.2023.ini) for each date read in the Datalar.txt file, you can save each compatible data to this file (Value21 with User ID). , Value22'e Date, Value23'e Entry Time, that is the first value found and Value24'e Output Time, that is, the second value it finds) For this code, it only writes the output time, that is, the last read value, as Value23, and deletes the first read value. I hope I was able to explain. Thanks in advance for your help on this.
-
That's the kind of inexperienced thing, I'm sorry. With your support, we will improve our skills. Thanks again for your help and support.
-
Hello Autoit lovers, I am trying to write the data in the Datalar.txt and Users.txt files to the ini file according to the dates by comparing the data. The problem is that it writes only 1 data per date to Date.txt file. Thank you in advance for your friends to help you. Datalar.txt Users.txt #include <Misc.au3> #include <File.au3> #include <Array.au3> #include <GUIConstantsEx.au3> _Singleton(@ScriptName, 0) Global $aFile,$bFile _FileReadToArray("Datalar.txt", $aFile, $FRTA_NOCOUNT) _FileReadToArray("Users.txt", $bFile, $FRTA_NOCOUNT, "=") Global $iLines = UBound($aFile) GUICreate("_ank_ File Splitting", 430, 500, -1, -1) $lv = GUICtrlCreateListView("KART ID |DATE |TİME |NAME AND SURNAME ", 10, 10, 410, 480) For $i = 0 To $iLines - 1 $aTemp = StringSplit($aFile[$i], ", ", $STR_NOCOUNT) $user = GetUser($aTemp[1]) $sLine = $aTemp[1] &"|"& $aTemp[3] &"|"& $aTemp[4] &"|"& $user GUICtrlCreateListViewItem($sLine, $lv) If $aTemp[4] > "08:10:00" And $aTemp[4] < "17:00:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $i = 0 Then ; sadece bir kez (1. satır => 1. tarih => 1. tarih txt dosyasını aç) $sDate = $aTemp[3] $sFilePath = @ScriptDir &'\'& $sDate &'.txt' IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1]) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3]) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4]) EndIf If $sDate <> $aTemp[3] Then ; Tarih değiştiyse => eski tarih txt dosyasını kapatın, ardından yeni tarih txt dosyasını açın $sDate = $aTemp[3] $sFilePath = @ScriptDir &'\'& $sDate &'.txt' IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value01",$aTemp[1]) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value02",$aTemp[3]) IniWrite(@ScriptDir &"\" &$sDate& ".ini",$user,"Value03",$aTemp[4]) EndIf Next GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd Func GetUser($ID) Local $iIndex = _ArraySearch($bFile, $ID) If $iIndex <> -1 Then Return $bFile[$iIndex][1] Else Return "Undefined ID" EndIf EndFunc