Jump to content
Sign in to follow this  
Hyflex

Why does this script not function?

Recommended Posts

Hyflex

As you may be able to tell I'm trying to get the tray to have options to reboot the router... its not working though

#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
HotKeySet("{Pause}", "Pause")
Global $bPaused = False
Global $versionnumber = "v1.0.0.0 (17-12-2009)"
Global $mainguititel = "Router Reboot and Reconnect, " & $versionnumber

TraySetClick(8)
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)
Opt("TrayAutoPause", 0)

$Tray_ReconnectJDownloader = TrayCreateItem("Reconnect JD")
TrayItemSetOnEvent(-1, "ReconnectJD")
$Tray_ReconnectHTTP = TrayCreateItem("Reconnect HTTP")
TrayItemSetOnEvent(-1, "ReconnectHTTP")
$Tray_Exit = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "Terminate")

While 1
    Sleep(100)
WEnd

Func ReconnectHTTP()
Dim $oXML = ObjCreate('Microsoft.XMLHTTP')
Dim $aMatch

    $oXML.Open('GET', 'http://192.168.1.1/Status_Router.asp', True, 'admin', 'admin')

    ;; HTTP Version
    $oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=disconnect&change_action=gozila_cgi&wan_proto=dhcp', True, 'admin', 'admin')
    ;; JD Version:
    ; $oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=disconnect&change_action=gozila_cgi&wan_proto=pppoe', True, 'admin', 'admin')
    
    $oXML.Send
    $IP = "192.168.1.1"
    Ping($IP, 99999999999999999999999999999)
    
    ;; HTTP Version
    $oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=connect&change_action=gozila_cgi&wan_proto=dhcp', True, 'admin', 'admin')
    ;; JD Version:
    ;$oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=connect&change_action=gozila_cgi&wan_proto=pppoe', True, 'admin', 'admin')
    
    $oXML.Send  
EndFunc

Func ReconnectJD()
Dim $oXML = ObjCreate('Microsoft.XMLHTTP')
Dim $aMatch

    $oXML.Open('GET', 'http://192.168.1.1/Status_Router.asp', True, 'admin', 'admin')

    ;; HTTP Version
    ;; $oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=disconnect&change_action=gozila_cgi&wan_proto=dhcp', True, 'admin', 'admin')
    ;; JD Version:
    $oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=disconnect&change_action=gozila_cgi&wan_proto=pppoe', True, 'admin', 'admin')
    
    $oXML.Send
    $IP = "192.168.1.1"
    Ping($IP, 99999999999999999999999999999)
    
    ;; HTTP Version
    ;;$oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=connect&change_action=gozila_cgi&wan_proto=dhcp', True, 'admin', 'admin')
    ;; JD Version:
    $oXML.Open('GET', 'http://192.168.1.1/apply.cgi?submit_button=Status_Router&submit_type=connect&change_action=gozila_cgi&wan_proto=pppoe', True, 'admin', 'admin')
    
    $oXML.Send  
EndFunc

Func Pause()
    $bPaused = Not $bPaused
    If $bPaused Then
        HotKeySet("{1}")
        HotKeySet("{2}")
        HotKeySet("{3}")
        HotKeySet("{4}")
        While $bPaused
            Sleep(50)
        WEnd
    EndIf
EndFunc

Func Terminate()
    Exit 0
EndFunc

Share this post


Link to post
Share on other sites
Authenticity

What is not working? -The reboot or the event is not fired? Also, in the Pause function you're resetting the hot keys but are not setting them back, although I don't see any use of them in the script.

Share this post


Link to post
Share on other sites
Hyflex

What is not working? -The reboot or the event is not fired? Also, in the Pause function you're resetting the hot keys but are not setting them back, although I don't see any use of them in the script.

The events are not being fired... yeh (EDIT: Nvm, stupid me.. password is different! lol)

oops the hotkey bit was a mistake (from a diff script)

Is it possible with Autoit to make a GUI which is a round ball like AMD's Fusion for Gaming (http://www.istartedsomething.com/wp-content/uploads/2008/09/fusion.jpg)

Edited by XxXGoD

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.