-
Notifications
You must be signed in to change notification settings - Fork 13
If you want for the script to just autodetect HOE just add the marked line in the afk-daily.sh script:
Screenshot 2022年04月03日 194441
or as text:
if testColorOR -d 3 540 430 893445; then eventHoe=true; fi
after line 797 in afk-daily.sh
keep in mind that on any automated script updates you will lose that change.
All reactions
-
👍 2
Replies: 2 comments 2 replies
The only problem with this solution is a false positive... but that should not happen...
Can you do a PR to add this line, we will see if @Zebiano is ok with it? 😉
Maybe use this since DEFAULT_DELTA=3:
if testColorOR -d "$DEFAULT_DELTA" 540 430 893445; then eventHoe=true; fi
All reactions
About the false positive:
first tab (HoE):
./deploy.sh -s 540,430
[DEBUG] doTest [540, 430] > HEX: 893445
[DEBUG] doTest [540, 430] > HEX: 893445
[DEBUG] doTest [540, 430] > HEX: 893445
same position on second tab (AoH) (compared with the above color):
./deploy.sh -s 540,920,893445
[DEBUG] doTest [540, 920] > HEX: fcfce7 [Δ 63%]
[DEBUG] doTest [540, 920] > HEX: fcfce7 [Δ 63%]
[DEBUG] doTest [540, 920] > HEX: fcfce7 [Δ 63%]
All reactions
Yeah, checking the emblem in the middle does not seem like the best approach here, as it can easily change in the future and therefore has a higher probability of false positives than checking for HEX values elsewhere.
On that screen, I'd probably accept checking for two HEXes:
- Top left corner of the Heroes of Esperia banner, as that's what distinguishes it from the others and has the smallest probability of having any animations in front of it and/or changing colour.
- Check if there's a fourth banner on the bottom of the screen, as you can still see a little bit of it when the event is active. Here I'd probably check the rightmost cloud, as it has the highest contrast compared to the dark background. Maybe a problem in the winter season though, I don't know.
But since both those options are a bit meh, I tried to find another one: Check for the yellowish banner of the "Heroes of Esperia" in the Dark Forest tab. This should be fine both in Summer and Winter customizations, as long as Lilith does not change the animation of the "stars". This even has the added bonus of giving the initial cycle between Tabs an extra reason to exist, as I'd check for HoE there.
The next commit will have this in place, thanks for the idea, Gary.
All reactions
-
👍 1
Because now we have 2 events at the same time (Heroes of Esperia and Treasure Scramble) detecting just HoE is no longer enough.
I have these changes to search for the location of the AoH rectangle and click it:
arenaOfHeroes() { if [ "$DEBUG" -ge 4 ]; then printInColor "DEBUG" "arenaOfHeroes" >&2; fi inputTapSleep 740 1050 3 - if [ "$eventHoe" = false ] && [ "$eventTs" = false ]; then - inputTapSleep 550 450 3 - else - inputTapSleep 550 900 3 + if testColorOR -d 5 560 310 b4bcc4; then inputTapSleep 560 310 3 + elif testColorOR -d 5 560 800 b4bcc4; then inputTapSleep 560 800 3 + else inputTapSleep 560 1290 3 fi
Also, to get Legends' Challenger Tournament tokens I have something similar (in this case the click is in the rectangle just bellow AoH):
legendsTournament() { [..] ## For testing only! Keep as comment ## # inputTapSleep 740 1050 1 ## End of testing ## - if [ "$eventHoe" = false ] && [ "$eventTs" = false ]; then - inputTapSleep 550 900 # Legend's Challenger Tournament - else - inputTapSleep 550 1450 # Legend's Challenger Tournament + if testColorOR -d 5 560 310 b4bcc4; then inputTapSleep 560 710 3 + elif testColorOR -d 5 560 800 b4bcc4; then inputTapSleep 560 1200 3 + else inputTapSleep 560 1690 3 fi