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

Yeah, unfortunately I ran straight into the next ascension rather than having any (even brief) farming last time. So no calling of the CanAdv, and no fixing the areas which no longer exist. I'll try to run through this either today or tomorrow, depending on how long it takes me to develop either accuracy in typing or the ability to code with my eyes closed.
 
I noticed you changed the warProgress checks to use questL12War instead, which is a change I like, in principle. However, you are still checking "started" which worked for warProgress but not for the quest property, because the quest starts before the war does. Actually starting the war is "step1".

I recommend changing these two lines in zone_check() as follows:

PHP:
      case "Island": return (get_property("lastIslandUnlock") == my_ascensions()) && !qprop("questL12War","step1");
      case "IsleWar": return levelcheck(12) && qprop("questL12War","step1") && get_property("questL12War") != "finished";
 
Ah, right you are. Also suggest this change:

PHP:
   case $location[A Maze of Sewer Tunnels]: return my_adventures() > 9;
 
Here's a fix for the Hedge Maze in the latest daily versions of Mafia. There's no simple item check or check from the quest log anymore, unless you feel like stringing 9 or 10 or more ORs together, and the wiki doesn't have all the different quest log permutations available yet, as I checked what mine says vs them and mine has different text. For some reason if you try to run it without anything after the levelcheck(13); it keeps failing saying "Expected ;, found ) (canadv.ash, line 553)" despite me having the ; there, no idea why.

Code:
   case $location[The Hedge Maze]: return levelcheck(13) && !adventure(1, $location[the hedge maze]);
 
Last edited:
I'm pretty sure that you only need to check get_property( "questL13Final" ) == "step2" for that.

Yeah, I realized that my solution wouldn't work while in the shower, as mine will try to adventure at the location and if you can adventure at the location then it's going to adventure there even if you didn't want it to.

Lets try what you got there next.
 
Also, by checking in a negative way against the adventuring there, can_adv would only say you can adventure at the hedge maze if you either can't, had an unfulfilled goal, or if you got beat up. Which isn't what we want. I'll get lost's test into it when my computer stops being slow. Apparently I have a bad memory slot, since both memory sticks make the computer BSOD with only that slot filled, but it hasn't crashed in 5 hours of the other slot. Ugh.
 
Anyways, we need someone to tell us the step number for the new hedge maze, so next time you're running through that section, pull it up.
 
Also, by checking in a negative way against the adventuring there, can_adv would only say you can adventure at the hedge maze if you either can't, had an unfulfilled goal, or if you got beat up. Which isn't what we want. I'll get lost's test into it when my computer stops being slow. Apparently I have a bad memory slot, since both memory sticks make the computer BSOD with only that slot filled, but it hasn't crashed in 5 hours of the other slot. Ugh.

Did you run MemTest+?
 
1) Like lost already did? It's apparently step 2.
2) Have it downloaded. Didn't have a burnable CD in my immediate vicinity and I had a screwdriver, so I just pulled one of the memory sticks. BSOD within 5 minutes. Swapped memory sticks. BSOD within 5 minutes. Swapped memory slots. No BSOD in 10 hours.
 
2) Have it downloaded. Didn't have a burnable CD in my immediate vicinity and I had a screwdriver, so I just pulled one of the memory sticks. BSOD within 5 minutes. Swapped memory sticks. BSOD within 5 minutes. Swapped memory slots. No BSOD in 10 hours.



The reason I'd suggest running MemTest anyways, is that there may be an issue with your RAM stick that only shows up when run in that one slot, not the slot itself that is bad, but that it exposes the issue in the stick. Did you try another known good RAM stick in the suspected bad slot, that would be a way to validate your original theory of the slot being bad as well.
 
Since it's a personal laptop, and it has two sticks of memory, and both sticks of memory in that slot caused BSOD... either the slot is bad, or all of the laptop's memory is. Testing other sticks of memory involves purchasing more memory.

Anyways, unrelated to the CanAdv adventure.
 
I had an issue with Canadv, via Bale's CounterChecker script, today where it, incorrectly passed along to CounterChecker that the Haunted Wine Cellar was inaccessible. That was not the case as I was adventuring in the Haunted Laundry Room when a Lights Out counter came due. Here's the link the post in the Bug Reporting thread.

Any ideas? If it happens again what information would help pin down the problem?
 
Manor0 uses this:
Code:
      case "Manor0": return levelcheck(11) && itemcheck($item[your father's macguffin diary]) && qprop("questL11Manor","step2");
So you need to be level 11, with a macguffin, and questL11Manor needs to be at step2 or higher.

You were likely 11 with the macguffin. So what was your quest value set to?

Also, you're working under a misapprehension... CounterChecker doesn't use CanAdv. Which is why it's wrong. :) Here is what CounterChecker uses:
Code:
	case $location[The Haunted Wine Cellar]:
		return get_property("questL11Manor") == "finished";
Tell Bale on his thread. :)
 
I just looked at canadv. I see the following:

Code:
      case "Manor0": return levelcheck(11) && itemcheck($item[your father's macguffin diary]) && qprop("questL11Manor","step2");
I think there's a lot of redundancy there; the one and only thing which determines if you can get into the Spookyraven Cellar is whether you have gotten the "We'll All Be Flat" non-combat in the Ballroom - which will only happen after you've reached level 11 and read the diary. But really, the quest progress is the only thing that matters.

Looking at questlog.txt, I see this:

Code:
questL11Manor	In a Manor of Spooking	Find your way into the cellar of Spookyraven Manor.	Investigate the cellar of Spookyraven Manor.	Gather the mortar-dissolving ingredients:	Enter the chamber and confront Lord Spookyraven.	You defeated Lord Spookyraven and recovered the Eye of Ed. Huzzah!
That says that we "In a Manor of Spooking" quest log to quest steps like this:

Find your way into the cellar of Spookyraven Manor. = started
Investigate the cellar of Spookyraven Manor. = step1
Gather the mortar-dissolving ingredients: = step2
Enter the chamber and confront Lord Spookyraven = step3
You defeated Lord Spookyraven and recovered the Eye of Ed. Huzzah! = finished

Given that, you have access to the cellar as soon as the quest is at step1; you don't HAVE to have looked at the wall and gotten the mortar-dissolving solution recipe in order to adventure in the cellar locations, right?

So, that is a bug in canadv. However, I guess the next question is: do we track the steps of questL11Manor as they occur, or do we set them based only on the quest log? They would go like this:

started - when you read the diary
step1 - when you get You'll All Be Flat
step2 - when you get (read?) the mortar-dissolving solution recipe
step3 - when you dissolve (or blow up) the mortar
finished - when you defeat Lord Spookyraven

Looking at the code:

When you read the diary: QuestDatabase.setQuestIfBetter( Quest.MANOR, QuestDatabase.STARTED );
When you take choice 921 (We'll All Be Flat): QuestDatabase.setQuestProgress( Quest.MANOR, "step1" );
When you acquire the mortar-dissolving recipe: QuestDatabase.setQuestIfBetter( Quest.MANOR, "step2" );
When you acquire the wine bomb: QuestDatabase.setQuestProgress( Quest.MANOR, "step3" );
When you acquire the Eye of Ed: QuestDatabase.setQuestProgress( Quest.MANOR, QuestDatabase.FINISHED );

Obviously, the "step3" thing is not quite right; it should go there when you click on the wall and it either dissolves or blows up. That's easy enough, now that I have PlaceRequest.php: we log "Inspecting Suspicious Masonry" when you go to "place.php?whichplace=manor4chamberwall" or "place.php?whichplace=manor4chamberwalllabel". We should look at the responsetext when you do that and, if you've blown it open, advance the quest.

But that is not THIS bug. The problem here is that canadv says you can't adventure in Spookyraven Cellar locations until step2, whereas the locations are actually available at step1.

Things you can check?

- Next time you get We'll All Be Flat, check questL11Manor and verify that it says step1.
- How far along on that quest are you now? What is the quest setting?
- DID you look at the Suspicious Masonry after We'll All Be Flat before adventuring in the Laundry Room?

Edit: Well, Theraze pointed out the CounterChecker bug. CanAdv still has the issue I described - but I, too, was mislead when I looked at CounterChecker and saw it calling a function called "canadv". :)
 
Last edited:
Theraze: you're correct. I apologize. I saw the call to canadv in CounterChecker and assumed it was a call to an imported copy of CanAdv. It isn't it's a call to a function inside CounterChecker.

Edit: and I see that both you and Bale have fixed this issue in your respective scripts. Thank you!
 
Last edited:
Back
Top