Dive into the Script Editor for Code Automation
A beginner-friendly guide to mastering the Script Editor in NX Auto Clicker. Learn the built-in language to create powerful automation scripts.
Welcome to Advanced Automation
You’ve learned Multi-Point Clicking and the Macro Recorder. Now, it’s time to unlock the ultimate level of control: the Script Editor.
Don’t let the word “Code” scare you! NX Auto Clicker uses a built-in language (Domain Specific Language, or DSL for short) that is incredibly easy to read and write. It’s designed specifically for absolute beginners to understand.
With the Script Editor, you can type out exact instructions for your computer to follow, line by line.
Core Commands: The Building Blocks
Let’s look at the simple words (commands) you can use to build your script.
1. Wait: Pausing the Action
Applications need time to load. The wait command tells the script to pause for a certain number of milliseconds (1000 milliseconds = 1 second).
wait(500) // Wait for half a second
wait(2000) // Wait for 2 full seconds
2. Move: Positioning the Mouse
The move command instantly puts your mouse pointer at exact X and Y coordinates on your screen.
move(500, 300) // Move the mouse to X: 500, Y: 300
(Tip: You can use the Multi-Point clicker interface to easily find out the X and Y coordinates of places on your screen!)
3. Click: Clicking the Mouse
The click command does exactly what it says: it clicks the mouse.
Option A: Simple Click If you just want to left-click wherever the mouse currently is, just use click():
click()
Option B: Click at Coordinates You can tell it to click exactly at specific coordinates:
click(500, 300)
Option C: Choose the Mouse Button
By default, it left-clicks. But you can specify left, right, or middle:
click(500, 300, right) // Right-clicks at 500, 300
click(100, 200, middle) // Middle-clicks at 100, 200
4. Key Press: Pressing the Keyboard
Need to type a letter or hit a special key? Use key_press.
key_press(Space)
key_press(A)
key_press(Enter)
Loops: Doing Things Repeatedly
The real power of scripts comes from loops. Instead of writing click() five times, you can tell the script to loop it.
The Infinite Loop
If you want something to run forever until you press the Emergency Stop (Escape key):
loop {
click(500, 300)
wait(1000)
}
This script will click at 500, 300 wait one second, and repeat forever.
The Counted Loop
If you know exactly how many times you want a task to repeat, put a number after the word loop:
loop 5 {
key_press(Space)
wait(500)
}
This script will press the Spacebar exactly 5 times, pausing for half a second between each press.
Putting It All Together: A Simple Example Workflow
Imagine a game where you need to move to an inventory slot, right-click an item to “use” it, press Enter to confirm, and repeat this 10 times.
Here is how easily you can write that script:
loop 10 {
// 1. Move to the item
move(800, 600)
wait(200)
// 2. Right click to open the menu
click(800, 600, right)
wait(500)
// 3. Press Enter to confirm the "use" action
key_press(Enter)
// 4. Wait a bit before repeating on the next item
wait(1000)
}
Start Scripting!
The Script Editor is your blank canvas. Open it up in NX Auto Clicker and start experimenting. Remember, you can always save your scripts in the Task Manager just like any other automation! Always remember your Emergency Stop hotkey (default: Escape) in case your script starts doing something unexpected. Happy automating!