]> git.pond.sub.org Git - empserver/blob - scripts/mapper/mapper
Import of Empire 4.2.12
[empserver] / scripts / mapper / mapper
1 #!/bin/sh
2
3 # This script may be run from cron before each update make
4 # a map of the world.  It increments the number in the file "frames"
5 # each time it is run, and uses this number to determine the map
6 # file names.  Creates a country map and an overlay with country names. 
7 #               -harmless
8
9
10 # edit these to the location of the map files and the utilities
11 cd /home/children/howitzer/map
12 PATH=/home/children/bin/netpbm:${PATH}:/usr/local/bin:${HOME}/bin:.
13 export PATH
14
15 if test ! -s frames
16 then
17         echo 0 >frames.new
18 else
19         awk '{ print $1 + 1; }' frames > frames.new
20 fi
21
22
23 FILE=map-`cat frames.new`.gif
24 OVERMAP=overmap-`cat frames.new`.gif
25 touch census report version
26 eif mapper  <<EOF
27 dump * | ./pgmmap.awk | /home/children/bin/netpbm/ppmtogif >${FILE}
28 report * | egrep -v '(Frey|Lurker|pea|Mapmaker|Visitor|visitor|report)' >report
29 census * >! census
30 version >!version
31 exit
32 EOF
33
34 ./over.awk scale=4 version report census
35 /home/children/bin/netpbm/ppmtogif over.pbm >${OVERMAP}
36
37 if test -s "$FILE"
38 then
39         cp frames.new frames
40         rm frames.new
41 fi