erikson Posted March 5, 2007 Share Posted March 5, 2007 hi i try to make a script that will run something between some hours ( between 22:00 and 8:00 ) i try something like this: CODE$ora = @HOUR if 22< $ora <08 Then run ("something") else MsgBox (1, "ora", "not now") EndIf but don`t work some ideeas? Link to comment Share on other sites More sharing options...
Talder Posted March 5, 2007 Share Posted March 5, 2007 Hi, Why not run the script with scheduled task? Otherwise you can create a loop, but you will have 100% cpu usage! So this is not such great idea... dim $iTimehascome $iTimehascome = 0 do if @HOUR >= 4 Then ; your code goes here $iTimehascome = 1 EndIf Until $iTimehascome = 1 Link to comment Share on other sites More sharing options...
Helge Posted March 5, 2007 Share Posted March 5, 2007 (edited) Otherwise you can create a loop, but you will have 100% cpu usage! So this is not such great idea...Sure, if you don't have a Sleep() in a loop the script's CPU-usage will be close to 100%...Edit : tags.. Edited March 5, 2007 by Helge Link to comment Share on other sites More sharing options...
erikson Posted March 5, 2007 Author Share Posted March 5, 2007 thanx now i thing i have another problem if i change the computer hour .. .. its no good so i must take the exact hour from another machine , or via internet. can i make this? Link to comment Share on other sites More sharing options...
Talder Posted March 5, 2007 Share Posted March 5, 2007 Sure, if you don't have a Sleep() in a loop the script's CPU-usage will be close to 100%...Edit : tags..You are right, this solves the problem Link to comment Share on other sites More sharing options...
Shevilie Posted March 5, 2007 Share Posted March 5, 2007 Well you can get the time from the internet Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
erikson Posted March 6, 2007 Author Share Posted March 6, 2007 Well you can get the time from the interneti know. but how?i must save a webpage locally, fileopen that file and search the string with hour, grab the time into a variable and so on? o or is a more simple method? 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