Repository: runelite/runelite
Pull request #18201 (2024-08-29 13:56:51)

slayer: add araxyte and spider alternatives
This PR adds Araxxor to Araxyte tasks, and Araxyte variations to spider tasks.


Patch:
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java
index 778109e12..82cf605fd 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java
@@ -43,7 +43,7 @@ enum Task
 	ADAMANT_DRAGONS("Adamant dragons", ItemID.ADAMANT_DRAGON_MASK),
 	ALCHEMICAL_HYDRA("The Alchemical Hydra", ItemID.IKKLE_HYDRA),
 	ANKOU("Ankou", ItemID.ANKOU_MASK),
-	ARAXYTES("Araxytes", ItemID.ARAXYTE_HEAD),
+	ARAXYTES("Araxytes", ItemID.ARAXYTE_HEAD, "Araxxor"),
 	AVIANSIES("Aviansies", ItemID.ENSOULED_AVIANSIE_HEAD, "Kree'arra", "Flight Kilisa", "Flockleader Geerin", "Wingman Skree"),
 	BANDITS("Bandits", ItemID.BANDIT, "Bandit", "Black Heather", "Donny the Lad", "Speedy Keith"),
 	BANSHEES("Banshees", ItemID.BANSHEE),
@@ -159,7 +159,7 @@ enum Task
 	SKELETONS("Skeletons", ItemID.SKELETON_GUARD, "Vet'ion", "Calvar'ion"),
 	SMOKE_DEVILS("Smoke devils", ItemID.SMOKE_DEVIL),
 	SOURHOGS("Sourhogs", ItemID.SOURHOG_FOOT),
-	SPIDERS("Spiders", ItemID.HUGE_SPIDER, "Kalrag", "Sarachnis", "Venenatis", "Spindel"),
+	SPIDERS("Spiders", ItemID.HUGE_SPIDER, "Kalrag", "Sarachnis", "Venenatis", "Spindel", "Araxxor", "Araxyte"),
 	SPIRITUAL_CREATURES("Spiritual creatures", ItemID.DRAGON_BOOTS, "Spiritual ranger", "Spiritual mage", "Spiritual warrior"),
 	STEEL_DRAGONS("Steel dragons", ItemID.STEEL_DRAGON),
 	SUQAHS("Suqahs", ItemID.SUQAH_TOOTH),
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingPlugin.java
index 0937232a7..392da085e 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingPlugin.java
@@ -95,7 +95,7 @@ public class SmeltingPlugin extends Plugin
 			return;
 		}
 
-		if (event.getMessage().startsWith("You retrieve a bar of"))
+		if (event.getMessage().startsWith("You retrieve a bar of") || event.getMessage().startsWith("The Varrock platebody enabled you to smelt your next ore"))
 		{
 			if (session == null)
 			{
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java
index 9c012c262..7de6c3518 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java
@@ -131,7 +131,7 @@ public class XpTrackerPlugin extends Plugin
 	private long lastTickMillis = 0;
 	private boolean fetchXp; // fetch lastXp for the online xp tracker
 	private long lastXp = 0;
-	private boolean initializeTracker;
+	private int initializeTracker;
 
 	private final XpPauseState xpPauseState = new XpPauseState();
 
@@ -165,7 +165,7 @@ public class XpTrackerPlugin extends Plugin
 
 		// Initialize the tracker & last xp if already logged in
 		fetchXp = true;
-		initializeTracker = true;
+		initializeTracker = 2;
 		lastAccount = -1L;
 		clientThread.invokeLater(() ->
 		{
@@ -209,12 +209,12 @@ public class XpTrackerPlugin extends Plugin
 				lastWorldType = type;
 				resetState();
 				// Must be set from hitting the LOGGING_IN or HOPPING case below
-				assert initializeTracker;
+				assert initializeTracker > 0;
 			}
 		}
 		else if (state == GameState.LOGGING_IN || state == GameState.HOPPING)
 		{
-			initializeTracker = true;
+			initializeTracker = 2;
 		}
 		else if (state == GameState.LOGIN_SCREEN)
 		{
@@ -382,7 +382,7 @@ public class XpTrackerPlugin extends Plugin
 		final int startGoalXp = client.getVarpValue(startGoal);
 		final int endGoalXp = client.getVarpValue(endGoal);
 
-		if (initializeTracker)
+		if (initializeTracker > 0)
 		{
 			// This is the XP sync on login, wait until after login to begin counting
 			return;
@@ -437,10 +437,8 @@ public class XpTrackerPlugin extends Plugin
 	@Subscribe
 	public void onGameTick(GameTick event)
 	{
-		if (initializeTracker)
+		if (initializeTracker > 0 && --initializeTracker == 0)
 		{
-			initializeTracker = false;
-
 			// Check for xp gained while logged out
 			for (Skill skill : Skill.values())
 			{
diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/regions/regions.txt b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/regions/regions.txt
index 5397075a3..f1f9d7566 100644
--- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/regions/regions.txt
+++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/regions/regions.txt
@@ -307,4 +307,47 @@ R 36 147 37 147
 
 // observatory dungeon
 n
-r 36 146
\ No newline at end of file
+r 36 146
+
+// ham storeroom
+n
+r 40 81
+
+// mor ul rek
+n
+r 37 80
+R 38 79 39 80
+
+// barbarian assault lobby
+n
+r 40 82
+
+// mage training arena
+n
+r 52 150
+
+// mta telekinetic theatre
+n
+r 52 151
+
+// water ravine (spirits of the elid)
+n
+r 52 149
+m 52 148
+c 2 7
+
+// kalphite cave
+n
+r 51 148
+m 51 149
+C 0 0 7 1
+m 52 148
+C 0 0 2 6
+
+// kalphite lair
+n
+r 54 148
+
+// chasm of tears
+n
+r 50 148
\ No newline at end of file


Test patch:
diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/smelting/SmeltingPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/smelting/SmeltingPluginTest.java
index 414bbbcfe..7e882d7f5 100644
--- a/runelite-client/src/test/java/net/runelite/client/plugins/smelting/SmeltingPluginTest.java
+++ b/runelite-client/src/test/java/net/runelite/client/plugins/smelting/SmeltingPluginTest.java
@@ -46,6 +46,7 @@ public class SmeltingPluginTest
 	private static final String SMELT_CANNONBALL_DOUBLE_AMMO_MOULD = "The molten metal cools slowly to form 8 cannonballs.";
 	private static final String SMELT_CANNONBALL_DONE_MESSAGE = "You remove the cannonballs from the mould";
 	private static final String SMELT_BAR = "You retrieve a bar of steel.";
+	private static final String SMELT_BAR_VARROCK_PLATEBODY = "The Varrock platebody enabled you to smelt your next ore simultaneously";
 
 	@Inject
 	SmeltingPlugin smeltingPlugin;
@@ -104,4 +105,17 @@ public class SmeltingPluginTest
 		assertNotNull(smeltingSession);
 		assertEquals(1, smeltingSession.getBarsSmelted());
 	}
+
+	@Test
+	public void testBarsVarrockPlatebody()
+	{
+		ChatMessage chatMessageExtra = new ChatMessage(null, ChatMessageType.SPAM, "", SMELT_BAR_VARROCK_PLATEBODY, "", 0);
+		smeltingPlugin.onChatMessage(chatMessageExtra);
+		ChatMessage chatMessageNormal = new ChatMessage(null, ChatMessageType.SPAM, "", SMELT_BAR, "", 0);
+		smeltingPlugin.onChatMessage(chatMessageNormal);
+
+		SmeltingSession smeltingSession = smeltingPlugin.getSession();
+		assertNotNull(smeltingSession);
+		assertEquals(2, smeltingSession.getBarsSmelted());
+	}
 }
diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/xptracker/XpTrackerPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/xptracker/XpTrackerPluginTest.java
index 9311385e4..cad589893 100644
--- a/runelite-client/src/test/java/net/runelite/client/plugins/xptracker/XpTrackerPluginTest.java
+++ b/runelite-client/src/test/java/net/runelite/client/plugins/xptracker/XpTrackerPluginTest.java
@@ -95,14 +95,16 @@ public class XpTrackerPluginTest
 	@Test
 	public void testOfflineXp()
 	{
+		// Flag initialization of tracker
 		GameStateChanged gameStateChanged = new GameStateChanged();
 		gameStateChanged.setGameState(GameState.LOGGING_IN);
-
-		// Flag initialization of tracker
 		xpTrackerPlugin.onGameStateChanged(gameStateChanged);
+
 		when(client.getSkillExperience(Skill.ATTACK)).thenReturn(42);
+
 		// Initialize tracker
 		xpTrackerPlugin.onGameTick(new GameTick());
+		xpTrackerPlugin.onGameTick(new GameTick());
 
 		// Gain attack xp
 		StatChanged statChanged = new StatChanged(
@@ -119,6 +121,7 @@ public class XpTrackerPluginTest
 		xpTrackerPlugin.onGameStateChanged(gameStateChanged);
 		// Initialize tracker
 		xpTrackerPlugin.onGameTick(new GameTick());
+		xpTrackerPlugin.onGameTick(new GameTick());
 
 		// Start at 42 xp, gain of 58 xp, offline gain of 41900 xp - offset start XP: 42 + 41900
 		XpStateSingle skillState = xpTrackerPlugin.getSkillState(Skill.ATTACK);