Jump to content
computergroove

Powercycling the power control in Hamachi

Recommended Posts

WinActivate("LogMeIn Hamachi")
Sleep(1000)
ControlSend("LogMeIn Hamachi","","Power","{SPACE}")
WinSetState("LogMeIn Hamachi","",@SW_MINIMIZE)

I have a client that is using Hamachi to remote access her office PC from home with VNC. There is an issue where the clients in the Hamachi network will randomly stop communicating with the rest of the Hamachi network group. The quick fix is to log into teamviewer and click the power button and let hamachi "power off" and then power it back on. This usually fixes it. I had her pay the $29 annual fee thinking that the problems would go away but they haven't. I made the above script and it does power off the machine and I can run it again to turn it back on but I would like to do it without having to activate the Hamachi window and then power cycling it then minimizing it. Also I would like to get notified if there is a client in the Hamachi window that is on the net but cannot connect. The difference in the GUI is that the client is flagged as red if they cannot connect, green if everything is ready and grey/white if they are offline. Any assistance on this is appreciated. Yes the above code works to power the hamachi network on and if I run it again it will power it off.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Well the solution to the first issue is simple, all you have to do is ControlSend 2 times without the rest

ControlSend("LogMeIn Hamachi","","Power","{SPACE}")
ControlSend("LogMeIn Hamachi","","Power","{SPACE}")

ill look into the other issue tho i think its not easy/possible to get pixels without focus.

instead why don't you check Hamachi log file maybe it can tell you if somebody is on the network and cant connect. i cant test it because my other computer is not currently working.

 

Edited by CrypticKiwi

Share this post


Link to post
Share on other sites

It Works for me, got my second pc working  and tested it twice on two different pcs.

what version of Hamachi/Autoit/Windows are you using?

Before_Nafter.png

Edited by CrypticKiwi

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

  • Similar Content

    • By Htps
      1. How do I make a multiple minimized windows at once believe I am holding down a key for like 5 seconds?
      I know I can send minimized windows a key press with ControlSend.
      What hat would be the way to simulate a 'humanly' held down key to a few minimized windows? 
       
      2. How come: if I compare a handle's hexa value and the actual handler, I get false
      For example: when the Notepad's handler value is 0x00000000000CFFFF, I always get the message box.
       
      if(NOT(0x00000000000C0664 == WinGetHandle("Untitled - Notepad"))) Then MsgBox(0,"swi","0x00000000000CFFFF" & @CRLF & "lmao" & @CRLF & WinGetHandle("Untitled - Notepad")) EndIf  
      Why does that happen? also I can't use hexadecimal value as a handler when I use the ControlSend function.
    • By SkysLastChance
      I must be missing something. I have had this problem multiple times. Why does F6 key not send 6 times?  
      Not working 
      ControlSend("[CLASS:#32770]", "", "", ("{F6 6}")) Working
      ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}")) ControlSend("[CLASS:#32770]", "", "", ("{F6}"))  
    • By faustf
      hi guys
      i have a script  like this,  in windows 7 work perfect , in windows 10 not  work  , some one can explain me  why ??'
      #include <Array.au3> #include <MsgBoxConstants.au3> Global $aGPathFoto= FileReadToArray (@ScriptDir & "\TEMP\PathFoto.txt") Local $ctrl = 0 While 1 Local $hWnd = WinWait("[CLASS:#32770]", "", 10) If WinExists("[CLASS:#32770]") Then If $ctrl < 2 Then ControlSend($hWnd, "Choose File to Upload", "[CLASS:Edit; INSTANCE:1]", $aGPathFoto[0]&"{Enter}") Exit $ctrl += 1 Else ExitLoop EndIf EndIf WEnd $aGpathfoto = C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg
    • By SkysLastChance
      Run("notepad.exe") GLOBAL $One = ('Line1' & _ 'Line2' & _ 'Line3' & _ 'Line4' & _ 'Line5') ClipPut($One) $Notepad = WinWait("[CLASS:Notepad]", "", 10) ControlSend("Untitled - Notepad", "", "", ("^v")) Instead of having this paste as Line1Line2Line3Line4Line5
      How can I make it paste it into notepad as (without double spacing.)
      Line1
      Line2
      Line3
      Line4
      Line5
    • By lganta
      Hello!
      I created some scripts for a simple farming bot a few years ago and they rely on ControlSend.
      A year ago I quit that game and then installed Windows 10 (was using windows 7).
      Recently I installed that game and tried running them again and they seem to work (I have some messages displayed on the screen with the state of the bot ), except for the ControlSend part (which obviously is crucial).
      I started debugging the scripts so I created a basic script that makes use of Send. I tested this with Notepad in focus and works just fine and then with my game window in focus and it didn't work (it's supposed to write that text in an input box from the game).
      #include <MsgBoxConstants.au3> Sleep(3000); Send("some text"); MsgBox($MB_OK, "Notification", "Control was sent!");  
      Is there a way for the creators of the game to create some kind of security system against this? Or something happens because I updated to Windows 10?
      Is there something I'm missing?
      Thank you!
×
×
  • Create New...