Jump to content

Checking The Ip Of Individual Windows


 Share

Recommended Posts

I'm still a noob at all of this, but I've been learning fairly well. I've browsed this forum for some time, but have never needed to register or post because I usually found what I was looking for. I have hit a snag and I can't seem to find the answer this time. I mostly write scripts for game related functions. Anyway, my questions is this:

Is there any way to check the IP of individual windows and know which IP goes to which window?

When I say "window", I mean that it is a game that is connected to the internet, and each window is a different instance of the same game. I have no problems checking the IP of one window, but for multiple windows I don't know how to associate the individual IP's to each window correctly. Each game has a slight variation in it's IP to make it unique.

I run Netstat to get a list of all active connections and search through a text file printout of what Netstat returns and find a specific string within it to identify the proper IP. However, for 3 windows let's say, I will get 3 returns of that specific string and I don't know which IP goes to which window.

I hope this is clear enough of what I am intending to accomplish. I can't find anything relating to this in the AutoIt help menus either.

Thank you.

Link to comment
Share on other sites

HI,

i didn't get at all, but maybe think of doing it manually. How would you do that? and then think about automating the manual way with Autoit.

Hope that helps a bit.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

HI,

i didn't get at all, but maybe think of doing it manually. How would you do that? and then think about automating the manual way with Autoit.

Hope that helps a bit.

So long,

Mega

Thank you for your input. I am already doing it automatically the manual way. :think:

There is no way to determine which foreign address corresponds to which window using netstat, even manually, in the event that more than one of the foreign addresses for the windows are the same. The only difference I can see is the port on the local address. I assume that is the port, it ends with :xxxx. Anyway, I still do not see any way to determine which port goes to which window either.

This is very important since I want to take my existing program and let it perform it's function for multiple windows, but in the event that one of those windows loses connection with the game server, I need to know which window it is that loses connection so I can have it automatically reconnect. I think I can write a complex script to determine each window's address as it is established, and then maybe use pixel recognition to determine the current state of each window at specified intervals, but I was hoping there was an easier way. If not then I guess I have no other option, but I would think that every computer had some way to determine which programs were using which connections.

I just thought of another way too, I could also link the specified local port to each window as it is connected. I would still rather find an easier way however, if there is one, and I'm sure there has to be one. Any help would be appreciated.

Link to comment
Share on other sites

Yea what about just.. Open Window 1 > Find IP1. Open Window 2 > Find IP2 in list that is not IP1, etc. Then if one disconnects you will know which because the IP will be assigned to the window in your script.

It will work, but it might be an annoying way to do it since you will not be able to have the windows open before the script is run.

Link to comment
Share on other sites

Yea what about just.. Open Window 1 > Find IP1. Open Window 2 > Find IP2 in list that is not IP1, etc. Then if one disconnects you will know which because the IP will be assigned to the window in your script.

It will work, but it might be an annoying way to do it since you will not be able to have the windows open before the script is run.

Yeah, that really wouldn't help for two reasons.

1) In a lot of cases the IP's are completely identical, with exception of the local port.

2) That would only allow me to determine the IP of each window as it is established, but not allow me to monitor the connection status so I can reconnect if I should happen to lose connection. Unless I use the local port to link them.

This is basically what I have already thought of and am trying to get around. Thanks for your suggestion however. :think:

Link to comment
Share on other sites

I don't know how to do it progmatically, but there is a freeware program called ActivePorts for Windows that I use to see what ports are being used by what programs. It's better than netstat.

As far as automation, I don't know. Maybe see if you can find a DLL sniffer to see what DLLs it's calling (I mean ActivePorts) and try to do the same from AutoIt. Or write the author and see if he can point you in the right direction.

Link to comment
Share on other sites

I don't know how to do it progmatically, but there is a freeware program called ActivePorts for Windows that I use to see what ports are being used by what programs. It's better than netstat.

As far as automation, I don't know. Maybe see if you can find a DLL sniffer to see what DLLs it's calling (I mean ActivePorts) and try to do the same from AutoIt. Or write the author and see if he can point you in the right direction.

I tried to get Active Ports, if for no other reason to aid in troubleshooting the program. Unfortunately I still use Windows 98 and it's not supported for this program. I'll write the author, maybe, as a last resort only. I'm sure he has enough emails from other people to sort through as it is. Thanks anyway. :think:

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...