pikablue Posted June 30, 2009 Share Posted June 30, 2009 (edited) Hello! with the help of many people here I finally created my first ever autoit function. it repeats a set number of mouse moments every 35 minutes. Give warning at the 3 minute mark down to the 1 minute mark. and also has a tray icon tip that shows a count down timer in minutes. xD took me quite a while. I was wondering how would i be able to add a countdown timer in seconds when its only 1minute left, like 60, 59, 58, 57... etc as a trayicon tool tip. anyways here is the code I got so far: expandcollapse popupGlobal $iCounter Global $fLoop = True HotkeySet("{Esc}", "Close") While $fLoop AutoItSetOption("MouseClickDelay", 100) MouseClick("Left", 300, 790, 2) MouseClick("Left", 400, 650, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) AutoItSetOption("MouseClickDownDelay", 100) MouseClick("left", 790, 350, 2) $iCounter = 35 While $fLoop $iCounter -= 1 TraySetState() TraySetToolTip($iCounter & " Minutes left.") Sleep(1000*60) If $iCounter = 0 Then ExitLoop If $iCounter = 5 Then Traytip("Bot", "5 Minutes left, there will be another warning at 1 minute.", 10) If $iCounter = 1 Then MsgBox(0, "LAST WARNING", "LAST WARNING!!" & $iCounter & " Minutes left!!", 10) WEnd WEnd Func Close() Exit EndFunc Edited June 30, 2009 by pikablue Link to comment Share on other sites More sharing options...
Yashied Posted June 30, 2009 Share Posted June 30, 2009 (edited) Hello! with the help of many people here I finally created my first ever autoit function. it repeats a set number of mouse moments every 35 minutes. Give warning at the 3 minute mark down to the 1 minute mark. and also has a tray icon tip that shows a count down timer in minutes. xD took me quite a while. I was wondering how would i be able to add a countdown timer in seconds when its only 1minute left, like 60, 59, 58, 57... etc as a trayicon tool tip. anyways here is the code I got so far: expandcollapse popupGlobal $iCounter Global $fLoop = True HotkeySet("{Esc}", "Close") While $fLoop AutoItSetOption("MouseClickDelay", 100) MouseClick("Left", 300, 790, 2) MouseClick("Left", 400, 650, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) MouseClick("left", 450, 475, 2) MouseClick("left", 475, 350, 2) AutoItSetOption("MouseClickDownDelay", 100) MouseClick("left", 790, 350, 2) $iCounter = 35 While $fLoop $iCounter -= 1 TraySetState() TraySetToolTip($iCounter & " Minutes left.") Sleep(1000*60) If $iCounter = 0 Then ExitLoop If $iCounter = 5 Then Traytip("Bot", "5 Minutes left, there will be another warning at 1 minute.", 10) If $iCounter = 1 Then MsgBox(0, "LAST WARNING", "LAST WARNING!!" & $iCounter & " Minutes left!!", 10) WEnd WEnd Func Close() Exit EndFuncI would have done so, try to understand it. $Min = 35 $Sec = 60 TraySetState() TraySetToolTip($Min & ' Minutes left.') $Timer = TimerInit() While 1 Sleep(10) If TimerDiff($Timer) > 1000 Then $Timer = TimerInit() $Sec -= 1 If $Sec = 0 Then $Sec = 60 $Min -= 1 Switch $Min Case 0 ExitLoop Case 1 MsgBox(0, 'LAST WARNING', 'LAST WARNING!! 0 Minutes left!!', 10) $Sec -= 10 Case 5 TrayTip('Bot', '5 Minutes left, there will be another warning at 1 minute.', 10) EndSwitch TraySetToolTip($Min & ' Minutes left.') Else If $Min = 1 Then TraySetToolTip($Sec & ' Seconds left.') EndIf EndIf EndIf WEnd Edited June 30, 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... 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