Find my IP Address?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 327
Joined: Sun Apr 15, 2012 1:17 am
Location: USA
Contact:

Find my IP Address?

Post by Newbie4 » Thu May 02, 2013 3:08 am

Is there a way to find my IP address?

The dictionary has some commands but they require an open socket. I just want to find out what my computer's IP address is without starting a server up and connecting to it
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

CoffeeCone
Posts: 64
Joined: Fri Apr 26, 2013 8:38 am

Re: Find my IP Address?

Post by CoffeeCone » Thu May 02, 2013 3:26 am

Newbie4 wrote:Is there a way to find my IP address?

The dictionary has some commands but they require an open socket. I just want to find out what my computer's IP address is without starting a server up and connecting to it
You use the hostName along with the hostNameToAddress functioon.

Code: Select all

on mouseUp
   answer the hostNameToAddress of the hostName
end mouseUp
Learning LiveCode, one step at a time.

Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 327
Joined: Sun Apr 15, 2012 1:17 am
Location: USA
Contact:

Re: Find my IP Address?

Post by Newbie4 » Thu May 02, 2013 3:51 am

Thank you. I would never have figured that out on my own in a million years.
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/

CoffeeCone
Posts: 64
Joined: Fri Apr 26, 2013 8:38 am

Re: Find my IP Address?

Post by CoffeeCone » Thu May 02, 2013 4:01 am

Newbie4 wrote:Thank you. I would never have figured that out on my own in a million years.
The Dictionary does leave a lot to be desired.
Learning LiveCode, one step at a time.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Find my IP Address?

Post by Mark » Thu May 02, 2013 5:52 pm

Hi,

The hostname is nice, but if you want to find the global IP address, the easiest way is to use a web service:

Code: Select all

put URL "http://qery.us/iptest.php"
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Find my IP Address?

Post by andrewferguson » Fri May 10, 2013 8:25 am

Mark wrote:Hi,

The hostname is nice, but if you want to find the global IP address, the easiest way is to use a web service:

Code: Select all

put URL "http://qery.us/iptest.php"
Best,

Mark
That doesn't seem to work for me. I just get http://qery.us/iptest.php as if its a normal put and not put URL.

Andrew

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Find my IP Address?

Post by Simon » Fri May 10, 2013 9:02 am

Works for me.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Find my IP Address?

Post by Simon » Fri May 10, 2013 9:05 am

Works for me.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Find my IP Address?

Post by andrewferguson » Fri May 24, 2013 6:55 pm

Downloaded LiveCode open source, and now it works!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Find my IP Address?

Post by Mark » Fri May 24, 2013 7:05 pm

Hi,

Just to be clear, qery.us works with any version of LiveCode, open-source or not.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: Find my IP Address?

Post by andrewferguson » Fri May 24, 2013 7:09 pm

Oh,
I'll check on Wednesday when I get back to the Commercial LiveCode.
Andrew

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Find my IP Address?

Post by trevix » Thu Sep 07, 2017 4:45 pm

put URL "http://qery.us/iptest.php"

Does not work anymore. You get a bunch of stuff...

Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Find my IP Address?

Post by bogs » Thu Sep 07, 2017 5:22 pm

trevix wrote:Does not work anymore. You get a bunch of stuff...
To better define "a bunch of stuff..." heh, you basically get the page source.
Image
Image

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Find my IP Address?

Post by trevix » Thu Sep 07, 2017 5:26 pm

This works:

put URL "https://ip.seeip.org" into MyPubblicIP

I wonder for how long...
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Find my IP Address?

Post by FourthWorld » Thu Sep 07, 2017 5:56 pm

I realize the OP was looking for an answer that wasn't dependent on a server, but since the nature of the task almost requires an external server and relying on other people's servers may be dodgy, if you have a server with LC Server installed you can use this:

Code: Select all

<?lc put put $_SERVER["REMOTE_ADDR"] ?>
The bigger question here is: why is the address needed?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”