Feature - Implemented When visiting an unknown adventure locationin mafia, automatically add it to the list

Rinn

Developer
Currently a user can temporary add an adventure location by using the cli command location zoneid name, however I expect that a majority of users aren't aware this command exists as it does not appear when typing help. I propose that after a user manually adventures in the relay browser, mafia would scrape the adventure again link and automatically add the location if it doesn't exist.

I also propose that the text be changed from Holiday: location name to Override: location name to make it more apparent that it is a temporary override. Or as an alternative the Go Back to <zone> link could be scraped, so the correct zone could be given as the maximizer uses this information.

Also the cli command should probably appear when typing help.

This should help prevent users from creating local versions of adventures.txt and zonelist.txt, which could cause confusion when they inevitably forget to remove the local override files.
 

Ethelred

Member
Currently a user can temporary add an adventure location by using the cli command location zoneid name, however I expect that a majority of users aren't aware this command exists as it does not appear when typing help. I propose that after a user manually adventures in the relay browser, mafia would scrape the adventure again link and automatically add the location if it doesn't exist.

This looks to be a very nice capability but that is a very terse description. I looked on the kolmafia wiki and tried a help command in the cli, but neither gave me the information necessary to use this command. Please provide parameter desciptions and hopefully and example or two of how to use this. It would also be swell if one of the wiki wizards could add that info to the kolmafia wiki. Thanks in advance.
 
I came to the boards last night right after rollover looking for a way to add the adventure so i could plow through fudge mountain and didn't find anything. the location command would have been helpful to know last night, but the feature request would be even better if implemented.

To the poster above, try in your CLI:
location 275 Fudge Mountain

After I did that I could select it from the adventure tab (it put the location in the "Holiday" zone, not sure how to fix that part)
 
Last edited:

fronobulax

Developer
Staff member
location 275 FudgeM

is one sample that will add a new area called FudgeM.

275 is the snarfblat. Easiest way to find that out (since the diorama is almost certainly not done with new areas) is to load the mini-browser (not the relay browser) and "manually" adventure in the new area. The snarfblat number should be in the URL display in the mini-browser.

Concur with the suggestion for Override vs. Holiday and that documentation should be improved. I'm not likely to work on either one in the next couple of days, however.
 
Yeah, I never knew that command existed. Nice to know it exists. Saves me the trouble of coming up with complicated ashq set-ups to auto-adventure in new zones.

But since mafia no longer has a problem with adding in holiday, or other limited-time, zones in, I'd very much like to see an auto-addition of zones. A name can be picked up from the charpane links or end-of-adventure links. Probably the hover/alt text for link/image from the map itself. With that auto-addition before adventuring there can be done.
 
Last edited:

Winterbay

Active member
location 275 FudgeM

is one sample that will add a new area called FudgeM.

275 is the snarfblat. Easiest way to find that out (since the diorama is almost certainly not done with new areas) is to load the mini-browser (not the relay browser) and "manually" adventure in the new area. The snarfblat number should be in the URL display in the mini-browser.

In regards to adventure-URLs it works just as fine to load the relay browser and hover over the image for the image that leads to the area, the URL shown will contain "snarfblat=whatever" as well.
 

slyz

Developer
I have given some thought to this. I think we need two things:

(1) a way to detect that we are adventuring in a location that Mafia doesn't know about.
(2) a way to parse the informations necessary to create a new KoLAdventure.

There are a few places where (1) could happen, and (2) could be done in CharPaneRequest.java, since the "Last Adventure" link will hold the adventure's full URL and its name.

I thought of breaking it like this in two steps to avoid parsing charpane.php for an unknown Last Adventures at each refresh. (1) could set something like CharPaneRequest.checkForNewLocation, and a CharPaneRequest.handleNewLocation() would be called only when that is true.

Another thought: maybe this should only happen to adventure.php locations, since otherwise AdventureRequest might not know how to reconstruct the location's URL. Either that or we need to save the name of the field that hold the adventureId too.

I'll try adding something like this in AdventureDatabase.getUnknownName():
PHP:
if ( urlString.startsWith( "adventure.php" ) )
{
	if ( urlString.indexOf( "snarfblat=122" ) != -1 )
	{
		return "Oasis in the Desert";
	}
	if ( urlString.indexOf( "snarfblat=122" ) != -1 )
	{
		CharpaneRequest.setCheckNewLocation( true );
		return "Unknown location";
	}
	return null;
}
and modifying CharPaneRequest.java to parse the Last Adventure link and call RegisterAdventureCommand.
 

slyz

Developer
Ok, here is what I came up with. I'm posting the patch instead of committing because it's the kind of change that I'm not comfortable with. It was tested successfully but Veracity, Jason or Hola could certainly make the implementation better and/or more efficient.

I think this is safe enough since only adventure.php locations will be automatically processed.
 

Attachments

  • newLocations.patch
    8 KB · Views: 66

Veracity

Developer
Staff member
Bump to remind myself to look at slyz's patch.

(Sorry for the delay; I was way busy in December, and you did the lion's share of adding support for new Crimbo content, as I am sure you noticed, and for which I am grateful.)
 

slyz

Developer
At the time, I tested the patch on an advent calendar location, but it is easy to make any location unknown to Mafia to test it now.
(Sorry for the delay; I was way busy in December, and you did the lion's share of adding support for new Crimbo content, as I am sure you noticed, and for which I am grateful.)
And you probably noticed I haven't been putting much work towards version 15.0... Job hunting is taking me a lot of time, and my wife and I just learned that we have started creating a fork of ourselves :D
 

Veracity

Developer
Staff member
Congrats! And good luck, both in the short term, for your job hunt, and in the long term for what you are getting yourself into. ;)
 

Winterbay

Active member
At the time, I tested the patch on an advent calendar location, but it is easy to make any location unknown to Mafia to test it now.

And you probably noticed I haven't been putting much work towards version 15.0... Job hunting is taking me a lot of time, and my wife and I just learned that we have started creating a fork of ourselves :D

Oh, fun for you :) I know that can be slightly distracting, and probably will eat up way more time when it actually comes out than one thinks. I should know this myself in about 3 months time...
 
Top