[PD] IP address in windows?

Epic Jefferson jeffreyconcepcion at gmail.com
Wed Jan 4 18:40:59 CET 2012


This worked on Ubuntu for me

#N canvas 440 77 450 300 10;
#X obj 27 107 shell;
#X msg 27 13 ifconfig rausb0;
#X obj 27 134 route inet;
#X obj 27 171 unpack s s s s;
#X symbolatom 27 216 10 0 0 0 - - -;
#X msg 27 36 ifconfig wlan0;
#X msg 27 58 ifconfig eth0;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 1 4 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;

http://www.mail-archive.com/pd-list@iem.at/msg27187.html


On Wed, Jan 4, 2012 at 1:21 PM, Epic Jefferson
<jeffreyconcepcion at gmail.com>wrote:

> Hey guys, has anyone solved this issue for windows 7? I've tried to use
> the getip.bat file solution but the cmd just opens and closes instantly,
> and nothing gets returned to Pd through the [flatspace/popen] object.
> Perhaps I'm placing the getip.bat file in the wrong place, but I tried the
> same patch as the .pd file and also pd/bin, none are working.
>
>
> On Sat, Jan 29, 2011 at 7:46 PM, patko <colet.patrice at free.fr> wrote:
>
>> I've tried on windows vista it works like a charm:
>>
>> Microsoft Windows [version 6.0.6002]
>> Copyright (c) 2006 Microsoft Corporation. Tous droits réservés.
>>
>> C:\Users\patko>getip.bat
>> 192.168.0.21
>>
>> ---
>>
>> Please check with 'ipconfig' command into cmd prompt if your computer has
>> an IPv4 adress.
>>
>> In pd patch the ip adress is displayed into symbol atom, no need to add
>> 'pause' command,
>>
>> maybe you could try also on your friend's computer, I'll try to find a xp
>> machine to see what's happening.
>>
>>
>> ----- "Pierre Massat" <pimassat at gmail.com> a écrit :
>>
>> > Thank you both for your replies.
>> > As you can imagine i'm not at all comfortable with batch files. I know
>> > how to create one from a txt file, but that's about it.
>> >
>> > getip.bat doesn't work for me. Nothing happens. Even when i try this :
>> >
>> > @echo off
>> > for /F "usebackq tokens=14" %%i in (`ipconfig ^| find /i "IPv4"`) do
>> > echo %%i
>> > pause
>> >
>> > and launch the script manually, nothing happens in the dos window
>> > (except "hit a key to continue..." or something).
>> > Of course it doesn't work any better in Pd.
>> >
>> > Is there something wrong with my version of windows? I have XP. By the
>> > way, when this works (i trust you!), do you think it'll work in any
>> > version of windows? Because i have XP but the friends i'm writing the
>> > game for have 7 of vista.
>> >
>> > Pierre
>> >
>> >
>> > 2011/1/29 patko < colet.patrice at free.fr >
>> >
>> >
>> > Hello Pierre,
>> >
>> > you can get ip adress with windows cmd
>> >
>> >
>> > In pd-extended there is [flatspace/popen] object for that,
>> >
>> > you need to create a file called 'getip.bat' containing those lines:
>> >
>> > @echo off
>> > for /F "usebackq tokens=14" %%i in (`ipconfig ^| find /i "IPv4"`) do
>> > echo %%i
>> >
>> > and then you can grab the ip adress from the computer you are in by
>> > sending [getip.bat< message to [popen] like this:
>> >
>> > [getip.bat<
>> > |
>> > [flatspace/popen<
>> > |
>> > <symbol box>
>> >
>> > both patch and batch files must be in the same directory, or put the
>> > batch file into pd/bin to run it from anywhere
>> >
>> >
>> >
>> > ----- "Pedro Lopes" < pedro.lopes at ist.utl.pt > a écrit :
>> >
>> >
>> >
>> >
>> > > <lame-solution> Even if there's no shell/system object for windoes
>> > > (I'm not using win so I cannot really answer) you can easily create
>> > a
>> > > batch script (a windows shell script) that saves the output of
>> > > ipconfig in a file. Then parse the file with pd and extract the ip
>> > > from there.
>> > >
>> > >
>> > > It can even by dynamic in the sense that your shell script can be a
>> > > sort of cron (linux scheduled jobs, I think are called sheduled
>> > > services in win) and can run a number of times. Thus your game could
>> > > see the file for the lastest IP.
>> > >
>> > > </lame-solution>
>> > >
>> > >
>> > >
>> > > On Fri, Jan 28, 2011 at 11:57 PM, Pierre Massat < pimassat at gmail.com
>> > >
>> > > wrote:
>> > >
>> > >
>> > > Hi all,
>> > >
>> > > Is it possible to get my computer's IP from inside Pd? I know it's
>> > > possible in Linux using the shell object, but it doesn't exist in
>> > > windows. I'm trying to make a game requiring two players to play on
>> > > two different computers, and it'd be very annoying if each user had
>> > to
>> > > find her IP before playing.
>> > >
>> > > Pierre
>> > >
>> > > _______________________________________________
>> > > Pd-list at iem.at mailing list
>> > > UNSUBSCRIBE and account-management ->
>> > > http://lists.puredata.info/listinfo/pd-list
>> > >
>> > >
>> > >
>> > >
>> > > --
>> > > Pedro Lopes (MSc)
>> > > contact: pedro.lopes at ist.utl.pt
>> > > website: http://web.ist.utl.pt/Pedro.Lopes /
>> > > http://pedrolopesresearch.wordpress.com/
>> > >
>> > > _______________________________________________
>> > > Pd-list at iem.at mailing list
>> > > UNSUBSCRIBE and account-management ->
>> > > http://lists.puredata.info/listinfo/pd-list
>> >
>> > --
>> > Patrice Colet
>>
>> --
>> Patrice Colet
>>
>> _______________________________________________
>> Pd-list at iem.at mailing list
>> UNSUBSCRIBE and account-management ->
>> http://lists.puredata.info/listinfo/pd-list
>>
>
>
>
> --
> www.epicjefferson.com
> www.avmachinists.org Puerto Rico based Art Collective/ Non-Profit Org
>



-- 
www.epicjefferson.com
www.avmachinists.org Puerto Rico based Art Collective/ Non-Profit Org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20120104/58dc6881/attachment-0001.htm>


More information about the Pd-list mailing list