Jump to content
Sign in to follow this  
matumbo

Sense other compurers online

Recommended Posts

matumbo

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.

Share this post


Link to post
Share on other sites
weaponx

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?

Share this post


Link to post
Share on other sites
Blue_Drache

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

Share this post


Link to post
Share on other sites
matumbo

Would it work just to ping the other computer, in that case what should I use to get my computer to act when the ping comes?

Share this post


Link to post
Share on other sites
matumbo

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.

Share this post


Link to post
Share on other sites
Nahuel

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^Ñ[

Share this post


Link to post
Share on other sites
Blue_Drache

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

Share this post


Link to post
Share on other sites
matumbo

thx, I'll check if I can make it to work for me

Right now it's only to check if one computer comes online.

Edited by matumbo

Share this post


Link to post
Share on other sites
Nahuel

Then the first one I posted should do the job.

Share this post


Link to post
Share on other sites
weaponx

$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

Share this post


Link to post
Share on other sites
matumbo

$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?

Share this post


Link to post
Share on other sites
SmOke_N

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.

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.