As gausie said, can_adventure() can be trusted: if it returns true, you really can go there without using unavailable (or expensive) resources.Will this properly account for when a relay script tells you if you can adventure there or not?
Quick example, say I have a script that tells me to go to this location for whatever reason, maybe its something I run in gCLI, something I run in a relay script.
It has a bunch of locations, but recommends I visit this area.
Is the relay script supposed to now include a bunch of checks for if that area needs unlocking, because can_adventure can't be trusted?
Given that the script isn't going there, it's the player.
I like that idea. We have a preference to perform restoration before relay visits.Maybe we should have a preference to run prepareForAdventure before relay visits
if (this.formSource.equals("cobbsknob.php") && this.canAdventure()) {
this.prepareForAdventure();
}
Note that we have support for a lot of those, but I want to look more closely, add missing features, and, yes - write lots of tests.7) Astral
8) Shape of Mole
9) Grimstone
11) Gingerbread City
12) PirateRealm
13) Batfellow Area
14) Spelunky Area
16) Casino
17) Twitch
18) Holidays
KoLCharacter.mysteriousIslandAccessible()
KoLCharacter.desertBeachAccessible()
The Sea:
- A big job to figure out which of the many zones has been unlocked.
- Do we parse the map of the Sea Floor?
Don't worry - it is not out of scope. It really is a bug.you can fight the Knob Goblin Very Mad Scientist without having access to anything in Cobb Knob (well, outskirts in CS. No clue if the key drops if you don't even have access to that).
I am sorry, when I reported this I assumed it is a bug because it is called "can_adventure" - and it can't adventure in the Menagerie in this path even with the key.
If that is out of scope for it, okay. Disregard the report then.
if (this.formSource.equals("mining.php")) {
KoLmafia.updateDisplay(MafiaState.ERROR, "Automated mining is not currently implemented.");
return;
}
> set questM20Necklace=unstarted
questM20Necklace => unstarted
Preference questM20Necklace changed from finished to unstarted
> set questM21Dance=unstarted
questM21Dance => unstarted
Preference questM21Dance changed from finished to unstarted
> debug on
> ashq visit_url("questlog.php")
Preference questM20Necklace changed from unstarted to started
Preference questM21Dance changed from unstarted to finished
Preference questM20Necklace changed from started to finished
> debug off
@Test
public void canReadQuestLog() {
var builder = new FakeHttpClientBuilder();
var client = builder.client;
var cleanups =
new Cleanups(
withHttpClientBuilder(builder),
withQuestProgress(Quest.MYST, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.ARTIST, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.MEATSMITH, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.DOC, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.ARMORER, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.SPOOKYRAVEN_NECKLACE, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.SEA_OLD_GUY, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.SHIRT, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.GUZZLR, QuestDatabase.UNSTARTED),
// Things that were NOT mentioned in the Quest Log
withQuestProgress(Quest.SPOOKYRAVEN_DANCE, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.SPOOKYRAVEN_BABIES, QuestDatabase.UNSTARTED),
withQuestProgress(Quest.MANOR, QuestDatabase.UNSTARTED));
try (cleanups) {
client.addResponse(200, html("request/test_questlog_post_cs.html"));
GenericRequest request = new GenericRequest("questlog.php");
request.run();
assertThat(Quest.MYST, isStarted());
assertThat(Quest.ARTIST, isStarted());
assertThat(Quest.MEATSMITH, isStarted());
assertThat(Quest.DOC, isStarted());
// We don't actually detect this one.
// assertThat(Quest.ARMORER, isStarted());
assertThat(Quest.SPOOKYRAVEN_NECKLACE, isStarted());
assertThat(Quest.SEA_OLD_GUY, isStarted());
// Doesn't match, for some reason
// assertThat(Quest.SHIRT, isStarted());
assertThat(Quest.GUZZLR, isStarted());
// Things that were NOT mentioned in the Quest Log
assertThat(Quest.SPOOKYRAVEN_DANCE, isUnstarted());
assertThat(Quest.SPOOKYRAVEN_BABIES, isUnstarted());
assertThat(Quest.MANOR, isUnstarted());
}
}
Use 1 disintegrating quill pen + 1 inkwell + 1 tattered scrap of paper
You acquire an item: scroll of ancient forbidden unspeakable evil
Preference questL11Manor changed from unstarted to step1
Preference lastSecondFloorUnlock changed from 836 to 837
summon Ak'gyxoth
[no error & no effect gained here]
// Go to the Summoning Chamber
RequestThread.postRequest(new PlaceRequest("manor4", "manor4_chamber", true));
if (responseText.contains("sr_brickhole.gif")) {
QuestDatabase.setQuestIfBetter(Quest.MANOR, "step3");
} else {
QuestDatabase.setQuestIfBetter(Quest.MANOR, "step1");
}
SummoningChamberRequest.run():
Code:// Go to the Summoning Chamber RequestThread.postRequest(new PlaceRequest("manor4", "manor4_chamber", true));
That was without even checking you have access to it. We could/should cut off requests here.
Also, the summon demon command could give you a friendly message right away if it is not accessable.
QuestManager, if you get a response from place.php?whichplace=manor4:
Code:if (responseText.contains("sr_brickhole.gif")) { QuestDatabase.setQuestIfBetter(Quest.MANOR, "step3"); } else { QuestDatabase.setQuestIfBetter(Quest.MANOR, "step1"); }
It assumes it succeeded. This is where your quest step was set.
What is the responseText from attempting to go to the Summoning Chamber when it is not open?
<html><head><link rel="stylesheet" type="text/css" href="https://d2uyhvukfffg5a.cloudfront.net/styles.css"></head><body><center><table width=95% cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Uh Oh!</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td>You shouldn't be down here yet. I mean here. Wherever here is.<p><center><A href=main.php>Back to the Main Map</a></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></body></html>