CanAdv -- check whether you can adventure at a given location

Hey, thanks for keeping this up to date. I was just playing around with Donavin69's KingdomExplorer script which uses CanAdv, and I found a few zones that it thought were inaccessible that were accessible at the time. Just wanted to let you know in case there's an easy solution for next time CanAdv gets an update.
1) For Ed compatibility, he has a "copy of a jerk adventurer's father's diary" instead of the normal diary, so CanAdv thought I didn't have access to a bunch of lvl 11 stuff.
2) You can adventure in the spookyraven 3rd floor zones without talking to lady spookyraven there. CanAdv currently requires "questM17Babies=started", but you can adventure there "unstarted". Not a big deal since you can just go talk to lady spookyraven, but just wanted to point you might be able to use the 2nd floor status instead (maybe "questM21Dance"? although I'm not sure which step indicates that you've danced with her)
 
Last edited:
Yeah... it's probably a KoL bug that allows for adventuring in the third floor directly when you haven't actually ever visited the floor, since the other floors do have adventure-gates tied into visiting the Lady. But we should be able to move that to M21 finished, since that bug is still hanging around months later.
 
Can't remember and I don't have an Ed currently: can Ed adventure in the desert or oasis? Since he has the pyramid unlocked from the beginning, he doesn't need to search the desert for it. If he CAN adventure in the desert, where is the 'gate' that unlocks this?
 
I was pretty sure the Oasis and Desert were available from the start of the run in Ed. The wiki seems to confirm this:
-The Arid, Extra-Dry Desert and An Oasis are unlocked from the start.
-The combat zones in A Small Pyramid are not available.
-Upon completing the path, The Upper Chamber becomes available. Crumbling wooden wheels may drop. You can progress down the Pyramid until The Control Room is unlocked. At that point, the game realizes that you've done the Pyramid already, stops dropping crumbling wooden wheels, and does not let you turn the wheel in the Control Room.
 
Okay, so what we have for the pyramid then is this:
Code:
      case "Pyramid": return itemcheck($item[staff of ed]) || (my_path() != "Actually Ed the Undying" && qprop("questL13Final","finished"));
Guessing that the staff doesn't magically come back into your inventory after you grab the MacGuffin. So once we are no longer Ed, and we've finished the L13 quest, we should be able to go to the Pyramid.

Not sure if Ed auto-unlocks the beach for mafia either, but I threw in an Ed-check there.
 
I was pretty sure the Oasis and Desert were available from the start of the run in Ed. The wiki seems to confirm this:
-The Arid, Extra-Dry Desert and An Oasis are unlocked from the start.
-The combat zones in A Small Pyramid are not available.
-Upon completing the path, The Upper Chamber becomes available. Crumbling wooden wheels may drop. You can progress down the Pyramid until The Control Room is unlocked. At that point, the game realizes that you've done the Pyramid already, stops dropping crumbling wooden wheels, and does not let you turn the wheel in the Control Room.

Last I checked, you could actually still URL-manip your way into the upper and middle chambers, but you couldn't get into the control room to turn the wheel to fight Ed and get the macguffin and finish the run in about 30 turns.
 
You'll want that check to be by item number, as you'll get the new staff of ed there, probably.

Still hoping at some point that mafia will mark exact duplicate items as errors rather than just picking the wrong item. Oh well. At least there's a way to do it, even if there's no way to tell where those duplicate items might be in scripts.
 
Hey, it's me again, sorry.
I saw the updates for Ed compatibility so I tried adding the CanAdv check back into my script. A few more things to point out if you're interested.
1) Unknown zones the script asked to report:
-The Skeleton Store (zone: Town)
-The Secret Council Warehouse (zone: Mountain)
-Tower Level 1 (zone: Sorceress) [all levels, 1-5]
-The Naughty Sorceress' Chamber (zone: Sorceress)
-The Secret Government Laboratory (zone: Conspiracy Island)
-The Deep Dark Jungle (zone: Conspiracy Island)
-The Mansion of Dr. Weirdeaux (zone: Conspiracy Island)

2) It looks like most of the Ed compatibility updates are working now. However, it looks like the Oasis and Desert are reported as inaccessible for Aftercore Ed. At that point, your path is not Ed, but you still don't have the regular Diary. Instead you have a "copy of a jerk adventurer's father's diary".

3) Also, it reported all the Level 12 Post War zones were inaccessible in aftercore. I'm not sure the checks for Island access are correct.
Current code from CanAdv.ash: case "Island": return (get_property("lastIslandUnlock") == my_ascensions()) && !qprop("questL12War","step1");
It looks like qprop returns TRUE if that quest property is equal to or farther than the indicated step, so when questL12War=finished, qprop evaluates to TRUE, resulting in the Island zones being reported as inaccessible.

4) It also reported the pirate zones were inaccessible even though I was wearing pirate fledges
It may be because of the island access issue above, but while I was checking around, it looks like the Cove url may have changed at some point? The script tries to check images at "place.php?whichplace=cove" and it looks to me like it is now just "cove.php" if I'm reading that right.

Thanks!
 
1) All well and good, but I need what the checks are to actually validate them. Which is why the zones aren't in yet. If you have something you want it not to scream about, I need the item/picture/quest bit to check. Thanks! :)

2) JAF's diary added as alternative to those two checks.

3) Looks like the 4 stages of ISLAND_WAR are unstarted, started, step1, and finished. Changed the check from qprop to !get_property so that we only block it when the war is actually on, same as what mafia uses to decide if the hippy store is available.

4) Generally KoL has changed from using straight <location>.php pages to having place.php?whichplace=<location> bits. It'd be more likely that KoL changed its pictures which we manually check for than that they decided that they really don't like the system that they changed to and moved back. But hey, it's KoL and inconsistency is their only real consistency. But I'd expect this to be tied into the bad check in 3.
 
Cool, yea, I'm not sure what all is needed for those new zones either. I just wanted to report them since the script asked for it, heh.

I did find 2 errors when I tried to run r56 today.
1) Function 'get_property( string, string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (canadv.ash, line 154)
It looks like when the qprop was replaced with get_property, the arguments weren't updated. Maybe it should be (get_property("questL12War") != "step1")
case "Island": return (get_property("lastIslandUnlock") == my_ascensions() && !get_property("questL12War","step1"));


2) Cannot apply operator || to your father's MacGuffin diary (item) and itemcheck() (boolean) (canadv.ash, line 362)
It looks like a ')' ended up in the wrong place after adding the JAF's diary. It's missing a ')' to close the first itemcheck and has 2 ')' after the 2nd itemcheck.
case $location[The Arid, Extra-Dry Desert]: return my_path() == "Actually Ed the Undying" || itemcheck($item[your father's macguffin diary] || itemcheck($item[copy of a jerk adventurer's father's diary]));

I changed those two locally on my PC and ran my script with CanAdv, and it looks pretty good.
 
Heh. I did play with parenthesis on the second one, which makes sense as to why that would have failed. *coughs* And the first one, I just forgot to move the second one out.

The dangers of updating scripts at work without actually having access to mafia. Oh well. Script should be fixed soon.
 
Spectral Pickle Factory does not seem to be working. The current check is:
if (!primecheck(50) || today_to_string().substring(4, 8) != "0401") return false;
Which then falls through to the next case. Shouldn't it be:
return primecheck(50) && today_to_string().substring(4, 8) == "0401";
 
Apparently it got moved at some point. It had been in an 'always unlocked' zone. Now it's not. So... yeah, it needs to be tweaked.
 
This brings the script up to date. Added all missing zones and fixed known issues.

However, I haven't yet confirmed the Sorceress' Tower quest steps for each level of the tower (and the NS's Chamber). My placeholders are invariably wrong.

Edit: File served its purpose. removed.
 
Last edited:
This brings the script up to date. Added all missing zones and fixed known issues.

However, I haven't yet confirmed the Sorceress' Tower quest steps for each level of the tower (and the NS's Chamber). My placeholders are invariably wrong.

At some point I seem to recall that Theraze and Zarqon had a difference of opinion/need and canadv was forked into cango and canadv until that could be resolved. Since the post above is cango and is an attachment and not in SVN, is there a possibility that the differences can be reconciled and the fork merged back into the trunk? Thanks.
 
The difference is whether or not you should be able to have CanAdv unlock the guild through a variable (defaulting to false) or not. He prefers to remove that functionality, while I prefer it have it available. Other than that, I've been merging in his changes as submitted for the last year or two. :)

As such, comparing through again and will probably have his changes merged in within the next few hours. Longer if I remember to actually compare the unlock levels for the NS against the BCA checks.
 
Okay, will be committing the updated version with the following differences. The first noted will (generally) be the CanAdv version.
1) Usual differences regarding default visibility (6 v. 9) and guild unlocking (possible v. not).
2) Closed event zones follow the normal 'one per line' configuration rather than being compressed as that makes readability slightly more difficult.
3) Pump Up Mysticality and The Sunken Party Yacht are zone checks and therefore included in the zone check section, rather than having an additional manual zone check call later.
4) The Arid, Extra-Dry Desert and The Oasis have special eligibility checks for Ed which were not included in the proposed merge version, and so would have provided incorrect results.
5) There is a proposed change to try to break down the wall in the manor basement during the boss check. I could be convinced to change this, but I'm not sure if KoL provides the same html if you try to break down the wall that's already been removed.
6) The proposed check for Ed's warehouse was wrong, as it suggested that you could adventure there as soon as you hit level 13, rather than after you'd started the warehouse quest. Changed in our version to use the warehouse quest status.
7) The Red Zeppelin zone is named for its mooring, so we include that in its zone description.
8) Most of the NS quest checks were wrong - all but the contestants. Specifically, contestant complete is 2, coronation is 3, and the door is 5. These numbers must be skipped in the quest checks.
9) Most of the 'never open' zones were already being blocked through their zone checks. Added Crimbo13 as a closed zone and removed the other duplicate lookups, which reduces our NO zones to two.
10) We don't add a spurious space to the available check. :)

Of those, 5 is the only rejected change which seems like it might be worth approving if someone can validate that re-breaking the wall over and over and over again still provides the chamberboss link. I'll make sure that the script still validates, but it should be committed in the next few minutes.
 
Last edited:
Heh, I knew you'd flesh out the things I wasn't able to check out. High five!

I've been merging most of your changes into my script as well. I wouldn't call it a fork so much as cango.ash is simply my personal version of CanAdv.

As to 5), it works. It's the same as adding the coffeegrounds unlock action to the URL check for Penultimate Airship.

EDIT: Diffing changes now and noting some issues remain:

1) You have Pump Up Mysticality as being available if its zone is, but its zone ("Gyms") is not checked in zone_check. It does need that separate check.
2) You didn't accept my fix to Sunken Party Yacht. It is an underwater zone and is not accessible unless you and your familiar can breathe.
3) I changed several of the imagename checks to use to_url() checks, as these are less likely to break if KoL rejiggers things. These are not necessary changes, but they are a slight improvement in terms of robustness.

The rest of your fixes to my fixes I shamelessly stole! Thanks.
 
Last edited:
Back
Top