-
-
Save spac3unit/a4b33c047790147b93cf32ed66221fc8 to your computer and use it in GitHub Desktop.
Revisions
-
YogaSakti revised this gist
Sep 5, 2021 . 1 changed file with 13 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,20 @@ #!/bin/bash DELAY=300 #in secs - how often restart the script ROLL_PRICE=100 for (( ;; )); do WALLET=$(massa-client wallet_info) ADDRESS=$(echo -e $WALLET | grep -oP 'Address:\s*\K.*(?=\s+State)') FINAL_BAL=$(echo -e $WALLET | grep -oP 'final balance:\s*\K.*(?=\s+candidate balance)') CANDIDATE_BAL=$(echo -e $WALLET | grep -oP 'candidate balance:\s*\K.*(?=\s+locked balance)') LOCKED_BAL=$(echo -e $WALLET | grep -oP 'locked balance:\s*\K.*(?=\s+final rolls)') FINAL_ROLL=$(echo -e $WALLET | grep -oP 'final rolls:\s*\K.*(?=\s+candidate rolls)') CANDIDATE_ROLL=$(echo -e $WALLET | grep -oP 'candidate rolls:\s*\K.*(?=\s+active rolls)') ACTIVE_ROLL=$(echo -e $WALLET | grep -oP 'active rolls:\s*\K.*') ROLL=$(bc -l <<<"scale=0; $FINAL_BAL/$ROLL_PRICE") echo -e "================================== Wallet ==================================" @@ -36,7 +37,7 @@ for (( ;; )); do echo -e "================================= Failed! =================================" echo -e "[x] You don't have enough coins to buy roll" fi echo -e "================================== Delay! ==================================" for (( timer=${DELAY}; timer>0; timer-- )) -
YogaSakti created this gist
Sep 3, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ #!/bin/bash DELAY=300 #in secs - how often restart the script WALLET=$(massa-client wallet_info) ADDRESS=$(echo -e $WALLET | grep -oP 'Address:\s*\K.*(?=\s+State)') FINAL_BAL=$(echo -e $WALLET | grep -oP 'final balance:\s*\K.*(?=\s+candidate balance)') CANDIDATE_BAL=$(echo -e $WALLET | grep -oP 'candidate balance:\s*\K.*(?=\s+locked balance)') LOCKED_BAL=$(echo -e $WALLET | grep -oP 'locked balance:\s*\K.*(?=\s+final rolls)') FINAL_ROLL=$(echo -e $WALLET | grep -oP 'final rolls:\s*\K.*(?=\s+candidate rolls)') CANDIDATE_ROLL=$(echo -e $WALLET | grep -oP 'candidate rolls:\s*\K.*(?=\s+active rolls)') ACTIVE_ROLL=$(echo -e $WALLET | grep -oP 'active rolls:\s*\K.*') ROLL_PRICE=100 for (( ;; )); do ROLL=$(bc -l <<<"scale=0; $FINAL_BAL/$ROLL_PRICE") echo -e "================================== Wallet ==================================" echo -e "[>] Address: ${ADDRESS}" echo -e "================================= Balances =================================" echo -e "[>] Final Balance: ${FINAL_BAL}" echo -e "[>] Candidate Balance: ${CANDIDATE_BAL}" echo -e "[>] Locked Balance: ${LOCKED_BAL}" echo -e "================================== Rolls ===================================" echo -e "[>] Final Roll: ${FINAL_ROLL}" echo -e "[>] Candidate Roll: ${CANDIDATE_ROLL}" echo -e "[>] Active Roll: ${ACTIVE_ROLL}" if [ "$ROLL" -gt 0 ]; then echo -e "================================= Success =================================" echo -e "[+] Balance : ${FINAL_BAL}" echo -e "[+] Buyable : ${ROLL}" echo -e $(massa-client buy_rolls ${ADDRESS} ${ROLL} 0) else echo -e "================================= Failed! =================================" echo -e "[x] You don't have enough coins to buy roll" fi echo -e "================================== Delay! ==================================" for (( timer=${DELAY}; timer>0; timer-- )) do printf "[+] Sleep for ${RED}%02d${NC} sec\r" $timer sleep 1 done done