HiroMacro Help Document

English    /    한국어

v2.1

1. General

2. Usage

3. Setting (v1.4+)

4. Script

5. Supplement


1. General

HiroMacro is available on Android devices with auto-touch macro.
Script by recording a user’s touch to create jobs, and it can be played repeatedly.
Using a simple scripting language. You can easily implement powerful features.
In order to use the HiroMacro Android devices should be rooting.
HiroMacro must have root permission.


2. Usage

2.1. How to record your touch work?

      1. Run the HiroMacro. And start the service.
      2. Go to the application for recording and press the ActionKey once.
      3. Pop-up menu appears, press the record button.
      4. Touch the screen to repeat the operation.
      5. if you want to finish recording, press the ActionKey. Automatically "Record_current time.txt" saved.

2.2. How to play the recording of touch work?

      1. Run the HiroMacro. And start the service.
      2. Go to the application for playing and press the ActionKey.
      3. Pop-up menu appears, select script from the list.
      4. Play times and delay intervals can be set. Play times is set to "0" when the operation of the endless playback. After the completion of the playBack delay the time it the next play. Entered in seconds, and "5" will allow you to play again after 5 second delay will play.
      5. Set the Play times and delay intervals and press the play button. To start Playing.
      6. if you want to stop playing. press the ActionKey. Macro stops.

2.3. How to edit the script?

      1.  If you want to create a new script to the new script touch.
      2.  if you edit an existing script form the script list, touch and hold the pop-up menu will appear. Touch the Edit menu.
      3. To edit of create  a new script.
      4. Order to apply modified part Touch the save menu.

3. Setting

3.1. Macro ActionKey

And call HiroMacro menu. Stop the playback. To stop recording.
VolumeUp button, volumeDown button, Menu button, the buttons are supported in hardware. Software button is not supported.
Without the hardware buttons on the device used to Use it in other ways.

      • VolumeUp button: Device to raise the sound button.
      • VolumeDown button: Device to reduce the sound button.
      • Menu button: Calling device menu button.
      • Add a button on the screen.: Add buttons on the screen for use.
      • Device Shake it: Shake the device run.

3.1. Color Access Method

When using the color values in the script, and set the approach to it.
If you use the superuser, or supersu HiroCapture , ScreenCapture method is used, or if the way to access the color values whenever the toast message will appear.
superuser or supersu us from the HiroMacro to turn off the toast notification.

      • Auto-detect: Depending on your environment it is set automatically.
      • FrameBuffer: Android v4.1- less and Android v4.2+ versions to enable custom firmware only. (ex> cm10, cm11)
      • ScreenCapture: The basics of using Android devices to capture the screen, and then access the color values. Some high-resolution Device, the Freeze phenomenon without notice.
      • HiroCapture: Screen capture method is a way of improving symptoms stop. Reducing the size of the capture of a way to speed up. Because of the smaller size of image loss may not be accurate color values. Available on the Android v4.3+ or higher.

3.2 Screen Capture Delay

When you use ScreenCapture or HiroCapture set the minimum delay.
This script, which is a very fast-paced getcolor a screenshot every time you use the command to cause problems with the script process speed it specifies the minimal delay.
For example, to specify the number of seconds to 2 seconds, and the initial set up to capture the screen instructions hanhu getcolor getcolor after 2 seconds, even if the instruction is newly out does not capture.
If the type of frame buffer access in real time without a separate screen capture, because the setting is not affected.


3.4. Keyboard Access Method

KeyInput and Hardware Key input in a script that you use to set the way.

      • Vitual Keyboard: Bluetooth devices such as a keyboard to create a virtual keyboard and then press enter. Influenced by the Android default keyboard settings, depending on the type of hardware key is available does not always work.
      • Command Keyboard: Directly without having to add a separate keyboard command. All equipment available and slower than the virtual keyboard on.

3.5. Always stay awake

Android devices do not use a user function locks automatically when the screen by default.
Long delay when the screen is locked. When this feature is enabled, the service is running, the screen does not lock automatically while.


3.5. Touch Location Debug

When this feature is enabled, the user's touch position that gives a visual representation of the coordinates of the output to the screen.
Coordinate direction is independent of the screen due to the use of a fixed screen turned horizontally and vertically, of the state out of the state that it is normal for the same coordinates.
The color values fixed coordinate equally used in the script.


3.5. Color Location Debug

When this feature is enabled, the user touches one of the color values and the output to the screen coordinates.
If the developer has option to activate the touch Show. the Touchimage is captured as a color value may not be accurate.
If you are using a screencapture method, capture fullscreen as a touchdown during freeze Symptoms. If possible, the FrameBuffer and Use it HiroCapture 25% Size


3. Script

4.1. Basic

The script is basically a line to be one kind of action. Function of the parameters are separated by spaces. To note the spacing and line breaks must be created.


4.2. Function

Script a macro toe create a variety of situations in order to cope with various features.
For example, the color of the current screen can be brought to act accordingly.
The usage of each function, see below.


4.2.1. touchDown finger x y

Screen x, y coordinates of touchdown event occurs.

      • Params
        • finger: By default, 0 is used to implement a multi-touch input, if the formula 1, 2, 3, 4.
        • x: X-coordinate of the raising events.
        • y: Y-coordinate of the raising events.
// First finger touch down event
touchDown 0 100 200   
// Second finger touch down event 
touchDown 1 300 300    

4.2.2. touchMove finger x y

Events that must after touchdown,  touch and hold the event and moving the event to occur.

      • Params
        • finger: By default, 0 is used to implement a multi-touch input, if the formula 1, 2, 3, 4.
        • x: X-coordinate of the raising events.
        • y: Y-coordinate of the raising events.
// touch down event (100,200)
touchDown 0 100 200  
 // Wait 1 second (1000 = 1sec)
sleep 1000 
// touch move event (200,200)

touchMove 0 200 200


4.2.3. touchUp finger

Event tha must occur after th touchdown or touch move to stop the event and leave the touch.

      • Params
        • finger: By default, 0 is used to implement a multi-touch input, if the formula 1, 2, 3, 4.
 // touch down event (100,200)
touchDown 0 100 200  
// Wait 1 second (1000 = 1sec)
sleep 1000
// touch move event (200,200)      
touchMove 0 200 200 
// touch up event
touchUp 0             

4.2.4. touchPress finger x y

touchUp touchDown features and functionality of the combined functions. Touch can be easily implemented.

      • Params
        • finger: By default, 0 is used to implement a multi-touch input, if the formula 1, 2, 3, 4.
        • x: X-coordinate of the raising events.
        • y: Y-coordinate of the raising events.
// touch down event (100,200)
touchDown 0 100 200 
// Wait 0.1 second (1000 = 1sec)
sleep 100
// touch up event
touchup 0

// Same as above event.
touchPress 0 100 200

4.2.5. keyDown code

Android hardware keys and keyboard keys holding down event.

// down as a key. (Lowercase a input)
keyDown K_A
// Wait 0.03 seconds (1000 = 1 second) 
sleep 30 
//  up to a key.
keyUp K_A
sleep 1000
// down as shift key.
keyDown K_SHFT_LEFT 
sleep 30
// down as a key. (Uppercase A input)
keyDown K_A
sleep 30
 // up to a key.
keyUp K_A
sleep 30
// up to shift key.
keyUp k_SHIFT_LEFT 
sleep 1000

4.2.6. keyUp code

KeyDown event must occur after the use of a single event and has no effect.

See 4.2.5 keyDown

4.2.7. keyPress code

keyDown keyUp features and functionality of the combined functions.

// down as a backkey. 
keyDown K_BACK
// Wait 0.05 second (1000 = 1sec)
sleep 50
// up to a backkey.
keyUp K_BACK

// Same as above event.
keyPress K_BACK

4.2.8. Sleep time

The event of a delay at that time.

      • Params
        • time: 1/1000 units of input. 1000 is 1 second.
// Wait 1 second (1000 = 1 sec.)
sleep 1000

4.2.9. Var name val

Put the name in the variable named val. :start the label before the macro should be run only at the beginning of the first.

      • Params
        • name: Must sure to begin with #. ( #a #apple #abc)
        • val: Must envet a numeric format. (0 1 2 3 4 5)
// Declare a variable 
Var #abc 0

:start
// Wait 1 second (1000 = 1 sec.) 
sleep 1000 
:end

4.2.10. Set name val

Put the name in the variable name val. var function like. However, if the macro is to be repeated every set. :start and :end should come between.

      • Params
        • name : Must sure to begin with #. ( #a #apple #abc)
        • val: Must envet a numeric format. (0 1 2 3 4 5)
// Declare a variable 
Var #abc 0 

// Start the macro label. 
:start    

// 1 into the variable.   
Set #abc 1  

// shows toast message.
toast #abc 

/// Wait 3 second (1000 = 1 sec.)  
sleep 3000

// End the macro label.
:end 

4.2.11. Calc var val1 option val2

Plus , minus, Division, Multiply, Remaining value the variable calculation.

      • Params
        • var : Variable values are calculated be saved. (#result)
        • val1: Can be used as a variable(#abc) or a number
        • option: + (Plus), - (minus), / (Division), * (Multiply) % (Remaining value) support
        • val2: Can be used as a variable(#abc) or a number
// Declare a variable.
Var #result 0
Var #abc 0  


:start  

 // Set variables(#abc) 1       
Set #abc 1

 // Variable(#result) number plus 10 to the save #abc
calc #result #abc + 10 

 // shows toast message.
toast #result 

// Wait 3 second (1000 = 1 sec.) 
sleep 3000 

// Variable(#result) number minus 10 to the save #result
Calc #result #result - 5  

 // shows toast message.
toast #result 
:end

4.2.12. Calc Simple calculation

Set functions and Calc functions in a way that is more easily available.

// Declare a variable.
Var #result 0
Var #abc 0  

:start
Set #abc 1
calc #result #abc + 10
toast #result
sleep 3000
Calc #result #result - 5 
toast #result

// Same as above event.
#abc = 1
#result = #abc + 10
toast #result
sleep 3000
#result = #result - 5
toast #result

// Available by mixing the various formula
#result = (#abc+10-1)*2+(#abc%10)*5
#result = #abc+#result-10 

:end
and var min max

A random number is generated and the variable is set.

      • Params
        • var : Value of the random variable will be saved (#result)
        • min: The minimum value of the random value.
        • max: The maximum value of the random value.
var #count 0

:start
// 20 or less 10 or more (#count)
rand #count 10 20 

// shows toast message.
toast Random is #count

// Wait 2 second (1000 = 1 sec.) 
sleep 2000

// Restart. Infinite loop.
goto :start
:end

4.2.14. If Endif

available if the bifurcation. endif if you must have, be sure to use.
Conditions are = (equal to), == (equal to), != (Different) > (Greater than) >= (greater than or equal to) < (less than) <= (less than or equal to) can be used.
Comparing the variable and the variable, it is possible.
Example, if # count <# hunt can be used as shown. When I compare two or more conditions, or (or) and (and) are used.
And be sure the end of the if statement must come Endif.

// Declare a variable.
Var #count 0

:start
// 1 plus a variable(#count)
#count = #count + 1  

 // #count is the same as 10. 
if #count == 10

     // shows toast message. 
     toast  now count : Ten
     
// End of if statement.  
endif  

// # Count is greater than 10 and less than 20
if #count > 10 and #count

4.2.15. ElseIF

The syntax of the IF statement compares as ElseIF statement, be sure to come between the IF and ENDIF IF statement or another of the above statement is false when ElseF conditions can be compared again. If the above conditions are true, does not compare.

// Declare a variable.
Var #count 0

:start
// 1 plus a variable(#count)
#count = #count + 1  

 // #count is the same as 10. 
if #count == 10

     // shows toast message. 
     toast now count : Ten

 // #count is the same as 15. 
elseif #count == 15

     // shows toast message. 
     toast  now count: Fifteen
 
// # Count is greater than 20
elseif #count >= 20    
 
      // shows toast message. 
      toast now count: More than twenty
     
// End of if statement.   
endif  


:end

4.2.16. Else

When using an IF statement in the Else statement is false when all of the conditions of execution of the syntax. elseIF statement else statement below must be used when using. If the above condition is true, do not run.

// Declare a variable.
Var #count 0
Var #na 0

:start
// 1 plus a variable(#count)
#count = #count + 1  

// The remainder division two #count
#na = #count % 2

//  If this value is 0, the remaining
if #na == 0

      // shows toast message. 
     toast Count is an even number.

// If this value is 1, the remaining
else

      // shows toast message. 
      toast count is the odd.
     
// End of if statement.   
endif  


:end
4.2.17. Goto label

Its function is to move the label. must be begin with : (:step :go) Label in the middle of the script can be added anywhere. :start label, :end label, so the default label must exist.

      • Params
        • label: Enter labels to move. must be begin with : (:step :go)
var #count 0;

:start
calc #count #count + 1   

// #count is the same as 10.
if #count < 10
    goto :alabel 
    
// #count of 10 is not        
else                     
    goto :blabel      
endif

:alabel
// implementation of a label events
goto :end        

:blabel
// implementation of b label events

// Variable initialization 
set #count 0

goto :end           

:end

4.2.18. getColor var x y

The current screen x, y coordinates of the rgb color values of the var variable.
var Is calculated by setting blue * 65526 + green * 256 + red
backwards
red = var % 256
green = var / 256 % 256,
blue = var / 256 / 256 % 256

      • Params
        • var: rgb color values to save a variable.<
        • x: Get the x-coordinate of the color values.
        • y: Get the y-coordinate of the color values.
 
var #color 0
var #result 0

:start

// Coordinate the color value into the variable.
getColor #color 100 200

// shows toast message.
toast 색값 #color 

// Wait 3 second (1000 = 1 sec.) 
sleep 3000 

#result = #color % 256
toast Red Color : #Result
sleep 3000 

#result = #color / 256 % 256
toast Green Color : #Result
sleep 3000 

#result = #color / 256 / 256 % 256
toast Blue Color #Result
sleep 3000 

:end

4.2.19. getColorGray var x y

The current screen x, y coordinates of the gray color values of the var variable.
var Is calculated by setting (blue + green + red) / 3

      • Params
        • var: gray color values to save a variable.
        • x: Get the x-coordinate of the color values.
        • y: Get the y-coordinate of the color values.
 
var #color 0

:start
// Coordinate the gray color value into the variable.
getColorGray #color 100 200

// shows toast message.
toast gray color: #color 

// Wait 3 second (1000 = 1 sec.) 
sleep 3000 

:end

4.2.20. getRGB var1 var2 var3 x y

x, y coordinates of each of the RGB color value stored in the variable var1 ~ var3.

      • Params
        • var1: red color values to save a variable.
        • var2: blue color values to save a variable.
        • var3: green color values to save a variable.
        • x: Get the x-coordinate of the color values.
        • y: Get the y-coordinate of the color values.
 
var #red 0
var #green 0
var #blue 0

:start
// Coordinates of the RGB color value # red, # green, # blue into the variable.
getRGB #red #green #blue 100 200

// shows toast message.
toast R: #red G: #green B: #blue

// Wait 3 second (1000 = 1 sec.) 
sleep 3000 

:end

4.2.21. screenLock time

Desired amount of time to lock the device's screen. Keyboard events, but the power of the keys and similar functions
macro is paused, the screen is turned off, because time keyboard input events when the power key until the user is on again, but the macro will not proceed spontaneously screenLock event, the screen turns on and after a specified time after the macro is in progress.
tme value is 0, the screen turns off and will not turn on automatically.

Android screen lock policy is to give the permission settings Settings -> Security -> Device Manager
Available to give permission.
Gave permission to the device manager is not able to delete the app is deleted when the macro later to revoke Hiro and should be deleted.

      • Params
        • time: Have time to turn off the screen (1000 = 1 second)
:start
// shows toast message.
toast After a while, the screen turns off. 
sleep 5000

// The screen is turned off. And 10 seconds later on.
screenLock 10000 
sleep 1000

// Lock Screen disable touch events
touchDown 0 100 100
sleep 50
touchMove 0 200 100
sleep 50
touchMove 0 300 100
sleep 50
touchUp 0

 // shows toast message.
toast The screen is on.
:end

4.2.22. RunApp name

When you run the script on the other applications that use the function. The names of those packages will not run if there is no application. Please enter the exact name of the package.

      • Params
        • name: Enter the name of the package (com.android.calendar, com.android.crome, com.prohiro.macro)
:start

// com.android.calendar Run the application
RunApp com.android.calendar
sleep 5000

RunApp com.android.crome
sleep 5000

RunApp com.prohiro.macro
sleep 5000

:end

4.2.23. WaitApp name

When it detects the execution of other applications using the feature. Pointin application is running, specify the script does not proceed until the wait.

      • Params
        • name: Enter the name of the package (com.android.calendar, com.android.crome, com.prohiro.macro)
:start

//  com.prohiro.macro Run the application
RunApp com.prohiro.macro

// com.prohiro.macro Want to run the application wait
WaitApp com.prohiro.macro
sleep 1000
toast Application is run.

:end
4.2.24. CheckApp var name

When it detects the execution of other applications using the feature. If the application is running, the value 1 is stored in var is not running, 0 is stored

      • Params
        • var: Variable to store the results. (#a, #apple #abc)
        • name: Enter the name of the package (com.android.calendar, com.android.crome, com.prohiro.macro)
var #check 0
:start

CheckApp #check com.prohiro.macro
if #check == 0
     toast Application is not running
elseif #check == 1
    toast Application is running
endif     

:end

4.2.25. Vibrate time

Vibration occurs in the machine during this time .

      • Params
        • time: 1/1000 units of input. 1000 is 1 second.
var #color 0
:start
// Vibration occurs for 3 seconds .
Vibrate 3000
// To delay the event , because the script is terminated immediately .
sleep 3000

:end

4.2.26. Beep

Play notification sound.

var #color 0
:start

// Play notification sound.
Beep

:end

4.2.27. ScreenCap

Saves the current screen screenshots.
The image file is saved as png. Stored in [~/HiroMacro/Screenshot/] folder

var #color 0
:start

// Saves the current screen screenshots.
ScreenCap

:end

4.2.28. ForceStop

Stop forcing the script , regardless of the number of repeat loop

var #color 0
:start

// shows toast message.
toast Toast message.
sleep 3000

// Stop forcing the script
ForceStop

//The following script will not run.

// Coordinate the color value into the variable.
getColor #color 100 200  
toast Color is #color

:end

4.2.29. Toast text

Android toast to the contents of the text message shows.

      • Params
        • text: Toast to output the character. Including variables be used.
var #color 0
:start
// shows toast message.
toast Toast message.
sleep 3000

// Coordinate the color value into the variable.
getColor #color 100 2000
toast Color is #color
:end

4.2.30. Log text

text written to the log. You can check the log menu.

      • Params
        • text: Log in record character. Including variables be used.
var #color 0
:start
getColor #color 100 200       // Coordinate the color value into the variable.
log color(100,200) is #color  // Writes the log.
:end

4.2.31. //

//(Comment) is formed on the script exists but does not run when the script is run, actually.
Record a description of the script or another script when not in use for a while at the beginning // it'll be less.

var #color 0
:start
/ / Created by Hiro 
/ / Date: April 10, 2014

toast Hello.
sleep 3000
// toast pleasure.

:end

5. Supplement

5.1. Keyboard keycode

As the actual input, you must type the keyboard input.
K_R, enter the lowercase r. but the keydown K_SHIFT_LEFT is entered in a state where the uppercase letter R.

KEYMAP2
(Code must be entered in uppercase.)


5.2. Swiching keyboard language

K_SPACE switch between Korean and English at the same time the key is pressed and that K_SHFIT_LEFT the transition. But Settings -> Language & input, depending on the default keyboard shortcut is registered may not be aware of that. In this case, I download and play the google keyboard  settings -> language and input from the keyboard the default keyboard to switch between Korean and English register available to us.

// down as shift key
keyDown K_SHFT_LEFT    
sleep 30
// down as space key
keyDown K_SPACE     
sleep 30

// up to space key
keyUp K_SPACE          
sleep 30

// up to shift key
keyUp k_SHIFT_LEFT