-
-
Save sorgo/6037684 to your computer and use it in GitHub Desktop.
This file contains 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 characters
#!/bin/bash | |
# | |
# Ingress Item Drop | |
# | |
# Display Koordinaten x/y (Galaxy S III) | |
# | |
# OPS: 640x110 | |
# Item: 400x600 | |
# Drop: 360x1200 | |
# Recycle: 580x1200 | |
# | |
# Usage Function :P | |
usage() { | |
echo "Usage: $0 drop|recycle <count>" | |
exit 1 | |
} | |
# Item Drop | |
drop() { | |
while [ $x -lt $to_drop ]; do | |
RUNNING="$(ps -P | grep nianticproject | awk '{print $6}')" | |
if [$RUNNING == 'fg']; then | |
input tap 640 110 | |
input tap 400 600 | |
input tap 360 1200 | |
fi | |
(( x++ )); done | |
} | |
# Item Recycle | |
# | |
# Needed an own function because recycle doesn't return to the main screen | |
recycle() { | |
input tap 640 110 | |
while [ $x -lt $to_drop ]; do | |
RUNNING="$(ps -P | grep nianticproject | awk '{print $6}')" | |
if [$RUNNING == 'fg']; then | |
input tap 400 600 | |
input tap 580 1200 | |
fi | |
(( x++ )); done | |
} | |
if [ $USER != "root" ]; then | |
echo "you need root to execute this script!" | |
exit | |
fi | |
if [ $# -lt 2 ]; then | |
usage | |
fi | |
# Drop Mode. recycle or drop | |
mode=${1-"drop"} | |
# Number of items to drop | |
to_drop=$2 | |
# Counter | |
x=0 | |
if [ $to_drop -lt 1 ]; then | |
usage | |
fi | |
if [ $mode == "drop" ]; then | |
drop | |
elif [ $mode == "recycle" ]; then | |
recycle | |
else | |
usage | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment