mirror of
https://github.com/datajerk/gameserverclient.git
synced 2025-01-15 10:30:32 +00:00
minor refactoring, timing
This commit is contained in:
parent
b7b32ec993
commit
92f183f045
@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# needs better error handling, zxing returns true on fail, test with Stellar Invaders
|
||||
|
||||
set -e
|
||||
|
||||
tifftopnm <$1 2>/dev/null | pnmtojpeg >decode.jpg
|
||||
|
18
demo.sh
18
demo.sh
@ -9,17 +9,13 @@ then
|
||||
DEMO=1
|
||||
fi
|
||||
|
||||
RAND=0
|
||||
if [ "$GAME" = "random" ]
|
||||
then
|
||||
GAME=""
|
||||
RAND=1
|
||||
fi
|
||||
ITEMS=$(curl -sL http://asciiexpress.net/gameserver/links.html | wc -l)
|
||||
LINE=$(( RANDOM % ITEMS + 1))
|
||||
else
|
||||
ITEMS=$(curl -sL http://asciiexpress.net/gameserver/links.html | awk -F\" '{print $4}' | sort | grep -i "$GAME" | wc -l)
|
||||
|
||||
ITEMS=$(curl -sL http://asciiexpress.net/gameserver/links.html | awk -F\" '{print $4}' | sort | grep -i "$GAME" | wc -l)
|
||||
|
||||
if (( RAND == 0 ))
|
||||
then
|
||||
if (( ITEMS == 0 ))
|
||||
then
|
||||
echo "game $GAME not found" >&2
|
||||
@ -38,14 +34,10 @@ then
|
||||
fi
|
||||
|
||||
LINE=$(curl -sL http://asciiexpress.net/gameserver/links.html | awk -F\" '{print $4}' | sort | grep -ni "$GAME" | head -$ITEM | tail -1 | awk -F: '{print $1}')
|
||||
else
|
||||
LINE=$(( RANDOM % ITEMS + 1))
|
||||
fi
|
||||
|
||||
GAME=$(curl -sL http://asciiexpress.net/gameserver/links.html | sort | head -$LINE | tail -1 | awk -F\" '{print $4 "," $6}' | sed 's/.html$/.qr.wav/')
|
||||
|
||||
DOWN=$((LINE - 1))
|
||||
TITLE=$(echo $GAME | awk -F, '{print $1}')
|
||||
TITLE=$(curl -sL http://asciiexpress.net/gameserver/links.html | sort | head -$LINE | tail -1 | awk -F\" '{print $4}')
|
||||
|
||||
echo
|
||||
echo -n "${TITLE}..."
|
||||
|
@ -5,7 +5,7 @@ on run argv
|
||||
set my_timeout1 to item 3 of argv
|
||||
set my_screen2 to item 4 of argv
|
||||
set my_timeout2 to item 5 of argv
|
||||
set my_down to item 6 of argv
|
||||
set my_down to item 6 of argv as number
|
||||
set my_demo to item 7 of argv as number
|
||||
|
||||
tell application "Virtual ]["
|
||||
@ -76,8 +76,9 @@ on run argv
|
||||
set speed to maximum
|
||||
end if
|
||||
if (my_demo = 1) then
|
||||
delay my_audiotime
|
||||
delay (my_audiotime + 0.5)
|
||||
end if
|
||||
-- will need to be ajusted based on speed of your mac
|
||||
delay 1.5
|
||||
-- normal speed
|
||||
set speed to regular
|
||||
|
18
quick.sh
18
quick.sh
@ -9,17 +9,13 @@ then
|
||||
DEMO=1
|
||||
fi
|
||||
|
||||
RAND=0
|
||||
if [ "$GAME" = "random" ]
|
||||
then
|
||||
GAME=""
|
||||
RAND=1
|
||||
fi
|
||||
ITEMS=$(curl -sL http://asciiexpress.net/gameserver/links.html | wc -l)
|
||||
LINE=$(( RANDOM % ITEMS + 1))
|
||||
else
|
||||
ITEMS=$(curl -sL http://asciiexpress.net/gameserver/links.html | awk -F\" '{print $4}' | sort | grep -i "$GAME" | wc -l)
|
||||
|
||||
ITEMS=$(curl -sL http://asciiexpress.net/gameserver/links.html | awk -F\" '{print $4}' | sort | grep -i "$GAME" | wc -l)
|
||||
|
||||
if (( RAND == 0 ))
|
||||
then
|
||||
if (( ITEMS == 0 ))
|
||||
then
|
||||
echo "game $GAME not found" >&2
|
||||
@ -38,14 +34,10 @@ then
|
||||
fi
|
||||
|
||||
LINE=$(curl -sL http://asciiexpress.net/gameserver/links.html | awk -F\" '{print $4}' | sort | grep -ni "$GAME" | head -$ITEM | tail -1 | awk -F: '{print $1}')
|
||||
else
|
||||
LINE=$(( RANDOM % ITEMS + 1))
|
||||
fi
|
||||
|
||||
GAME=$(curl -sL http://asciiexpress.net/gameserver/links.html | sort | head -$LINE | tail -1 | awk -F\" '{print $4 "," $6}' | sed 's/.html$/.qr.wav/')
|
||||
|
||||
DOWN=$((LINE - 1))
|
||||
TITLE=$(echo $GAME | awk -F, '{print $1}')
|
||||
TITLE=$(curl -sL http://asciiexpress.net/gameserver/links.html | sort | head -$LINE | tail -1 | awk -F\" '{print $4}')
|
||||
|
||||
echo
|
||||
echo -n "${TITLE}..."
|
||||
|
Loading…
x
Reference in New Issue
Block a user