-
Posts
5,298 -
Joined
-
Last visited
-
Days Won
174
argumentum last won the day on November 15
argumentum had the most liked content!
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
argumentum's Achievements
-
argumentum reacted to a post in a topic: WinSockUDF - TCP/UDP Networking Library for AutoIt -
WinSockUDF - TCP/UDP Networking Library for AutoIt
argumentum replied to Trong's topic in AutoIt Example Scripts
Forum in dark theme: vs. Dark Reader extension: So yeah, I use the default forum theme with the DarkReader extension that does what @Trong say the forum should have done for it's dark theme. 🤷♂️ -
WildByDesign reacted to a post in a topic: WinSockUDF - TCP/UDP Networking Library for AutoIt -
WinSockUDF - TCP/UDP Networking Library for AutoIt
argumentum replied to Trong's topic in AutoIt Example Scripts
If this forum had better themes and more formatting options I would agree but unfortunately none of that is there and a user is somewhat limited. On the other hand this post was formatted by AI and he just pasted it. Maybe pasting without formatting would do what you ask but would loose much of it's nice looking presentation. P.S.: It suck to come from the future @WildByDesign and having to wait for the past to catch up -
WildByDesign reacted to a post in a topic: WinSockUDF - TCP/UDP Networking Library for AutoIt -
WinSockUDF - TCP/UDP Networking Library for AutoIt
argumentum replied to Trong's topic in AutoIt Example Scripts
-
WinSockUDF - TCP/UDP Networking Library for AutoIt
argumentum replied to Trong's topic in AutoIt Example Scripts
.... ok @WildByDesign, good luck ? If you're gonna go "hard core dark mode" you're gonna have to "fix" those on your own. -
WildByDesign reacted to a post in a topic: WinSockUDF - TCP/UDP Networking Library for AutoIt -
WinSockUDF - TCP/UDP Networking Library for AutoIt
argumentum replied to Trong's topic in AutoIt Example Scripts
Poor coding does Change what you need 🤯 -
ntfy (notify) yourself and/or everyone
argumentum replied to argumentum's topic in AutoIt Example Scripts
The max. topic name is 65 characters in ntfy. The max. char viewable in the WebUI is about 18 char. That means that you can have a topic that shows the name, and a hidden randomness added to it. And lets say that you'd like to change the unique random part of the topic makes impossible to guess but for you to be able to calculate. Topics like these: Testing_AutoIt_script______NBlR3rhNisx0Wz4NAWkGbgLWwqmiC5Mowncgke Testing_AutoIt_script______mTTKMjxeZoP3f2VtMU8M5x1Zn3y5OdmVmQfJdY Testing_AutoIt_script______hGUseiM3rlxFnrhzaFizYj1JjClxBEyAtIi19p Testing_AutoIt_script______C6USjfsYrgOrPQqp7U0DEkgvkiMXDLgSxKRTdp Testing_AutoIt_script______fm8GAGVEXcsuIKe2WTzMM922h4GL5CdqyHxkzn Testing_AutoIt_script______ZhbeFm92lm7OZdnkH7LsZDkqWYfHit4FH10imx that has that random part of it and, can be calculated by you by knowing the variables that creates it -
argumentum reacted to a post in a topic: WinRT - UI Gallery (Xaml Islands) -
argumentum reacted to a post in a topic: A simple fast IPC based on Windows Messaging -
ioa747 reacted to a post in a topic: ntfy (notify) yourself and/or everyone -
argumentum reacted to a post in a topic: WinCred UDF - Windows Credential Management API - How would you like to run: curl -d "Finished running my script. All good." ntfy.sh/Testing_AutoIt_script or ConsoleWrite(ntfy_send("**All good**, all the time 😃") & @TAB & @error & @TAB & @extended & @CRLF) Func ntfy_send($sMsg, $sTopicName = "Testing_AutoIt_script") Local Static $iErr = 0, $oErr, $sUrl = "https://ntfy.sh/" & $sTopicName If IsObj($sMsg) Then If $sMsg.retcode Then $iErr = "0x" & Hex($sMsg.retcode, 8) Return EndIf If ObjEvent("AutoIt.Error") = "" Then $oErr = ObjEvent("AutoIt.Error", "ntfy_send") Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $sUrl, False) ; Open the connection using POST method (synchronous = False) $oHTTP.SetRequestHeader("Markdown", "yes") ; Set Markdown ON $oHTTP.SetRequestHeader("Tags", "heavy_check_mark,PC:" & "@ComputerName") ; https://docs.ntfy.sh/publish/#tags-emojis $oHTTP.Send($sMsg) ; Send the request If ObjEvent("AutoIt.Error") = "ntfy_send" Then $oErr = ObjEvent("AutoIt.Error", "") If $iErr Then Return SetError(2, $iErr, "oHTTP.Send FAILED") Return SetError(Int($oHTTP.Status <> 200), $oHTTP.Status, ($oHTTP.Status = 200 ? StringReplace($oHTTP.ResponseText, @LF, "") : $oHTTP.StatusText)) EndFunc ;==>ntfy_send and be notified in your phone, browser or ...basically any possible way ?!, meet ntfy.sh 🤩 Ok. How would you like to have your own AutoIt receiver for these notifications 🤯 For that you'll need the curl DLL, the curl UDF and something like this: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Opt("TrayAutoPause", 0) ; Script pauses when click on tray icon = OFF/0 Opt("TrayOnEventMode", 0) ; Enable/disable OnEvent functions notifications for the tray = OFF/0 Opt("GUICloseOnESC", 0) ; When ESC is pressed on a GUI the $GUI_EVENT_CLOSE message is sent = ON/1 If Not FileGetSize(@ScriptDir & '\curl-ca-bundle.crt') Then MsgBox(262144 + 64, @ScriptName, "The curl stuff needs to be in the same folder for this example", 30) Exit EndIf If Not @AutoItX64 Then MsgBox(262144 + 64, @ScriptName, "It needs to run x64", 30) Exit EndIf #include "Curl.au3" ; https://www.autoitscript.com/forum/topic/207859-curl-udf-libcurl-with-x64-support #include <GuiEdit.au3> ;_GUICtrlEdit_AppendText() ; GUI stuff #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 565, 425) Global $Group1 = GUICtrlCreateGroup("MyTopic", 8, 8, 305, 49) Global $Input1 = GUICtrlCreateInput("Testing_AutoIt_script", 16, 24, 281, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Button1 = GUICtrlCreateButton("Gather all in cache", 320, 16, 131, 25) Global $Button2 = GUICtrlCreateButton("Listen ( start )", 464, 16, 91, 25) Global $Group2 = GUICtrlCreateGroup("Dump", 8, 96, 545, 321) Global $Edit1 = GUICtrlCreateEdit("", 16, 120, 529, 289) GUICtrlCreateGroup("", -99, -99, 1, 1) Global $Label1 = GUICtrlCreateLabel("last ""keepalive""", 8, 64, 548, 33, $SS_CENTER) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $g_nfty_CurlPeeked, $g_nfty_ListenStop = 1 Global $__g_nfty_RunningHandles, $__g_nfty_Curl = 0, $__g_nfty_Multi = 0 OnAutoItExitRegister(nfty_Listen_Cleanup) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE If $g_nfty_ListenStop = 1 Then GUIDelete() Exit EndIf GUICtrlSetState($Button2, $GUI_DISABLE) GUICtrlSetData($Button2, "Listen ( stoping )") $g_nfty_ListenStop = 2 Case $Button1 $g_nfty_ListenStop = 0 nfty_Listen_Start(GUICtrlRead($Input1), "?poll=1&since=all") nfty_Listen_Perform() Case $Button2 If $g_nfty_ListenStop Then GUICtrlSetState($Button1, $GUI_DISABLE) GUICtrlSetState($Button2, $GUI_DISABLE) $g_nfty_ListenStop = 0 GUICtrlSetData($Button2, "Listen ( starting )") nfty_Listen_Start(GUICtrlRead($Input1)) If @error Then $g_nfty_ListenStop = 1 GUICtrlSetData($Button2, "Listen ( start )") GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetState($Button2, $GUI_ENABLE) Else GUICtrlSetData($Button2, "Listen ( stop )") GUICtrlSetState($Button2, $GUI_ENABLE) EndIf Else GUICtrlSetState($Button2, $GUI_DISABLE) GUICtrlSetData($Button2, "Listen ( stoping )") $g_nfty_ListenStop = 2 EndIf EndSwitch Switch $g_nfty_ListenStop Case 1 ; was never running ContinueLoop Case 0 ; not stopped - is running nfty_Listen_Perform() Case 2 ; request to stop nfty_Listen_Cleanup() $g_nfty_ListenStop = 1 GUICtrlSetData($Button2, "Listen ( start )") GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetState($Button2, $GUI_ENABLE) EndSwitch WEnd Func nfty_Listen_Start($sTopic, $suffix = "") $__g_nfty_Curl = Curl_Easy_Init() If Not $__g_nfty_Curl Then $g_nfty_ListenStop = 0 Return SetError(1, 0, 1) EndIf Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_URL, "https://ntfy.sh/" & $sTopic & "/json" & $suffix) ;~ Curl_Easy_Setopt($Curl, $CURLOPT_USERAGENT, "AutoIt/Curl") Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_FOLLOWLOCATION, 1) Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_ACCEPT_ENCODING, "") Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_WRITEFUNCTION, Curl_DataWriteCallback_nfty()) Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_WRITEDATA, $__g_nfty_Curl) Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_TCP_KEEPALIVE, 1) If $suffix Then Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_TIMEOUT, 10) ; 10 sec timeout ;peer verification curl_easy_setopt($__g_nfty_Curl, $CURLOPT_CAINFO, @ScriptDir & '\curl-ca-bundle.crt') ; ;~ Curl_Easy_Setopt($__g_nfty_Curl, $CURLOPT_SSL_VERIFYPEER, 0) $__g_nfty_Multi = Curl_Multi_Init() If Not $__g_nfty_Multi Then $g_nfty_ListenStop = 0 nfty_Listen_Cleanup() Return SetError(2, 0, 2) EndIf Curl_Multi_Add_Handle($__g_nfty_Multi, $__g_nfty_Curl) EndFunc ;==>nfty_Listen_Start Func nfty_Listen_Perform() Local Static $MsgsInQueue, $hTimer = 0 If TimerDiff($hTimer) < 100 Then Return ; no need to ask so often $hTimer = TimerInit() ; let's restart the timer Curl_Multi_Perform($__g_nfty_Multi, $__g_nfty_RunningHandles) Local $CURLMsg = Curl_Multi_Info_Read($__g_nfty_Multi, $MsgsInQueue) If DllStructGetData($CURLMsg, "msg") = $CURLMSG_DONE Then Local $__g_nfty_Curl = DllStructGetData($CURLMsg, "easy_handle") Local $Code = DllStructGetData($CURLMsg, "data") If $Code = $CURLE_OK Then ;~ ConsoleWrite('@@(' & @ScriptLineNumber & ') : ' & @MIN & ':' & @SEC & '.' & @MSEC & @TAB & "Content Type: " & Curl_Easy_GetInfo($__g_nfty_Curl, $CURLINFO_CONTENT_TYPE) & @LF) ;~ ConsoleWrite('@@(' & @ScriptLineNumber & ') : ' & @MIN & ':' & @SEC & '.' & @MSEC & @TAB & "Download Size: " & Curl_Easy_GetInfo($__g_nfty_Curl, $CURLINFO_SIZE_DOWNLOAD) & @LF) ;~ ConsoleWrite('@@(' & @ScriptLineNumber & ') : ' & @MIN & ':' & @SEC & '.' & @MSEC & @TAB & '- Header >' & BinaryToString(Curl_Data_Get($__g_nfty_Curl + 1)) & '<' & @CRLF) ;~ ConsoleWrite('@@(' & @ScriptLineNumber & ') : ' & @MIN & ':' & @SEC & '.' & @MSEC & @TAB & '- Html >' & BinaryToString(Curl_Data_Get($__g_nfty_Curl)) & '<' & @CRLF) Else ConsoleWrite('@@(' & @ScriptLineNumber & ') : ' & @MIN & ':' & @SEC & '.' & @MSEC & @TAB & Curl_Easy_StrError($Code) & @LF) EndIf nfty_Listen_Cleanup() $g_nfty_ListenStop = 1 EndIf EndFunc ;==>nfty_Listen_Perform Func nfty_Listen_Cleanup() If $__g_nfty_Multi Then Curl_Multi_Remove_Handle($__g_nfty_Multi, $__g_nfty_Curl) Curl_Multi_Cleanup($__g_nfty_Multi) $__g_nfty_Multi = 0 EndIf Curl_Easy_Cleanup($__g_nfty_Curl) Curl_Data_Cleanup($__g_nfty_Curl) Curl_Data_Cleanup($__g_nfty_Curl + 1) $__g_nfty_Curl = 0 EndFunc ;==>nfty_Listen_Cleanup Func Curl_DataWriteCallback_nfty() Static $Ptr = DllCallbackGetPtr(DllCallbackRegister(__Curl_DataWriteCallback_nfty, (@AutoItX64 ? "uint_ptr" : "uint_ptr:cdecl"), "ptr;uint_ptr;uint_ptr;ptr")) Return $Ptr EndFunc ;==>Curl_DataWriteCallback_nfty Func __Curl_DataWriteCallback_nfty($Ptr, $Size, $Nmemb, $Handle) Local $Length = $Size * $Nmemb, $Data = __Curl_Peek("byte[" & $Length & "]", $Ptr) $g_nfty_CurlPeeked = StringReplace(BinaryToString($Data), @LF, @CRLF) If StringInStr($g_nfty_CurlPeeked, ',"event":"open","topic":"') Or StringInStr($g_nfty_CurlPeeked, ',"event":"keepalive","topic":"') Then ; not important GUICtrlSetData($Label1, @MIN & ":" & @SEC & " >" & StringStripCR($g_nfty_CurlPeeked) & "<") Else _GUICtrlEdit_AppendText($Edit1, $g_nfty_CurlPeeked & @CRLF) EndIf Return $Length EndFunc ;==>__Curl_DataWriteCallback_nfty Do place your scripts in the bin folder where libcurl-x64.dll is at, or this example will not work as is. This is just an example. FAQ: Q: Why the curl UDF ?, why not ... A: Because "the page" never finishes the download ( and is not meant to finish ). Couldn't find a way to peek into the message other than this. Q: Can you ... A: Maybe. But am busy, and not all that good at all these. If you code that you wish it had, do share it in the forum. ( Think GPLv2 ) Q: I sent a message but my receiver script wasn't running at the time / Lost internet for X hours. A: Text messages are likely to be available for up to 12 hours ( for what I read ). Just click "Gather all in cache" in this example. Q: How can I ... A: ntfy has excellent documentation. Read it. Q: Can I make my messages private ? A: Yes you can. Read the offers they have available for the service.
-
argumentum reacted to a post in a topic: Bug in map ( and how to avoid it ) -
Bug in map ( and how to avoid it )
argumentum replied to argumentum's topic in AutoIt General Help and Support
Nice dive into it @AspirinJunkie. Since the help file states clearly that is "experimental" and basically "take it or leave it", would string only names have collisions ?, because if they don't, just avoiding integers ( that could be matching the index ) would solve the problem/bug, in using maps. - Global $g_iCount Exit test() Func test() Local $iCount = 0 ; should always be 0 For $n = 0 To 99 Main() If $iCount <> $g_iCount Then ConsoleWrite(' ' & $n & '(' & $g_iCount & ')') $iCount = $g_iCount EndIf Next ConsoleWrite(@CRLF) EndFunc ;==>test Func Magic() $g_iCount = 0 Local $this[] $this['c'] = 11 If $this[8] Then $g_iCount += 1 ; ConsoleWrite('lol $this[8] = ' & $this[8] & @CRLF) Return $this EndFunc ;==>Magic Func Main() Local $a For $i = 0 To 99 Step 1 Magic() Dim $a = [0, 0, 0, 0, 0, 0, 0, 0, 0] $a = CopyToMap($a) Next EndFunc ;==>Main Func CopyToMap($x) Local $m[], $1 = UBound($x, 1) For $j = 0 To $1 - 1 Step 1 ;~ $m[$j] = $x[$j] ; bug $m[String($j)] = $x[$j] ; no bug Next Return $m EndFunc ;==>CopyToMap The help file states this in regards to the map functions: Warning: This feature is experimental. It may not work, may contain bugs or may be changed or removed without notice. DO NOT REPORT BUGS OR REQUEST NEW FEATURES FOR THIS FEATURE. Therefore, all we can do is avoid them. The code above shows such bug. The solution: name your maps with strings. Ok, good chat Note: @Mars shared this in a chat at https://autoit.de/ . And I did not know of it. And probably neither did you. Now you do.
-
CYCho reacted to a post in a topic: Sudden Spike in zPlayer Downloads — Any Idea Why? -
Sudden Spike in zPlayer Downloads — Any Idea Why?
argumentum replied to CYCho's topic in Developer General Discussion
...If, there are very many distributed workloads and the "master" overwhelmed itself, then you see what you just witnessed. All this is painfully stupid. More bandwidth than brains. Idea: we should offer torrents ( in a throttle ). With a bit of luck they can feed each other the files 🤪 -
Avoid "AutoIt Error" message box in unknown errors
argumentum replied to EKY32's topic in AutoIt General Help and Support
Ok, I looked at it a bit more. It fails when UPX is used. Is not the technique, is the compressor. If you must use a compressor, there are other ways, like "/ErrorStdOut" but you'd have to run 2 instances: one as a watchdog and the other as the running script. And there are nice looking scripts that are based on that idea around the forum. There are other compressors too. And even in UPX you can play around with the switches and see what works. My advise is don't use compressors. -
Avoid "AutoIt Error" message box in unknown errors
argumentum replied to EKY32's topic in AutoIt General Help and Support
The wrapper I put together ( @trancexx's code ) works just fine in 32 and 64 bit. I have not seen it fail. -
Avoid "AutoIt Error" message box in unknown errors
argumentum replied to EKY32's topic in AutoIt General Help and Support
https://www.autoitscript.com/forum/topic/154081-avoid-autoit-error-message-box-in-unknown-errors/page/4/#findComment-1547359 -
SciTE on Windows 11 Doesn't have Alt-Space Menu
argumentum replied to RichardL's topic in AutoIt Technical Discussion
You ought to see me pressing Alt + space then C. People see me doing that, and is like am a god or something Maybe Co-Pilot took it ? 🤔 -
argumentum reacted to a post in a topic: Sudden Spike in zPlayer Downloads — Any Idea Why? - #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idButton_Yes = GUICtrlCreateButton("Yes", 10, 50, 65, 25) Local $idButton_No = GUICtrlCreateButton("No", 80, 50, 65, 25) Local $idButton_Exit = GUICtrlCreateButton("Exit", 150, 50, 65, 25) ; Set GUIAccelerators for the button controlIDs, these being Ctrl + y and Ctrl + n Local $aAccelKeys[2][2] = [["^y", $idButton_Yes], ["^n", $idButton_No]] GUISetAccelerators($aAccelKeys) GUISetState(@SW_SHOW) ; Display the GUI. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE MsgBox($MB_SYSTEMMODAL, "You selected", "Close") ExitLoop Case $idButton_Yes MsgBox($MB_SYSTEMMODAL, "You selected", "Yes") ; Displays if the button was selected or the hotkey combination Ctrl + y was pressed. Case $idButton_No MsgBox($MB_SYSTEMMODAL, "You selected", "No") ; Displays if the button was selected or the hotkey combination Ctrl + n was pressed. Case $idButton_Exit MsgBox($MB_SYSTEMMODAL, "You selected", "Exit") ExitLoop EndSwitch WEnd GUIDelete() ; Delete the GUI. EndFunc ;==>Example ..is in the help file.