The Rotation Engine is the core automation system that manages skill rotations, track switching, and complex automation logic.
The Rotation Engine provides:
The engine is divided into specialized sub-modules:
Main entry point that includes all sub-modules.
Manages the current state of rotation execution.
RotationState := {
IsRunning: false,
CurrentTrack: 1,
LastSkillTime: 0,
BlackGuard: {
LastCheck: 0,
BlackCount: 0,
IsBlack: false
},
Opener: {
Active: false,
StartTime: 0,
CurrentStep: 0
}
}
Supports multiple skill tracks with different priorities and conditions.
Track := {
Id: 1,
Name: "Default Track",
Skills: [1, 2, 3], ; Skill indices
Priority: 1,
Conditions: [], ; Activation conditions
Cooldown: 1000 ; Track cooldown
}
Conditional track switching based on game state.
Gate := {
SourceTrack: 1,
TargetTrack: 2,
Conditions: [
{
Type: "Pixel",
X: 100,
Y: 200,
Color: "0xFF0000",
Tolerance: 10
}
],
Priority: 1
}
Protects against black screen states by detecting and avoiding them.
BlackGuard := {
Enabled: 1,
SampleCount: 5,
BlackRatioThresh: 0.7,
WindowMs: 120,
CooldownMs: 600,
MinAfterSendMs: 60,
MaxAfterSendMs: 800,
UniqueRequired: 1
}
Manages initial skill sequences for combat initiation.
Opener := {
Enabled: 0,
MaxDurationMs: 4000,
Watch: [
{
Type: "Skill",
SkillId: 1,
Condition: "Ready"
}
],
Steps: [
{Skill: 1, Delay: 0},
{Skill: 2, Delay: 500},
{Skill: 3, Delay: 1000}
]
}
Starts the rotation engine.
Parameters: None
Returns: Boolean indicating success
Stops the rotation engine.
Parameters: None
Returns: Boolean indicating success
Checks if the rotation engine is active.
Parameters: None
Returns: Boolean indicating running state
Adds a new skill track.
Parameters:
trackConfig (Map): Track configurationReturns: Track ID
Removes a skill track.
Parameters:
trackId (Integer): Track identifierReturns: Boolean indicating success
Adds a new track switching gate.
Parameters:
gateConfig (Map): Gate configurationReturns: Gate ID
Evaluates all gate conditions for track switching.
Parameters: None
Returns: New track ID if switching should occur
RotationConfig := {
Enabled: 0,
DefaultTrackId: 1,
SwapKey: "",
BusyWindowMs: 200,
ColorTolBlack: 16,
RespectCastLock: 1,
BlackGuard: { ... },
Opener: { ... }
}
Skills are configured separately and referenced by index in tracks.
; Configure skills first
skills := [
{Name: "Skill 1", Key: "1", X: 100, Y: 200, Color: "0xFF0000", Tol: 10},
{Name: "Skill 2", Key: "2", X: 150, Y: 200, Color: "0x00FF00", Tol: 10}
]
; Create a simple track
track := {
Id: 1,
Name: "Basic Rotation",
Skills: [1, 2], ; Reference skill indices
Priority: 1
}
; Add track to rotation
Rotation_AddTrack(track)
; Start rotation
Rotation_Start()
; Create a gate that switches tracks based on pixel color
gate := {
SourceTrack: 1,
TargetTrack: 2,
Conditions: [
{
Type: "Pixel",
X: 300,
Y: 400,
Color: "0x0000FF",
Tolerance: 5,
Operator: "Equals"
}
]
}
Rotation_AddGate(gate)
The rotation engine includes comprehensive error handling: