Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.66 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <EditConstants.au3>
  3. #include <GUIConstantsEx.au3>
  4. #include <WindowsConstants.au3>
  5. #include <Constants.au3>
  6. #include <plink.au3>
  7. #include <file.au3>
  8. #Region ### START Koda GUI section ### Form=
  9. HotKeySet('`',"_read"); hit this button to read your input after hitting enter(tilde button)
  10. $Form1 = GUICreate("ParagonPOS Autoresponder", 625, 443, 192, 124)
  11. $Button1 = GUICtrlCreateButton("Autoresponder ON", 112, 96, 145, 33, $WS_GROUP)
  12. $Button2 = GUICtrlCreateButton("Autoresponder OFF", 336, 96, 145, 33, $WS_GROUP)
  13. $Input = GUICtrlCreateInput("", 232, 48, 121, 21)
  14. GUISetState(@SW_SHOW)
  15. #EndRegion ### END Koda GUI section ###
  16. Global $plink
  17. $_plink_logging=true
  18. $user = "";username
  19. $pass = "";password
  20. $host = "";host
  21.  
  22.  
  23. $read = False
  24. $log = "plink.log"
  25. responderOn()
  26. responderOff()
  27. _read()
  28. While 1
  29.  
  30. $nMsg = GUIGetMsg()
  31. Switch $nMsg
  32. Case $GUI_EVENT_CLOSE
  33. Exit
  34. Case $Button1
  35. $Input = GUICtrlRead($Input)
  36. responderOn()
  37.  
  38. Case $Button2
  39. $Input = GUICtrlRead($Input)
  40. responderOff()
  41. EndSwitch
  42. Sleep(20)
  43. WEnd
  44.  
  45. func responderOn()
  46. while 1
  47. $msg = StdoutRead($plink)
  48. if @error then ExitLoop
  49. if $msg <> "" Then
  50. ConsoleWrite($msg)
  51. EndIf
  52. if $read Then
  53. StdinWrite($plink,ConsoleRead())
  54. $read=False
  55. EndIf
  56. sleep(25)
  57. WEnd
  58. StdioClose($plink)
  59. $command = '"' & "/usr/local/psa/bin/autoresponder --on " & $Input & '"'
  60. $plink = Run("plink.exe -P 666 -l "&$user&" -pw "&$pass&" -ssh "&$host&" "&$command,@ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDERR_CHILD + $STDOUT_CHILD)
  61. EndFunc
  62. func responderOff()
  63. while 1
  64. $msg = StdoutRead($plink)
  65. if @error then ExitLoop
  66. if $msg <> "" Then
  67. ConsoleWrite($msg)
  68. EndIf
  69. if $read Then
  70. StdinWrite($plink,ConsoleRead())
  71. $read=False
  72. EndIf
  73. sleep(25)
  74. WEnd
  75. StdioClose($plink)
  76. $command1 = '"' & "/usr/local/psa/bin/autoresponder --off " & $Input & '"'
  77. $plink = Run("plink.exe -P 666 -l "&$user&" -pw "&$pass&" -ssh "&$host&" "&$command1,@ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDERR_CHILD + $STDOUT_CHILD)
  78. EndFunc
  79.  
  80. func _read()
  81. $read = True
  82. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement