Thank you both for your replies.<br>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. <br><br>getip.bat doesn't work for me. Nothing happens. Even when i try this :<br>
<br>
@echo off<br>
for /F "usebackq tokens=14" %%i in (`ipconfig ^| find /i "IPv4"`) do echo %%i<br>pause<br><br>and launch the script manually, nothing happens in the dos window (except "hit a key to continue..." or something).<br>
Of course it doesn't work any better in Pd. <br><br>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. <br>
<br>Pierre<br><br><div class="gmail_quote">2011/1/29 patko <span dir="ltr"><<a href="mailto:colet.patrice@free.fr">colet.patrice@free.fr</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello Pierre,<br>
<br>
you can get ip adress with windows cmd<br>
<br>
<br>
In pd-extended there is [flatspace/popen] object for that,<br>
<br>
you need to create a file called 'getip.bat' containing those lines:<br>
<br>
@echo off<br>
for /F "usebackq tokens=14" %%i in (`ipconfig ^| find /i "IPv4"`) do echo %%i<br>
<br>
and then you can grab the ip adress from the computer you are in by sending [getip.bat< message to [popen] like this:<br>
<br>
[getip.bat<<br>
|<br>
[flatspace/popen<<br>
|<br>
<symbol box><br>
<br>
both patch and batch files must be in the same directory, or put the batch file into pd/bin to run it from anywhere<br>
<br>
<br>
<br>
----- "Pedro Lopes" <<a href="mailto:pedro.lopes@ist.utl.pt">pedro.lopes@ist.utl.pt</a>> a écrit :<br>
<div><div></div><div class="h5"><br>
> <lame-solution> Even if there's no shell/system object for windoes<br>
> (I'm not using win so I cannot really answer) you can easily create a<br>
> batch script (a windows shell script) that saves the output of<br>
> ipconfig in a file. Then parse the file with pd and extract the ip<br>
> from there.<br>
><br>
><br>
> It can even by dynamic in the sense that your shell script can be a<br>
> sort of cron (linux scheduled jobs, I think are called sheduled<br>
> services in win) and can run a number of times. Thus your game could<br>
> see the file for the lastest IP.<br>
><br>
> </lame-solution><br>
><br>
><br>
><br>
> On Fri, Jan 28, 2011 at 11:57 PM, Pierre Massat < <a href="mailto:pimassat@gmail.com">pimassat@gmail.com</a> ><br>
> wrote:<br>
><br>
><br>
> Hi all,<br>
><br>
> Is it possible to get my computer's IP from inside Pd? I know it's<br>
> possible in Linux using the shell object, but it doesn't exist in<br>
> windows. I'm trying to make a game requiring two players to play on<br>
> two different computers, and it'd be very annoying if each user had to<br>
> find her IP before playing.<br>
><br>
> Pierre<br>
><br>
> _______________________________________________<br>
> <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -><br>
> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Pedro Lopes (MSc)<br>
> contact: <a href="mailto:pedro.lopes@ist.utl.pt">pedro.lopes@ist.utl.pt</a><br>
> website: <a href="http://web.ist.utl.pt/Pedro.Lopes" target="_blank">http://web.ist.utl.pt/Pedro.Lopes</a> /<br>
> <a href="http://pedrolopesresearch.wordpress.com/" target="_blank">http://pedrolopesresearch.wordpress.com/</a><br>
><br>
> _______________________________________________<br>
> <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -><br>
> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br>
--<br>
</div></div>Patrice Colet<br>
</blockquote></div><br>