Leaderboard
Popular Content
Showing content with the highest reputation on 03/24/2024 in all areas
-
I need from from time to time to run small processes to perform task that would otherwise clog the main process. Yes, there is a number of other UDF that could have done it very well, but I felt they were an over-kill for what I wanted. Don't throw me stones, I know it's not really multi-threading, but it is as close as I could get with simple AutoIt. If someone wonders why I called it PMT, the P stands for Pretending. And I'm also not pretending it is an elaborate UDF. Just small and simple to use... Version 2024-03-24 * corrected bug when 8 parameters (max) is passed to the function Example : #AutoIt3Wrapper_Res_SaveSource=y #include "PMT-UDF.AU3" #include <Constants.au3> _PMT_Init() Local $hProc1 = _PMT_Start("Test1", Default, "Test 1") _PMT_Start("Test2") _PMT_Start("Test3", 5) Local $sResponse While Sleep(50) $sResponse = _PMT_GetResponse($hProc1) If @error Then Exit MsgBox($MB_OK, "Error", "Process has dropped") If $sResponse <> "" Then MsgBox($MB_OK, "Success", $sResponse & @CRLF) ExitLoop EndIf WEnd Func Test1($sTitle, $sMessage) Local $iResp = MsgBox($MB_OK, $sTitle, $sMessage) Return "Done with value " & $iResp EndFunc Func Test2() MsgBox($MB_OK, "2", "Test 2") EndFunc Func Test3($iTimeout) MsgBox($MB_OK, "3", "Test 3", $iTimeout) EndFunc You can pass up to 8 parameters to _PMT_Start. It is up to you to manage the right number. You cannot pass structures, maps or arrays as parameter (only bool, ptr, hWnd, int, float, string, and the keyword Default). You could use my WCD-IPC if need be to exchange large amount of data. If you want to run it compiled, you need to have add #AutoIt3Wrapper_Res_SaveSource=y at the start of your script. In the case you decide to compile your script, _PMT_Init allows you to identity where AutoIt3 is located (in the situation where AutoIt is not installed in the usual directory) to get the right includes in your "threads". Let me know if you have any question, or suggestion, I will be glad to hear them. Enjoy. PMT-UDF.au32 points
-
Using ControlClick to click a program's taskbar options? Yes or no?
argumentum and one other reacted to Nine for a topic
Lol, I spent over 40 years understanding what computer science is about. Stop making wall of words and make a runable script that all we actually can run...2 points -
Unfortunately, it is not possible, AFAIK. Another way would be to move/hide the window like I did, make modifications to the window, use PrintWindow, kill the window, create a toast (guicreate) with a pic inside. BTW, Printwindow is really fast...I don't think user would notice.1 point
-
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
No clue yet. You are not familiar with CSS, neither am I. We needed a tool to find out what would work and what wouldn't, hence the "modernizr4ChmTestBed". That way, frustration of "this isn't working" is minimized. Now I ( or any willing soul ) has to make a better CSS that don't rely just on "px" measurements. This "ex" uses the size of the letter "o" or "x" to determine the size ( as far as I read so far anyway ). In any case "ex" may not work that well either. It has to be tried and tested. Another thing that I noticed is that with IE7, in the browser area there is a border, and with emulations it ain't there. So that'll need attention too.1 point -
This would be correct : #include <Date.au3> Global $nTime = _NowCalc() Global $sLastLogTime = _DateTimeFormat($nTime, 0) ConsoleWrite("--$sLastLogTime: " & $sLastLogTime & @CRLF)1 point
-
Parameter 2 of _DateTimeFormat isn't used in the correct way. Please have a look at the help file and you will understand what I'm talking about1 point
-
Another approach would be to move the window to the usual toast location and close it after 2-3 secs. Edit : made an example for the fun of it... Run("Notepad") Local $hWnd = WinWaitActive("[CLASS:Notepad]") ControlSend($hWnd, "", "Edit1", "Test") ControlSend($hWnd, "", "", "!{F4}") ; simulate a msg box While Sleep(10) $hWnd = WinGetHandle("[CLASS:#32770]") ; or title "Bloc-notes" for french Notepad If $hWnd Then ExitLoop WEnd Local $aPos = WinGetPos($hWnd) WinMove($hWnd, "", @DesktopWidth - $aPos[2] - 10, @DesktopHeight + 1) ControlHide($hWnd, "", "Button1") ControlHide($hWnd, "", "Button2") ControlHide($hWnd, "", "Button3") For $i = 15 To $aPos[3] + 50 Step 3 WinMove($hWnd, "", @DesktopWidth - $aPos[2] - 10, @DesktopHeight - $i) Sleep(10) Next SoundPlay("C:\Windows\Media\Windows Notify Messaging.wav") Sleep(2000) WinKill($hWnd) ps. changed a bit the code to make it more of toast1 point
-
1 point
-
It's the error stream: #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIConv.au3> Local $hTimer = TimerInit() AskToAI("Why is the sky blue?") ConsoleWrite("processed in: " & Round(TimerDiff($hTimer) / 1000, 3) & " seconds " & @LF) Func AskToAI($sInput) ;https://github.com/ollama/ollama/tree/main Local $iPID = Run(@ComSpec & " /c ollama run llama2", @LocalAppDataDir & "\Programs\Ollama", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD) ;~ ; Write a string to child Stdin. StdinWrite($iPID, $sInput) ;~ ; Calling StdinWrite without a second parameter closes the stream. StdinWrite($iPID) Local $sOutput = "" ; Store the output of StdoutRead to a variable. Local $sError = "" While 1 $sError &= StderrRead($iPID) $sOutput &= StdoutRead($iPID) ; Read the Stdout stream of the PID returned by Run. If @error Then ; Exit the loop if the process closes or StdoutRead returns an error. ExitLoop EndIf WEnd ConsoleWrite("The Response is: " & _WinAPI_OemToChar($sOutput) & @CRLF & @CRLF) ConsoleWrite("Error stream: " & $sError & @CRLF & @CRLF) EndFunc ;==>Example If you don't really need this data you can simply redirect the standard error stream to nul device: Local $iPID = Run(@ComSpec & " /c ollama run llama2 2> nul", @LocalAppDataDir & "\Programs\Ollama", @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD)1 point
-
that output looks like a string containing ANSI escape codes where is it displayed, on the AutoIt console or on the "ollama" console? by the way, what is "ollama" and where do you download it? ... Sorry, just saw the link in the listing ...1 point
-
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
..and, tested the chm ( from above ) in WinXP and, "CSS Font ex Units" works. So that is a solution1 point -
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
Fear not citizen for I am here I put together a CHM with "modernizr" to test stuff. The file is "modernizr4ChmTestBed_v0.0.0.3.zip". It has descriptions and links and is all very ugly looking but a good tool for discovery and learning. Edit: v0.0.0.2 has better looking links. Edit: v0.0.0.3 has more information about compatibility mode1 point -
@donnyh13 Thank you! John1 point