I can see the bigger issue:That... shouldn't happen. The code to set "_luckyGoldRingVolcoino" checks for it dropping from combat.
If that's not working for some reason, then there's a bigger issue.
if (urlString.startsWith("adventure.php")) {
ResultProcessor.processResults(true, this.responseText);
return;
}
if ( // KoL Con 13 Snowglobe
str.contains("KoL Con")
|| str.contains("You notice some extra Meat")
||
// Mr. Screege's spectacles
str.contains("You notice something valuable hidden")
||
// Mr. Cheeng's spectacles
str.contains("You see a weird thing out of the corner of your eye, and you grab it")
|| str.contains("You think you see a weird thing out of the corner of your eye")
||
// lucky gold ring
str.contains("Your lucky gold ring gets warmer for a moment.")) {
FightRequest.logText(str, status);
}
if str contains “your lucky gold ring gets warm” {
log text
if str contains “Volcoino” {
set property
}
}
I agree! I noticed that nothing else in that logging function actually set any prefs so I didn't want to. I'll do something with status to make it a little more performant.OK. Although, as coded, isn’t that another String search of the entire responseText? Seems like that could be incorporated into the HTML parsing of the fight response where we look for the lucky gold ring.
Code:if str contains “your lucky gold ring gets warm” { log text if str contains “Volcoino” { set property } }
Whatever.
diff --git a/src/net/sourceforge/kolmafia/request/FightRequest.java b/src/net/sourceforge/kolmafia/request/FightRequest.java
index 3354d5a868..ff4e05a880 100644
--- a/src/net/sourceforge/kolmafia/request/FightRequest.java
+++ b/src/net/sourceforge/kolmafia/request/FightRequest.java
@@ -6346,13 +6346,12 @@ public class FightRequest extends GenericRequest {
||
// Mr. Cheeng's spectacles
str.contains("You see a weird thing out of the corner of your eye, and you grab it")
- || str.contains("You think you see a weird thing out of the corner of your eye")
- ||
- // lucky gold ring
- str.contains("Your lucky gold ring gets warmer for a moment.")) {
+ || str.contains("You think you see a weird thing out of the corner of your eye")) {
FightRequest.logText(str, status);
}
+ FightRequest.handleLuckyGoldRing(str, status);
+
// Retrospecs
if (str.contains("notice an item you missed earlier")) {
FightRequest.logText(str, status);
@@ -7133,6 +7132,16 @@ public class FightRequest extends GenericRequest {
}
}
+ private static void handleLuckyGoldRing(String str, TagStatus status) {
+ if (!str.contains("Your lucky gold ring gets warmer for a moment.")) {
+ return;
+ }
+ FightRequest.logText(str, status);
+ if (str.contains("You look down and find a Volcoino!")) {
+ Preferences.setBoolean("_luckyGoldRingVolcoino", true);
+ }
+ }
+
private static boolean handleProselytization(TagNode node, TagStatus status) {
String str = node.getText().toString();