Skip to content

Instantly share code, notes, and snippets.

@nopjia
Created January 11, 2018 23:27
Show Gist options
  • Save nopjia/24a69fc48ff888d8ee285486ca9ff589 to your computer and use it in GitHub Desktop.
Save nopjia/24a69fc48ff888d8ee285486ca9ff589 to your computer and use it in GitHub Desktop.
ADB bash script for auto-clicking through Magikarp Jump Master League
# Magikarp Jump
# Master League Automated Clicker
#
# Notes:
#
# All tap positions are hardcoded to my OnePlus3.
# Please re-adjust positions if phone resolution is different.
#
# Any league-triggered event will interrupt this script.
#
# If script is interrupted, please terminate the script.
# Continue by running doMasterLeague with the desired number.
XM=540
XL=316
XR=758
YB=1765 # bottom
YD=1310 # dialog
YD2=1445 # dialog lower
function doClick() {
echo -e "click\t"$1","$2"\t"$3
input tap $1 $2
}
function repeatClick() {
local COUNTER=1
while [ $COUNTER -lt $1+1 ]; do
doClick $2 $3 $COUNTER"/"$1
let COUNTER=COUNTER+1
done
}
function repeatRoutine() {
local COUNTER=1
while [ $COUNTER -lt $1+1 ]; do
echo Iteration $COUNTER"/"$1...
let COUNTER=COUNTER+1
$2
done
}
function doLeagueAt() {
doClick $1 $2 "battle location"
sleep 0.2
doClick $XR $YD2 "Battle!"
sleep 0.2
doClick $XR $YD "Skip"
sleep 4
doClick $XR $YD2 "OK Results"
sleep 4
doClick $XR $YB "OK exp"
sleep 2
doClick $XR $YD "OK money"
sleep 9
doClick $XR $YD "OK Congratulations!"
sleep 0.5
}
function alternateClicks() {
doClick $XM $YD
doClick $XM $YD2
doClick $XM $YB
}
function doLeagueAt() {
doClick $1 $2 "battle location"
sleep 0.2
doClick $XR $YD2 "Battle!"
sleep 0.2
doClick $XR $YD "Skip"
sleep 5
doClick $XR $YD2 "OK Results"
sleep 3
doClick $XR $YB "OK Battle Results"
sleep 0.5
doClick $XR $YD "OK money"
sleep 5
}
function doNewFish() {
repeatRoutine 25 alternateClicks # spam clicks
doClick 472 836 "select rod"
sleep 0.5
doClick $XR $YD "yes"
sleep 10
repeatClick 40 $XR $YD
doClick $XR $YB "select karp"
sleep 1
repeatClick 30 $XR $YD
}
function doLose() {
doClick $XR $YD "OK Results"
sleep 1
doClick $XR $YB "OK Battle Results"
sleep 2
doClick $XR $YD "OK money"
sleep 0.2
doClick $XR $YD "OK Retirement Day"
sleep 10
doClick $XR $YD "tap to continue retirement"
sleep 2
doClick $XR $YD "tap to continue retirement"
sleep 2
doClick 753 737 "Continue"
}
function doMasterLeague15() {
doClick $XM 1240 "battle 15 location"
sleep 0.2
doClick $XR $YD2 "Battle!"
sleep 12
doClick 905 1234 "click little skip"
sleep 1
doClick $XR $YB "Jump!"
sleep 24
doClick $XR $YD2 "OK Results"
sleep 18
doClick $XR $YD "tap to continue"
sleep 5
doClick $XR $YD "tap to continue"
sleep 2
doClick $XR $YD "OK money"
sleep 6
doClick $XR $YD "Skip Ending"
sleep 8
doClick $XR $YD "tap to continue retirement"
sleep 2
doClick $XR $YD "tap to continue retirement"
sleep 2
doClick 753 737 "Continue"
}
function doMasterLeague() {
case $1 in
"") ;&
"0") ;&
"1") doLeagueAt $XL 1240 ;&
"2") doLeagueAt $XM 1240 ;&
"3") doLeagueAt $XM 1240 ;&
"4") doLeagueAt $XM 860 ;&
"5") doLeagueAt $XL 860 ;&
"6") doLeagueAt $XM 480 ;&
"7") doLeagueAt $XM 480 ;&
"8") doLeagueAt $XM 480 ;&
"9") doLeagueAt $XM 480 ;&
"10") doLeagueAt $XM 480 ;&
"11") doLeagueAt $XM 860 ;&
"12") doLeagueAt $XM 860 ;&
"13") doLeagueAt $XM 860 ;&
"14") doLeagueAt $XM 1240 ;&
"15") doMasterLeague15
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment