Document

1. General
2. Usage
3. Script

1. General

AutoTouch is used to record and play back your operations in your mobile device.More often it's used to run the lua script written beforehand to implement more powerful features.You may use it to play games automatically to gain more score and coins, even use it to simulate human operations to test your program with nobody.You have to jailbreak the device before installing AutoTouch.Jailbreak is easy and you can search from the internet.

Now AutoTouch have had the ability to record and play back most of the actions such as touches, home button click, volume button click, ringer switch, lock button click at home screen and any other apps with accurate and smooth experience.It also provides the functions for screenshot,screenshot for region,get color of specified point, find point fit specified color and many others.With these you can already control your device freely and skillfully.


2. Usage

2.1. How to install?

  1. Make sure you've added the BigBoss source to the Cydia;
  2. Search and install "AutoTouch" from Cydia;
  3. It will install the dependent app "Activator" automatically, which is used for control management. Do not remove "Activator" or it will remove "AutoTouch" together.

2.2. How to record your operations?

  1. At any view you want to record start, hold on volume down button until there popup a action sheet;
  2. Click on the "Record" button, it will vibrate to promopt;
  3. Then do your operations;
  4. When you want to finish recording, hold on the volume down button until there popup a alert to notice it's stopped';
  5. Then you can hold on volume down button to choose the script recorded just now to play, or go ahead to the app to manage the scripts.

2.3. How to play back the recordings?

  1. At the view your script will play start, hold on volume down button until there popup a action sheet;
  2. Click on the "Play" button, there will popup another view for repeat choosing, you can set time and interval in seconds.If you set time as 0, it will loop infinitely. Then it will vibrate and begin to play;
  3. The playing will stop when it's finished.If you want to interrupt it, hold on the volume down button until it vibrate to notice it's stopped'.

2.4. How to write a script?

  1. Click the "Action" button at middle of the toolbar, then choose "New File";
  2. Write in the edit view to make your script;
  3. Then click the "Save" button to save it.

2.5. How to encrypt a script?

  1. Click on the script in AutoTouch, select the "Encrypt" option;
  2. Input the password, if you don't want a password just leave it blank.
  3. Confirm to encrypt it, then it will generate a file with the same name but .lua.e suffix.
  4. You can play the encrypted scripts just as playing .lua scripts, if it ask for password just input it.

2.6. How to upload the scripts from computer?

  1. Click the "Action" button at middle of the toolbar, choose the "Upload" button to open the upload view;
  2. Open the url provided in the upload view with the web browser from you computer;
  3. Then you can upload and manage your scripts and other files from the browser.

2.7. How to buy a license?

  1. Click on the "License" in the "Settings" view to open the license infomation view;
  2. It will validate you license when open the license infomation view;
  3. If you are not validated, you will find the "Pay with Paypal" button, just click on it;
  4. Then you will switch to the Safari browser window, finish the payment on Paypal official payment site, it is safe;
  5. When payment is finished, switch to the "Settings" view of AutoTouch, click on the "License", it will validate the license if you have connection to the internet;
  6. When the license is validated, you will have all the features of the app.

2.8. How to download and buy script from the store?

  1. You can download any script from the store directly;
  2. Some of the scripts may be encrypted, some may need password to decrypt to run, if need password, you should connect with the author to buy the password;
  3. Downloaded scripts are in the script list, use them as others.

2.9. How to release your script in the store?

  1. You can release your scripts in the store to share or sell to others;
  2. If you just want to share the scripts, you may upload the .lua files directly, if you don't want others know how you implement it, just encrypt them;
  3. If you want to sell your scripts, you should encrypt them and make sure you've set the passwords so that when someone need them could buy from you.

3. Script

3.1. Basic

You can learn lua from Lua Official Reference Manual to know how to use it.


3.2. Extended functions

The extended functions are provided by AutoTouch to give some powerful features on mobile device, with which you can simulate touch operations,find color or image from the screen, etc.


3.2.1. touchDown(id, x, y)

touch on the point(x, y) and set the event id.

touchDown(0, 100, 200); -- touch down at point(100, 200).

3.2.2. touchMove(id, x, y)

touch move to the point(x, y).

touchDown(0, 100, 200); -- touch down at point(100, 200).
touchMove(0, 200, 200); -- touch move to point(200, 200).

3.2.3. touchUp(id, x, y)

touch up from the point(x, y).

touchDown(0, 100, 200); -- touch down at point(100, 200).
touchMove(0, 200, 200); -- touch move to point(200, 200).
touchUp(0, 200, 200); -- touch up from point(200, 200).

3.2.4. homeButtonDown()

Simulate a home button down event.

homeButtonDown();
-- Simulate a home button down event.

3.2.5. homeButtonUp()

Simulate a home button up event.

homeButtonUp();
-- Simulate a home button up event.

3.2.6. lockButtonDown()

Simulate a lock button down event.

lockButtonDown();
-- Simulate a lock button down event.

3.2.7. lockButtonUp()

Simulate a lock button up event.

lockButtonUp();
-- Simulate a lock button up event.

3.2.8. ringerOff()

Simulate a ringer switch off event.

ringerOff();
-- Simulate a ringer switch off event.

3.2.9. ringerOn()

Simulate a ringer switch on event.

ringerOn();
-- Simulate a ringer switch on event.

3.2.10. volumeUpButtonDown()

Simulate a volume up button down event.

volumeUpButtonDown();
-- Simulate a volume up button down event.

3.2.11. volumeUpButtonUp()

Simulate a volume up button up event.

volumeUpButtonUp();
-- Simulate a volume up button up event.

3.2.12. volumeDownButtonDown()

Simulate a volume down button down event.

volumeDownButtonDown();
-- Simulate a volume down button down event.

3.2.13. volumeDownButtonUp()

Simulate a volume down button up event.

volumeDownButtonUp();
-- Simulate a volume down button up event.

3.2.14. rootPathOfDocuments()

Get the root path of the dir you place the scripts in.

local dirPath = rootPathOfDocuments();
-- dirPath = "/var/mobile/Library/AutoTouch/Scripts/"

3.2.15. usleep(microseconds)

Sleep the process for microseconds.

usleep(1000000);
-- Sleep one second

3.2.16. logging(logContent)

Take log of the string type log content.See log in the log view

logging("play here...");

3.2.17. alert(message)

Open an alert view to show the message.

alert("Hello world!");

3.2.18. vibrate()

Take a vibration.

vibrate();
-- Take a vibration for a time.

3.2.19. screenshot(filePath)

Take a screenshot and save it to the specified file path.

screenshot("/var/screenshot1.png");
-- Take a screenshot and save it to the specified path.

3.2.20. screenshotRegion(filePath, x, y, width, height)

Take a screenshot and save it to the specified file path.

screenshotRegion("/var/screenshot2.png", 0, 0, 100, 100);
-- Take a screenshot of the region(0, 0, 100, 100)
-- and save it to the specified path.

3.2.21. getScreenResolution()

Get the resolution of your device screen.

local w, h = getScreenResolution();
-- width is 1136, height is 640 for iPhone 5

3.2.22. getScreenSize()

Get the size of your device screen in iOS coordinate system.

local width, height = getScreenSize();
-- width is 320, height is 568 for iPhone 5

3.2.23. getColor(x, y)

Get the RGB color value of the specified point on the screen.

local rgb = getColor(100, 200);
alert("rgb:" .. rgb);
-- rgb:16777215

3.2.24. findColor(rgb, count)

Find all the points fit the specified color on the screen, and return the coordinates of the points as table. Attention: you should use it as find(0x0000ff, 5), but not find(rgb=0x0000ff, count=5), that's different with the findImage function, because the argument of findImage is a table.

local result = findColor(0x0000ff, 2);
for i, v in pairs(result) do
    logging("x:" .. v[1] .. "y:" .. v[2]);
end

3.2.25. findImage {imagePath, count, fuzzy, ignoreColors}

Find the regions similar to the specified image on the screen, return the top-left coordinates of the regions as table.

-- example 1:
local result = findImage {imagePath="/var/spirit.png", count=5};
for i, v in pairs(result) do
    logging("x:" .. v[1] .. "y:" .. v[2]);
end
 
-- example 2:
local result = findImage {imagePath="/var/spirit.png", fuzzy=0.6};
for i, v in pairs(result) do
    logging("x:" .. v[1] .. "y:" .. v[2]);
end
        
-- example 3:
local result = findImage {imagePath="/var/spirit.png", ignoreColors={0xffffff, 0x2b2b2b}};
for i, v in pairs(result) do
    logging("x:" .. v[1] .. "y:" .. v[2]);
end
          
-- example 4:
local result = findImage {imagePath="/var/spirit.png", count=1, fuzzy=0.9, ignoreColors={0x0000ff}};
for i, v in pairs(result) do
    logging("x:" .. v[1] .. "y:" .. v[2]);
end