; vzw.ahk v1.0 ; AutoHotkey Version: 1.x ; Language: English ; Platform: Win9x/NT ; Author: -DC- ; ; Script Function: ; Logs into Verizon Wireless homepage and fetches total minutes used, then sends e-mail alert if over expected usage. ; Requires program blat.exe available for free at http://www.blat.net/. Make sure to copy it into a folder that's in ; your Windows PATH variable, or modify this script to include the path. Set user variables (below) first! ; ; IMPORTANT: Click locations (x,y) will likely need to be changed for your computer. AutoIt3 comes with AutoHotkey ; and can be used to find the correct x,y screen coordinates for your setup (replace them accordingly in this script.) #NoEnv ;Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ;Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ;Ensures a consistent starting directory. SetFormat, FLOAT, 0.0 ;--- Set user variables here ----- User = yourlogin ;User name used to log into www.verizonwireless.com. PW = yourpassword ;Password for user above. MaxMinutes = 700 ;Number of free minutes in your plan. Email1 = youremail@home.com ;Primary e-mail address to send alerts to. ;Email2 = secondemail@home.com ;Secondary e-mail address for alerts, if needed. ;--------------------------------- Process, Priority,, A Run, iexplore.exe http://www.verizonwireless.com/b2c/splash/checkbalance.jsp,,max WinWait, Check your balance online - Windows Internet Explorer WinActivate MouseMove, 0, 0 ;Prevents the status bar from showing a mouse-hover link instead of "Done". StatusBarWait, Done, 30 if ErrorLevel MsgBox The wait timed out or the window was closed. Sleep 500 Click 308, 665 ;User textbox -- change this x,y coordinate to match your computer using AutoIt3. Sleep 500 Send +{Home} ;Highlight any autotext to type over Send %User% Sleep 500 Click 308, 717 ;PW textbox Sleep 500 Send +{Home} ;Highlight any autotext to type over Send %PW% Sleep 500 Click 728, 761 ;Login button WinWait, Verizon Wireless - My Account - Windows Internet Explorer ;This might change and break script WinActivate MouseMove 0, 0 ; Prevents the status bar from showing a mouse-hover link instead of "Done". StatusBarWait Done, 60 if ErrorLevel MsgBox The wait timed out or the window was closed. ;Click Family Plan minutes Sleep 1000 Click 260, 536 Sleep 1000 MouseMove 0, 0 ; Prevents the status bar from showing a mouse-hover link instead of "Done". StatusBarWait Done, 60 if ErrorLevel MsgBox The wait timed out or the window was closed. ;Highlight minutes used Sleep 1000 MouseMove 930, 592 Sleep 1000 Click 2 Sleep 1000 clipboard= Send ^c ClipWait WinClose ;MsgBox Control-C copied the following contents to the clipboard:`n`n%clipboard% ;See if minutes are above a certain amount Minutes = %clipboard% Day = %A_DD% if (Day < 10) ;New billing starts on the 10th of each month. { Day += 22 } else { Day -= 9 } Day *= MaxMinutes / 31 ; Max monthly minutes divided by 31 days gives us approximate daily max. if (Minutes > Day) { Subj = Warning: Current cellular minutes used exceeds expectation (%Minutes% vs. %Day%) Run, blat.exe -to %Email1%`,%Email2% -s "%Subj%" -body http://www.verizonwireless.com } else if (A_DD = 1 or A_DD = 5 or A_DD = 7) { Subj = FYI: Current cellular minutes used are at %Minutes% Run, blat.exe -to %Email1%`,%Email2% -s "%Subj%" -body http://www.verizonwireless.com }