Skip to main content

Reaction

Keyboard#

setKeyboardDelay#

FieldTypeRequiredDefaultDescription
msnumberโœ”๏ธnoneYour message
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.setKeyboardDelay(50);
}

keyTap#

FieldTypeRequiredDefaultDescription
keystringโœ”๏ธnoneYour message
modifierstringstring[]โŒnone
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.keyTap("a");
await moduleAutomation.keyTap("a", "alt");
await moduleAutomation.keyTap("a", [ "control", "alt"]);
}

keyToggle#

FieldTypeRequiredDefaultDescription
keystringโœ”๏ธnoneYour message
downstringโœ”๏ธnoneAccepts down or up.
modifierstringstring[]โŒnone
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.keyToggle("a", "down");
await moduleAutomation.keyToggle("b", "up");
await moduleAutomation.keyToggle("c", "up", ["alt"]);
}

typeString#

FieldTypeRequiredDefaultDescription
messagestringโœ”๏ธnoneYour message
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.typeString("Hello from script");
}


typeStringDelayed#

FieldTypeRequiredDefaultDescription
messagestringโœ”๏ธnoneYour message
cpmnumberโŒnoneCharacters per minute
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.typeStringDelayed("Hello from script", 60);
}

Mouse#

setMouseDelay#

FieldTypeRequiredDefaultDescription
msnumberโœ”๏ธnoneYour message
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.setMouseDelay(50);
}

moveMouse#

FieldTypeRequiredDefaultDescription
xnumberโœ”๏ธnone
ynumberโœ”๏ธnone
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.moveMouse(50, 5);
}

moveMouseSmooth#

FieldTypeRequiredDefaultDescription
xnumberโœ”๏ธnone
ynumberโœ”๏ธnone
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.moveMouseSmooth(50, 5);
}

mouseClick#

FieldTypeRequiredDefaultDescription
sidenumberโŒleftAccepts left, right, or middle.
doublebooleanโŒfalseSet to true to perform a double click
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.mouseClick();
await moduleAutomation.mouseClick("right", true);
}

mouseToggle#

FieldTypeRequiredDefaultDescription
downnumberโŒleftAccepts down or up.
buttonnumberโŒleftAccepts left, right, or middle.
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.mouseToggle("down");
await moduleAutomation.mouseToggle("up", "left");
}

dragMouse#

FieldTypeRequiredDefaultDescription
xnumberโœ”๏ธleft
ynumberโœ”๏ธleft
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.dragMouse("down");
await moduleAutomation.dragMouse("up", "left");
}

getMousePos#

Return#

Return a Promise with mouse position.

Example#
const reaction = async (event) => {
const mousePos = await moduleAutomation.getMousePos();
console.log(mousePos);
}

scrollMouse#

FieldTypeRequiredDefaultDescription
xnumberโœ”๏ธleft
ynumberโœ”๏ธleft
Return#

Return a Promise with void.

Example#
const reaction = async (event) => {
await moduleAutomation.scrollMouse(5, 5);
}

Screen#

getPixelColor#

FieldTypeRequiredDefaultDescription
xnumberโœ”๏ธleft
ynumberโœ”๏ธleft
Return#

Return a Promise with color.

Example#
const reaction = async (event) => {
const color = await moduleAutomation.getPixelColor(5, 5);
console.log(color);
}

getScreenSize#

Return#

Return a Promise with color.

Example#
const reaction = async (event) => {
const screenSize = await moduleAutomation.getScreenSize();
console.log(screenSize);
}

screenCapture#

FieldTypeRequiredDefaultDescription
xnumberโœ”๏ธ
ynumberโœ”๏ธ
widthnumberโœ”๏ธ
numbernumberโœ”๏ธ
Return#

Return a Promise with image data.

Example#
const reaction = async (event) => {
const imgData = await moduleAutomation.screenCapture(150, 100, 50, 65);
console.log(imgData);
}