Jump to content

Recommended Posts

Posted
#include <GUIConstants.au3>


     GUICreate("Ceragon Ip 20G Config", 320, 435, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, $WS_EX_ACCEPTFILES)

    ; Menu pasirinkimai

    Local $CName = GUICtrlCreateInput("Config name", 10, 15, 300, 20)
    Local $Name = GUICtrlCreateInput("Name", 10, 45, 300, 20)
    Local $Location = GUICtrlCreateInput("Location", 10, 75, 300, 20)
    Local $IPv4 = GUICtrlCreateInput("IPv4", 10, 105, 300, 20)
    Local $Subnet = GUICtrlCreateInput("Subnet", 10, 135, 300, 20)
    Local $GW = GUICtrlCreateInput("Gateway", 10, 165, 300, 20)
    Local $Radio1TX = GUICtrlCreateInput("Radio 1 Tx", 10, 195, 300, 20)
    Local $Radio1RX = GUICtrlCreateInput("Radio 1 Rx", 10, 225, 300, 20)
    Local $Radio2TX = GUICtrlCreateInput("Radio 2 Tx", 10, 255, 300, 20)
    Local $Radio2RX = GUICtrlCreateInput("Radio 2 Rx", 10, 285, 300, 20)
    Local $MngPort = GUICtrlCreateInput("Service points - MNG Port number", 10, 315, 300, 20)
    Local $MODid = GUICtrlCreateInput("Moduliacijos ID", 10, 345, 300, 20)
    Local $MODpr = GUICtrlCreateInput("Moduliacijos max profile", 10, 375, 300, 20)
    Local $idBtn = GUICtrlCreateButton("Generate", 10, 405, 60, 20)



    GUISetState(@SW_SHOW)



 While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idBtn
                ExitLoop
        EndSwitch

 WEnd

If $idBtn = True Then

; Atidaromas Notepad
Run ("Notepad.exe")
Sleep (3000)

; Saito Name (pvz KN01-KN02) ir Location (KN01) nustatymai
ControlSend("[CLASS:Notepad]", "", "Edit1", "platform management system-name set name ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Name))
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "platform management system-location set name ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Location))
Send ("{Enter}")
Send ("{Enter}")

; Ip adreso nustatymai
ControlSend("[CLASS:Notepad]", "", "Edit1", "platform management ip set ipv4-address ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($IPv4))
ControlSend("[CLASS:Notepad]", "", "Edit1", " subnet ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Subnet))
ControlSend("[CLASS:Notepad]", "", "Edit1", " gateway ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($GW))
ControlSend("[CLASS:Notepad]", "", "Edit1", " name ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Name))
ControlSend("[CLASS:Notepad]", "", "Edit1", " description ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Location))
Send ("{Enter}")
Send ("{Enter}")

; Disable demo admin nustatymas
ControlSend("[CLASS:Notepad]", "", "Edit1", "platform activation-key set demo admin disable")
Send ("{Enter}")
Send ("{Enter}")
; Sukuriama XPIC group, nustatomas XPIC admin enable

ControlSend("[CLASS:Notepad]", "", "Edit1", "radio xpic create group 1 radio 1 port 1 radio 1 port 2")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "radio xpic set group 1 admin enable")
Send ("{Enter}")
Send ("{Enter}")

; Sukuriama Multi-carrier-abc grupe/Pridedami members i group/ iseinama is Multi-carrier-abc komandines eilutes

ControlSend("[CLASS:Notepad]", "", "Edit1", "multi-carrier-abc create group group_id 1")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "multi-carrier-abc group-id 1")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "attach-member slot 1 port 1 channel-id 1")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "attach-member slot 1 port 2 channel-id 2")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "exit")
Send ("{Enter}")
Send ("{Enter}")

; Radio Frequency keitimas (pirmo), nustatomas Radio mute off, ijungiamas admin enable

ControlSend("[CLASS:Notepad]", "", "Edit1", "radio slot 1 port 2")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf set tx-frequency ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Radio1TX))
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf set rx-frequency ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Radio1RX))
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf mute set admin off")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf adaptive-power admin enable")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "exit")
Send ("{Enter}")
Send ("{Enter}")

; Radio Frequency keitimas (antro), nustatomas Radio mute off, ijungiamas admin enable

ControlSend("[CLASS:Notepad]", "", "Edit1", "radio slot 1 port 2")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf set tx-frequency ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Radio2TX))
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf set rx-frequency ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($Radio2RX))
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf mute set admin off")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "rf adaptive-power admin enable")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "exit")
Send ("{Enter}")
Send ("{Enter}")

; Ijungiamas ethernet - services - MNG (1025) - Service points valdymas Ethernet port valdymas

ControlSend("[CLASS:Notepad]", "", "Edit1", "ethernet service sid 1025")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "sp add sp-type mng int-type dot1q spid 1 interface eth slot 1 port ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($MngPort))
ControlSend("[CLASS:Notepad]", "", "Edit1", " vlan untag sp-name N.A.")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "exit")
Send ("{Enter}")
Send ("{Enter}")

; Pakeiciama radijo galvos moduliacija/ Dvieju galvu

ControlSend("[CLASS:Notepad]", "", "Edit1", "radio slot 1 port 1")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "mrmc set acm-support script-id ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($MODid))
ControlSend("[CLASS:Notepad]", "", "Edit1", "mrmc set acm-support script-id ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($MODpr))
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "yes")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "exit")
Send ("{Enter}")
Send ("{Enter}")

ControlSend("[CLASS:Notepad]", "", "Edit1", "radio slot 1 port 2")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "mrmc set acm-support script-id ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($MODid))
ControlSend("[CLASS:Notepad]", "", "Edit1", " mrmc set acm-support script-id ")
ControlSend("[CLASS:Notepad]", "", "Edit1", GUICtrlRead($MODpr))
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "yes")
Send ("{Enter}")
ControlSend("[CLASS:Notepad]", "", "Edit1", "exit")


EndIf

I have a code, when i fill multiple insert box he opens notepad and paste the full code in there so i could copy it. But i have a problem if i push exit on the table he still generate the code in notepad so i cant leave the table without generating code... Maybe some advise?

Posted
1 hour ago, Subz said:

Use Exit rather than ExitLoop below Case $GUI_EVENT_CLOSE.

Also why don't you just use FileWrite?

That fixed the problem thank you so much you saved me bro, also never tried FileWrite does it makes text file? 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...