
Tersion
Active Members-
Posts
31 -
Joined
-
Last visited
Everything posted by Tersion
-
Close old instance and restart script
Tersion replied to Scoox's topic in AutoIt General Help and Support
Scoox, About 'ghost' icon in a tray - maybe would help using #NoTrayIcon ? -
Not able to take the Screenshot - (Moved)
Tersion replied to mdd's topic in AutoIt General Help and Support
mdd, And if you follow by the path (through Windows Explorer) you indicated in _ScreenCapute(" C:\Users\7000017413\Documents\screencapture\GDIPlus_Image1.png ") call , you can see the image file? You could change slightly this part of your code to see if _ScreenCapute return True or some error occur (the result will be shown in console): ;... Local $bReturn $bReturn = _ScreenCapture_Capture("C:\Users\7000017413\Documents\screencapture\GDIPlus_Image1.png") ConsoleWrite($bReturn & @CRLF & @error & @CRLF) ;... -
Scoox, Nice question! I'm same new to AutoIt and for a while wondering about this Sleep() tricks in empty While loops. Melba23 and FrancescoDiMuro, Thanks for explanations about what going on under the hood!
-
Here the this wiki page with list of available UDFs for data compression. For my tasks I only need ZIP support, so I started looking at pure AutoIt UDFs without any 3rd party dlls. And found out that most of available realizations uses standard ("native method") Windows dll - "zipfldr.dll". So for now I chose ZIP UDF by wraithdu. I've tested it on Windows 7 (x64) and it seem works fine. But here the comment from another topic where user says that Windows 10 discontinued support of "zipfldr.dll". Now I confused. I don't have around any Windows 10 machine to tested it. So maybe someone could confirm or deny that? Or maybe would better to switch to UDF with 7zip dll? I need an advice...
-
InetClose() hang program for several seconds...
Tersion replied to Tersion's topic in AutoIt General Help and Support
pixelsearch, YES YES YES !!! I found out why I get problems with this downloads. By default in Windows 7 (don't know, maybe in more late versions too) max connection per ONE server is only 2. As I can assume InetGet somehow related to Windows system settings and that's why it's allow only 2 simultaneous downloads with followed problematic 0 bytes downloads. So I started search how to increase this value and found out, that this Windows Register Keys do the trick: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "MaxConnectionsPer1_0Server"=dword:00000010 "MaxConnectionsPerServer"=dword:00000010 This parameters increase max connections per ONE server to 10, so now I just could handle in my scripts this number of connections and do not come across with this 0-bytes downloads troubles! This info needs to be added to InetGet() help reference! I'm so happy to figure out this thing! P.S. Here the .gif where I'M THE LORD OF MY DOWNLOADS! -
InetClose() hang program for several seconds...
Tersion replied to Tersion's topic in AutoIt General Help and Support
pixelsearch, Thanks for that constructive rework of my example! Now it's more clearer. I need more practice to handle that type of code-thinking. And for "==" vs "=" also. I check language reference and you are right! What about $Result = InetClose($hDownload[$i]) - you can check this topic. For some reason it always return False. So I don't know if it appropriate for checking if handle of download is valid. You say: " ... so maybe the InetClose() function shouldn't be used when your download returns 0 bytes (?) ". I also think about that, but why then InetClose() nevertheless executes of download termination? After 10 sec but still... And no @error's anywhere. And that: ; part of the online example, topic InetGetInfo : ; ... ; Retrieve details about the download file. Local $aData = InetGetInfo($hDownload) If @error Then FileDelete($sFilePath) Return False ; If an error occurred then return from the function and delete the file. EndIf ; Close the handle returned by InetGet. InetClose($hDownload) ; ... " Why the handle was not closed in the example when something went wrong ? " Very good remark! Now I also ask myself the same question... Ok, if I would don't use InetClose() for 0 bytes downloads, how can I terminate them then? Also I've checked all available InetGetInfo optional data for 0 bytes download: $INET_DOWNLOADREAD - 0 $INET_DOWNLOADSIZE - 0 $INET_DOWNLOADCOMPLETE - False $INET_DOWNLOADSUCCESS - False $INET_DOWNLOADERROR - 0 $INET_DOWNLOADEXTENDED - 0 And must admit that after changing "==" to "=", If statement True every loop and I get the same result of InetGetInfo() before InetClose() and after handle of 0 bytes download is closed. -
InetClose() hang program for several seconds...
Tersion replied to Tersion's topic in AutoIt General Help and Support
Here slightly modified version of previous script. Now it informs in console how many KB is downloaded before InetClose() call... #include <InetConstants.au3> Local $hDownload_1, $hDownload_2, $hDownload_3 Local $iStep = 0 Local $aFileName[3] = ["\1-BigBuckBunny_320x180.mp4", "\2-BigBuckBunny_640x360.m4v", "\3-big_buck_bunny_720p_stereo.ogg"] $hDownload_1 = InetGet("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", @ScriptDir & $aFileName[0], $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) $hDownload_2 = InetGet("http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v", @ScriptDir & $aFileName[1], $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) $hDownload_3 = InetGet("http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_stereo.ogg", @ScriptDir & $aFileName[2], $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) Sleep(5000) ConsoleWrite("Download 1: " & InetGetInfo($hDownload_1, $INET_DOWNLOADREAD) / 1024 & "KB while downloaded and still ongoing..." & @CRLF) ConsoleWrite("Download 2: " & InetGetInfo($hDownload_2, $INET_DOWNLOADREAD) / 1024 & "KB while downloaded and still ongoing..." & @CRLF) ConsoleWrite("Download 3: " & InetGetInfo($hDownload_3, $INET_DOWNLOADREAD) / 1024 & "KB while downloaded and still ongoing..." & @CRLF) Do If InetGetInfo($hDownload_1, $INET_DOWNLOADREAD) == 0 Then ConsoleWrite("Waiting - $hDownload_1 is closing!" & @CRLF) $iTimer = TimerInit() InetClose($hDownload_1) ConsoleWrite("It took: " & Round(TimerDiff($iTimer)) & "ms" & @CRLF) Else If InetGetInfo($hDownload_2, $INET_DOWNLOADREAD) == 0 Then ConsoleWrite("Waiting $hDownload_2 is closing!" & @CRLF) $iTimer = TimerInit() InetClose($hDownload_2) ConsoleWrite("It took: " & Round(TimerDiff($iTimer)) & "ms" & @CRLF) Else If InetGetInfo($hDownload_3, $INET_DOWNLOADREAD) == 0 Then ConsoleWrite("$hDownload_3 is closing!" & @CRLF) $iTimer = TimerInit() InetClose($hDownload_3) ConsoleWrite("It took: " & Round(TimerDiff($iTimer)) & "ms" & @CRLF) EndIf EndIf EndIf ConsoleWrite($iStep & @CRLF) Sleep(1000) $iStep += 1 Until $iStep == 10 InetClose($hDownload_1) InetClose($hDownload_2) InetClose($hDownload_3) For $i = 0 To UBound($aFileName) - 1 FileDelete(@ScriptDir & $aFileName[$i]) Next Console output: Download 1: 4807KB while downloaded and still ongoing... Download 2: 0KB while downloaded and still ongoing... Download 3: 6877KB while downloaded and still ongoing... Waiting $hDownload_2 is closing! It took: 10015ms 0 ... 9 -
InetClose() hang program for several seconds...
Tersion replied to Tersion's topic in AutoIt General Help and Support
So, I come up with more simple example of a problem with some measurements: What the script does - it's start simultaneously 3 downloads in background mode, each from one server. Wait for 5 sec to get some data from downloads. Then starts Do...Until loop with checks if one of downloads doesn't have any downloaded data: InetGetInfo($hDownload_1, $INET_DOWNLOADREAD) == 0 and then take place InetClose() which in my tests always take around 10 SECONDS !!! If you change InetGetInfo($hDownload_1, $INET_DOWNLOADREAD) == 0 to InetGetInfo($hDownload_1, $INET_DOWNLOADREAD) > 0 then you will see that InetClose() for downloads which have something downloaded already takes around 3-4 MS !!! The $iStep thing in Do...Until is just for some recall in console to see where loop stop and where he add +1 to $iStep every 1 sec. Here some output from console: If InetGetInfo($hDownload_1, $INET_DOWNLOADREAD) == 0 Waiting $hDownload_2 is closing! It took: 10016ms 0 1 ... ; slightly removed iterations for more space 8 9 If InetGetInfo($hDownload_1, $INET_DOWNLOADREAD) > 0 Waiting - $hDownload_1 is closing! It took: 5ms ... -
Strange behavior of InetClose()...
Tersion replied to Tersion's topic in AutoIt General Help and Support
mikell, Yes. Thanks that you mention about that interrupted download returns the same. It's looks like some bug, or just typo the AutoIt code. In that sort of situation it's bad that the AutoIt code is closed. I decide to create ticket in Bug Tracker. By the way, I had another problem with InetClose()... -
InetClose() hang program for several seconds...
Tersion replied to Tersion's topic in AutoIt General Help and Support
I've tried to debug, maybe some error occurs, by adding this line to UpdateDownloadInfo(): ConsoleWrite(InetGetInfo($hDownload_1, $INET_DOWNLOADEXTENDED) & @CRLF & InetGetInfo($hDownload_2, $INET_DOWNLOADEXTENDED) & @CRLF & InetGetInfo($hDownload_3, $INET_DOWNLOADEXTENDED)& @CRLF & "--" & @CRLF) I get only 0's every second from each of the downloads: 0 0 0 -- P.S. $INET_DOWNLOADEXTENDED or $INET_DOWNLOADERROR parameter in InetGetInfo() always return 0's... -
Here test example: The code is not prefect, but it's demonstrates the problem. So, when I download more than 2 files simultaneous from one server (in my example I download 3 simultaneously) by InetGet() with background option, I will get only 2 active downloads. It's seems like server limitation. The third will remain with 0 read bytes until one of the previous downloads would finished. And if I want to close this third 0 bytes read download with InetClose() I will get hang of Window GUI for several seconds! After that, the third download would be closed and everything will continue to work normally. If I InetClose() one of the active downloads with more than 0 bites read - all works fine! You can try by your self given example, or watch this .gif's: 1. Window GUI hangs when I trying to Cancel (InetClose()) download with 0 bytes read download: 2. All works as it should, when I Cancel more than 0 bytes read download: Any ideas why is it happens?
-
Here simple script: #include <InetConstants.au3> Local $hDownload $hDownload = InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @ScriptDir & "\test.txt", $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) ConsoleWrite(@error) Sleep(5000) $bReturn = InetClose($hDownload) MsgBox(0, "", $bReturn) The reference says: Return Value True: if the handle was found and closed. False: if not. But I get always: False? I guess there should be True... Why that? Something wrong? Downloaded text file open as normal. @error = 0
-
Handle GUI events when Do...Until is working.
Tersion replied to Tersion's topic in AutoIt General Help and Support
So, I come up today with next example (see .gif below) which for now implement almost all I need for multiple download support and non blocking info report every second to ListView column (using AdlibRegister method). For now this example uses classic "Message Loop" and maybe I would rewrote it to "On Event" mode, when I would get more practical skills. -
Handle GUI events when Do...Until is working.
Tersion replied to Tersion's topic in AutoIt General Help and Support
pixelsearch, Thanks for your thoughts about the problem and for the links you provided. I tested your rework of my example and it's really works nicely and looks not that bad as for understanding. I never used "On Event" mode before, but now I understand that for some tasks it's could be a solution, so I will begin to study more about how to work in this mode. -
Handle GUI events when Do...Until is working.
Tersion replied to Tersion's topic in AutoIt General Help and Support
Melba23, Oh, I see: 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Launching, automation or script interaction with games or game servers, regardless of the game. I understand that point and my previous post with a mentions of the game related things was last. But can I explain? My program just download publicly available .zip archives (which contains .vpk files inside with additional campaigns for the game) and unpack them to game folder. That's all. As I know, in licensed (Steam version) of Left 4 Dead 2 you have two legit options to install some kind of addons to the game. First - use Workshop, or second - manual copy .vpk file to addons folder. After that you manually launch the game and it's processed newly copied .vpk files. So the whole process of installing additional campaigns I cant to name: "regardless of the game". And I use second option almost from 2013. Now I want to add some automation to this process. judge of course to you (or any other moderator) if I violate forum rules, but as already I say, I understand that kind of Forum Rules and in the future I will avoid any mention of this kind and any other prohibited topics. -
Handle GUI events when Do...Until is working.
Tersion replied to Tersion's topic in AutoIt General Help and Support
Danp2, Thanks one more time! For me, your advice with AdlibRegister appeared to be simpler to incorporated to my project (mainly it's download manager for additional Left 4 Dead 2 campaigns), and now I can show simultaneously multiple progress status of downloads in ListView control column. Here the .gif: P.S. Some translation: Статус - Status Загрузить - Download Загрузка: 5% - Downloading: 5% Ожидание загрузки - Waiting for download Загружено - Downloaded -
Handle GUI events when Do...Until is working.
Tersion replied to Tersion's topic in AutoIt General Help and Support
Danp2, BrewManNH, Thanks to both of you! I will try yours suggestions in my bigger project than that example. -
Huge RAM usage with GuiListView.au3 include.
Tersion replied to Tersion's topic in AutoIt General Help and Support
JLogan3o13 and BrewManNH, Thanks both of you! I used AU3Stipper(I didn't know about that thing) like you mentioned and it's definitely WORKS! With GUIListView.au3 included, RAM usage goes down from 13 MB to 2-3 MB !!! And JLogan3o13, you mentioned that bigger question is what kind of poor equipment I use that 13 MB of memory usage is concern... I understand your point, but I'm concerned about a bit another thing. I more concerned about comparison of memory usage vs functionality of the app. For my case, app doesn't do anything rather displaying some GUI controls and takes 13 MB of memory. For my point of view, it's waist of memory, even now with availability to have 8 GB or 16 GB of RAM. And about Calc app which takes upwards of 18 MB. You may say about Windows 10 type of app? Because in my Windows 7 (x64), standard calc.exe in 'Programmer' mode uses ~7 MB of memory. So even there you can see that app (calc.exe) which has enormous functions for its type uses much less memory. -
Here test example of a dummy program with random added controls to the main form: If #include <GuiListView.au3> is commented out, then this simple program uses around 3,5 MB of RAM. When #include <GuiListView.au3> NOT commented out - RAM usage is around 13-14 MB. How can I reduce memory usage? Even if I'm not using GuiListView.au3 - 3,5 MB quite a bit for a such dummy program! I found out that using this DLLCall in main loop: DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) Significantly reduces RAM usage (even with GuiListView.au3 included, from 13-14 MB to 600 KB !!! ) but I'm not sure if it's doesn't have any impact to common workflow of a program... So, give me any advice about that, please.
-
Melba23, YES! It's works on my test example exactly like robertocm "work-around". Thanks for that fix! May I ask you, when these last fixes would be added to main release of GUIListViewEx?
-
robertocm, YOU MY HERO! I added this lines in me example as you sad after _GUIListViewEx_EventMonitor() in my main loop: Switch @extended Case 1 GUICtrlSetState($cIDEditableListView, $GUI_FOCUS) EndSwitch The solution turned out so simple - after edit, return focus to ListView control. Brilliant! Thanks!
-
Melba23, Ok, I will switch to mouse only, to feel what it's like to be normal... Just kidding! I focused on keyboard just because a such great thing like in place edit with your UDF makes me think like I'm in spread sheet editor (Excel or something), where you can moves only with keyboard. But I understand that with any UDF (not only your) you can meet restrictions with which you must be considered. So, I will be use your GUIListViewEX as it is. And will be write back if found some problem more critical for UDF usage.