Settings
The Settings module provides various configuration options to control how your macro behaves. Here are the key features:
Detection Settings
Minimum Score
Settings:getMinScore()
- Get the current minimum threshold score for text/image detectionSettings:setMinScore(score: number)
- Set the minimum threshold score for detection
Grayscale Mode
Settings:isGrayscale()
- Check if grayscale mode is enabledSettings:grayscaleOn()
- Enable grayscale mode for faster detectionSettings:grayscaleOff()
- Disable grayscale mode
Template Caching
Settings:cacheOn()
- Enable template caching to improve performanceSettings:cacheOff()
- Disable template caching
Delay Settings
Click Delay
Settings:getClickDelay()
- Get the current click delaySettings:setClickDelay(delayMs: number)
- Set the delay between click actions
Swipe Delay
Settings:getSwipeDelay()
- Get the current swipe delaySettings:setSwipeDelay(delayMs: number)
- Set the delay between swipe actions
Scan Interval
Settings:getScanInterval()
- Get the current scan interval for detectionSettings:setScanInterval(interval: number)
- Set the delay between detection scans
Example Usage
// Configure detection settings
Settings:setMinScore(0.8);
Settings:grayscaleOn();
Settings:cacheOn();
// Configure delays
Settings:setClickDelay(500);
Settings:setSwipeDelay(1000);
Settings:setScanInterval(200);
// Get current settings
minScore = Settings:getMinScore();
isGray = Settings:isGrayscale();
clickDelay = Settings:getClickDelay();
Block Configuration
Detection Settings
- Minimum Score: Set the threshold score (0-1) for text and image detection
- Grayscale Mode: Toggle grayscale processing for faster detection
- Template Cache: Enable/disable template caching to optimize performance
Delay Settings
- Click Delay: Set the delay between click actions (in milliseconds)
- Swipe Delay: Set the delay between swipe actions (in milliseconds)
- Scan Interval: Set the delay between detection scans (in milliseconds)
Example
Usage Tips
-
Performance Optimization
- Enable grayscale mode when color isn't important for detection
- Use template caching when working with static screens
- Adjust scan intervals based on your device's capabilities
-
Timing Adjustments
- Increase delays on slower devices
- Use shorter delays for time-critical operations
- Balance speed vs reliability
-
Detection Tuning
- Higher minimum scores (closer to 1) for more precise matching
- Lower scores (closer to 0) for more flexible matching
- Start with 0.8 and adjust as needed
Related Blocks
- Image Detection
- Text Detection
- Click
- Swipe