Skip to content

Conversation

@XXaorui
Copy link

@XXaorui XXaorui commented Sep 15, 2019

Hello!
I added the English templates for Mi8(dipper) with 400dpi screen, and optimized (at least) main function. if you wanna cherry-pick some of the code changes, please do it. ^_^
and... sorry that i forgot to edit README

Add: templates for Mi8(dipper) with 400dpi screen
Add: function to collect own forest energy
Fix: swipe will no more trigger back gesture on MIUI
Optimize: code structure

TODO:
more reasonable time gap
strip adb operations from @Class Ant
@gemfield
Copy link
Contributor

The changes are most focused on coding style and "os.system" to subprocess, right? Anything else I missed? And any bugfix in this PR?

rc = self.getIconPos('farm_thief_flag_template', 0.8)
if not rc:
self.swipe(self.width // 2, self.height - 10, self.width // 2, self.height // 1.5, 600 )
self.swipe(self.width // 2, self.height - 250, self.width // 2, self.height // 2, 600 )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swipe-up from very bottom may trigger "back to home" gesture on ROMs with full screen gestures.
so i shift up this swipe-up here.

def findMoreFriends(self):
for i in range(5):
self.swipe(self.width // 2, self.height - 10, self.width // 2, self.height // 2, 400 )
self.swipe(self.width // 2, self.height - 250, self.width // 2, self.height // 2, 400 )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shift up swipe-up again

time.sleep(4)
break

def getOwnEnergy(self):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cannot go back to one's own forest from friend list.
so add a function to collect own energy at entering the forest interface.


def playForest(self):
self.checkForest()
self.getOwnEnergy()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run getOwnEnergy() immediately after launching the forest interface

@XXaorui
Copy link
Author

XXaorui commented Sep 18, 2019

Some bugfix changes are:

  • checkForest() fails to deal with the miscellaneous pop-up windows at launching Alipay app, while checkFarm() does. This can lead to "bug" when running in forest-only mode.

  • playForest() lacks operation to collect one's own energy, since it is impossible to enter one's own forest page from the friend list.

  • Shift up swipe-up to avoid triggering other system-wide gestures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants