Did you create a mod, map, music, or a tool? Present them here and earn feedback!
Note: addon requests do not belong here. Note, everything uploaded to this forum, MUST have a license!
Very simple one. It connects to the lobby web interface, does some parsing of the web page and plays some sound every five seconds if at least one game is waiting in the lobby. You'll need to modify it to use your favorite sound and audio player, and you can also change the beeping rate (check out the comments). You'll need the curl package for this to work. Then you can run it in the background while doing other things. I hope it won't overload the lobby server. Suggestions are welcome.
#!/bin/sh
while [ 1 ]; do
if [ "`curl wz2100.net/lobbyserver 2>&1 | grep 'Current games' -A3 | tail -n 1 | awk '{print $1}'`" != "</ul>" ]; then
mpg123 letsplay.mp3 # put your sound and probably another sound player here
fi
sleep 5 # put the delay amount here.
done
I'm not familiar with MacOS and other UNIX-like OSes, but i think it might be working under them as well.
Last edited by NoQ on 13 Apr 2010, 18:56, edited 1 time in total.
Actually the game has the lobby built in but I see how u could use this for notifications. Just turn the time between connects down a bit . BTW it looks like it would only work on mac/linux/unix.
I know
But it doesn't auto-update and [therefore] doesn't beep when a game starts, and even if it did, it is not a pleasure to do something while an instance of warzone is running (even if you manage to "alt+tab", it still consumes some resources).
BTW it looks like it would only work on mac/linux/unix.
I've heared someone saying that windows is POSIX-compliant now, but even if it is, a typical windows user will still be unable to guess how to run this script. (And how is it supposed to beep? Run windows media player all the time? )
Windows is only "posix" compliant IF youve installed "cygwin" http://www.cygwin.com/ which is a unix shell for windows - HOWEVER most ppl have never heard of it. If you want your script to be able to run on windows, you should include cygwin lite with it .
macuser wrote: If you want your script to be able to run on windows, you should include cygwin lite with it
I suspect that if hao was concerned about Windows, he would have named his post something other than "Lobby watching script for linux".
The idea of including cygwin with a short shell script like this is amusing. And I say that as someone who has set up and used cygwin environments on Windows.
Zarel wrote:Maybe we should offer XML/JSON output...
Good idea, CSV would be also useful.
Maybe we could have kind of switch to get wanted format (?format=xml, or after slash: http://wz2100.net/lobbyserver/xml)?
Nadszedł już czas, najwyższy czas, nienawiść zniszczyć w sobie.
The time has come, the high time, to destroy hatred in oneself.
I acltually meant something like this: http://en.wikipedia.org/wiki/Microsoft_ ... s_for_UNIX
(and it seems to be pretty similar to cygwin, but official).
(i've seen some windows lovers who used emacs via cygwin. but i think it must me at least 100mb heavy (since it must include an X server) (never tried actually))
(oh no, why all my topics end up in some windows vs. linux holywar )
Eeek, you're scraping wz2100.net/lobbyserver? Maybe we should offer XML/JSON output...
Wow, we could use some! On the other hand, i could've looked at the source and do something similar to what the game itself does (though it might be more complicated).
Very interesting. However I am NOT about to start a "holy war" I have all 3 windows mac and linux and I use them all. However I hope your script can be facilitated by csv or whatever so as not to load down the server when 100 computers update every 5 secconds - poor server . Anyway good luck and keep working
hao wrote:
Wow, we could use some! On the other hand, i could've looked at the source and do something similar to what the game itself does (though it might be more complicated).
Or just use the lobby bot source code (svn/trunk/tools) ... python love!
hao wrote:oh no, why all my topics end up in some windows vs. linux holywar
Because no good deed goes unpunished? And because all the Windozers are jealous of your mad linux skillz and the elegant simplicity of your script? Don't Fear The Penguin!
hao wrote:I acltually meant something like this: http://en.wikipedia.org/wiki/Microsoft_ ... s_for_UNIX
(and it seems to be pretty similar to cygwin, but official).
(i've seen some windows lovers who used emacs via cygwin. but i think it must me at least 100mb heavy (since it must include an X server) (never tried actually))
(oh no, why all my topics end up in some windows vs. linux holywar )
1. Cygwin is fairly slow, and, afaik, does not include an X server.
2. Windows SFU is only available for the "Enterprise" and "Ultimate" versions of Windows - you can't even get it on Windows 7 Professional (and doesn't include an X server, either).
Really, X isn't exactly an inextricable part of POSIX.