From 9bf211fae9fb3eb2088c568e1bf13d2af5b3f69d Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 5 Mar 2023 02:38:03 +0100 Subject: [PATCH] smooth carousel made from image from G1WALLET or your own pictures --- tools/make_image_ipfs_index_carousel.sh | 63 ++++++++++++++----------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/tools/make_image_ipfs_index_carousel.sh b/tools/make_image_ipfs_index_carousel.sh index b57fb338..015d7c78 100755 --- a/tools/make_image_ipfs_index_carousel.sh +++ b/tools/make_image_ipfs_index_carousel.sh @@ -5,35 +5,32 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized #Set Path to Images img_dir="$1" + if [[ ! -d $img_dir ]]; then -PLAYERONE=($(ls -t ~/.zen/game/players/ | grep -Ev "localhost" 2>/dev/null)) - [[ ! $PLAYERONE ]] && echo "NO PLAYER IN THE GAME HERE" && exit 1 - echo "ASTROPORT STATION CAROUSEL MODE" - rm -Rf ~/.zen/tmp/carousel 2>/dev/null - mkdir -p ~/.zen/tmp/carousel -# Make it with latest PLAYERS WALLETS -## RUNING FOR ALL LOCAL PLAYERS -for PLAYER in ${PLAYERONE[@]}; do - pub=$(cat ~/.zen/game/players/$PLAYER/.g1pub) - curl -so ~/.zen/tmp/carousel/${pub}.png \ - "https://g1sms.fr/g1barre/image.php?pubkey=${pub}&target=20000&title=${PLAYER}&node=g1.asycn.io&start_date=2020-01-01&display_pubkey=true&display_qrcode=true" + PLAYERONE=($(ls -t ~/.zen/game/players/ | grep -Ev "localhost" 2>/dev/null)) + [[ ! $PLAYERONE ]] && echo "NO PLAYER IN THE GAME HERE" && exit 1 - # Get PLAYER wallet amount :: ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS - COINS=$(${MY_PATH}/timeout.sh -t 20 $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey balance | cut -d '.' -f 1) - [[ $COINS == "" || $COINS == "null" ]] && echo "${PLAYER} G1WALLET ERROR" && continue - echo "+++ ${PLAYER} have $COINS Ğ1 Coins +++" - OLDCOINS=$(cat ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS 2>/dev/null) - [[ $OLDCOINS != $COINS && ! $COINS -lt 0 ]] \ - && ( cp ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS.$MOATS 2>/dev/null; \ - echo $COINS > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS ) + echo "ASTROPORT STATION CAROUSEL MODE" + rm -Rf ~/.zen/tmp/carousel 2>/dev/null + mkdir -p ~/.zen/tmp/carousel + # Make it with latest PLAYERS WALLETS + ## RUNING FOR ALL LOCAL PLAYERS + for PLAYER in ${PLAYERONE[@]}; do - ASTRONAUTENS=$(cat ~/.zen/game/players/${PLAYER}/.playerns) + pub=$(cat ~/.zen/game/players/$PLAYER/.g1pub) - ASTR="" - OPORT="" + # Get PLAYER wallet amount :: ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS + COINS=$(${MY_PATH}/timeout.sh -t 20 $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey balance | cut -d '.' -f 1) + echo "+++ ${PLAYER} have $COINS Ğ1 Coins +++" -done - img_dir="$HOME/.zen/tmp/carousel" + curl -so ~/.zen/tmp/carousel/${pub}.png \ + "https://g1sms.fr/g1barre/image.php?pubkey=${pub}&target=20000&title=${PLAYER}&node=g1.asycn.io&start_date=2020-01-01&display_pubkey=true&display_qrcode=true" + echo "GOT ~/.zen/tmp/carousel/${pub}.png" + ASTRONAUTENS=$(cat ~/.zen/game/players/${PLAYER}/.playerns) + echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert + + done + img_dir="$HOME/.zen/tmp/carousel" fi #Set Path to HTML page @@ -43,7 +40,7 @@ html_file="/tmp/index.html" echo " -Astroport IPFS Gallery +Astroport ZEN Gallery : $myIP