jaberwacky Posted September 3, 2010 Posted September 3, 2010 Oh, he's a noob. Let's not scare him away from AutoIt. Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
russell Posted September 3, 2010 Author Posted September 3, 2010 omg I would but I can't stop laughing. I mean seriously dude? MouseMove(460, 510) MouseClick("left") I mean it's probably no slower than MouseClick("left",460, 510) ...but who write it the 1st way? And what about Run ( @ScriptDir & '\program.exe ' ) Sleep (5000) Send("{enter}") Sleep(25000) WinActivate($ProgramName) What is the 25 seconds for? Does ProgramName run in the background when it starts? Programs normally open and become active so all you need is... WinWaitActive($ProgramName) I could go on but you need to read the help file. Edit: And for the Shutdown all you need is Shutdown(6) Edit 2: I assume that Send("{enter}") is maybe because windows asks you if you are sure you want to run it or something like that. If so just figure out what that windows title is and do a WinWaitActive() for that as well, but use the timeout parameter in case it doesn't ask. Actually i know the window name and changed that in the script before posting. Yes the window ask if im sure thus the "enter" and the 25sec is to ensure the pc has fully booted and loaded the program before running the shutdown.Actually is is a reboot. This script is ran in startup folder. muppet hands are so soft :)
jaberwacky Posted September 3, 2010 Posted September 3, 2010 But honestly, in order to help you better then you'll need to provide a clear explanation of exactly what you're trying to acheive with Autoit. A numbered list will be nice. Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
russell Posted September 3, 2010 Author Posted September 3, 2010 Well, try this: HotKeySet("{F10}", "exitNow") Func exitNow() Exit EndFunc ;==>exitNow Global Const $ProgramName = "program name" While 1 ToolTip("F10: Exit", 0, 0) Sleep(10000) RunWait(@ScriptDir & "\program.exe") Send("{enter}") Sleep(25000) WinActivate($ProgramName) WinMove($ProgramName, '', 0, 0, 550, 570) ;first is width WinWaitActive($ProgramName) MouseMove(460, 510) MouseClick("left") If Not WinActive($ProgramName) Then Run("shutdown -r", @ComSpec, @SW_HIDE) EndIf Sleep(7200000) ; Sleep for two hours only to get up and do it all over again. WEnd I will run this, it looks like it will work. Thank you jaberwocky6669 you have been helping me. muppet hands are so soft :)
russell Posted September 3, 2010 Author Posted September 3, 2010 hmm it seems to not hit enter or resize the window or click now......still rereading it muppet hands are so soft :)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now