Added a game list maker script for Crazy Party. did some restructuring of convenience scripts.
This commit is contained in:
37
game-scripts/crazy-party-build-games.sh
Executable file
37
game-scripts/crazy-party-build-games.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in dialog unix2dos; do
|
||||
if ! command -v $i &> /dev/null ; then
|
||||
echo "Please install dialog and dos2unix before using this script."
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "usage: $0 filename without the .txt extension."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mapfile -t gameList < <(tail +3 "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/Mini-games reference.txt")
|
||||
|
||||
for i in "${gameList[@]}" ; do
|
||||
menuList+=("$i" "${i#* }" "off")
|
||||
done
|
||||
|
||||
unset gameList
|
||||
gameList="$(dialog --clear \
|
||||
--no-tags \
|
||||
--ok-label "Add Games" \
|
||||
--separate-output \
|
||||
--backtitle "Select games to add to the $1 list." \
|
||||
--checklist "Press space to check or uncheck a selected game." 0 0 0 "${menuList[@]}" --stdout)"
|
||||
|
||||
if [[ -z "${gameList}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game"
|
||||
echo "$gameList" >> "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt"
|
||||
sort -uno "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt" "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt"
|
||||
eunix2dos "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt"
|
||||
dialog --infobox "Game list \"$1\" updated." 10 80
|
||||
exit 0
|
34
game-scripts/swamp-update.sh
Executable file
34
game-scripts/swamp-update.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
updateURL="https://www.kaldobsky.com/audiogames/SwampPatch.zip"
|
||||
|
||||
extract_error() {
|
||||
echo "There was an error extracting the patch."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# Set the swamp directory
|
||||
pushd ~/.local/wine/swamp
|
||||
|
||||
# Restore the directory stack on exit.
|
||||
trap popd EXIT
|
||||
|
||||
echo "Checking for Swamp updates..."
|
||||
|
||||
# Check for and download new patches.
|
||||
update="$(wget -N "${updateURL}" 2>&1 | grep "not modified on server")"
|
||||
|
||||
if [ -n "${update}" ]; then
|
||||
echo "Swamp is up to date."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Updating Swamp..."
|
||||
|
||||
# Unzip the new patch
|
||||
unzip -o SwampPatch.zip || extract_error
|
||||
|
||||
echo "Swamp has been updated."
|
||||
|
||||
exit 0
|
17
game-scripts/topspeedserver.sh
Executable file
17
game-scripts/topspeedserver.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
path=${1:-~/.local/wine/top-speed-3/drive_c/Program\ Files/Playing\ in\ the\ dark/Top\ Speed\ 3}
|
||||
echo "Enter URL or IP address for Top Speed 3 Server:"
|
||||
read -r -e server
|
||||
|
||||
if ! [[ "${server}" =~ ^[0-9.]*$ ]]; then
|
||||
ip="$( ping -c1 "${server}" 2> /dev/null | head -1 | cut -d '(' -f2 | cut -d ')' -f1)"
|
||||
if [[ ${#p} < 3 ]]; then
|
||||
echo "Ip address not found, nothing changed."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
ip="${ip:-${server}}"
|
||||
|
||||
sed -i "s/^Multiplayer=.*/Multiplayer=${ip}/" "${path}/TopSpeed.cfg"
|
||||
exit 0
|
Reference in New Issue
Block a user