Skip to content

Instantly share code, notes, and snippets.

@meicookies
Last active October 18, 2021 05:10
Show Gist options
  • Select an option

  • Save meicookies/923fa5c3e2bcf197c67d7449054b63af to your computer and use it in GitHub Desktop.

Select an option

Save meicookies/923fa5c3e2bcf197c67d7449054b63af to your computer and use it in GitHub Desktop.
Bot social credit
get() {
credit=0
wallet=()
until [ $credit -ge $1 ]; do
[[ $credit -ge $1 ]] && break
social=$(( RANDOM % $1 ))
credit=$(( $credit + $social ))
echo "[+] You have earned: $credit Social credits"
sleep 1
wallet+=($credit)
done
total=$(IFS=+; echo "$((${wallet[*]}))")
echo $total > .wallet
unset social credit
}
if [ -z $1 ]; then
echo "Usage: $0 [option] [int]"
echo -e "Option:\n\t-c [int]\t to earn social credit"
echo -e "\n\t-w\t\t your social credit wallet"; exit
fi
case $1 in
-c)
if [[ -z $2 ]]; then
echo "how much?"
else
get "$2"
fi
;;
-w)
if [[ -f .wallet ]]; then
echo "Balance: $(cat .wallet) Social Credits"
else
echo "poor"
fi
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment