-
Notifications
You must be signed in to change notification settings - Fork 1
Scripting
Sami Ylönen edited this page Dec 6, 2015
·
26 revisions
Note: This scripting part is not done, and can be quite buggy.
In the Scripts page, click "Add script".
Add a name for the script, and add source file(s) by clicking "Add source".
For each source file you add, write a file name for it.
You can reorder the scripts when you've added all you need. Execution order matters, place libraries first.
Press save.
You can now find the script entry, folder and js files from DATAROOT\Scripts.
The .js file you intend to be your main "executable" needs to have these 2 methdods
function execute() {
return true;
}
function executionCallback() {
}
execute() will be called by the engine and expects you to return true or false, true for script done and false if you want to rerun the script.
executionCallback() is called each time execute() is finished
var action = createAction();
var sequence1 = createSequenceFromString(200, "Tab"); //Keep key down for ms, Name of the key
var sequence2 = createSequenceFromInt(200, 69) // Keep key down for ms, int value of the key
var sequence3 = createStringAction("Some message here", 200); // String message, Keep each key down for ms
appendSequence(action, sequence1);
appendSequence(action, sequence2);
appendSequence(action, sequence3);// Adds the 3 sequences in the action
sendInput(action); // Sends the action
// Just sending a string message without creating action and sequences separately
sendString("Message", 200);