Skip to content

Instantly share code, notes, and snippets.

@Samg381
Created December 18, 2022 02:04
Show Gist options
  • Save Samg381/f06bde264c065e51ff20c9e9bde51949 to your computer and use it in GitHub Desktop.
Save Samg381/f06bde264c065e51ff20c9e9bde51949 to your computer and use it in GitHub Desktop.
DayZ Chernarus Map Downlaoder
## Used with WSL // Hence explorer.exe call at bottom
printf "Please specify resolution (1-8): "
read RES
# =========
if [ $RES == 1 ]; then
SIZE=1
elif [ $RES == 2 ]; then
SIZE=3
elif [ $RES == 3 ]; then
SIZE=7
elif [ $RES == 4 ]; then
SIZE=15
elif [ $RES == 5 ]; then
SIZE=31
elif [ $RES == 6 ]; then
SIZE=63
elif [ $RES == 7 ]; then
SIZE=127
elif [ $RES == 8 ]; then
SIZE=255
else
exit;
fi
# res 3, size 7
# res 4, size 15
# res 7, size 127
# res 8, size 255
find . -type f -iname \*.jpg -delete
TOT=$((SIZE+1))
for (( y=0; y<=$SIZE; y++ ))
do
for (( x=0; x<=$SIZE; x++ ))
do
xFileName=$(printf "%03d" $x)
yFileName=$(printf "%03d" $y)
echo https://maps.izurvive.com/maps/ChernarusPlus-Top/1.19.0/tiles/"$RES"/"$x"/"$y".jpg | xargs wget -O "${yFileName}_${xFileName}.jpg" > /dev/null 2>&1
if [ $RES -ge 5 ]
then
if ! (( $x % 5 )) ; then
if ! (( $y % 5 )) ; then
printf "[${yFileName}_${xFileName}]"
fi
fi
else
printf "[${yFileName}_${xFileName}]"
fi
done
if [ $RES -ge 5 ]
then
if ! (( $y % 5 )) ; then
printf "\n"
fi
else
printf "\n"
fi
done
montage -mode concatenate *_*.jpg -tile "${TOT}x${TOT}" miff:- | convert - +append "${TOT}x${TOT}.png"
explorer.exe "${TOT}x${TOT}.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment