Jump to content
Advert

6DAVEROO9

Members
  • Posts

    7
  • Joined

  • Last visited

6DAVEROO9's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. OK, so putting in the While loop on PhoenixXL's script got it compiled and running. I was still somewhat frustrated that I could not get my own script running, so I plugged away at it, and I finally came up with this. Launch at bedtime, and forget. It polls the system only once, and then does its thing. Dim $A=@HOUR, $B=@MIN, $C, $D, $E While 1 _CalcInterval () $D=(($C*60)+(70-$B))*60000 Sleep($D) Run("C:\Program Files (x86)\Steam\Steam.exe") Sleep($E) ProcessClose("Steam.exe") WEnd Func _CalcInterval () If $A > 6 Then $C = 25 - $A $E = 17400000 ElseIf $A < 2 Then $C = $A - 1 $E = 17400000 Else $C=0 $B=70 $E=((60*(5-$A))+(70-$B))*60000 EndIf EndFunc My first functioning script! Newbie challenge #1... Accepted. And completed. F#ck yeah. OK, maybe I've been spending a bit too much time at Memebase. Time to go outside. ;-) Oh, and if I didn't mention it, the reason I needed this is that my ISP has unlimited downloads during that time window, so it is the best time to download game files.
  2. Thanks BrewManNH.
  3. Oops! Just compiled and ran it, and nothing appears to have happened. Cannot see the process running in Task Manager. Wil try to rework mine in the meantime to see if I can get better results.
  4. Thanks PhoenixXL. I like it. Very elegant. Another example of how it pays to know your process library.
  5. Gee, thanks for all the optimizations, guys. I am kind of going in another direction, however. I found that the program was using up 25% CPU time, likely because it was polling the system time continuously while waiting for the criteria to be met. I put the following together in an attempt to minimize activity: A = @HOUR B = @MIN If A > 6 C = 25 - A E = 290 ElseIf A < 2 C = A - 1 E = 290 Else C = 0 B = 70 E = ( ( 60 * ( 5 - A ) ) + ( 70 - B ) EndIf D = ( C * 60 ) + ( 70 - B ) Wait D minutes Run ( "C:\Program.exe" ) Wait E minutes ProcessClose ( "Program.exe" ) What do you think?
  6. Thanks MKISH. That looks way more like something I'm familiar with than what I was doing. Once you know the syntax, it just flows right out, doesn't it?
  7. Hi Folks, While I am new to AutoIt, as well as to Windows programming, I do have a fairly solid understanding of programming structures (IF's, WHILE's, FOR's, etc.) What I am trying to accomplish is the following: Poll system time, and when it reaches 2:10 AM, launch a program. Continue polling system time, and when it reaches 6:50 AM close the program that was launched at 2:10. That's it. I tried to schedule it in Task Manager, and while it launched, there does not seem to be a way to shut the program down, other than the vague "If still running after" option. I also tried to search online for an automation program that would provide the option to launch and close other programs, and that is what lead me to AutoIt. That's fine. I have no problem learning how to do it myself. I just need some guidance with respect to which variables to use, and the syntax of the AutoIt commands. All help is appreciated. Cheers. ~6DAVEROO9~
×
×
  • Create New...