Jump to content

argumentum

MVPs
  • Posts

    4,663
  • Joined

  • Last visited

  • Days Won

    145

argumentum last won the day on May 30

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

Recent Profile Visitors

12,334 profile views

argumentum's Achievements

  1. The one who made this was last seen over 4 years ago and had only 9 posts. No a regular in the forum. My advise is to not use this project to avoid the flicker in your GUI.
  2. What's New in Version 0.0.0.5 Added an icon ( looks violet to me ) to show while not online on startup ( optional default ). Changed script reload to run via .lnk as otherwise I can not see the it's own icon on the Task Manager running as script. Added key combination ( Ctrl + Shift ) that when pressed, on exit will not close the window if that was default.
  3. Try this https://www.autoitscript.com/forum/index.php?showtopic=212643
  4. What's New in Version 0.0.0.4 Fixed default phython's expected folder Fixed default run and update commands Better INI file comment handling Some function refactoring.
  5. If Not FileExists(@TempDir & "\YouAreHERE") Then DirCreate(@TempDir & "\YouAreHERE") ; Run(@ComSpec & " /K @SET PROMPT=$E[32m$C$E[94m" & "$D" & "@" & "$T" & "$E[32m$F-[$E[90m$P$E[32m]$_$G$E[33m", @TempDir & "\YouAreHERE") ; date@time Run(@ComSpec & " /K @SET PROMPT=$E[32m$C$E[94m" & @UserName & "@" & @ComputerName & "$E[32m$F-[$E[90m$P$E[32m]$_$S$E[33m", @TempDir & "\YouAreHERE") May be silly but this "most awesome code™" opens a cmd in a folder without consequence and leaves a prompt with enough room to type even in long paths. For more "prompt creativity", visit https://ss64.com/nt/prompt.html Edit: made an icon for it too cmdWprompt.ico.zip
  6. What's New in Version 0.0.0.3 Added "cmdForUdate". The default is the command to update open-webui, but you can put anything there. If "cmdForUdate" is empty, the context menu will not show the option. So that's how you hide the menu entry. Added environment variables. By default sets or adds "WEBUI_AUTH=True". If you don't want it set to "WEBUI_AUTH=". To have these be applied set DoEnvSet=1 Added, given that you may not ever double click to see the window, to do something else. Added something else. There is a ExtraCmd area where you can have an extra menu entry that executes whaever you declare. For more help look in https://www.autoitscript.com/autoit3/docs/functions/ShellExecute.htm because that is what it does/runs. The default example is to open your current session of open-webui ( http://localhost:8080/?temporary-chat=true ) I did that because that's what I'll use it for. In regards to WEBUI_AUTH=False, it will bypass asking for an email/password if it never had a user in it's users DB. In python one can have a virtual environment and that keeps things neat. In the verbatim words of an AI: Why a Virtual Environment is Preferable (and why users don't know): Users, especially those new to development or specific tools, often aren't aware of the benefits of virtual environments. The "default install" often means installing directly into the system's Python environment, which can lead to: Dependency Conflicts: Different projects might require different versions of the same library. Installing globally can cause these versions to clash, breaking one or both projects. System Pollution: The global environment can become cluttered with many packages, some of which are no longer needed, making it harder to manage. Reproducibility Issues: It's harder to guarantee that a project will run the same way on another machine if its dependencies are tangled with system-wide installations. Permissions Problems: Installing globally often requires administrative privileges, which can be a security risk or an annoyance. Virtual environments (like venv in Python) solve these problems by creating isolated spaces for each project, allowing them to have their own dependencies without interfering with others. So, how do I get that venv done ? SET WEBUI_AUTH=False python -m venv C:\open-webui-venv CD /d C:\open-webui-venv\Scripts python.exe -m pip install --upgrade pip open-webui 1st line is to bypass the login. Since you're gonna use it at home might as well not have users. 2nd line is to set the venv ( virtual environment ) 3rd line is to change the working directory to the one where our new venv has the executables 4th line is to finally install the open-webui. Then you're ready to run it ( open-webui.exe serve --host 0.0.0.0 --port 8080 ) to test that it all runs. That's what these 4 lines do. What is as default in my setup is without this venv but I had no idea of it's existence until @ioa747 called my attention. We also have an update menu entry thanks to @ioa747 telling me to do it, that admittedly does come in handy as updates come in quite often as I later found out. And that, I think wraps it up.
  7. "essential to handle GUI events in GUIOnEventMode=1". Is not needed when using GUIOnEventMode. you can just: Func OnExit() ;~ ; Stop Adlib timer ;~ AdlibUnRegister("AttachToMT5") ;~ ; Close GUI ;~ GUIDelete($AllertNotify) ;~ ; Set flag to exit loop ;~ $bExit = True Exit EndFunc ..welcome to the forum
  8. Version 0.0.0.5

    22 downloads

    open-webui is a nice toy but leaves the command prompt where it runs visible and I wanted to hide it, or move it to the tray. Solution ?, code it. So here is the open-webui-ToTray I wanted. Tested just on my PC with Win11. If you need something fixed, go to the help area and we'll chat.
  9. What's New in Version 0.0.0.2 Changed the way it waits for the terminal to be ready. If the "title" in the ini file is empty, the command is used as part of the title. That opens the possibility to use this script, as is, for other commands that open windows that the user may wanna send to tray. Since icon files are preferred over those in the executable, just changing the icons and running from another folder makes this a flexible toy to have.
  10. About This File open-webui is a nice toy but leaves the command prompt where it runs visible and I wanted to hide it, or move it to the tray. Solution ?, code it. So here is the open-webui-ToTray I wanted. Not much to it, just WinSetState() to hide/show the window. Is more of an app than an example script but it'd need a place to chat about it ( if needed ) hence posting here instead of the examples area. Command parameters are: /runUpdate = to run the update command (new in v0.0.0.3) /hide = to hide overiding the ini declaration /show = to show overiding the ini declaration /exit = do one of the above and exit the tray icon, if that is what you'd like. It'll wait 2 secs before exiting. The way I use it, is with a shortcut in "shell:startup" and that runs the script that in turn, runs open-webui and then hides it to tray. If the "OI" icon in the tray area is blue it's all good, now if it's red, then the title was not found. If so, check the ini file and change what needs changing. On updates the icon is green. While the window loaded but not ready ( the page is not ready yet ) the icon is violet. Double click the tray icon to either, hide/show the terminal window or run the ExtraCmd ( set to load the web UI ). Right click for the context menu.
  11. ... If $code = $NM_DBLCLK Then ; THIS PART DOES NOT EXECUTE ON 64-BIT EXE. WHY??? If $hwFrom = $hListView Then ;~ $b_Trigger_Event_Listview_NM_DBLCLK = True AdlibRegister(_Edit_Task, 20) EndIf EndIf ... I use AdlibRegister(), and that frees the $WM_NOTIFY function. The main difference is that the code don't have to constantly evaluate in the main loop "are we there yet".
  12. @jugador, would you post an example script to show it working ?
  13. - ..is like WTF !. - Language please ! - ..but the MF won't change ! - What I mean by language is, win32 vs .NET or other languages. Everyone knows what "Hola" mean but does not mean you speak Spanish, same with ciao ( Italian ). The point is that explorer is not win32. You'd benefit from looking at it from maybe C# or the like. Thank you for reading this excerpt from the upcoming novel "I can hear but don't understand". A book about one thing or another by renown book writer @argumentum coming to an amason near you, in PDF, later this year decade century
  14. My path is where SciTE is at because this is for SciTE. So I made a folder under that path and put it there ( $(SciteDefaultHome)\SciTE_AI_Assistant\SciTE_AI_Assistant.au3 ) But am (a) forgetful, (b) lazy and (c) have VMs running SciTE everywhere. And I'll have to add the new command everywhere !. Solution ?. A script to get it done for me !. main(0) Func main($iRemoveTheCommand = 0) Local $sPath_Scite = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1)) & 'SciTE' Local $iIsSciteThere = (FileGetSize($sPath_Scite & '\SciTE.exe') ? 1 : 0) ConsoleWrite('--- SciTE exists ? >' & ($iIsSciteThere ? "YES" : "NO") & '<' & @CRLF) Local $iIsScriptThere = (FileGetSize($sPath_Scite & '\SciTE_AI_Assistant\SciTE_AI_Assistant.au3') ? 1 : 0) ConsoleWrite('--- AI_Assistant script exists ? >' & ($iIsScriptThere ? "YES" : "NO") & '<' & @CRLF) If Not $iIsScriptThere Then ConsoleWriteEm('+++ Nothing to do, script is not at "' & $sPath_Scite & '\SciTE_AI_Assistant\SciTE_AI_Assistant.au3' & @CRLF) Return EndIf If Not StringInStr($CmdLineRaw, "/ErrorStdOut ") Then Local $iRet = MsgBox(262144 + 32 + 3 + 512, @ScriptName, "" & _ "Click Yes to add it" & @LF & _ "No to remove it" & @LF & _ ; in case you jusy click-click the script "Cancel to cancel it" & @LF & _ ; outside SciTE "..you have 60 seconds to decide. Tic-toc =P", 60) Switch $iRet Case 6 ; $IDYES (6) $iRemoveTheCommand = 0 Case 7 ; $IDNO (7) $iRemoveTheCommand = 1 Case Else Return EndSwitch EndIf Local $sPropertiesFilename = $sPath_Scite & "\Properties\au3.properties" Local $aProperties = FileReadToArray($sPropertiesFilename) If @error Then ConsoleWriteEm('!!! Error reading the file, bye.' & @CRLF) Return EndIf If $iRemoveTheCommand Then $sNewPropertiesFile = sciteAiAssistant_CommandSnippet_Remove($aProperties) If @error Then ConsoleWriteEm('!!! Nothing to do, the entry was not found !' & @CRLF) Return EndIf Local $hFileOpen = FileOpen($sPropertiesFilename, 2) ; $FO_OVERWRITE (2) = Write mode (erase previous contents) If $hFileOpen = -1 Then ConsoleWriteEm('!!! FAILED to open file for re-write !' & @CRLF) Return EndIf FileWrite($hFileOpen, $sNewPropertiesFile) FileClose($hFileOpen) ConsoleWriteEm('+++ Done. All good.' & @CRLF) Return EndIf Local $iLastCommand = findLastCommand($aProperties) Local $iError = @error Local $iExtended = @extended ConsoleWrite('--- LastEntryNumber , $nArrayIndex , existed >' & $iLastCommand & ' , ' & $iExtended & ' , ' & $iError & '<' & @CRLF) If $iError Then ConsoleWriteEm('+++ Nothing to do, entry already there' & @CRLF) Return EndIf $aProperties[$iExtended] &= @CRLF & sciteAiAssistant_CommandSnippet($iLastCommand + 1) If @error Then ; not gonna happen but the AI feels better with this here =D ConsoleWriteEm('+++ something went wrong, bye.' & @CRLF) Return EndIf Local $sNewPropertiesFile = "" For $n = 0 To UBound($aProperties) - 1 $sNewPropertiesFile &= $aProperties[$n] & @CRLF Next ;~ Exit ConsoleWrite($sNewPropertiesFile) Local $hFileOpen = FileOpen($sPropertiesFilename, 2) ; $FO_OVERWRITE (2) = Write mode (erase previous contents) If $hFileOpen = -1 Then ConsoleWriteEm('!!! FAILED to open file for re-write !' & @CRLF) Return EndIf FileWrite($hFileOpen, $sNewPropertiesFile) FileClose($hFileOpen) ConsoleWriteEm('+++ Done. All good.' & @CRLF) EndFunc ;==>main Func sciteAiAssistant_CommandSnippet_Remove($aProperties) Local $iError = 0, $iSkip = 0, $sRet = "" For $n = 0 To UBound($aProperties) - 1 If $iSkip = 0 And _ StringInStr($aProperties[$n], "SciTE_AI_Assistant") And _ StringInStr($aProperties[$n], "-8<-") Then ; start $iSkip = 1 $iError += 1 ContinueLoop EndIf If $iSkip = 1 And _ StringInStr($aProperties[$n], "SciTE_AI_Assistant") And _ StringInStr($aProperties[$n], "->8-") Then ; end $iSkip = 0 $iError += 1 ContinueLoop EndIf If Not $iSkip Then $sRet &= $aProperties[$n] & @CRLF Next ;~ ConsoleWrite(@CRLF & '$iError = ' & $iError & @CRLF & $sRet & @CRLF) Return SetError(($iError = 2 ? 0 : 1), 0, $sRet) EndFunc ;==>sciteAiAssistant_CommandSnippet_Remove Func findLastCommand($aProperties) Local $aTemp, $iError = 0, $iRet = -1, $iExtended = -1 For $n = 0 To UBound($aProperties) - 1 If StringInStr($aProperties[$n], "\SciTE_AI_Assistant.au3") Then $iError += 1 If Not StringInStr($aProperties[$n], "command.") = 1 Then ContinueLoop If Not StringInStr($aProperties[$n], "=") Then ContinueLoop $aTemp = StringSplit($aProperties[$n], ".$(au3)=", 1) $aTemp = StringSplit($aTemp[1], ".", 0) For $m = $aTemp[0] To 1 Step -1 If $aTemp[$m] = Int($aTemp[$m]) And $aTemp[$m] > 0 And $iRet <= $aTemp[$m] Then $iRet = Int($aTemp[$m]) $iExtended = $n ExitLoop EndIf Next Next Return SetError($iError, $iExtended, $iRet) EndFunc ;==>findLastCommand ; ( all the comments in this function aids the AI to make sense of how it work ) Func sciteAiAssistant_CommandSnippet($iCommandIndexNumber, $sFileIsAt = "$(SciteDefaultHome)\SciTE_AI_Assistant\SciTE_AI_Assistant.au3") If Int($iCommandIndexNumber) < 5 Then Return SetError(1, 0, "") Local $sRet = "" ; string to be crated andf formated to be added to a SciTE properties file $sRet &= "# ---------- SciTE_AI_Assistant ----8<---------" & @CRLF $sRet &= "# " & $iCommandIndexNumber & " SciTE_AI_Assistant" & @CRLF ; comment line entry $sRet &= "command." & $iCommandIndexNumber & ".$(au3)=""$(SciteDefaultHome)\..\AutoIt3.exe"" """ & $sFileIsAt & """" & @CRLF $sRet &= "command.subsystem." & $iCommandIndexNumber & ".$(au3)=0" & @CRLF $sRet &= "command.name." & $iCommandIndexNumber & ".$(au3)=SciTE AI Assistant" & @CRLF ; $sFileIsAt = a full filename. Can have a SciTE constant in it. $sRet &= "command.shortcut." & $iCommandIndexNumber & ".*.au3=F10" & @CRLF ; $iCommandIndexNumber = next unused integer value to use in SciTE's menu system $sRet &= "command.save.before." & $iCommandIndexNumber & ".$(au3)=2" & @CRLF $sRet &= "# command.replace.selection." & $iCommandIndexNumber & ".$(au3)=1" & @CRLF $sRet &= "command.quiet." & $iCommandIndexNumber & ".$(au3)=0" & @CRLF $sRet &= "command.input." & $iCommandIndexNumber & ".$(au3)=$(CurrentSelection)" & @CRLF $sRet &= "# ----------->8--- SciTE_AI_Assistant ---------" Return SetError(0, 0, $sRet) ; https://www.scintilla.org/SciTEDoc.html EndFunc ;==>sciteAiAssistant_CommandSnippet Func ConsoleWriteEm($sStr) If StringInStr($CmdLineRaw, "/ErrorStdOut ") Then ConsoleWrite($sStr) Else MsgBox(262144, @ScriptName, StringTrimRight($sStr, 2), 60) EndIf EndFunc ;==>ConsoleWriteEm ..close SciTE, open SciTE. and enjoy {F10} Edit: Changed the entry a bit to be able to add or remove the entry more easily.
  15. I asked ChatGPT and it told me I was the best. It made my day. Am very happy today. Thank you ChatGPP
×
×
  • Create New...