Jump to content

Own IP


Paul Thomas
 Share

Recommended Posts

You can create a batch file in bmx which launches ipconfig.exe and redirects the output to a text file, which you then can read from bmx. That's better than reading directly from the registry using win32 api calls, because it's compatible with linux and mac too.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

or you can cheat and goto an outside source

 

file:TStream = OpenFile("http::checkip.dyndns.org")
ip:String = ReadLine(file)
CloseStream(file)
ip = Replace(ip, "<html><head><title>Current IP Check</title></head><body>Current IP Address:", "")
ip = Replace(ip, "</body></html>", "")
Notify(ip)

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Going to use your method, Mack, since then I can easily check if I'm online or not. This is for a tool so I don't mind the address opening though I'm probably going to change it to connect to my own server address.

 

Thanks, Mack.

 

not a problem, glad to help... and thats alot easier than trying to parse the results of ipconfig, which would be almost impossible on various computers... not to mention ipconfig wouldn't give you what you are looking for if you are behind a router. ;)

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

It depends, if you're doing a LAN game, then you need the internal IP from ipconfig, but for internet games the internet IP address is better.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...