[Miscellaneous Android Development] AnkuLua:
When play games, there are cases just repeating some basic actions (touch and maybe drag-drop).

To avoid doing the boring actions again and again, there are majorly two ways.

1. Record the touch positions and timing, then replay it after.

2. Write scripts

It's easy to do that for the first method. But there are some drawbacks:

1. To keep it working, the users need to keep some time buffer. It causes no efficiency.

2. For harder levels, the recorded actions doesn't work because the waiting time is not enough.

3. It may cause wrong behavior because it just don't care what shown on the screen. Consider that phone coming when playback.

The second method could be very powerful if users have programming skills and time. But not every one know programming and time...

Is there better way to do that?

How do we use smart phones? we watch the screen. Find the icon/images to click. Then click it.

Isn't it perfect that a tool can save the icon/images that we clicks.

When playback, the tools can scan the screen. It click the images if the images are found on the screen.

Then without writing scripts and take care of timing, we can make automation very efficiently.

AnkuLua snap-and-play script help users to play game with above rules.

Even better is that users can expand the script and make the generated script more complete if that new screen found and not recorded before.

-------------------------------------------

First, let's see the demo video

https://youtu.be/1iZcBamvyxg

[YOUTUBE]1iZcBamvyxg[/YOUTUBE]

Preparation:

1. This script is written for AnkuLua. Please install AnkuLua from Google play.

2. If devices not rooted, please install daemon from PC. (google AnkuLua daemon installation)

3. download script

-----------------------------------------

Record usage:

1. Choose recordAndPlay.lua, then enter the the screen to record.

2. Press the lower left AnkuLua Play button, then choose record.

Choose the game is immersive or not.

Input the file name to save

When running, please only touch the screen when there is light yellow on screen. Or the touch will not be recorded.

When running, please only touch the screen when there is light yellow on screen. Or the touch will not be recorded.

When running, please only touch the screen when there is light yellow on screen. Or the touch will not be recorded.

Don't touch the screen like below.

Only touch screen when there is light yellow on screen.

3. To stop recording, press the red "Stop!" area or AnkuLua stop button.

Playback usage:

1. Choose recordAndPlay.lua and enter the screen to playback.

2. Choose playback

3. Choose the file to playback

The first two settings are clear. Need no more explanation.

Some snaps don't always occur on a fixed area. In this case, cancel the click on "All searchings with regions".

Then following setting page will show. And you can choose which snap to search on fixed area and which to search on whole screen.

Hint: You can find the images in directory luar/fileNameImage under snapAndPlay script.

Expands existing luar:

If the script stuck because new screenshots., please stop the script first.

Then start the script again. Choose "Expand existing luar". Then choose the luar to expand.

Follow the steps for recording. The new image will be added to the luar.

The script is open source, You are welcome to modify it.

Any feedback is welcome.