Jump to content

argumentum

MVPs
  • Posts

    5,872
  • Joined

  • Last visited

  • Days Won

    203

argumentum last won the day on April 14

argumentum had the most liked content!

7 Followers

About argumentum

Profile Information

  • Member Title
    ✨Universalist ✨
  • Location
    I'm in your browser now =)
  • WWW
    https://www.youtube.com/watch?v=SjwX-zMRxO0&t=5s
  • Interests
    Relax

Recent Profile Visitors

14,938 profile views

argumentum's Achievements

  1. if you resize the columns it all goes crazy
  2. _WinAPI_SetWindowSubclass($__g_hGui, $__g_pWndProc2, 2) A latent question would be: that UINT_PTR , how can I make it unique for my UDF, as to not interfere with other scripts ? can I pass TimerInit() ? 🤯 Edit: I guess something higher than 10000 as a Const, like 54437 or whatever, to be known as reserved.
  3. Am in the US. But if a VPN don't work, what @Nine said is true too. GitHub API has a rate limit (usually 60 requests per hour for unauthenticated users).
  4. ..and a hash checker for github: #include <MsgBoxConstants.au3> Local $sUrl = "https://github.com/ip7z/7zip/releases/download/26.00/7z2600-x64.exe" Local $sHash = _GetGitHubAssetHash($sUrl) If $sHash Then ConsoleWrite(@CRLF & $sHash & @CRLF) MsgBox($MB_ICONINFORMATION, "Found Hash", "Official SHA-256 Digest:" & @CRLF & $sHash) Else MsgBox($MB_ICONERROR, "Error", "Could not retrieve hash from GitHub API.") EndIf Func _GetGitHubAssetHash($sUrl) ; Parse the URL to get owner, repo, and tag Local $aMatch = StringRegExp($sUrl, "github\.com/([^/]+)/([^/]+)/releases/download/([^/]+)/([^/]+)", 3) If UBound($aMatch) < 4 Then Return "" Local $sOwner = $aMatch[0], $sRepo = $aMatch[1], $sTag = $aMatch[2], $sFile = $aMatch[3] ; Build the API URL for this release Local $sApiUrl = "https://api.github.com/repos/" & $sOwner & "/" & $sRepo & "/releases/tags/" & $sTag Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("GET", $sApiUrl, False) ; GitHub API requires a User-Agent header $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)") ; Use a real browser string ? $oHTTP.Send() If @error Then ConsoleWrite("Network Error: Could not connect to GitHub. Check your ISP/VPN." & @CRLF) Return SetError(1, @ScriptLineNumber, "") EndIf If $oHTTP.Status = 403 Then ConsoleWrite("Rate Limit Exceeded! Check: https://github.com" & @CRLF) Return SetError(2, @ScriptLineNumber, "") EndIf If $oHTTP.Status <> 200 Then Return SetError(3, @ScriptLineNumber, "") ; Use Regex to find the 'digest' for our specific filename in the JSON response ; Recent GitHub releases include a "digest" field for each asset Local $sResponse = $oHTTP.ResponseText Local $sPattern = '"name"\s*:\s*"' & $sFile & '".*?"digest"\s*:\s*"([^"]+)"' Local $aHashMatch = StringRegExp($sResponse, $sPattern, 3) If UBound($aHashMatch) > 0 Then Return $aHashMatch[0] Return SetError(4, @ScriptLineNumber, "") EndFunc
  5. ..worked for me. Are you blocked in the area were you live ?
  6. ..or just get the file ? #include <MsgBoxConstants.au3> Local $sUrl = "https://github.com/ip7z/7zip/releases/download/26.00/7z2600-x64.exe" Local $sSavePath = @ScriptDir & "\7z2600-x64.exe" If _DownloadBinaryFile($sUrl, $sSavePath) Then MsgBox($MB_ICONINFORMATION, "Success", "File downloaded successfully to:" & @CRLF & $sSavePath) Else MsgBox($MB_ICONERROR, "Error", "Failed to download the file.") EndIf Func _DownloadBinaryFile($sUrl, $sFileName) Local $oMyError = ObjEvent("AutoIt.Error", "_COMErrorFunc") Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") If Not IsObj($oHTTP) Then Return False ; Enable redirects for GitHub CDN $oHTTP.Option(6) = True $oHTTP.Option(12) = True $oHTTP.Open("GET", $sUrl, False) $oHTTP.Send() If @error Then Return False Local $iStatus = $oHTTP.Status If $iStatus >= 200 And $iStatus < 400 Then ; Use ResponseBody for binary files like .exe Local $vBinaryData = $oHTTP.ResponseBody ; Open file in Binary mode (16) + Overwrite (2) = 18 Local $hFile = FileOpen($sFileName, 18) If $hFile = -1 Then Return False FileWrite($hFile, $vBinaryData) FileClose($hFile) Return True EndIf Return False EndFunc Func _COMErrorFunc() Return ; Ignore errors to let script handle them via @error EndFunc
  7. #include <MsgBoxConstants.au3> Global $sUrl = "https://github.com/ip7z/7zip/releases/download/26.00/7z2600-x64.exe" If _CheckUrlAlive($sUrl) Then MsgBox($MB_ICONINFORMATION + $MB_SYSTEMMODAL, "Success", "URL is alive: " & @extended) Else MsgBox($MB_ICONERROR + $MB_SYSTEMMODAL, "Error", "URL is dead or inaccessible") EndIf Func _CheckUrlAlive($sUrl) Local $oMyError = ObjEvent("AutoIt.Error", "_COMErrorFunc") Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") If Not IsObj($oHTTP) Then Return False ; Enable redirects (Option 6) and HTTPS-to-HTTP transitions (Option 12) $oHTTP.Option(6) = True $oHTTP.Option(12) = True $oHTTP.Open("HEAD", $sUrl, False) $oHTTP.Send() If @error Then Return False Local $iStatus = $oHTTP.Status Return SetError(0, $iStatus, ($iStatus >= 200 And $iStatus < 400)) EndFunc Func _COMErrorFunc() ; This function runs automatically if a COM error occurs ConsoleWrite("COM Error Intercepted!" & @CRLF) Return EndFunc 🤔
  8. ...and the other file too 🤔 These declarations ( $_g__Style_Gui ) would benefit from standardizing the globals to avoid collisions with other sources/scrips and unlikely to be used by a user.
  9. Yes please do. And the version thing too ( for debugging )
  10. I was looking at the code and saw Global $hGdi32Dll = DllOpen("gdi32.dll") then am like hmm, the GDI UDF uses Global $__g_hGDIPDll = 0 You could use $__DM_g_hDllGdi32. That way it complies with everything as far as been "internal use only", and of the DM UDF "signature", and type, and easily searchable because all the internal globals start with the same unique "$__DM_g_". The "hDll" shows that is a DLL, so $__DM_g_hDllName also makes it easier to see. Is a simple global replace in any coding editor. Also adding $__DM_g_Version = "1.2.3.4" gives a way to know the version via code in a helper function MyUdfVersion() You're giving us a very good looking UDF. Works quite nice. Thanks
  11. You could use something like I did with OSLangCodes because JS will run in the help file
  12. update your Microsoft Visual C++ Redistributable and that should fix it.
  13. ...nice hmmm, should we ask to "fix" AutoIt3 to work with emoji ? ( make a trac entry ) because ..., I was expecting ChrW() to give me the whole enchilada but I have to be aware of stuff I don't understand as a scripter 🤔 Programmers know about bitwise stuff and what a surrogate is, but me.. 🤷‍♂️ @jpm what do you think ? ( because it would fall into your lap anyway )
  14. It don't show as intended in my PC: 25H2 26200.8039 Windows Feature Experience Pack 1000.26100.300.0
  15. ... I believe that after v0.8.6 the code broke the bottom right corner resize thing. If you minimize the examples and restore it, you'll see that you can now resize the GUI 😕
×
×
  • Create New...