News:

Come Chat with us live! Learn how HERE!

Main Menu

Automatic Tremulous Map Downloader

Started by Somethief, August 14, 2006, 08:28:57 PM

Glunnator


Quote from: (Cebt)GlunnatorHAVE FUN PPL, IT'S THE MEANING OF LIFE TO LOOK AT THE BRIGHT SIDE OF IT! ;)

Aninhumer

While I would like an apt repository for the maps, the app works fine under wine.
I'll just run it now so I don't have to worry about maps until there is an update.

Somethief

Quote from: AninhumerWhile I would like an apt repository for the maps, the app works fine under wine.
I'll just run it now so I don't have to worry about maps until there is an update.

But under wine it cant directly copy files to trem dir?
The list of maps is public btw, http://tremmap.omgwtf.nl/tremmapdownload.php holds list of files the server has (starting from third line).

Bajsefar

Quote from: Lava CroftGood job Somethief, I think you made a lot of lazy people really happy:)

Lazy people like me.

http://tremulous.net/phpBB2/viewtopic.php?t=1409

David

Quote from: SomethiefThe list of maps is public btw, http://tremmap.omgwtf.nl/tremmapdownload.php holds list of files the server has (starting from third line).

WOOT!!!
i'll make somthing to exploit this in a min.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Somethief

Quote from: David

WOOT!!!
i'll make somthing to exploit this in a min.

I guess so too -.-

David

#!/bin/bash

#get the list
wget http://tremmap.omgwtf.nl/tremmapdownload.php -O /tmp/tremmaplist

#drop the first 3 lines
Lines=`wc -l < /tmp/tremmaplist`
tail -n $(($Lines-3)) /tmp/tremmaplist > /tmp/tremmaplist2

#download the files
wget -i /tmp/tremmaplist2 -B http://tremmap.omgwtf.nl/

#del the temp files
rm /tmp/tremmaplist
rm /tmp/tremmaplist2


this *should* stick the maps in the folder where it run.
it works for me, hopefuly it will for you.
relesed under GPL, no warrenty and all that.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

kevlarman

this is a bit of a hack but... you should add -c to wget so you don't download maps that you already have (plus things work better if your internet connection goes out on you for some reason as it did to me when i tested this script)
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

WolfWings ShadowFlight

http://wolfwings.us/tremulous/mapupdate.sh.gz

#!/bin/bash

#get the raw file list
Files=`wget http://tremmap.omgwtf.nl/tremmapdownload.php -q -O -`

#line count
Lines=`echo -e "$Files" | wc -l`

#download the files (skip the first 3 lines, they are a header)
echo -e "$Files" | tail --lines=$[$Lines - 3] - | wget -i - -B http://tremmap.omgwtf.nl;


I removed the need for temporary files except for the actual downloading part. It still stores the files in the 'current' directory as your version did.

WolfWings ShadowFlight

Quote from: kevlarmanthis is a bit of a hack but... you should add -c to wget so you don't download maps that you already have (plus things work better if your internet connection goes out on you for some reason as it did to me when i tested this script)

If you don't kill the script, wget will automatically retry and continue the download where it left off without the -c option once the connection comes back up.

David

the $[ ] has been deprecated and is going to be removed, so for future proofing

#!/bin/bash

#get the raw file list
Files=`wget http://tremmap.omgwtf.nl/tremmapdownload.php -q -O -`

#line count
Lines=`echo -e "$Files" | wc -l`

#download the files (skip the first 3 lines, they are a header)
echo -e "$Files" | tail --lines=$(($Lines - 3)) - | wget -i - -c -B http://tremmap.omgwtf.nl/


i also added the -c
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

kevlarman

Quote from: Davidthe $[ ] has been deprecated and is going to be removed, so for future proofing

#!/bin/bash

#get the raw file list
Files=`wget http://tremmap.omgwtf.nl/tremmapdownload.php -q -O -`

#line count
Lines=`echo -e "$Files" | wc -l`

#download the files (skip the first 3 lines, they are a header)
echo -e "$Files" | tail --lines=$(($Lines - 3)) - | wget -i - -c -B http://tremmap.omgwtf.nl/


i also added the -c
all right, it's official: i needto get a clue about bash scripting.
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

David

For all you windows users out there? see the power of open source?
i posted it, and with in half an hour it has been massivly upgraded by lots of people all working togever.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

kevlarman

Quote from: DavidFor all you windows users out there? see the power of open source?
i posted it, and with in half an hour it has been massivly upgraded by lots of people all working togever.
that and the fact that you did it in 3 lines of code (and could have done it in 1.5 in perl)
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

[db@]Megabite

Windows and Open Source are no real enemies... I use Windows at home (for gaming reasons mostly ;)) and use open source software most of the time... firefox, thunderbird, gimp, gaim, tremulous...

I love sh though, greatly helps administrating my servers... can't wait to use the Windows Vista scripting console once it is done... :D

Danny

P.S.: Posted the final script on tremulous.info

kevlarman

Quote from: [db@]MegabiteWindows and Open Source are no real enemies... I use Windows at home (for gaming reasons mostly ;)) and use open source software most of the time... firefox, thunderbird, gimp, gaim, tremulous...

I love sh though, greatly helps administrating my servers... can't wait to use the Windows Vista scripting console once it is done... :D

Danny

P.S.: Posted the final script on tremulous.info
windows vista is a resource hog, so i wouldn't recommend using it (for gaming reasons;))
i had to dual boot for a while this summer to run some software that only works on windows, and i absolutely couldn't stand working with windows after i was spoiled by ubuntu dapper, so i don't know how you do it, now my windows install never gets to execute any code outside vmware.
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Nosfore

Quote from: David
Quote from: OdinWouldn't it be much better if it worked like apt?
lets submit a tremulous-maps-beta package!
then someone has to keep it up to date, and all is sorted!.

Oh my god! Greatest idea of the week.

I DEMAND a Tremulous Map package!

kevlarman

Quote from: Nosfore
Quote from: David
Quote from: OdinWouldn't it be much better if it worked like apt?
lets submit a tremulous-maps-beta package!
then someone has to keep it up to date, and all is sorted!.

Oh my god! Greatest idea of the week.

I DEMAND a Tremulous Map package!
technically it should be a meta-package that depends on the packages of the individual maps, so you don't have to download 50MB every time someone releases a new map.
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

WolfWings ShadowFlight

Quote from: Davidthe $[ ] has been deprecated and is going to be removed

Looking at http://www.gnu.org/software/bash through the FAQ, current reference manual, and every mailing list I was able to find with Google, I was unable to find any statement to this effect. Source, please?

David

Quote from: WolfWings ShadowFlight
Quote from: Davidthe $[ ] has been deprecated and is going to be removed

Looking at http://www.gnu.org/software/bash through the FAQ, current reference manual, and every mailing list I was able to find with Google, I was unable to find any statement to this effect. Source, please?

i'm on xubuntu drapper.
when i do man bash, about line 1445 onwards reads
Quote from: man bashArithmetic Expansion
      Arithmetic  expansion allows the evaluation of an arithmetic expression
      and the substitution of the result.  The format for  arithmetic  expan‐
      sion is:

             $((expression))

      The  old  format  $[expression]  is  deprecated  and will be removed in
      upcoming versions of bash.


      The expression is treated as if it were within  double  quotes,  but  a
      double  quote  inside  the  parentheses  is not treated specially.  All
      tokens in the expression undergo parameter expansion, string expansion,
      command  substitution, and quote removal.  Arithmetic expansions may be
      nested.


Quote from: kevlarmanthat and the fact that you did it in 3 lines of code (and could have done it in 1.5 in perl)
could have been 1 in bash. remove comments and put ; between commands.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

kevlarman

Quote from: David
could have been 1 in bash. remove comments and put ; between commands.
i meant without cheating.
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Teiman

On Linux, with wine, fail. Try to download then show a error. Also the directory where the files are searched and downloaded are not visible, that is a important feature you sould code.

WolfWings ShadowFlight

Quote from: Davidi'm on xubuntu drapper.
when i do man bash, about line 1445 onwards reads

Thanks, was able to back-track between my version and that version and trace through the chngelog. Apparently Gentoo updated 'around' that depreciated statement. I still haven't been able to find any discussion on the actually BASH-development mailing lists about this though, so the depreciation may have been retroactively cancelled, or they may be proceeding. Thanks for the heads up though. :-)

[db@]Megabite

Quote from: kevlarmanwindows vista is a resource hog, so i wouldn't recommend using it (for gaming reasons;))
i had to dual boot for a while this summer to run some software that only works on windows, and i absolutely couldn't stand working with windows after i was spoiled by ubuntu dapper, so i don't know how you do it, now my windows install never gets to execute any code outside vmware.

Vista is not finished yet, and will not be finished by its release date... we will have to wait at least half a year or so until it is usable after release. Serious gaming will harldly go on without it as direct3d10 will only come on vista and there is not even a usable direct3d9 implementation for Linux yet. Yes, I have tried Cedega...

I am using my machine at home 90% for gaming so I am kinda bound to windows. Otherwise I would happily run Gentoo... ;)
At work I have to cope with Windows, Linux, MacOS and others... so I am used to all the good and bad sides of all systems. None of them is perfect, all of them have faults... it is just a decision of what you want to use your machine for which operation system to use.
I am not a windows fan, but I am not a Linux fan either. They are both not black or white but different shades of gray.

Danny

David

Quote from: [db@]MegabiteSerious gaming will harldly go on without it as direct3d10 will only come on vista

yes, but no games will requre dx10  for a LONG time.
all games will suppory dx9 and win XP untill the migroity of the users have vista.  afaik there are no dx10 games in the pipeline (bar MS games)
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Thorn

Quote from: David
Quote from: [db@]MegabiteSerious gaming will harldly go on without it as direct3d10 will only come on vista

yes, but no games will requre dx10  for a LONG time.
all games will suppory dx9 and win XP untill the migroity
of the users have vista.  afaik there are no dx10 games in
the pipeline (bar MS games)


What really pissed me off is the fact that there
WILL BE NO DX10 FOR WIN XP.of course somebody
will crack dx10. but ofcourse ms want money STILL.

hi , im bill gates , im the richest man on the planet. Btw do
you have any spare cash in your wallet that youd like to give me?

[db@]Megabite

1. There is Crysis by Crytek, the makers of Far Cry. DX9 version will be okay, but geeks like me want all the eye-candy... ;)

2. If I owned a company like Microsoft and had several hundred developers working for years on a project like Vista costing millions of $ I would expect people to pay for the new features the new OS brings and I had payed for developing. Where is the problem with that?

3. Nobody compels you to buy vista. Stay with XP or Ubuntu or whatever you want. Nobody comples you to drive a Porsche, stay with a Volkswagen or whatever you want... ;)

Danny

David

so its,
ubuntu = porch
xp = dump truck with moped moter
vista = dump truck full of lead with moped moter
:)
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

Thorn

WRONG . Everything compels you to to buy vista. they are dropping ALL 3d support for XP.

oh and Crysis? OH BOY OH BOY!!!!!! If only i could play right now!!! i watched the 15mins of ingame footage and things. Pretty fricken neat!

ok now were taking this TO far of topic

the Auto download idea looks neat btw

[db@]Megabite

Sure, I'd love to see you fire up Call of Duty2 on Ubuntu 1680x1050, 4XFSAA, 8xAnisotropic Filtering and get steady 125FPS. ;)

Danny