usabrad86 Posted February 1, 2010 Share Posted February 1, 2010 (edited) website has Ben changed Fall 2010no longer workinghey guys i made this Autoit script that will turn on call forwarding when computer goes to idle.. and and turn off when your mouse moves expandcollapse popup$debug = False $web_username = "email or phone number for website" $web_password = "password for website" #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () GUICreate("Embedded Web control Test", 800,600) $GUIActiveX = GUICtrlCreateObj($oIE, 5, 5, 790, 560) $GUI_ENABLEFWD = GUICtrlCreateButton("Enable Call Forward",5,565) $GUI_DISABLEFWD = GUICtrlCreateButton("Disable Call Forward",120,565) if $debug Then GUISetState() ;Show GUI _IENavigate ($oIE, "https://my.magicjack.com/my/myindex.html") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $GUI_ENABLEFWD _ChangeFWDon() Case $msg = $GUI_DISABLEFWD _ChangeFWDoff() EndSelect WEnd EndIf if Not $debug Then _IENavigate ($oIE, "https://my.magicjack.com/my/myindex.html") _ChangeFWDon() $pos = MouseGetPos() While 1 $tmp_pos = MouseGetPos() if $pos[0] = $tmp_pos[0] and $pos[1] = $tmp_pos[1] Then Sleep(100) Else _ChangeFWDoff() ExitLoop EndIf WEnd EndIf GUIDelete() Exit ;~ ProcessFunections Func _ChangeFWDoff() _IENavigate ($oIE, "https://my.magicjack.com/my/myindex.html?myfocus=callFwd") _login() Sleep(5000) _DisableForward() Sleep(5000) _logout() EndFunc Func _ChangeFWDon() _IENavigate ($oIE, "https://my.magicjack.com/my/myindex.html?myfocus=callFwd") _login() Sleep(5000) _EnableForward() Sleep(5000) _logout() EndFunc ;~ Single Functions Func _login() ; get pointers to the login form and username, password and signin fields $o_form = _IEFormGetObjByName ($oIE, "frmLogin") $o_login = _IEFormElementGetObjByName ($o_form, "inpUsr") $o_password = _IEFormElementGetObjByName ($o_form, "inpPsw") $o_signin = _IEFormElementGetObjByName ($o_form, "btnLogin") ; Set field values and submit the form _IEFormElementSetValue ($o_login, $web_username) _IEFormElementSetValue ($o_password, $web_password) _IEAction ($o_signin, "click") EndFunc Func _logout() _IENavigate ($oIE, "https://my.magicjack.com/my/myindex.html?logout=true") EndFunc Func _EnableForward() $o_form = _IEFormGetObjByName ($oIE, "SaveFwd") $o_checkON = _IEFormElementCheckboxSelect ($o_form, "On", "inpCallForwardEnableOn") if @error = 7 Then ConsoleWrite("Allready Enabled") Return EndIf $o_buttonsubmit = _IEFormElementGetObjByName ($o_form, "ForwardingChangesSubmit") _IEAction ($o_buttonsubmit, "click") EndFunc Func _DisableForward() $o_form = _IEFormGetObjByName ($oIE, "SaveFwd") $o_checkON = _IEFormElementCheckboxSelect ($o_form, "Off", "inpCallForwardEnableOff") if @error = 7 Then ConsoleWrite("Allready Disabled") Return EndIf $o_buttonsubmit = _IEFormElementGetObjByName ($o_form, "ForwardingChangesSubmit") _IEAction ($o_buttonsubmit, "click") EndFunc$debug= true shows what it does this code works in autoit v3+ on win2K and up... Sorry win9x-erz Edited December 1, 2010 by usabrad86 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