Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #include <Constants.au3>
- #include <plink.au3>
- #include <file.au3>
- #Region ### START Koda GUI section ### Form=
- HotKeySet('`',"_read"); hit this button to read your input after hitting enter(tilde button)
- $Form1 = GUICreate("ParagonPOS Autoresponder", 625, 443, 192, 124)
- $Button1 = GUICtrlCreateButton("Autoresponder ON", 112, 96, 145, 33, $WS_GROUP)
- $Button2 = GUICtrlCreateButton("Autoresponder OFF", 336, 96, 145, 33, $WS_GROUP)
- $Input = GUICtrlCreateInput("", 232, 48, 121, 21)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- Global $plink
- $_plink_logging=true
- $user = "";username
- $pass = "";password
- $host = "";host
- $read = False
- $log = "plink.log"
- responderOn()
- responderOff()
- _read()
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1
- $Input = GUICtrlRead($Input)
- responderOn()
- Case $Button2
- $Input = GUICtrlRead($Input)
- responderOff()
- EndSwitch
- Sleep(20)
- WEnd
- func responderOn()
- while 1
- $msg = StdoutRead($plink)
- if @error then ExitLoop
- if $msg <> "" Then
- ConsoleWrite($msg)
- EndIf
- if $read Then
- StdinWrite($plink,ConsoleRead())
- $read=False
- EndIf
- sleep(25)
- WEnd
- StdioClose($plink)
- $command = '"' & "/usr/local/psa/bin/autoresponder --on " & $Input & '"'
- $plink = Run("plink.exe -P 666 -l "&$user&" -pw "&$pass&" -ssh "&$host&" "&$command,@ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDERR_CHILD + $STDOUT_CHILD)
- EndFunc
- func responderOff()
- while 1
- $msg = StdoutRead($plink)
- if @error then ExitLoop
- if $msg <> "" Then
- ConsoleWrite($msg)
- EndIf
- if $read Then
- StdinWrite($plink,ConsoleRead())
- $read=False
- EndIf
- sleep(25)
- WEnd
- StdioClose($plink)
- $command1 = '"' & "/usr/local/psa/bin/autoresponder --off " & $Input & '"'
- $plink = Run("plink.exe -P 666 -l "&$user&" -pw "&$pass&" -ssh "&$host&" "&$command1,@ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDERR_CHILD + $STDOUT_CHILD)
- EndFunc
- func _read()
- $read = True
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement