Sfikes Posted October 4, 2016 Share Posted October 4, 2016 Hey i have a problem! This script will activate once the time is 22:05:00 and send a message. #include <Date.au3> While 1 If _NowTime(5) = "22:05:00" Then Send("Hell yea!") ExitLoop EndIf WEnd Whenever i try to run my code it doesn't go like it should. It never sends a "Hell Yea" when the time have passed. So i have no idea how to fix this. Link to comment Share on other sites More sharing options...
AutoBert Posted October 4, 2016 Share Posted October 4, 2016 (edited) try If _NowTime(5) >= "22:05:00" Then as you have a exitloop it will only be send once nearby 22:05:00. I suggest: put also a sleep(10) in your loop. Edited October 4, 2016 by AutoBert Link to comment Share on other sites More sharing options...
orbs Posted October 4, 2016 Share Posted October 4, 2016 the condition is correct, and a 1s time window should be sufficient to trap the time. the likely cause is that when the time is reached, you have no input field in focus, so you do not see the keys sent. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
spudw2k Posted October 4, 2016 Share Posted October 4, 2016 You also might want to consider using Scheduled Tasks instead if allowed in your environment. The advantage of doing so is you don't have to have a resident process (your script) tracking the time, but rather pass that task/responsibility to the OS. Depends on what you are looking to accomplish I guess.... Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
weirddave Posted October 4, 2016 Share Posted October 4, 2016 Are you certain the message isn't being sent, what window is active at 22:05:00 ? (Where is the send() sending the message) 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