matumbo Posted October 10, 2007 Share Posted October 10, 2007 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 More sharing options...
weaponx Posted October 10, 2007 Share Posted October 10, 2007 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 More sharing options...
Blue_Drache Posted October 10, 2007 Share Posted October 10, 2007 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 More sharing options...
matumbo Posted October 10, 2007 Author Share Posted October 10, 2007 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? Link to comment Share on other sites More sharing options...
matumbo Posted October 10, 2007 Author Share Posted October 10, 2007 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. Link to comment Share on other sites More sharing options...
Nahuel Posted October 10, 2007 Share Posted October 10, 2007 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Ý÷ Ø7yËb}©òr©º×«|¨º¹Þ· +Ê&zÊ')ÞÇ(اÚ&ʺ.µê÷öÇ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 More sharing options...
Blue_Drache Posted October 10, 2007 Share Posted October 10, 2007 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 More sharing options...
matumbo Posted October 10, 2007 Author Share Posted October 10, 2007 (edited) 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 October 10, 2007 by matumbo Link to comment Share on other sites More sharing options...
Nahuel Posted October 10, 2007 Share Posted October 10, 2007 Then the first one I posted should do the job. Link to comment Share on other sites More sharing options...
weaponx Posted October 10, 2007 Share Posted October 10, 2007 (edited) $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 October 10, 2007 by weaponx Link to comment Share on other sites More sharing options...
matumbo Posted October 10, 2007 Author Share Posted October 10, 2007 $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 More sharing options...
Moderators SmOke_N Posted October 10, 2007 Moderators Share Posted October 10, 2007 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 $resultShould 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now