Chobyhy Posted September 17, 2006 Share Posted September 17, 2006 1. Is there a way to make the script check for the current date and the do the following action So If Today > 12 / 1 /2006 (If today is after december first 2006) $var = 1 I think only possible way to do is to check the local comp time but this can be easily tricked if the user changes the local time so is there a possible way to check for a world timer on the internet? 2. I think I read this before but does anyone know how to make a script terminate if there is a same script already running? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 17, 2006 Moderators Share Posted September 17, 2006 (edited) Look at _Now()/_NowCalcDate()/_NowDate()/_NowTime() in the help file. (Make sure you are using AutoIt v3.2 or higher.) Edited September 17, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
xcal Posted September 17, 2006 Share Posted September 17, 2006 For question #2, this works for gui stuff: $script_version = "Some Name" If WinExists($script_version) Then ;do something if it's running/exists Exit ;and/or exit EndIf AutoItWinSetTitle($script_version) How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Chobyhy Posted September 17, 2006 Author Share Posted September 17, 2006 What do you mean gui stuff? its just a tray icon for mine Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 17, 2006 Moderators Share Posted September 17, 2006 What do you mean gui stuff? its just a tray icon for mineFor #2 look at _SingleTon() in the help file, regardless of whether you're using a script based or gui based executable. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
MHz Posted September 17, 2006 Share Posted September 17, 2006 For question #2, this works for gui stuff: $script_version = "Some Name" If WinExists($script_version) Then ;do something if it's running/exists Exit ;and/or exit EndIf AutoItWinSetTitle($script_version)In reference, that has got absolutely nothing to do with an "AutoIt Gui". It looks for the existance of a window title that is the main invisible window that AutoIt creates with every script executed and sets the title of that window. AutoItWinSetTitle() Link to comment Share on other sites More sharing options...
Chobyhy Posted September 17, 2006 Author Share Posted September 17, 2006 err wait about the date thing is there anyways to check date on internet instead of locally? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 17, 2006 Moderators Share Posted September 17, 2006 err wait about the date thing is there anyways to check date on internet instead of locally?Find a site that has the time you want and use _InetGetSource() or _InetGet() both in the help file. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
xcal Posted September 17, 2006 Share Posted September 17, 2006 In reference, that has got absolutely nothing to do with an "AutoIt Gui". It looks for the existance of a window title that is the main invisible window that AutoIt creates with every script executed and sets the title of that window.Ahhh ok, cool. I was making an assumption because of the Win references. :"> How To Ask Questions The Smart Way 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