Jump to content

Chantaro

Active Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Chantaro

  1. @argumentum good old missing sleep solution seems to have done it 😅 @Danp2 true good catch, but is there any performance benefit to not using Ubound? It just so happens to return that number +1 already which helps for my case. Unfortunately I need to call it every loop so it knows when to stop rendering by checking the amount of files in the folder, if you know another way I'd be happy to hear it. Good call on the ExitLoop! It has been implemented
  2. Hello Everyone Strange issue with a ConsoleWrite and MsgBox. I have a script inside a While loop that goes something like this: $projectfilepath = "insert/path/here" $outputpath = "insert/path/here" $finalframe = 174 $blenderpath = "insert/path/here" $init = 0 ConsoleWrite(@HOUR & ":" & @MIN & ":" & @SEC & " Render Initiate" & @CRLF) While 1 ;Grab amount of files in output folder $aFileList = _FileListToArray($outputpath,"*.png") $nextframe = UBound($aFileList,1) If $nextframe > $finalframe Then ConsoleWrite(@HOUR & ":" & @MIN & ":" & @SEC & " Render Finished" & @CRLF) MsgBox(0,"Finished","Render complete!") Exit Else ;XYZ EndIf Sleep(5000); Check status at regular intervals WEnd When the project finishes rendering I get a MsgBox like expected, but for some reason it does not log the actual time it finished (on the ConsoleWrite) but rather when I clicked the MsgBox away. Example Anyone know why this happens?
  3. Thanks a bunch Melba23!
  4. Hello Sorry to open such an old thread again, but is it possible to have this date selector return that invalid date for saturdays as well? I cannot figure out how the dll stuff works and I have trouble figuring out how kylomas gets sunday out of this in the first place
  5. Thank you @AlessandroAvolio and @Jos! That did the trick
  6. Hah😃, actually I am using Windows 8.1 on this machine. And yes unless I am blind it's here:
  7. I did yes stikynot could not be found. Make sure you've entered the name correctly and retry
  8. Sadly I cannot move the exe for my use case and adding the x64 wrapper didn't do the trick
  9. Hello everyone I am having trouble trying to run the Sticky Notes program in windows. When I use: ShellExecute("C:\Windows\System32\StikyNot.exe") I keep getting an Error that it cannot be located even though it is definitely right there in that spot. The ScriptDir is located in @UserProfileDir & "\Downloads" if that matters. Anyone got any Ideas? Kind Regards Chantaro
  10. I have managed to get a workaround solution going by adding a WinSetState("DocGenie Desktop - Mozilla Firefox", "",@SW_RESTORE) It sets the window to not maximized and lets me move it to the desired position "cleanly"
  11. Thank you so much Musashi! In my case it still continues the Loop without the ExitLoop, but I'm still extremely grateful!
  12. Yes I did try it! So how do I get the loop to not fully jump back to the beginning but rather go to the third If statement the next time 6000 is reached?
  13. Well yeah now that you've turned down the timer in the beginning to 2000 it obviously won't be, but in my post it is "12000" and not "2000", with that value it will most definitely be reached, but it still ignores the third If in the loop At first the timer is supposed to go to 12000 ticks, do the GetWindow func, the ubound check and click the mouse. If after all of that the machine is still idle after 6000 ticks it's supposed to send me the notification Is the way I coded it wrong or is there a better way to make this happen?
  14. runnable script #Region Init #include <AutoItConstants.au3> #include "ALK-Bots.au3" #include "Access_UDF.au3" #include <Array.au3> #include <MsgBoxConstants.au3> #include <File.au3> #include <FileConstants.au3> #include <Date.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <Timers.au3> AutoItSetOption("WinTitleMatchMode",2) ; Break für Abbruch HotKeySet("{BREAK}","ExitScript") HotKeySet("{PAUSE}","ExitScript") Func ExitScript() If MsgBox (4, "Break" ,"Break gedrückt. Programm stoppen?") = 6 Then Exit EndFunc #EndRegion Init While 1 ConsoleWrite(_Timer_GetIdleTime() & @CRLF) If _Timer_GetIdleTime() > 12000 Then ;5 minutes 300000 GetWindow() If Ubound($ArrayError) < 2 Then ;If no window found MouseClick("left",1168, 727) Sleep(500) MouseClick("left",267, 574,2) If _Timer_GetIdleTime() > 6000 Then Notification() EndIf EndIf EndIf WEnd Func GetWindow() Global $Array = WinList("GUI") Global $ArrayError = WinList("ASAL-ALK Hauptmenu nicht gefunden") EndFunc Func Notification() WinSetState("megumin","",@SW_SHOW) Sleep(2000) WinActivate("megumin") Sleep(2000) Send("{TAB}") Sleep(1000) Send($Array[1][0]) Sleep(1000) Send("{Enter}") Sleep(1000) Send("{!}") Send("highlight 0") Sleep(1000) Send("{Enter}") Sleep(1000) WinSetState("megumin","",@SW_HIDE) MsgBox(0,"Idle","Bot could've stopped") WinSetState("megumin","",@SW_SHOW) Sleep(1000) WinActivate("megumin") Send("{TAB}") Sleep(1000) Send($Array[1][0] & " checked") Sleep(1000) Send("{Enter}") Sleep(1000) WinSetState("megumin","",@SW_HIDE) EndFunc once again, I can't figure out why it ignores the If _Timer_GetIdleTime() > 6000 Then Notification() part
  15. then context is in the OP, everything is in there
  16. then how come is being straight up ignored?
  17. you're both trying _timer_getidletime once in your examples, does it happen if you have the command in a while loop a second time?
  18. Yes I'm trying to reset the idletime with the mouseclick but the timer doesn't do that. the ConsoleWrite(_Timer_GetIdleTime() & @CRLF) after While 1 just keeps going after 6000 has been reached, which is how i tested it in the first place
  19. Hi, I'm trying to run a script that handles our document bots from stopping at work. I want to add an extra action (mouseclick) and to make it send me a notification if after said action the idletimer goes up again: #Region Init #include "ALK-Bots.au3" #include "Access_UDF.au3" #include <Array.au3> #include <MsgBoxConstants.au3> #include <File.au3> #include <Date.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <DateTimeConstants.au3> #include <Timers.au3> AutoItSetOption("WinTitleMatchMode",2) ; Break für Abbruch HotKeySet("{BREAK}","ExitScript") HotKeySet("{PAUSE}","ExitScript") Func ExitScript() If MsgBox (4, "Break" ,"Break gedrückt. Programm stoppen?") = 6 Then Exit EndFunc #EndRegion Init While 1 ConsoleWrite(_Timer_GetIdleTime() & @CRLF) If _Timer_GetIdleTime() > 10000 Then ;5 minutes 300000 GetWindow() If Ubound($ArrayError) < 2 Then ;If no window found MouseClick("left",1168, 727) Sleep(500) MouseClick("left",267, 574,2) If _Timer_GetIdleTime() > 6000 Then Notification() EndIf Else If $ArrayError[1][0] = ("ASAL-ALK Hauptmenu nicht gefunden") Then WinActivate("Sitzung") WinWaitActive("Sitzung") Send("{F12}") Sleep(1000) Send("15") Sleep(1000) Send("{Enter}") Sleep(1000) WinActivate("ASAL-ALK Hauptmenu nicht gefunden") WinWaitActive("ASAL-ALK Hauptmenu nicht gefunden") Send("{RIGHT}") Send("{Enter}") EndIf EndIf EndIf WEnd Func GetWindow() Global $Array = WinList("GUI") Global $ArrayError = WinList("ASAL-ALK Hauptmenu nicht gefunden") EndFunc Func Notification() WinSetState("megumin","",@SW_SHOW) Sleep(2000) WinActivate("megumin") Sleep(2000) Send("{TAB}") Sleep(1000) Send($Array[1][0]) Sleep(1000) Send("{Enter}") Sleep(1000) Send("{!}") Send("highlight 0") Sleep(1000) Send("{Enter}") Sleep(1000) WinSetState("megumin","",@SW_HIDE) MsgBox(0,"Idle","Bot could've stopped") WinSetState("megumin","",@SW_SHOW) Sleep(1000) WinActivate("megumin") Send("{TAB}") Sleep(1000) Send($Array[1][0] & " checked") Sleep(1000) Send("{Enter}") Sleep(1000) WinSetState("megumin","",@SW_HIDE) EndFunc megumin is just an irc bot I use to send me notifications over different computers. But the Problem is that the Idletimer doesn't care about surpassing 6000 after the Mouseclick in the Ubound section. Does AutoIt not allo w to account for multiple Idletimers in a While loop? Thanks
  20. Sadly didn't work, even when playing around with $RDW_VALIDATE or $RDW_UPDATENOW
  21. Greetings Occasionally Firefox will leave a black bar at the top when it's getting moved by the WinMove() function. This is of course fixed by dragging the window around manually, but it can mess with the positioning when you have a script set up to click on a certain part of a webpage in FF. Does anyone else experience this or know how to circumvent it? Kind Regards Chantaro
  22. You're a life saver, thank you! And excuse the formatting I found out how to do that after posting ^^'
  23. Hello Everyone, first time poster here. I'm trying to make a GUI for youtube-dl and I'm stuck with the error handling for when the Input is empty. What I want to happen is, when there's an Empty URL it gives a MsgBox with "please insert a link" and execute the download when a url is in place. But for some reason when the url is empty and I click the button to run the command, it gives me the error over and over even though I enter something into the URL after the first Error message. What is wrong here? Global $ytdl_path = (@ScriptDir & "\youtube-dl.exe") Global $argsmp3 = (' --extract-audio --format=bestaudio --audio-format mp3 --audio-quality=320k --output "%(title)s.%(ext)s" --cookies .\cookies.txt') Global $argsmp4 = (' --format=bestaudio --output "%(title)s.%(ext)s" --cookies .\cookies.txt') Global $empty = "" ;https://youtu.be/HQnC1UHBvWA #Region GUI YoutubeDL() Func YoutubeDL()     ; Create a GUI with various controls.     Global $hGUI = GUICreate("YouTube Downloader",400, 200,1000,500)     Global $Label1 = GUICtrlCreateLabel("Insert Youtube link here", 10, 45, 461, 24)     GUICtrlSetFont(-1, 10, 200, 0, "Arial")     Global $Pic1 = GUICtrlCreatePic(@ScriptDir & "\eXLs5Hw.jpg", 10, 10, 120, 30)           Global $video_url = GUICtrlCreateInput("", 10, 70, 370, 20)     Global $idConvertMP3 = GUICtrlCreateButton("Convert to MP3", 10, 100, 85, 25)     ; Display the GUI.     GUISetState(@SW_SHOW, $hGUI)     ; Loop until the user exits.     While 1         $nMsg = GUIGetMsg()         Switch $nMsg                 Case $GUI_EVENT_CLOSE                 Exit                     Case $idConvertMP3                          $video_url = GUICtrlRead($video_url)                         If $video_url = $empty Then                             MsgBox(0, "Error", "Please insert a Link")                         EndIf                         If $video_url <> $empty Then                             ConvertMP3()                         EndIf         EndSwitch     WEnd     ; Delete the previous GUI and all controls.     GUIDelete($hGUI) EndFunc  #EndRegion ;Run Conversion Func ConvertMP3()          Run($ytdl_path & " " & $video_url & $argsmp3) EndFunc
×
×
  • Create New...