this post was submitted on 06 Oct 2023
2 points (100.0% liked)

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ

54609 readers
601 users here now

⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don't request invites, trade, sell, or self-promote

3. Don't request or link to specific pirated titles, including DMs

4. Don't submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-Fi Liberapay
Ko-fi Liberapay

founded 1 year ago
MODERATORS
 

Paste code to text file .sh extension and run script in the directory where jc141 are present, also install dialog

#!/bin/bash

# navigate to the directory containing the .sh files
cd "$(dirname "$(readlink -f "$0")")" || exit

# directory containing the game directories
games_dir="$PWD/"

# check if the games directory exists
if [ ! -d "$games_dir" ]; then
echo "error: The 'games' directory does not exist."
exit 1
fi

# initialize the dialog menu options
menu_options=()

# loop through subdirectories in the games directory
for game_dir in "$games_dir"/*/; do
if [ -d "$game_dir" ]; then
# extract the parent directory name as the game name
game_name=$(basename "$game_dir")
        
# check if any of the specified .sh files exist
if [ -f "$game_dir/start.w.sh" ] || [ -f "$game_dir/start.e-w.sh" ] || [ -f "$game_dir/start.sh" ] || [ -f "$game_dir/start.n.sh" ]; then
# add the game name to the menu options
menu_options+=("$game_name" "Run $game_name")
fi
fi
done

# use dialog to display the menu
choice=$(dialog --title "Select a game:" --menu "Games:" 30 30 15 "${menu_options[@]}" 2>&1 >/dev/tty)

# check if the user selected a game and execute it
if [ -n "$choice" ]; then
selected_game="${choice#* }" # extract the selected game name from the choice
selected_game_dir="$games_dir/$selected_game"

# determine which script exists and set the selected_game_script accordingly
if [ -f "$selected_game_dir/start.w.sh" ]; then
selected_game_script="$selected_game_dir/start.w.sh"
elif [ -f "$selected_game_dir/start.e-w.sh" ]; then
selected_game_script="$selected_game_dir/start.e-w.sh"
elif [ -f "$selected_game_dir/start.n.sh" ]; then
selected_game_script="$selected_game_dir/start.n.sh"
elif [ -f "$selected_game_dir/start.sh" ]; then
selected_game_script="$selected_game_dir/start.sh"
else
echo "error: this script must run with in the directory of jc141 downloads"
exit 1
fi
    
# execute the selected game's script
chmod +x "$selected_game_script" # make the script executable
"$selected_game_script"
fi


no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here