Jump to content
computergroove

Powercycling the power control in Hamachi

Recommended Posts

computergroove
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
CrypticKiwi

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
computergroove

If I just put

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

without the other then it doesn't work. Doing it twice won't either.


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
CrypticKiwi

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
computergroove

Hamachi Version 2.2.0.383.


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
CrypticKiwi

Hamachi Version 2.2.0.383.

what about windows and Autoit?

Share this post


Link to post
Share on other sites
computergroove

Windows 8.1 and autoit version 3.3.14.1


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
CrypticKiwi

some people are having the same problem controlsend works on one pc but not the other...Try to run the script as admin and disable UAC. 

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

    • faustf
      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
    • SkysLastChance
      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
    • lganta
      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!
    • rawkhopper
      By rawkhopper
      Hello everyone,
      I have a script that is automating a piece of sluggish software.  I want to automate it with a bit of caution and I am not sure the best way to do it.  ControlSend works great most of the time.  If I have it enter 10 into a text box every once in a while it will enter 1 or 11 and then hit enter.
      To overcome this I use MouseClick to select the text I just entered and then see if it matches the string it was supposed to put in before it hits enter.  This seems to work but what I love about ControlSend is there is less room for human interaction messing it up.  
      Yes I could block input but I prefer not to do that (permissions).
      Is there a better way of doing this?  Any Help would be much appreciated.
      Anyway here is the snippet of the script in question:
      Func KVSend () WinActivate ( "Window", "" ) Local $WindowPos = WinGetPos("Window", "") If $kV < 30 Then WinActivate ( "Window", "" ) ControlClick ("Window", "", 1001) ;Click in Accel Voltage box Sleep (100) ControlSend ("Window", "", 1001, $kV) ; \ kV Sleep (100) MouseMove($WindowPos[0]+130,$WindowPos[1]+75,1) MouseClick($MOUSE_CLICK_LEFT) MouseClick($MOUSE_CLICK_LEFT) Send ("^c") Local $clip = ClipGet () If $clip = $kV Then ControlSend ("Window", "", 1001, "{ENTER}") ;Hit ENTER if value is correct Sleep (100) ControlClick ("Window", "", 1518) ;Lens Clear Else Send ("{BACKSPACE}") KVSend() ; If value is incorrect try again EndIf EndIf  
    • magmet00
      By magmet00
      Do you have a working imagesearch.au3 with working dll?
      and how can i gethandle and send keyboard/mouse commands to hidden d3d window?
       
      i have tried imagesearch2015 but im getting dll error every time and tried older imagesearchs too in forum what i found.
      i have tried many things to send commands to hidden/background d3dwindow still nothing works.
      Can you help me please?
       
×