AmitPatel Posted September 25, 2009 Posted September 25, 2009 Hi, I want to make a script in which I want to add a countdown timer for 30 secs, after which if there is no user input ( mouse movement or keyboard inputs ) then it automatically loads specified program after 30 seconds! countdown text should be shown at bottom right corner of my autoit app. Its a simple script but I m new to autoit so dont know how to do that . can anyone help me out? example: I want to run following program after 30 seconds if there is no user input x:\setup.exe waiting for someone's help .
JohnOne Posted September 25, 2009 Posted September 25, 2009 Hi Its customary, to at least attempt to read some helpfiles and try it yourself mate. The odds are you may encounter some hostility otherwise. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
water Posted September 25, 2009 Posted September 25, 2009 To check for no user input (mouse and keyboard) you could use something like: #Include <Timers.au3> If _Timer_GetIdleTime() > 30000 Then "<run your exe>" Else "<show counter>" EndIf How to show the counter depends where you want it to be displayed: In your GUI, in the system tray ... My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 thanks so much for fast reply. @water, I want to display timer in my GUI ( bottom right corner ). can u edit ur example script with showing how to display timer ? Thanks again.
jvanegmond Posted September 25, 2009 Posted September 25, 2009 thanks so much for fast reply.@water, I want to display timer in my GUI ( bottom right corner ). can u edit ur example script with showing how to display timer ?Thanks again.Why don't you try it yourself? github.com/jvanegmond
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 Okey, I tried following,If _Timer_GetIdleTime() > 30000 Then Run ("X:\startsetup.cmd" )else "<show counter>"EndIfIts giving me errorERROR: syntax errorelseI m noob at scripting so sorry for trouble.
jvanegmond Posted September 25, 2009 Posted September 25, 2009 Your effort is not good enough. github.com/jvanegmond
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 np, I will try it myself now Mr.MVP. I m among those ppl who are noobs at scripting, you could react better, anyways let others help me out if you dont mind . I have expertise in my own field as u have in ur own, I wouldnt react lyk this with anyone who wants to learn!!
Yashied Posted September 25, 2009 Posted September 25, 2009 I have expertise in my own field as u have in ur own, I wouldnt react lyk this with anyone who wants to learn!!AmitPatel, start with this, then show us what you got and we'll discuss that. OK? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 okey, I m searching forums for my answer. thanks for ur quicky replies
jvanegmond Posted September 25, 2009 Posted September 25, 2009 np, I will try it myself now Mr.MVP. I m among those ppl who are noobs at scripting, you could react better, anyways let others help me out if you dont mind .I have expertise in my own field as u have in ur own, I wouldnt react lyk this with anyone who wants to learn!! AmitPanel, I was once a noob on this forum too, without any expertise in any field at all. You have a head start on me, so to speak. I can remember though, actually I can just look it up, that I made a considerate effort into all the questions I asked on this forum. Efforts that took longer than 3 minutes.You're not here to learn, you're here just to find someone to write whatever you want for you. You're a leech, and a bad one at it. github.com/jvanegmond
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 I m not leecher, I searched google before registering over here. I want someone's help because its a litle script help i want, otherwise rest of the script part I have made myself!! I also have read autoIT help file but didnt find "_Timer_GetIdleTime()" function in help file! you see yourself if you can find this function in help! otherwise I wuldnt disturb anyone. I didnt want to waste time on just little part of my script so I asked for help.
Yashied Posted September 25, 2009 Posted September 25, 2009 (edited) Okey, I tried following, Its giving me error ERROR: syntax error else I m noob at scripting so sorry for trouble. I didnt want to waste time on just little part of my script so I asked for help. You lying. Edited September 25, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 If _Timer_GetIdleTime() > 5000 Then run ("C:\Windows\System32\taskmgr.exe")EndIfabove worked without error, but it didnt execute "taskgr.exe" .
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 I m noob at scripting so sorry for trouble. You lying.
Yashied Posted September 25, 2009 Posted September 25, 2009 (edited) above worked without error, but it didnt execute "taskgr.exe" . Look at While 1 ... WEnd EDIT: If _Timer_GetIdleTime() > 5000 Then Run("C:\Windows\System32\taskmgr.exe") EndIf Insert this in the loop. Edited September 25, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 Look at While 1 ... WEnd EDIT: If _Timer_GetIdleTime() > 5000 Then Run("C:\Windows\System32\taskmgr.exe") EndIf Insert this in the loop. Thanks I did following and worked While 1 If _Timer_GetIdleTime() > 5000 Then run ("C:\Windows\System32\taskmgr.exe") EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 I still need help displaying timer countdown at bottom-right corner of my GUI, any tips for it plz?
Yashied Posted September 25, 2009 Posted September 25, 2009 (edited) I still need help displaying timer countdown at bottom-right corner of my GUI, any tips for it plz? Look at GUICtrlCreateLabel(), and use the GUICtrlSetData() in the loop.EDIT:_Timer_GetIdleTime() returns an integer ticks since last (approx. milliseconds) since last activity. Edited September 25, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
AmitPatel Posted September 25, 2009 Author Posted September 25, 2009 u mean like this?While 1GUICtrlSetData($Label2, _Timer_GetIdleTime)If _Timer_GetIdleTime() > 5000 Then run ("C:\Windows\System32\taskmgr.exe")EndIf$nMsg = GUIGetMsg()Switch $nMsgCase $GUI_EVENT_CLOSEExitIt didnt work however, syntax error again! ( label2 is what I want to update as countdown time ).
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