Sign in to follow this  
Followers 0
Thatsgreat2345

_IEAction Click

1 post in this topic

#1 ·  Posted (edited)

I quickly threw this together to change my IP and it doesn't seem to work it Clicks the Release Button ok, but it does not click the renew i think it is clicking the release button again and not the renew.

#include <IE.au3>
$IE = _IECreate("192.168.1.1",0,1,0)
While Not WinExists("Connect to 192.168.1.1")
    Sleep(100)
WEnd

    ControlSetText("Connect to 192.168.1.1",'',1003,"admin")
    ControlSetText("Connect to 192.168.1.1",'',1005,"admin")
    ControlClick("Connect to 192.168.1.1",'',1)
    _IELoadWait($IE)
    _IENavigate($IE,"http://192.168.1.1/Status_Router.asp")
    _IELoadWait($IE)
    $HTML =_IEDocReadHTML($IE)
    $string = StringRegExp($HTML,'<TD><FONT style="FONT-SIZE: 8pt"><B>(\d+\.\d+\.\d+\.\d+)',3)
    $IP = $string[0]
    $CurrentIP = $string[0]
    While $IP = $CurrentIP
        $Status_Form = _IEFormGetObjByName($IE,"status")
        $release = _IEFormElementGetObjByName($Status_Form,"dhcp_release")
        _IEAction($release,"click")
        _IELoadWait($IE)
        $Status_Form = _IEFormGetObjByName($IE,"status")
        $renew = _IEFormElementGetObjByName($Status_Form,"dhcp_renew")
        _IEAction($renew,"click")
        _IELoadWait($IE)
        $string = StringRegExp(_IEDocReadHTML($IE),'<TD><FONT style="FONT-SIZE: 8pt"><B>(\d+\.\d+\.\d+\.\d+)',3)
        $CurrentIP = $string[0]
    WEnd
Edited by Thatsgreat2345

Share this post


Link to post
Share on other sites



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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0