✨ ARCANUM RUNE DIFFICULTY: Adept Structural

The Spectral Legion (Composite)

Group individual ghostly inputs and complex macro-swarms into unified ethereal entities.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Composite
ARCANUM SCHOOL: Illusion // Legion Manifestation
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
class MacroEntity {
    Execute() {
        throw Error("Not implemented")
    }
}

class KeystrokePoltergeist extends MacroEntity {
    __New(keys) {
        this.keys := keys
    }
    Execute() {
        Send(this.keys)
    }
}

class MousePoltergeist extends MacroEntity {
    __New(x, y) {
        this.x := x
        this.y := y
    }
    Execute() {
        Click(this.x, this.y)
    }
}

class GhostSwarm extends MacroEntity {
    __New() {
        this.children := []
    }
    Add(entity) {
        this.children.Push(entity)
    }
    Execute() {
        for index, child in this.children {
            child.Execute()
            Sleep(100)
        }
    }
}

swarm := GhostSwarm()
swarm.Add(KeystrokePoltergeist("^{Esc}"))
swarm.Add(MousePoltergeist(500, 500))

legion := GhostSwarm()
legion.Add(swarm)
legion.Add(KeystrokePoltergeist("!{F4}"))

legion.Execute()
Runic Tags: #autohotkey #composite #automation #poltergeist