Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@Slf4j
public class AmmoniteCrabPlugin extends Plugin {

public final static String version = "1.1.1";
public final static String version = "1.1.2";
@Inject
public AmmoniteCrabScript ammoniteCrabScript;
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void preStateChecks(AmmoniteCrabConfig config) {
ammoniteCrabState = AmmoniteCrabState.HOP_WORLD;
}

if (Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(config.crabLocation().getWorldhopLocation()) > 10 && (ammoniteCrabState != AmmoniteCrabState.RESET_AGGRO && ammoniteCrabState != AmmoniteCrabState.WALK_BACK && ammoniteCrabState != AmmoniteCrabState.BANK)) {
if (Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()).distanceTo(config.crabLocation().getWorldhopLocation()) > 10 && (ammoniteCrabState != AmmoniteCrabState.RESET_AGGRO && ammoniteCrabState != AmmoniteCrabState.WALK_BACK && ammoniteCrabState != AmmoniteCrabState.BANK)) {
ammoniteCrabState = AmmoniteCrabState.WALK_BACK;
resetAggro(config);
resetAfkTimer();
Expand Down Expand Up @@ -181,7 +181,7 @@ private void scanAmmoniteCrabLocation(AmmoniteCrabConfig config) {
ammoniteCrabState = AmmoniteCrabState.FIGHT;
return;
}
if (config.crabLocation().getWorldhopLocation().distanceTo(Microbot.getClient().getLocalPlayer().getWorldLocation()) > 2) {
if (config.crabLocation().getWorldhopLocation().distanceTo(Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation())) > 2) {
Rs2Walker.walkTo(config.crabLocation().getWorldhopLocation());
return;
}
Expand Down Expand Up @@ -211,7 +211,7 @@ private void usePotions(AmmoniteCrabConfig config) {

private void walkBack(AmmoniteCrabConfig config) {
Rs2Walker.walkTo(config.crabLocation().getFightLocation());
if (Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(config.crabLocation().getFightLocation()) <= 3) {
if (Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()).distanceTo(config.crabLocation().getFightLocation()) <= 3) {
attackScatteredCrabs(config);
resetAfkTimer();
ammoniteCrabState = AmmoniteCrabState.FIGHT;
Expand Down Expand Up @@ -253,7 +253,7 @@ private boolean isNpcAggressive() {

private void resetAggro(AmmoniteCrabConfig config) {
Rs2Walker.walkTo(config.crabLocation().getResetLocation());
if (Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(config.crabLocation().getResetLocation()) <= 3) {
if (Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()).distanceTo(config.crabLocation().getResetLocation()) <= 3) {
ammoniteCrabState = AmmoniteCrabState.WALK_BACK;
}
}
Expand All @@ -270,7 +270,7 @@ private void resetAfkTimer() {
}

private boolean otherPlayerDetected() {
return otherPlayerDetected(Microbot.getClient().getLocalPlayer().getWorldLocation());
return otherPlayerDetected(Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()));
}

private boolean otherPlayerDetected(WorldPoint worldPoint) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@Slf4j
public class DemonicGorillaPlugin extends Plugin {

public final static String version = "1.2.3";
public final static String version = "1.2.4";

private static final int DEMONIC_GORILLA_ROCK = 856;
public static FixedSizeQueue<WorldPoint> lastLocation = new FixedSizeQueue<>(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private void retreatToSafety(DemonicGorillaConfig config) {
currentTripKillCount = 0;
Microbot.pauseAllScripts.compareAndSet(false, true);
escapeTosafety();
sleepUntil(() -> Microbot.getClient().getLocalPlayer().getWorldLocation().equals(SAFE_LOCATION), 5000);
sleepUntil(() -> SAFE_LOCATION.equals(Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation())), 5000);
disableAllPrayers();
Microbot.pauseAllScripts.compareAndSet(true, false);
BOT_STATUS = State.BANKING;
Expand Down Expand Up @@ -387,7 +387,7 @@ private void handleDemonicGorillaAttacks(DemonicGorillaConfig config) {
// Handle AOE attack
if (currentAnimation == DEMONIC_GORILLA_AOE_ATTACK && demonicGorillaRockPosition != null) {
List<WorldPoint> dangerousWorldPoints = new ArrayList<>(Rs2Tile.getDangerousGraphicsObjectTiles().keySet());
dangerousWorldPoints.add(Microbot.getClient().getLocalPlayer().getWorldLocation());
dangerousWorldPoints.add(Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()));
dangerousWorldPoints.add(currentTarget.getWorldLocation());
dangerousWorldPoints.add(location);
dangerousWorldPoints.addAll(DemonicGorillaPlugin.lastLocation.getAll());
Expand Down Expand Up @@ -511,7 +511,7 @@ public Rs2NpcModel getTarget(boolean force) {
return (Rs2NpcModel) interacting;
}
}
var playerLocation = Microbot.getClient().getLocalPlayer().getWorldLocation();
var playerLocation = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());

var alreadyInteractingNpcs = Rs2Npc.getNpcsForPlayer("Demonic gorilla");
if (!alreadyInteractingNpcs.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@Slf4j
public class GemCrabKillerPlugin extends Plugin {

public final static String version = "1.0.1";
public final static String version = "1.0.2";
@Inject
GemCrabKillerScript gemCrabKillerScript;
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ private void handleWalking() {
}

// Check if we're near the cave entrance before walking
GameObject caveEntrance = Rs2GameObject.getGameObject(CAVE_ENTRANCE_ID, Rs2Player.getLocalPlayer().getWorldLocation());
WorldPoint playerLoc = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());
GameObject caveEntrance = Rs2GameObject.getGameObject(CAVE_ENTRANCE_ID, playerLoc);
if (caveEntrance != null) {
// Check if the cave entrance has the "Crawl-through" action
var composition = Microbot.getClientThread().runOnClientThreadOptional(() ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public boolean run()
return;
}

final WorldPoint playerWorldLocation = Microbot.getClient().getLocalPlayer().getWorldLocation();
final WorldPoint playerWorldLocation = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());
final int currentAgilityXp = Microbot.getClient().getSkillExperience(Skill.AGILITY);

if (handleFood())
Expand Down Expand Up @@ -217,8 +217,8 @@ public boolean run()
// Normal obstacle interaction
if (Rs2GameObject.interact(gameObject)) {
// Wait for completion - this now returns quickly on XP drop
boolean completed = plugin.getCourseHandler().waitForCompletion(agilityExp,
Microbot.getClient().getLocalPlayer().getWorldLocation().getPlane());
boolean completed = plugin.getCourseHandler().waitForCompletion(agilityExp,
Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()).getPlane());

if (!completed) {
// Timeout occurred - log warning (throttled to once per 30 seconds)
Expand Down Expand Up @@ -374,8 +374,8 @@ private boolean shouldPerformAlch()

private boolean performEfficientAlch(TileObject gameObject, String alchItem, int agilityExp)
{
WorldPoint playerLocation = Microbot.getClient().getLocalPlayer().getWorldLocation();
WorldPoint playerLocation = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());

if (gameObject.getWorldLocation().distanceTo(playerLocation) >= 5)
{
// Efficient alching: click, alch, click
Expand All @@ -385,8 +385,8 @@ private boolean performEfficientAlch(TileObject gameObject, String alchItem, int
Rs2Magic.alch(alchItem, 50, 75);
Rs2GameObject.interact(gameObject);
boolean completed = plugin.getCourseHandler().waitForCompletion(agilityExp,
Microbot.getClient().getLocalPlayer().getWorldLocation().getPlane());
Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()).getPlane());

if (!completed) {
// Timeout during efficient alching - log warning
long now = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@Slf4j
public class MicroAgilityPlugin extends Plugin
{
public static final String version = "1.2.4";
public static final String version = "1.2.5";
@Inject
private MicroAgilityConfig config;
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ default boolean canBeBoosted()

default TileObject getCurrentObstacle()
{
WorldPoint playerLocation = Microbot.getClient().getLocalPlayer().getWorldLocation();
WorldPoint playerLocation = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());

List<AgilityObstacleModel> matchingObstacles = getObstacles().stream()
.filter(o -> o.getOperationX().check(playerLocation.getX(), o.getRequiredX()) && o.getOperationY().check(playerLocation.getY(), o.getRequiredY()))
Expand Down Expand Up @@ -134,7 +134,7 @@ default boolean waitForCompletion(final int agilityExp, final int plane)

default int getCurrentObstacleIndex()
{
WorldPoint playerLoc = Microbot.getClient().getLocalPlayer().getWorldLocation();
WorldPoint playerLoc = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());
int playerPlane = Microbot.getClient().getTopLevelWorldView().getPlane();

if (playerPlane == 0 && playerLoc.distanceTo(getStartPoint()) < 5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
)
@Slf4j
public class AIOFighterPlugin extends Plugin {
public static final String version = "2.0.10";
public static final String version = "2.0.11";
public static boolean needShopping = false;
private static final String SET = "Set";
private static final String CENTER_TILE = ColorUtil.wrapWithColorTag("Center Tile", JagexColors.MENU_TARGET);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public boolean run(AIOFighterConfig config) {

if (projectiles.isEmpty()) return;
WorldPoint[] dangerousPoints = projectiles.stream().map(Projectile::getTargetPoint).toArray(WorldPoint[]::new);
WorldPoint playerLocation = Microbot.getClient().getLocalPlayer().getWorldLocation();
WorldPoint playerLocation = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());

if (projectiles.stream().anyMatch(p -> p.getTargetPoint().distanceTo(playerLocation) < 2)) {
WorldPoint safePoint = calculateSafePoint(playerLocation, dangerousPoints);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
isExternal = PluginConstants.IS_EXTERNAL
)
public class AmethystMiningPlugin extends Plugin {
public static final String version = "1.2.3";
public static final String version = "1.2.4";
@Inject
private OverlayManager overlayManager;
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private boolean isVein(WallObject wallObject) {
private int distanceToPlayer(WallObject wallObject) {
WorldPoint closestWalkableNeighbour = Rs2Tile.getNearestWalkableTile(wallObject.getWorldLocation());
if (closestWalkableNeighbour == null) return 999;
return Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo2D(closestWalkableNeighbour);
return Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo2D(closestWalkableNeighbour));
}

private void interactWithVein(WallObject vein) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)
public class BlueDragonsPlugin extends Plugin {

public static final String version = "1.1.1";
public static final String version = "1.1.2";
static final String CONFIG = "bluedragons";

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private void handleEscape(){

private void HandleBankingSimple(BlueDragonsConfig config) {
logOnceToChat("Traveling to Falador West bank for depositing looted items.", true, config);
logOnceToChat("Current location: " + Microbot.getClient().getLocalPlayer().getWorldLocation(), true, config);
logOnceToChat("Current location: " + Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()), true, config);

if (Rs2Bank.walkToBankAndUseBank(BankLocation.FALADOR_WEST)) {

Expand Down Expand Up @@ -300,7 +300,7 @@ private void withdrawFood(BlueDragonsConfig config) {

private void handleTravelToDragons() {
logOnceToChat("Traveling to dragons.", false, config);
logOnceToChat("Player location before travel: " + Microbot.getClient().getLocalPlayer().getWorldLocation(), true, config);
logOnceToChat("Player location before travel: " + Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()), true, config);

if (isPlayerAtSafeSpot()) {
logOnceToChat("Already at safe spot. Transitioning to FIGHTING state.", true, config);
Expand Down Expand Up @@ -525,7 +525,7 @@ private boolean attackDragon(Rs2NpcModel dragon) {
}

private boolean isPlayerAtSafeSpot() {
return SAFE_SPOT.equals(Microbot.getClient().getLocalPlayer().getWorldLocation());
return SAFE_SPOT.equals(Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()));
}

private void moveToSafeSpot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
)
@Slf4j
public class AutoCookingPlugin extends Plugin {
public final static String version = "1.1.2";
public final static String version = "1.1.3";
@Inject
AutoCookingScript autoCookingScript;
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void walkToBanker() {
}

WorldPoint bankerWorldLocation = WorldPoint.fromLocal(Microbot.getClient(), bankerLocation);
WorldPoint playerWorldLocation = Microbot.getClient().getLocalPlayer().getWorldLocation();
WorldPoint playerWorldLocation = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());

// Check if the player is within 4 tiles of the banker
if (playerWorldLocation.distanceTo(bankerWorldLocation) <= 4) {
Expand Down Expand Up @@ -286,7 +286,7 @@ public static Rs2NpcModel getBankerNPC() {
return Rs2Npc.getNpcs()
.filter(npc -> npc.getComposition() != null && npc.getComposition().getActions() != null &&
Arrays.asList(npc.getComposition().getActions()).contains("Bank"))
.min(Comparator.comparingInt(npc -> npc.getWorldLocation().distanceTo(Microbot.getClient().getLocalPlayer().getWorldLocation())))
.min(Comparator.comparingInt(npc -> npc.getWorldLocation().distanceTo(Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()))))
.orElse(null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
isExternal = PluginConstants.IS_EXTERNAL
)
public class FlipperPlugin extends Plugin {
public static final String version = "1.2.1";
public static final String version = "1.2.2";
@Inject
private Client client;
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean run() {
state = State.MONITORING_COPILOT;
return;
}
if (!grandExchangeArea.contains(Microbot.getClient().getLocalPlayer().getWorldLocation())) {
if (!grandExchangeArea.contains(Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation()))) {
Rs2GrandExchange.walkToGrandExchange();
}
state = State.GETTING_COINS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
)
@Slf4j
public class GotrPlugin extends Plugin {
public static final String version = "1.5.0";
public static final String version = "1.5.1";

@Inject
private GotrConfig config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,13 @@ public static boolean isOutsideBarrier() {
public static boolean isInLargeMine() {
int largeMineX = 3637;
return Rs2Player.getWorldLocation().getRegionID() == 14484
&& Microbot.getClient().getLocalPlayer().getWorldLocation().getX() >= largeMineX;
&& Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation().getX()) >= largeMineX;
}

public boolean isInHugeMine() {
int hugeMineX = 3594;
return Rs2Player.getWorldLocation().getRegionID() == 14484
&& Microbot.getClient().getLocalPlayer().getWorldLocation().getX() <= hugeMineX;
&& Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation().getX()) <= hugeMineX;
}

public static boolean isGuardianPortal(GameObject gameObject) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
)
public class MotherloadMinePlugin extends Plugin {

static final String version = "1.9.0";
static final String version = "1.9.1";

@Inject
private MotherloadMineConfig config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ private boolean attemptToMineVein() {
return sleepUntil(() -> {
Rs2TileObjectModel _vein = rs2TileObjectCache.query().where(o -> Objects.equals(o.getWorldLocation(), vein.getWorldLocation())).nearestReachable();
if (_vein == null || !isValidVein(_vein)) return false;
return AntibanPlugin.isMining() && _vein.getWorldLocation().distanceTo(Microbot.getClient().getLocalPlayer().getWorldLocation()) <= 2;
WorldPoint playerLoc = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());
return AntibanPlugin.isMining() && playerLoc != null && _vein.getWorldLocation().distanceTo(playerLoc) <= 2;
}, 10_000);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)
@Slf4j
public class NmzPlugin extends Plugin {
final static String version = "2.3.0";
final static String version = "2.3.1";
@Inject
private NmzConfig config;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public void shutdown() {
}

public boolean isOutside() {
return Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(new WorldPoint(2602, 3116, 0)) < 20;
WorldPoint loc = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());
return loc != null && loc.distanceTo(new WorldPoint(2602, 3116, 0)) < 20;
}

public void handleOutsideNmz() {
Expand Down Expand Up @@ -204,7 +205,10 @@ public boolean interactWithObject(int objectId) {
TileObject rs2GameObject = Rs2GameObject.findObjectById(objectId);
if (rs2GameObject != null) {
Rs2Walker.walkFastLocal(rs2GameObject.getLocalLocation());
sleepUntil(() -> Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(rs2GameObject.getWorldLocation()) < 5);
sleepUntil(() -> {
WorldPoint loc = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());
return loc != null && loc.distanceTo(rs2GameObject.getWorldLocation()) < 5;
});
Rs2GameObject.interact(objectId);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@Slf4j
public class PestControlPlugin extends Plugin {

static final String version = "2.2.8";
static final String version = "2.2.9";

@Inject
PestControlScript pestControlScript;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ private boolean handleInventorySetup() {


public boolean isOutside() {
return Microbot.getClient().getLocalPlayer().getWorldLocation().distanceTo(new WorldPoint(2644, 2644, 0)) < 20;
WorldPoint playerLoc = Microbot.getClientThread().invoke(() -> Microbot.getClient().getLocalPlayer().getWorldLocation());
return playerLoc.distanceTo(new WorldPoint(2644, 2644, 0)) < 20;
}

public boolean isInBoat() {
Expand Down
Loading
Loading