summaryrefslogtreecommitdiff
path: root/forgebot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'forgebot.sh')
-rwxr-xr-xforgebot.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/forgebot.sh b/forgebot.sh
index 0a5b1e7..bf07e1c 100755
--- a/forgebot.sh
+++ b/forgebot.sh
@@ -22,13 +22,13 @@ while true; do
fi
atrocity_debug UUID: $uuid
processes="$(curl -H "Api-Key: $HYPIXEL_KEY" https://api.hypixel.net/v2/skyblock/profiles\?uuid=$uuid 2>/dev/null | tee api_response.json|
- jq '[.profiles[].members["'$uuid'"] | select(.forge.forge_processes.forge_1) | {"qf": .mining_core.nodes.forge_time,"fp": [.forge.forge_processes.forge_1[]]}]')"
+ jq '[.profiles[] | select(.members["'$uuid'"].forge.forge_processes.forge_1) | {"qf": .members["'$uuid'"].mining_core.nodes.forge_time,"fp": [.members["'$uuid'"].forge.forge_processes.forge_1[]], cutename: .cute_name}]')"
atrocity_debug $processes
mkdir -p notificationdata
touch notificationdata/$uuid
now=$(date +%s000)
rm -f messagedata
- echo "$processes"| jq -r '.[] | {qf: (.qf // 0), fp: .fp[]} | (if (.qf == 20) then "0.7" elif (.qf == 0) then "1" else (1 - (.qf * .5 + 10) / 100|tostring) end) + " " + .fp.id + " " + (.fp.startTime|tostring) + " " + (.fp.slot|tostring)' | while read qf id starttime slot; do
+ echo "$processes"| jq -r '.[] | {qf: (.qf // 0), fp: .fp[], cutename: .cutename} | (if (.qf == 20) then "0.7" elif (.qf == 0) then "1" else (1 - (.qf * .5 + 10) / 100|tostring) end) + " " + .fp.id + " " + (.fp.startTime|tostring) + " " + (.fp.slot|tostring) + " " + (.cutename)' | while read qf id starttime slot cutename; do
atrocity_debug ID: $id STARTTIME: $starttime SLOT: $slot
doneat=$(($starttime + $(get_duration $id)))
atrocity_debug DONEAT WITHOUT QF: $doneat
@@ -40,11 +40,13 @@ while true; do
atrocity_debug "$now > $doneat: $isready"
if [[ $isready -eq 1 ]]; then
atrocity_debug READY
- echo $starttime > notificationdata/$uuid.new
+ echo $starttime >> notificationdata/$uuid.new
if [[ already_notified -eq 1 ]]; then
- echo Your $id in $slot is ready since "<t:$(($doneat / 1000)):R> (started <t:$(($starttime / 1000)):R>)" >>messagedata
+ echo Your $id in $slot on $cutename is ready since "<t:$(($doneat / 1000)):R> (started <t:$(($starttime / 1000)):R>)" >>messagedata
+ atrocity_debug ADDED
fi
fi
+ atrocity_debug ===============================
done
if [[ -f messagedata ]]; then
echo Sending messagedata: