Leaderboard
Popular Content
Showing content with the highest reputation on 12/01/2020 in all areas
-
I had this GIF animation script, but it was kind of slow when multiple GIFs were displayed. And then Bilgus posted a framework of how to use GDI+ Cached Bitmaps. I transformed my script and was very happy of the result. Hope you like it too. I enclosed the GIF, the UDF and the example into the zip file. ps. Hope KaFu won't mind as I used his avatar in the example Version 2023-08-15 * Added support for SetOnEvent GUI, while deletion of controls happens frequently * Optimized some minor code parts * Solved a possible stack overflow issue Version 2022-12-06 * Added support to transparent GIF over window background. The type of GIF that necessitate erasure between frames. Version 2022-04-07 * Added double buffering for all GIF * Added ability to erase each frame before repainting, thru a new optional parameter. This is required when the frames do not cover the whole area, leaving a trace of the previous frame. * Added support for the usage of the Default keyword for optional parameters Version 2020-12-20 * Changed frame delays from 0 to a minimum delay to prevent CPU overload Version 2020-12-02 * Reuse empty slots left by the deletion of GIF controls * Corrected bugs Version 2020-12-01 * Added support to delete a GIF control Version 2020-11-29 * Corrected bug on unregister adlib function (thanks to PixelSearch) Included in the zip file 2 examples. One with multiple GIF. Second with transparent GIF over a window background. Cached GIF Animation.zip1 point
-
EasyCodeIt A cross-platform implementation of AutoIt Introduction: EasyCodeIt is an attempt at implementing a programming language which is backward compatible with a sub-set of AutoIt which would work across multiple platforms with many aspects being agnostic to the platform-specific differences. Currently the primarily targeted platforms are Linux and Windows, more platforms may be supported in the future as per popular demand. For example it should be easy enough to port to Unix-like platforms such as BSD and Mac with the help of maintainers who are familiar with them. The main motivation behind the creation of this project is the lack of a proper easy-to-use scripting language in Linux, while there are numerous scripting languages which natively support it, none of them are as user-friendly and easy to use as AutoIt. (The "Easy" in "EasyCodeIt" reflects this) There was a previous thread in which the project was originally started, but it got too big and the discussion is too cluttered and hard to follow for any new readers, here is the thread for those who are interested in reading it: Progress: Frontend ✅ Tokenizer 🚧 Parser (work in progress) ✅ Expressions 👷♂️ Statements (current priority) Backend ⏰ Interpreter (scheduled) I am currently working on expression parsing and syntax tree building. -- This section will be updated in the future with new progress. To stay notified 🔔 follow this thread to get update notifications (by using the "Follow" button on the top-right corner of this page) and 👁️ watch the GitHub repository to get any new activity on your feed. Code: The code is available on GitHub, please 🌟 star the project if you like it and would like to show your support, it motivates me a lot! (Also don't forget to 👍 Like this post ) Chat: I created a room in Matrix (an open-source federated chat system) for EasyCodeIt, you can join it to chat with me and others who are in the room, it might be a good way to get the latest status updates from me You can preview the room without joining, and you don't need to be connected to it 24/7 like IRC. It works a bit like Slack for those who are familiar with it. Forum: I have created a dedicated forum to post more frequent updates, possibly in their own threads to better organize the discussion. Please sign-up and follow the blog section to get updates. By the way, you can also post pretty much anything there, both technical and non-technical stuff, it is intended to be a hangout for techies but not only for them. So casual discussions, funny cat videos etc. are allowed!1 point
-
Printer Management UDF
FrancescoDiMuro reacted to jguinch for a file
Version 3.1.0
646 downloads
Here is an UDF for managing printers. Features are : - add, remove or rename a printer - add or remove a driver - add or remove a TCP/IP printer port - add or remove a LPR printer port - connect to a remote printer - enum printers and there configuration and properties - pause resume or cancel all jobs of a printer - checks if a printer exists - print a test page - set the default printer1 point -
Buttons Aiming to Unintended Targets
pixelsearch reacted to Nine for a topic
One way would be to save the control ids in a MAP array that you can delete easily after usage : #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstants.au3> Create_Main_GUI() Func Create_Main_GUI() Local $mGUI[] Local $hGUI = GUICreate("Main GUI", 200, 120) Local $idMain1 = GUICtrlCreateButton("Main 1", 0, 0, 200, 40) Local $idMain2 = GUICtrlCreateButton("Main 2", 0, 40, 200, 40) Local $idMain3 = GUICtrlCreateButton("Main 3", 0, 80, 200, 40) GUISetState() Local $aPos, $nMsg, $idKill, $aKeys While True $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_NONE ; not truly necessary, but avoid triggering Case Else for nothing Case $GUI_EVENT_CLOSE ExitLoop Case $idMain1 If Not WinExists("Secondary Window") Then $aPos = MouseGetPos() $hWindow2 = GUICreate("Secondary Window", 160, 69, $aPos[0] - 80, $aPos[1] - 10, $WS_POPUPWINDOW) $idKill = GUICtrlCreateButton("X", 0, 0, 160, 23) $mGUI["Choice 1-1"] = GUICtrlCreateButton("Choice 1-1", 0, 23, 160, 23) $mGUI["Choice 1-2"] = GUICtrlCreateButton("Choice 1-2", 0, 46, 160, 23) WinSetOnTop($hWindow2, "", $WINDOWS_ONTOP) GUISetState(@SW_SHOW, $hWindow2) EndIf Case $idMain2 If Not WinExists("Secondary Window") Then $aPos = MouseGetPos() $hWindow2 = GUICreate("Secondary Window", 160, 69, $aPos[0] - 80, $aPos[1] - 10, $WS_POPUPWINDOW) $idKill = GUICtrlCreateButton("X", 0, 0, 160, 23) $mGUI["Choice 2-1"] = GUICtrlCreateButton("Choice 2-1", 0, 23, 160, 23) $mGUI["Choice 2-2"] = GUICtrlCreateButton("Choice 2-2", 0, 46, 160, 23) WinSetOnTop($hWindow2, "", $WINDOWS_ONTOP) GUISetState(@SW_SHOW, $hWindow2) EndIf Case $idMain3 If Not WinExists("Secondary Window") Then $aPos = MouseGetPos() $hWindow2 = GUICreate("Secondary Window", 160, 69, $aPos[0] - 80, $aPos[1] - 10, $WS_POPUPWINDOW) $idKill = GUICtrlCreateButton("X", 0, 0, 160, 23) $mGUI["Choice 3-1"] = GUICtrlCreateButton("Choice 3-1", 0, 23, 160, 23) $mGUI["Choice 3-2"] = GUICtrlCreateButton("Choice 3-2", 0, 46, 160, 23) WinSetOnTop($hWindow2, "", $WINDOWS_ONTOP) GUISetState(@SW_SHOW, $hWindow2) EndIf Case $idKill GUIDelete($hWindow2) Local $mGUI[] Case Else $aKeys = MapKeys($mGUI) For $i = 0 to UBound($aKeys)-1 If $mGUI[$aKeys[$i]] = $nMsg Then MsgBox ($MB_SYSTEMMODAL,"Info", "Button " & $aKeys[$i] & " was pressed !") Next EndSwitch WEnd EndFunc Sorry I had to rewrite much of it as I cannot stand very long var names ps. I could have streamlined $idMain1 to $idMain3 as only a few numbers differs , but I will leave it to you if you want.1 point -
TheDcoder: thanks, that solved the problem. Danp2: I could not find a page which requires login and offers a file to be downloaded this way. With setting download.default_directory, it works flawlessly. Thank you both!1 point
-
Have you tried the `download.default_directory` Chrome option? You can set a default path for downloads and any downloads will go into that folder.1 point
-
Buttons Aiming to Unintended Targets
baconaise reacted to pixelsearch for a topic
If you run the script from Scite, then you can debug with ConsoleWrite() showing all control ID's. Here is what you will find : Func Do_Events_Specified_By_Which_Button_Was_Pushed() Switch @GUI_CtrlId Case $Main_GUI_Button_1 Case ... Case $Secondary_Selection_Window_Choice_2_Spawned_From_Main_GUI_Button_3 EndSwitch ConsoleWrite( _ $Main_GUI_Button_1 & " " & _ $Main_GUI_Button_2 & " " & _ $Main_GUI_Button_3 & " " & _ $Kill_Secondary_Selection_Window & " " & _ $Secondary_Selection_Window_Choice_1_Spawned_From_Main_GUI_Button_1 & " " & _ $Secondary_Selection_Window_Choice_2_Spawned_From_Main_GUI_Button_1 & " " & _ $Secondary_Selection_Window_Choice_1_Spawned_From_Main_GUI_Button_2 & " " & _ $Secondary_Selection_Window_Choice_2_Spawned_From_Main_GUI_Button_2 & " " & _ $Secondary_Selection_Window_Choice_1_Spawned_From_Main_GUI_Button_3 & " " & _ $Secondary_Selection_Window_Choice_2_Spawned_From_Main_GUI_Button_3 & " " & @CRLF) EndFunc Console result : 3 4 5 6 7 8 3 4 5 6 7 8 3 4 5 6 7 8 7 8 3 4 5 6 7 8 7 8 3 4 5 6 7 8 7 8 7 8 3 4 5 6 7 8 7 8 7 8 Id's 3, 4, 5 are always for $Main_GUI_Button_1, $Main_GUI_Button_2, $Main_GUI_Button_3 Id 6 is always for $Kill_Secondary_Selection_Window Issue comes for Id's 7 and 8 which will be soon triplicated in your function. The console result (above) shows what happens when you click in this specific order : * Main Button 3 => choice 3-1 (message box is correct) then * Main Button 2 => choice 2-1 (message box is correct) then * Main Button 1 => choice 1-1 (message box is correct) At this stage, you notice that several variables (Case) got the same value in your function and the "first" id's 7 and 8 which will be first accessed correspond to : * $Secondary_Selection_Window_Choice_1_Spawned_From_Main_GUI_Button_1 = 7 * $Secondary_Selection_Window_Choice_2_Spawned_From_Main_GUI_Button_1 = 8 Which means that from now on, all clicks on main button 2 & 3 will display wrong results. It's important to remember that deleting a GUI doesn't "blank" the variables assigned to the deleted id's I had a similar problem once with this kind of script : $hGUI_Preview = GUICreate(...) ... GUIDelete($hGUI_Preview) ... If $hGUI_Preview Then ; very bad ! It's bad because deleting the GUI doesn't blank $hGUI_Preview which still contains a value until the end of time. If one really needs the "If" test, then It can be scripted like this : $hGUI_Preview = GUICreate(...) ... GUIDelete($hGUI_Preview) $hGUI_Preview = 0 ; <============= ... If $hGUI_Preview Then ; now it's ok1 point -
The GuiDelete deletes all control ids. When you recreate them, it will take place of the empty spaces number. So in your case, it thinks it is always first main button. So you should create all secondary windows at first then hide and show appropriately. That way all control ids will have different numbers.1 point
-
I am still working on the expression parser, the code is not complete but since it has almost been a week since the last update, so I thought I'd give you guys a sneak peak Here is a screenshot with the graphical representation of an expression's parse tree: The expression is pretty simple: 1 - 2 / 3 * 4 But the final result looks complex and huge because there are multiple layers of nodes for each bit of info... all thanks to C's strict type system, where you can't put anything anywhere like you usually would in a dynamically typed language like AutoIt. Here is a snippet of the code (the expression parsing function) for those are interested: There are no doubt many bugs in there, and a lot of the stuff needs to be completed, but I will try to post weekly updates to show the progress.1 point
-
Autoit-Socket-IO - Networking in AutoIt made simple!
x_bennY reacted to tarretarretarre for a topic
Yes, or at least kindof. My next project is going to be straight up WebSockets in AutoIt. That means you could establish connections between any language that support WebSockets, Socket Io has support for websockets, so it would be possible to make a straight port of the real Socket IO But, I am working 150% with so many projects, so I dont know when I will have the time1 point -
What to look into to replace a relative spreadsheet?
Tripredacus reacted to JLogan3o13 for a topic
What about a small sqlite db? I have moved a number of scripts away from using spreadsheets to sqlite, and am able to do calculations pretty easily (depending on their complexity of course).1 point -
Several questions around the forum get asked repeatedly: How to avoid false-positive Anti-Virus detection? Answered by AutoIt god himself How to make AutoIt software safe from hacking? How to prevent AutoIt software being de-compiled? How to prevent exposure of native AutoIt code? The general answers all go in the direction of (a) can't be done or (b) make it an .a3x script. The Wiki contains a single entry under "compiler directives" and the Help File contains mainly compiler info, with this note Also see this thread. So I thought I would make a little demo to actually show how it works. Here are the 2 scripts. The a3x_demo.zip file contains these 2, plus the compiled .a3x file and the .EXE The body #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_type=a3x #AutoIt3Wrapper_Outfile=a3x_demo.a3x #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: Skysnake Script Function: Demonstates working of a3x Instructions Code as normal Set Compiler option to .a3x as per Help File Compile Note output is (a) .a3x file, (b) now compile wrapper to make .exe file The compiled .a3x is included inside the .exe. To demonstrate, copy .exe to any new location and run. :) #ce ---------------------------------------------------------------------------- ; Script Start #include <MsgBoxConstants.au3> MsgBox($MB_SYSTEMMODAL, "a3x demo", "This message box is called from an a3x pre-compiled script " & @CRLF & "will timeout after 10 seconds or select the OK button.", 10) ; code ends The wrapper #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=a3x_wrapper.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: Skysnake Script Function: Wrapper for .a3x demo the INCLUDE line below forces the .a3x to be included in the new .EXE other option is to use FileIsntall and then run the a3x_demo.a3x as an external file NOTE: required in order are the following steps 1. body .au3 script 2. compile body .au3 as .a3x file, include in wrapper 3. wrapper .au3 script, to become the .exe -> compile as .EXE #ce ---------------------------------------------------------------------------- ; Script Start - #include "a3x_demo.a3x" ; code ends DOWNLOAD: The ax3_demo.zip file EDIT: 2016.07.08 Fixed typos1 point