Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: When visiting an unknown adventure locationin mafia, automatically add it to the list

  1. #1
    Developer
    Join Date
    Apr 2006
    Posts
    925

    Default When visiting an unknown adventure locationin mafia, automatically add it to the list

    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.
    Better Basement Automation - Version 1.??? Someone else is maintaining this
    Get an effect from a buffbot
    - Version 1.4

  2. #2
    Senior Member
    Join Date
    Feb 2009
    Posts
    377

    Default

    I approve this message.

    I did not know that command existed.

  3. #3
    Senior Member
    Join Date
    Sep 2006
    Posts
    352

    Default

    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.
    Originally Posted by Rinn View Post
    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.

  4. #4

    Default

    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 by maximillian the red; 12-08-2011 at 01:53 PM.

  5. #5
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,182

    Default

    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.
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  6. #6
    Senior Member
    Join Date
    Jan 2009
    Posts
    217

    Default

    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 by Fred Nefler; 12-08-2011 at 03:05 PM.

  7. #7
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010
    Posts
    5,033

    Default

    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.
    Originally Posted by fronobulax View Post
    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.
    My scripts:
    Best sushi for Profit
    Winterbay's Helpful Automatic Monsterbasher (WHAM)

    Scripts maintained by me:
    Autobasement
    Smashlib

    A small programmer joke:
    Wife: Honey, please go to the market and buy 1 bottle of milk. If they have eggs, bring 6.
    The man came back with 6 bottles of milk.
    Wife: Why did you buy 6 bottles of milk.
    Man: Because they had eggs...

    The 6 Stages of Debugging: 1 )That can't happen. 2) That shouldn't happen. 3) Hmmm, weird. 4) Why does that happen? 5) Oh, I see. 6 )How did that ever work?

    All programs can be optimized, and all programs have bugs; therefore all programs can be optimized to one line that doesn’t work. /Bob Fitch, Blizzard

  8. #8
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,510

    Default

    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 Code:
    if ( urlString.startsWith"adventure.php" ) )
    {
        if ( 
    urlString.indexOf"snarfblat=122" ) != -)
        {
            return 
    "Oasis in the Desert";
        }
        if ( 
    urlString.indexOf"snarfblat=122" ) != -)
        {
            
    CharpaneRequest.setCheckNewLocationtrue );
            return 
    "Unknown location";
        }
        return 
    null;

    and modifying CharPaneRequest.java to parse the Last Adventure link and call RegisterAdventureCommand.
    Try the Nemesis Quest Script or the FamiliarFeeder interface.
    *shakes KoLMafia tech support magic 8-ball* Update mafia to the latest daily .JAR!
    NEW Dad ASCENSION STARTED 20120730
    ------------------------------
    Welcome to Parenthood, Noob

  9. #9
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,510

    Default

    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.
    Attached Files
    Try the Nemesis Quest Script or the FamiliarFeeder interface.
    *shakes KoLMafia tech support magic 8-ball* Update mafia to the latest daily .JAR!
    NEW Dad ASCENSION STARTED 20120730
    ------------------------------
    Welcome to Parenthood, Noob

  10. #10
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,447

    Default

    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.)
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

Similar Threads

  1. Replies: 0
    Last Post: 03-07-2015, 06:40 PM
  2. Feature Use 1 adventure instead of 0 for unknown food/booze
    By lostcalpolydude in forum Bug Reports
    Replies: 9
    Last Post: 11-04-2014, 09:13 AM
  3. Replies: 1
    Last Post: 09-06-2014, 03:14 PM
  4. Bug - Fixed Island barracks is 'unknown adventure #220'
    By Nappa in forum Bug Reports
    Replies: 3
    Last Post: 11-29-2013, 04:12 PM
  5. Replies: 0
    Last Post: 11-23-2013, 06:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •