famers Posted April 27, 2023 Posted April 27, 2023 package main; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import java.text.NumberFormat; import java.util.Locale; @ScriptManifest(author = "Famers", info = "Ardougne Agility Course", name ="Ardougne Agility", version = 1.0, logo = "") public class ArdyAgility extends Script { private enum State { WaitStart, Part1, Part2, Part3, Part4, Part5, Part6, Part7, } private static int PART_1 = 15608; // Wooden Beams private static int PART_2 = 15609; // Gap private static int PART_3 = 26635; // Plank private static int PART_4 = 15610; // Gap private static int PART_5 = 15611; // Gap private static int PART_6 = 28912; // Steep Roof private static int PART_7 = 15612; // Gap private static Position PART_1_POS = new Position(2671, 3299, 3); private static Position PART_2_POS = new Position(2665, 3318, 3); private static Position PART_3_POS = new Position(2656, 3318, 3); private static Position PART_4_POS = new Position(2653, 3314, 3); private static Position PART_5_POS = new Position(2651, 3309, 3); private static Position PART_6_POS = new Position(2656, 3297, 3); private static int MARK_OF_GRACE = 11849; private State state; private int hourExp, totalExp; public void onStart() throws InterruptedException { experienceTracker.start(Skill.AGILITY); state = State.WaitStart; while (myPosition().getZ() != 0) { sleep(1000); } state = State.Part1; } public void onPaint(Graphics2D g) { g.setFont(new Font("Consolas", Font.PLAIN, 12)); g.drawString("State: " + state, 10, 290); totalExp = experienceTracker.getGainedXP(Skill.AGILITY); hourExp = experienceTracker.getGainedXPPerHour(Skill.AGILITY); g.drawString("Agility Exp Gained: " + totalExp + " (" + NumberFormat.getNumberInstance(Locale.US).format(hourExp) + "xp/h)", 10, 320); } private int attempts = 0; @Override public int onLoop() { Position self = myPosition(); if (self.getZ() == 0 && state != State.Part1) { state = State.Part1; return random(300, 400); } switch (state) { case Part1: if (positionEquals(self, PART_1_POS)) { state = State.Part2; } if (self.getZ() == 0 || attempts > 10) { objects.closest(PART_1).interact(); attempts = 0; return random(5000, 5500); } break; case Part2: if (positionEquals(self, PART_2_POS)) { state = State.Part3; } if (positionEquals(self, PART_1_POS) || attempts > 10) { objects.closest(PART_2).interact(); attempts = 0; return random(1200, 1500); } break; case Part3: if (positionEquals(self, PART_3_POS)) { state = State.Part4; } if (positionEquals(self, PART_2_POS) || attempts > 10) { objects.closest(PART_3).interact(); attempts = 0; return random(1200, 1500); } break; case Part4: java.util.List<GroundItem> groundItems = getGroundItems() .filter(groundItem -> groundItem.getId() == MARK_OF_GRACE); int itemCount = groundItems.stream() .map(item -> item.getAmount()) .reduce(0, (a, b) -> a + b); if (itemCount >= 5) { for (GroundItem item : groundItems) { item.interact(); } } if (positionEquals(self, PART_4_POS)) { state = State.Part5; } if (positionEquals(self, PART_3_POS) || attempts > 10) { objects.closest(PART_4).interact(); attempts = 0; return random(1200, 1500); } break; case Part5: if (positionEquals(self, PART_5_POS)) { state = State.Part6; } if (positionEquals(self, PART_4_POS) || attempts > 10) { objects.closest(PART_5).interact(); attempts = 0; return random(1200, 1500); } break; case Part6: if (positionEquals(self, PART_6_POS)) { state = State.Part7; } if (positionEquals(self, PART_5_POS) || attempts > 10) { objects.closest(PART_6).interact(); attempts = 0; return random(1200, 1500); } break; case Part7: if (positionEquals(self, PART_6_POS) || attempts > 10) { objects.closest(PART_7).interact(); attempts = 0; return random(1200, 1500); } break; } attempts++; return random(600, 700); } private static boolean positionEquals(Position a, Position b) { return a.getX() == b.getX() && a.getY() == b.getY() && a.getZ() == b.getZ(); } } Very simple but it worked. Note I only used it after 96 agility so idk if it recovers after failing. (~57k/hr if you position camera such that it doesn't need to reposition) 3