VG Script API Reference
Complete reference for the VG (Visual Gaming) scripting language used in Helios controller programming.
Controller Input
Vision Processing
Script Control
State Management
Advanced Features
Utilities
Controller Input Methods
press()
Simulates a button press and immediate release.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
button | string | Button identifier (A, B, X, Y, LB, RB, etc.) | Yes |
duration | number | Press duration in milliseconds (default: 50ms) | No |
Example
# Simple press press A # Press with custom duration press X 100ms # Multiple presses press A wait 200ms press B
hold()
Holds a button down for a specified duration.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
button | string | Button identifier | Yes |
duration | number | Hold duration in milliseconds | Yes |
Example
# Hold button for 2 seconds hold RT 2000ms # Charge attack combo hold X 1500ms press A
move_stick()
Moves an analog stick to a specific position.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
stick | 'left' | 'right' | Which analog stick to move | Yes |
x | number | X-axis value (-1.0 to 1.0) | Yes |
y | number | Y-axis value (-1.0 to 1.0) | Yes |
duration | number | How long to hold the position (ms) | No |
Example
# Move left stick forward move_stick left 0 1.0 # Diagonal movement move_stick left 0.7 0.7 1000ms # Circle motion repeat 36 { $angle = $i * 10 $x = cos($angle) $y = sin($angle) move_stick right $x $y 50ms }
Vision Processing Methods
on_detect()
Registers a callback function that triggers when a specific visual pattern is detected.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
pattern | string | Image file path or pattern name | Yes |
callback | function | Function to execute on detection | Yes |
options | DetectOptions | Detection configuration | No |
Example
# Detect enemy health bar on_detect "enemy_healthbar.png" { # Auto-aim towards detected position $offset_x = $detection.x - $screen.center_x move_stick right ($offset_x / $screen.width) 0 press RT } # With options on_detect "powerup.png" { move_to $detection.x $detection.y press A } { threshold: 0.9 region: [100, 100, 500, 500] cooldown: 1000ms }
find_image()
Searches for an image on screen and returns its location.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
template | string | Path to template image | Yes |
threshold | number | Match confidence (0.0-1.0, default: 0.8) | No |
Example
# Find and click on button $button = find_image "start_button.png" if $button { move_cursor $button.x $button.y press A } # With custom threshold $target = find_image "target.png" 0.95 if $target { log "Target found at: " + $target.x + ", " + $target.y }
Script Control Flow
combo
Defines a reusable sequence of actions that can be called as a single command.
Example
# Define combo combo heavy_attack { hold RT 200ms wait 100ms press Y wait 50ms press B } # Use combo heavy_attack wait 1000ms heavy_attack # Combo with parameters combo aim_and_shoot($duration) { hold LT 500ms hold RT $duration release LT }
parallel()
Executes multiple actions simultaneously.
Example
# Move and shoot at the same time parallel { move_stick left 1.0 0 2000ms repeat 10 { press RT wait 200ms } } # Complex parallel actions parallel { # Thread 1: Movement { move_stick left 0.5 0.5 1000ms move_stick left -0.5 -0.5 1000ms } # Thread 2: Combat { press X wait 500ms hold B 1500ms } }
Advanced Features
ml_predict() New
Uses machine learning models to make predictions based on screen content.
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
model | string | Path to trained model file | Yes |
input | Image | Region | Input data for prediction | Yes |
Example
# Predict enemy type $screen = capture_screen() $prediction = ml_predict "enemy_classifier.model" $screen if $prediction.class == "boss" { combo defensive_stance } else if $prediction.class == "minion" { combo quick_attack } # Predict next move in fighting game $frame = capture_region [100, 100, 400, 300] $next_move = ml_predict "move_predictor.model" $frame log "Predicted move: " + $next_move.label + " (confidence: " + $next_move.confidence + ")"
Need Help?
This is just a sample of the available API methods. For the complete reference, examples, and community scripts, join our Discord server.