Pattern Structure
Patterns are written in AutoHotkey v2 and define movement sequences using specific functions and variables.Required Functions
Every pattern must use these core movement functions:Pattern Variables
These variables are available in every pattern:| Variable | Type | Description |
|---|---|---|
size | Number | Pattern size multiplier (default: 1) |
reps | Number | Number of repetitions (default: 1) |
facingcorner | Number | Initial facing direction (0 or 1) |
TCFBKey | String | ”Toward Center” Forward/Back key |
TCLRKey | String | ”Toward Center” Left/Right key |
AFCFBKey | String | ”Away From Center” Forward/Back key |
AFCLRKey | String | ”Away From Center” Left/Right key |
Movement Key Variables
These directional keys are predefined:FwdKey- Forward movementBackKey- Backward movementLeftKey- Left movementRightKey- Right movementRotLeft- Rotate camera leftRotRight- Rotate camera right
Example Patterns
Simple Lines Pattern
Simple Lines Pattern
- Walks toward center for 11 units (scaled by size)
- Moves left/right 1 unit
- Walks away from center for 11 units
- Moves left/right 1 unit
- Repeats based on
repsvalue
Squares Pattern
Squares Pattern
A_Index to increase size each loop.Stationary Pattern
Stationary Pattern
Import Process
When you add a pattern file to thepatterns/ folder, Natro Macro automatically:
- Validates Syntax - Checks for AutoHotkey v2 syntax errors
- Security Check - Warns about untrusted patterns
- Compiles - Validates the pattern can execute
- Imports - Makes it available in the GUI
Validation Code
Fromnatro_macro.ahk:172-303, the import function:
Security Warnings
Security Dialog
When importing a new pattern, you’ll see this warning (fromnatro_macro.ahk:214-237):
Deprecated Pattern Warning
If you see this error:patterns[. Update to v2 syntax or download the latest version.
Common Issues
Pattern not appearing in GUI
Pattern not appearing in GUI
Cause: Syntax error or validation failureSolution:
- Check the error message when macro loads
- Verify your pattern uses correct function names
- Test pattern syntax in a text editor with AHK v2 syntax checking
- Remove and re-add the pattern file
Character moves incorrectly
Character moves incorrectly
Cause: Wrong key variables or movement logicSolution:
- Test with
size=1andreps=1first - Verify you’re using
TCFBKey/AFCFBKeycorrectly - Check
Walk()distances are reasonable (11 units ≈ full field width) - Add
HyperSleep()between movements if needed
Security warning every restart
Security warning every restart
Cause: Pattern hash not in verified listSolution: This is normal for custom patterns. The warning prevents malicious auto-imports. Click “Yes” if you trust your pattern.
Testing Your Pattern
- Start Small - Use
size=1andreps=1 - Visual Test - Watch the character movement in-game
- Field Coverage - Check pattern covers desired area
- Edge Cases - Test with different field sizes
- Performance - Ensure pattern completes in reasonable time
Best Practices
- Keep patterns simple and readable
- Use meaningful Walk() distances (11 units ≈ field width)
- Test patterns in Sunflower Field first (simple, accessible)
- Add comments explaining complex logic
- Use
HyperSleep()for precise timing when needed - Consider different field shapes when designing
File Location
Place pattern files here:Further Resources
Need help? Join our Discord server for pattern creation support and to share your patterns with the community!