Why No Built in GetMyIP call in LiveCode?
form at nonsanity.com
Fri Jun 10 13:49:09 CDT 2011
haha I completely failed to grasp that. :)
put char 2 to -2 of word 3 of shell( "ping -n 1" && word 2 of shell("ping -n
1 localhost") ) into msg
~ Chris Innanen
On Fri, Jun 10, 2011 at 2:20 PM, John Patten <johnpatten at mac.com> wrote:
> Actually Chris I wanted the local network, behind the firewall IP address.
> The project I have in mind is just using sockets in a single classroom. All
> computers have 10.x.x.x. addresses.
> John Patten
> On Jun 10, 2011, at 11:15 AM, Nonsanity wrote:
> Neither of the solutions given so far in this thread have worked for my on
>> my office PC. I just get my LAN 192.168.x.x number. Here's what I use.
>> do rely on outside entities, but they are both pretty stable sites that
>> lasted a good long time...
>> put url "http://www.whatismyip.org" into myExIP
>> put url "http://checkip.dyndns.org" into resp
>> set itemdel to ":"
>> put word 1 to -1 of item 2 of resp into resp
>> set itemdel to "<"
>> put item 1 of resp into myExIP
>> ~ Chris Innanen
>> ~ Nonsanity
>> On Fri, Jun 10, 2011 at 1:05 PM, John Patten <johnpatten at mac.com> wrote:
>> Hi All...
>>> I've been looking at all the solutions in the archive for getting the IP
>>> address of the machine running a stack. Some shell scripts, some php
>>> etc. etc.
>>> I have a situation where we are behind a firewall using NAT. So all our
>>> computers are running a 10.x.x.x.x address. I'm trying to implement some
>>> socket communication between stacks and IP address information is
>>> for this to work. I would like the communication process set up to be as
>>> transparent as possible, allowing users to connect by name and maybe
>>> IP address is a custom property for example.
>>> The Dictionary provides some examples for hostAdress function and I tried
>>> (wishful thinking, script trickery) something like this:
>>> on mouseUp
>>> open socket to "127.0.0.1:5005" with message "socketOpen"
>>> put the result
>>> end mouseUp
>>> on socketOpen theSock
>>> put the hostAddress of "127.0.0.1:5005"
>>> end socketOpen
>>> ...but it just gave me 127.0.0.1 and not the 10.x.x.x. address...
>>> Shell script works nice, but it gives quite a few IP in its result. Plus
>>> the actual machine IP is located on different lines in the result, such
>>> in a desktop machine, as opposed to a laptop on wireless.
>>> It just seems like it would be nice to have a built in function for
>>> reporting local machine's IP...
>>> Such as, "put localIP of current stack into tIP" or "get LocalIP of
>>> current stack."
>>> Is this available in the dictionary and I'm just missing it?
>>> Thank you!
>>> John Patten
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode