jimg Posted February 23, 2011 Share Posted February 23, 2011 I've got a trivial little script to load a screen wallpaper from an "of the day" website. If I try to use a scheduled task, it doesn't work properly, apparently because windows prevents scheduled tasks from affecting the user environment. So instead, I modified it to simply "sleep" for 24 hours and I just start it when I want it to do it's job. Works well enough except for two problems: 1) If I reboot at some point during the day, I have to run the program to get my wallpaper, and then stop and restart it at the correct time. (I know I could fix that by making the sleep command look at the absolute time before calling sleep). But more seriously, 2) it seems the program may be causing a BSOD. It occurs rarely, and I'm still gathering evidence about the culprit. It's hard to believe the Sleep command has a bug in it. I'm running an up to date Windows 7/32bit. The best solution would be if I could run the script at a prescribed time. Is there another way? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 23, 2011 Share Posted February 23, 2011 There are a few ways to do something at a particular time, but one way would be to use an If loop and the time related macros, like this.. If @HOUR = 4 And @MIN = 20 Then MsgBox(0, "", "Yay!") - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
jimg Posted February 24, 2011 Author Share Posted February 24, 2011 There are a few ways to do something at a particular time, but one way would be to use an If loop and the time related macros, like this.. If @HOUR = 4 And @MIN = 20 Then MsgBox(0, "", "Yay!") I've done a few things like that and it brings your PC to it's knees or at least down on one knee. I'm hoping the BSOD turns out to be something else, and I'll just create the Sleep() argument using the time macros. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 24, 2011 Share Posted February 24, 2011 I guess my PC has no knees because this script runs fine and shows 00 in the CPU column of the task manager. While 1 If @HOUR = 18 And @MIN = 20 Then MsgBox(0, "", "Yay!") Sleep(100) WEnd So I would think that there is something else in your code affecting the PC. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
JohnOne Posted February 24, 2011 Share Posted February 24, 2011 $timer = TimerInit() While TimerDiff($Timer) < 86400000 ; 24hrs Sleep(1000) WEnd _DoMyTrivialLittleScript() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
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