All scripts

Gnome Stronghold Agility

by SolemnVanguard ·Agility

Gnome Stronghold Agility

1

Installed

1.0

Version

21 Aug 2026

Updated

About this script

Gnome Stronghold Agility course, will do every obstacle

Builds

VersionKindPublishedSizeWhat changed
1.0 current text script 21 Aug 2026 3 KB First upload.

Source of 1.0

Published by the author. This is the current build, exactly as it will be delivered.

script      "Agility Barbarian Village"
author      "you"
version     "1.0"
description "Runs the Barbarian Village agility course loop"
category    "Agility"
every       600

# Runs only the first two obstacles in a loop, starting from
# tile(487, 556):
#   0. id 675 - "swing"
#   1. id 676 - "balance on"
# then walks back to the start tile and repeats.

var step = 0

var lastFatigueMillis = -1
var fatigueSuspicious = false
var FatigueSuspiciousWindowMs = 120000   # 2 minutes

var startedMillis = 0
var startXp = 0

on start {
    if not batchAvailable() {
        print("batch hooks missing - clicks may double up")
    }
    startedMillis = nowMillis()
    startXp = xp("agility")
    uiTab("Agility")
}

fun fatigueSuspiciousCheck() {
    if fatigue() >= 100 {
        let now = nowMillis()
        if lastFatigueMillis >= 0 and (now - lastFatigueMillis) < FatigueSuspiciousWindowMs {
            print("Fatigue hit 100 again within", FatigueSuspiciousWindowMs, "ms - stopping")
            fatigueSuspicious = true
        }
        lastFatigueMillis = now
    }
}

# Tries the obstacle for the CURRENT step only, found by id. Advances
# the step and returns true if it acted.
fun tryStep(int id, string command) -> bool {
    let obj = nearestObject(id: id, within: 6)
    if obj == none { return false }
    if not interact(obj, command) { return false }   # interact narrates its own reason
    step = step + 1
    wait until batchActive() timeout 3000 else { }
    return true
}


on loop {
    fatigueSuspiciousCheck()
    if fatigueSuspicious { return 999999 }

    let gained = xp("agility") - startXp
    let elapsedMs = elapsedSince(startedMillis)
    let perHour = 0
    if elapsedMs > 0 { perHour = gained * 3600000 / elapsedMs }
    uiStat("xp", "Agility xp", commas(gained), "lime")
    uiStat("xphr", "Xp/hr", commas(perHour), "yellow")

    if isSleeping() {
        print("Sleeping, fatigue left:", sleepFatigue())
        return 2000
    }
    if fatigue() >= 100 {
        let bag = invItem(1263)
        if bag != none { interact(bag, "Sleep") }
        return random(600, 900)
    }

    if batchActive() { return 600 }

    if step == 0 {
        if tryStep(675, "swing") { return random(900, 1400) }
    } else if step == 1 {
        if tryStep(676, "balance on") { return random(900, 1400) }
    } else {
        if myTile() != tile(487, 556) {
            walkTo(tile(487, 556))
            return 900
        }
        step = 0
        return random(900, 1400)
    }

    print("waiting for step", step, "obstacle to come into view")
    return 900
}

on render {
    if fatigueSuspicious {
        paintRoundFill(4, 300, 220, 60, 12, "#cc6600ee")
        paintTextCenteredSized(114, 322, "FATIGUE LOOP", "white", 16)
        paintTextCenteredSized(114, 344, "SCRIPT STOPPED", "white", 12)
    }
}