-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the NaMacroJS wiki!
NaMacroJS(Neoarc's Macro with JavaScript) is simple macro program using Google V8 Javascript Engine. The process focuses on an easily extensible, editable by the developers.
- OS
Windows XP (minimum requirement)
- TTS Engine
Microsoft Speech Engine 5.3 Maybe included as default
- Macro Player
Javascript runner (Mouse, Keyboard control, TTS, Screen Capture, Image Processing, etc)
- Macro Recorder
Javascript Generator (Recording Mouse, Keyboard)
-
Base
-
Mouse
Handling mouse status. Change cursor position, Button status (down, up), Process Click, etc.
system.mouse.move(0, 0);
system.mouse.click(100, 100);
- Keyboard
Handling Keyboard input.
system.keyboard.input('a');
system.keyboard.typeString('Hello');
// global hotkey and its callback function
system.keyboard.on(0x10, function() { alert("hi!"); });
- Screen
Capture Screen to Image object, Get Color from Screen Point or etc.
// create Image object from screen coordinate 100,100 to 600,600
var image = system.screen.capture(100, 100, 500, 500); // [object Image]
// get color of image coord 0,0
var color1 = image.getPixel(0, 0);
// get color of screen coord 100, 100
var color2 = system.screen.getPixel(100, 100);
- Extended
Extended module. (etc)
- Window
Handling win32 window. Toggle visible, move, resize, Change text, etc.
// get current active window as [object Window]
var win = getActiveWindow();
// change width to 800
win.width = 800;
// move window to center of screen
win.move("center", "middle");
// change title text of window
win.text = "hello world";
- Image
Handling captured image. Get pixel from x,y of Image, etc.
var image = system.screen.capture(100, 100, 500, 500);
var color1 = image.getPixel(0, 0);
// search small image from big image and get first coordinates
var coord = big_image.findImage(small_image_to_find);
// and click found
system.mouse.click(coord.x, coord.y);
- File
Handling file. Read, write, move, rename, copy, delete, etc.
// open file for write
var file = new File("haha.txt", "w");
file.write("hahaha hohoho");
// close is unnecessary
file.close();
- Make your own script (must contain 'main' function)
- Run: NaMacro.exe [your_script.js]