-
Posts
7,103 -
Joined
-
Days Won
88
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by TheDcoder
-
GCD of 2 numbers to calculate screen aspect ratio.
TheDcoder replied to Belini's topic in AutoIt General Help and Support
Then we're back to the start, just take a look at the wiki article for GCD There's no simple formula but Wikipedia mentions all of the popular ones. -
GCD of 2 numbers to calculate screen aspect ratio.
TheDcoder replied to Belini's topic in AutoIt General Help and Support
Then it would just be half of the number, and you'll get a dividend of 2. -
GCD of 2 numbers to calculate screen aspect ratio.
TheDcoder replied to Belini's topic in AutoIt General Help and Support
Well, the greatest divisor of any number is the number itself, the dividend will always be 1. Here's the function Func GreatestDivisor($n) Return $n EndFunc -
GCD of 2 numbers to calculate screen aspect ratio.
TheDcoder replied to Belini's topic in AutoIt General Help and Support
Are you asking about the Greatest common divisor? There's no function for it in AutoIt but you can translate the functions in Wikipedia to AutoIt Maybe someone already did that in an UDF but I don't know of any. -
How to get IDM Download Panel HWND?
TheDcoder replied to IgImAx's topic in AutoIt General Help and Support
Not directly helpful to you but if your goal is to download videos then there are better tools out there like yt-dlp. -
I was just reminded of this. Windows 10 (and later) started shipping with curl.exe natively in 2017, so I wonder if they ship the DLL too? I don't have a Windows machine handy to check, so please let me know if you do
-
Very awesome, thank you for working on this, it will liberate us from using the CLI tool and parsing the output ourselves
-
@jchd The code is actually open-source and published as a library https://github.com/AutoItConsulting/text-encoding-detect A detailed write-up of how it works on the AutoIt Consulting website: https://www.autoitconsulting.com/site/development/utf-8-utf-16-text-encoding-detection-library/
-
JavaScript Vanilla Shopping Cart
TheDcoder replied to BalanceOfPower's topic in AutoIt Projects and Collaboration
@JLogan3o13 I am curious as well, I've noticed that we sometimes get new users who need help with programming stuff which is not related to AutoIt at all. I wonder what makes them think this is a good place to ask for help here. I am assuming this isn't a spam post, if it is then it's a very elaborate setup. Kudos to the spammer who's doing such hard work -
Cannot create sub-menu items in tray menu
TheDcoder replied to TheDcoder's topic in AutoIt GUI Help and Support
I knew it would be something so obvious 😠Thanks Subz for pointing out the error -
Hi, my code is not able to create sub-menu items in the tray: #include <TrayConstants.au3> Opt("TrayMenuMode", 1 + 2) ; No default menu and automatic checkmarks Opt("TrayOnEventMode", 1) ; OnEvent mode Opt("TrayAutoPause", 0) ; No Auto-Pause Global $g_idTrayOption_Main, $g_idTrayOption_Sub, $g_idTrayOption_Exit Tray_Initialize() Func Tray_Initialize() TraySetClick(16) $g_idTrayOption_Main = TrayCreateItem("Open sub-menu") ConsoleWrite("Main ID: " & $g_idTrayOption_Main & @CRLF) $g_idTrayOption_Sub = TrayCreateItem("Sub-menu item", $g_idTrayOption_Main) ConsoleWrite("Sub ID: " & $g_idTrayOption_Sub & @CRLF) $g_idTrayOption_Exit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, Tray_Exit) EndFunc Func Tray_Exit() Exit EndFunc While True Sleep(1000) WEnd The Sub ID for me is always 0, which according to the help file means TrayCreateItem has failed, what gives? I tried to find if there is any obvious error in my code but I cannot find any... so I need an extra pair of eyes to look at the code! Thanks for the help in advance
-
Sounds like the classic reference counting bug with cyclic references. Just curious, doesn't AutoIt already have a garbage collector which can take care of these kind of memory leaks?
-
Messed up AutoIt GUI dimensions
TheDcoder replied to TheDcoder's topic in AutoIt Technical Discussion
That won't work as I have the control's coordinates, not the absolute screen coordinates. I am using ControlGetPos function and it returns coordinates relative to the window, but it is relative to the client area. Thus my question about converting client area coordinates to actual window coordinates or screen coordinates (which can be converted into window coordinates too). -
Messed up AutoIt GUI dimensions
TheDcoder replied to TheDcoder's topic in AutoIt Technical Discussion
It works exactly like you described. My original goal was to get the coordinates relative to the window's client area itself, but that could be easily calculated with the help of this function. Thanks again -
Not a direct answer to your problem, but I recommend using an open-source program called BleachBit instead of CCleaner, it has the same functionality but it's all open source and free without adware and spyware. BleachBit even has a command-line interface that you can use directly in your script to do the cleaning, entirely skipping the window automation part.
-
Messed up AutoIt GUI dimensions
TheDcoder replied to TheDcoder's topic in AutoIt Technical Discussion
Thanks @Melba23, that does look like what I want, will report back tomorrow after I test it -
Messed up AutoIt GUI dimensions
TheDcoder replied to TheDcoder's topic in AutoIt Technical Discussion
Hello, Sorry for necro posting but I have a related issue and I think it's worth posting here instead of in another topic. So my issue is, how do I get the left and top (X and Y) values of a window's "client area" which actually contains the content? For example if a window has a title bar and a menu bar I want to offset the height of those to my relative coordinates from ControlGetPost. -
@Danp2 Right, I'd guess there is type casting happening here which converts all values to strings, and all of the values except 0 and False should turn into empty strings. In any case, doesn't look like it's possible to achieve the default behavior without using hacks like this: Func ProcessListFixed($iPID = "") If $iPID = "" Then Return ProcessList() Else Return ProcessList($iPID) EndIf EndFunc
-
I'd say it's more of an over-sight. The documentation says that it searches for a name when it is specified, so technically you did specify a name albeit it doesn't contain any words, so it doesn't match anything. Did you try with values other than an empty string? I'd suggest trying Default, 0, Null, False etc. In any case, this should be filed as a bug so that the check also takes an empty string into account.
-
Unfortunately programming doesn't quite work like that, even in the best case scenario you'd have to write code to bring it all together, there is no magical solution here. This is a misconception you have. Depending on the level of skill you have with computers you can easily get started within a couple of weeks assming you dedicate some time each day towards learning it. AutoIt is especially easy to use even for beginners. Learning to code is also a useful skill in general. Having said that, if you still don't want to take any time for learning, then there are other no code automation solutions out there, I have't used them personally so I can't help you with recommendations in that regard.
-
Absolutely agree. @goldieczr You may want to read the FREE book on AutoIt: Or if you are a visual learner, you can watch this series on YouTube: https://www.youtube.com/playlist?list=PLNpExbvcyUkOJvgxtCPcKsuMTk9XwoWum Best of luck in your coding journey
-
I'd check the double-to-integer conversion you are doing in the compare function, floating math may not function like you'd expect. An unrelated suggestion: You might wanna start with C first as it's the basis of C++ but it's a lot simpler in concept, nailing the fundamentals will really help you later in your C/C++ journey
-
WebDriver UDF - Help & Support (III)
TheDcoder replied to Danp2's topic in AutoIt General Help and Support
I don't see how CDP could help if the Chome instance isn't started with remote debugging enabled CDP itself requires remote debugging, and we also need to remember that our UDF communicates with ChromeDriver, so even if Chrome is started with correct flags, we still need ChromeDriver to be able to take control, this is something which I don't have a lot of expertise in.