Document
1. General
2. Usage
3. Script
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.
- Make sure you've added the BigBoss source to the Cydia;
- Search and install "AutoTouch" from Cydia;
- It will install the dependent app "Activator" automatically, which is used for control management. Do not remove "Activator" or it will remove "AutoTouch" together.
- At any view you want to record start, hold on volume down button until there popup a action sheet;
- Click on the "Record" button, it will vibrate to promopt;
- Then do your operations;
- When you want to finish recording, hold on the volume down button until there popup a alert to notice it's stopped';
- 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.
- At the view your script will play start, hold on volume down button until there popup a action sheet;
- 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;
- 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'.
- Click the "Action" button at middle of the toolbar, then choose "New File";
- Write in the edit view to make your script;
- Then click the "Save" button to save it.
- Click on the script in AutoTouch, select the "Encrypt" option;
- Input the password, if you don't want a password just leave it blank.
- Confirm to encrypt it, then it will generate a file with the same name but .lua.e suffix.
- You can play the encrypted scripts just as playing .lua scripts, if it ask for password just input it.
- Click the "Action" button at middle of the toolbar, choose the "Upload" button to open the upload view;
- Open the url provided in the upload view with the web browser from you computer;
- Then you can upload and manage your scripts and other files from the browser.
- Click on the "License" in the "Settings" view to open the license infomation view;
- It will validate you license when open the license infomation view;
- If you are not validated, you will find the "Pay with Paypal" button, just click on it;
- Then you will switch to the Safari browser window, finish the payment on Paypal official payment site, it is safe;
- 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;
- When the license is validated, you will have all the features of the app.
- You can download any script from the store directly;
- 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;
- Downloaded scripts are in the script list, use them as others.
- You can release your scripts in the store to share or sell to others;
- 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;
- 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.
You can learn lua from Lua Official Reference Manual to know how to use it.
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.
touch on the point(x, y) and set the event id.
- Params
- id: the id you speficified for this event.
- x: the x-coordinate you want to touch down at.
- y: the y-coordinate you want to touch down at.
- Return
- Examples
touchDown(0, 100, 200); -- touch down at point(100, 200).
touch move to the point(x, y).
- Params
- id: the id your touch continues from.
- x: the x-coordinate you want to touch move to.
- y: the y-coordinate you want to touch move to.
- Return
- Examples
touchDown(0, 100, 200); -- touch down at point(100, 200).
touchMove(0, 200, 200); -- touch move to point(200, 200).
touch up from the point(x, y).
- Params
- id: the id your touch continues from.
- x: the x-coordinate you want to touch up from.
- y: the y-coordinate you want to touch up from.
- Return
- Examples
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).
Simulate a home button down event.
homeButtonDown();
-- Simulate a home button down event.
Simulate a home button up event.
homeButtonUp();
-- Simulate a home button up event.
Simulate a lock button down event.
lockButtonDown();
-- Simulate a lock button down event.
Simulate a lock button up event.
lockButtonUp();
-- Simulate a lock button up event.
Simulate a ringer switch off event.
ringerOff();
-- Simulate a ringer switch off event.
Simulate a ringer switch on event.
ringerOn();
-- Simulate a ringer switch on event.
Simulate a volume up button down event.
volumeUpButtonDown();
-- Simulate a volume up button down event.
Simulate a volume up button up event.
volumeUpButtonUp();
-- Simulate a volume up button up event.
Simulate a volume down button down event.
volumeDownButtonDown();
-- Simulate a volume down button down event.
Simulate a volume down button up event.
volumeDownButtonUp();
-- Simulate a volume down button up event.
Get the root path of the dir you place the scripts in.
- Params
- Return
- The path string of the root dir.
- Examples
local dirPath = rootPathOfDocuments();
-- dirPath = "/var/mobile/Library/AutoTouch/Scripts/"
Sleep the process for microseconds.
- Params
- microseconds: the time you want to sleep for.
- Return
- Examples
usleep(1000000);
-- Sleep one second
Take log of the string type log content.See log in the log view
- Params
- logContent: the content you want to log.
- Return
- Examples
logging("play here...");
Open an alert view to show the message.
- Params
- message: the message you want to show with alert view.
- Return
- Examples
alert("Hello world!");
Take a vibration.
vibrate();
-- Take a vibration for a time.
Take a screenshot and save it to the specified file path.
- Params
- filePath: The path that you want the screenshot be saved
- Return
- Examples
screenshot("/var/screenshot1.png");
-- Take a screenshot and save it to the specified path.
Take a screenshot and save it to the specified file path.
- Params
- filePath: The path that you want the screenshot be saved
- x: the top-left x-coordinate in iOS coordinate system of the region you want to take the screenshot.
- y: the top-left y-coordinate in iOS coordinate system of the region you want to take the screenshot.
- width: the width in iOS coordinate system of the region you want to take the screenshot.
- height: the height in iOS coordinate system of the region you want to take the screenshot.
- Return
- Examples
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.
Get the resolution of your device screen.
- Params
- Return
- width: The width resolution of your device.
- height: The height resolution of your device.
- Examples
local w, h = getScreenResolution();
-- width is 1136, height is 640 for iPhone 5
Get the size of your device screen in iOS coordinate system.
- Params
- Return
- width: The width of your device screen.
- height: The height of your device screen.
- Examples
local width, height = getScreenSize();
-- width is 320, height is 568 for iPhone 5
Get the RGB color value of the specified point on the screen.
- Params
- x: the x-coordinate in iOS coordinate system of the point you want to get the color.
- y: the y-coordinate in iOS coordinate system of the point you want to get the color.
- Return
- rgb: the rgb value of the color.
- Examples
local rgb = getColor(100, 200);
alert("rgb:" .. rgb);
-- rgb:16777215
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.
- Params
- rgb: the int type rgb value of the color. (REQUIRED)
- count: how many no more than you want to find out, default is 0, means all the fit ones in the screen should be found.count=1 means only the first fit one should be found, count=2 means the first two should be found.It will be faster when you set this parameter to a small value. (OPTIONAL).
- Return
- locations: the locations of the points these fit the specified color. Looks like {{x1, y1}, {x2, y2}, ...}.
- Examples
local result = findColor(0x0000ff, 2);
for i, v in pairs(result) do
logging("x:" .. v[1] .. "y:" .. v[2]);
end
Find the regions similar to the specified image on the screen, return the top-left coordinates of the regions as table.
- Params
- imagePath: the path of the small image you want to find out from the screen, such as the spirit image in the game. (REQUIRED)
- count: how many no more than you want to find out, default is 0, means all the fit ones in the screen should be found.count=1 means only the first fit one should be found, count=2 means the first two should be found.It will be faster when you set this parameter to a small value. (OPTIONAL).
- fuzzy: the degree of fuzzy matching when finding, default is 1, means match exactly, fuzzy=0.5 means match 50%. (OPTIONAL)
- ignoreColors: array(table in lua) type of colors will be ignored when finding. (OPTIONAL).
- Return
- locations: the top-left coordinates of the regions these similar to the specified image. Looks like {{x1, y1}, {x2, y2}, ...}.
- Examples
-- 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