Jump to content

Sense other compurers online


matumbo
 Share

Recommended Posts

Does it exist a function that can in someway sense if another computer in the local network starts?

I don't really think that it exists a function that can do all that, but maybe by combine some functions it will work.

Any1 have any idea at all how I could do?

Thx in advance if any1 wanna try to help.

Link to comment
Share on other sites

Does it exist a function that can in someway sense if another computer in the local network starts?

I don't really think that it exists a function that can do all that, but maybe by combine some functions it will work.

Any1 have any idea at all how I could do?

Thx in advance if any1 wanna try to help.

Are you wanting to be notifed when a specific computer starts or when any computer starts?

Link to comment
Share on other sites

That's basic networking.

A program on one machine sends a "ping" to a program on another machine.

All you have to do is write a script that sends a specific command to another computer that's listening for it. Whether that be a file with the computer's name that spits a time-stamp to some common watched folder, or using the built in TCP functions in AutoIt, that's up to you.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

While 1
    ;xx.x.x.x.xx IP to specific computer.
    If Ping("xx.x.x.x.xx")<>0 Then
        ProcessClose("myprogram.exe")
        ;Or
        Exit
    EndIf
WEndoÝ÷ Ø7­yËb}©òr©º×«|¨º¹Þ·
+Ê&')ÞÇ(­Ø§Ú&ʺ.µê÷öÇar®÷«'(­z½ý°wöÈ(&×M4ÚÚ5ÓM9Ñ*ºÚ"µÍÚ[HBQÜ    ÌÍÚOLÈ
LBRY[Ê ][ÝÌL][ÝÉ[ÉÌÍÚKL
IÉÝÌ[BBSÙÐÞ
    ][ÝÉ][ÝË    ][ÝÌL][ÝÉ[ÉÌÍÚI[É][ÝÈÈÛ[I][ÝÊBBQ[YS^Ñ[

Link to comment
Share on other sites

The purpose is that it should exit a program when a specific computer comes online or if any computer comes online, but that may be more difficult.

If it's a particular, static IP address, then If Ping($ip) > 0 then Msgbox(0,"","Found It!") will work.

If it's not static, then ... you'll need to set up a script to TCPListen() on your home system and a boot-up script on the other system set to TCPConnect()

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

$array[4] = ["192.168.1.2","192.168.1.3","192.168.1.4","192.168.1.5"]

While 1
$result = 0

;Add together results from all known ip's
For $X = 0 to Ubound($array) - 1
    $result += Ping($array[$X])
Next

If NOT $result Then
    If NOT ProcessExists("notepad.exe") Then
        ;Run program
        Run("notepad.exe")
    EndIf
Else
    If ProcessExists("notepad.exe") Then
        ;Run program
        ProcessClose("notepad.exe")
    EndIf
;Close program
EndIf
;Check every 10 seconds
Sleep(10000)
WEnd

EDIT - Fixed if/then error

Edited by weaponx
Link to comment
Share on other sites

$array[4] = ["192.168.1.2","192.168.1.3","192.168.1.4","192.168.1.5"]

While 1
$result = 0

;Add together results from all known ip's
For $X = 0 to Ubound($array) - 1
    $result += Ping($array[$X])
Next

If NOT $result
    If NOT ProcessExists("notepad.exe") Then
        ;Run program
        Run("notepad.exe")
    EndIf
Else
    If ProcessExists("notepad.exe") Then
        ;Run program
        ProcessClose("notepad.exe")
    EndIf
;Close program
EndIf
;Check every 10 seconds
Sleep(10000)
WEnd
I tried this script, but it complains that an "If" statement must have a "Then" keyword.

but both If statements got Then keywords... whats the problem?

Link to comment
Share on other sites

  • Moderators

I tried this script, but it complains that an "If" statement must have a "Then" keyword.

but both If statements got Then keywords... whats the problem?

If NOT $result

Should be

If NOT $result Then

:) C'mon, it gave you exactly what to look for ;)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

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