Results 1 to 8 of 8

Thread: Make the CLI command "garden" available via ash

  1. #1
    Senior Member
    Join Date
    Oct 2017
    Posts
    523

    Default Make the CLI command "garden" available via ash

    There is a CLI command called garden which tells you which garden you have, its growth, and can also use "garden pick" to collect it.

    Would be great if this CLI command was translated into ash availability.

  2. #2

    Default

    The first two are available both from get_campground() and my_garden_type(). So you're just asking for an ASH function to harvest your garden?

  3. #3
    Senior Member
    Join Date
    Oct 2017
    Posts
    523

    Default

    The first two are available both from get_campground() and my_garden_type(). So you're just asking for an ASH function to harvest your garden?
    Originally Posted by lostcalpolydude View Post
    Thank you, I added my_garden_type() to the wiki. that is what I get for relying on it instead of ashref.

    In regards to get_campground()
    you can extract the growth from it but it is somewhat of a pain to do so. so it would be great if there was something like
    int my_garden_growth()
    for example I use this function
    Code:
    int grass_growth()
    {
        int [item] campground = get_campground();
        foreach it,qty in campground
        {
            if(it == $item[packet of tall grass seeds])
            {
                return qty;
            }
        }
        return 0;
    }
    which is specific to only one garden type.

    and yes I would definitely love a function to let you harvest garden. Either a specified amount or all of it (for grass you need to pick it multiple times)
    Last edited by taltamir; 05-20-2020 at 03:37 AM.

  4. #4
    Senior Member
    Join Date
    Jun 2016
    Posts
    405

    Default

    There's no reason to loop the entire thing, just to find the value for one item.

    I have the following static dataset
    Code:
    item [string] Gardens = {"pumpkin": $item[packet of pumpkin seeds],
    			"peppermint": $item[Peppermint Pip Packet],
    			"skeleton": $item[packet of dragon's teeth],
    			"beer": $item[packet of beer seeds],
    			"winter": $item[packet of winter seeds],
    			"thanksgarden": $item[packet of thanksgarden seeds],
    			"grass": $item[packet of tall grass seeds],
    			"mushroom": $item[packet of mushroom spores],
    			};
    So now I can find the garden growth with:
    Code:
    int GardenGrowth() {
    	get_campground()[Gardens[my_garden_type()]]
    }
    Last edited by the dictator; 05-20-2020 at 07:21 AM.

  5. #5
    Senior Member
    Join Date
    Aug 2009
    Posts
    139

    Default

    Thank you, I added my_garden_type() to the wiki. that is what I get for relying on it instead of ashref.
    Originally Posted by taltamir View Post
    Which wiki? And what's ashref?

    I added my_garden_type to the only wiki I know about after it was implemented.

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

    Default

    Which wiki? And what's ashref?
    Originally Posted by Ryo_Sangnoir View Post
    https://wiki.kolmafia.us/index.php?title=Ashref
    Well, thank you.
    Originally Posted by Veracity View Post

  7. #7
    Senior Member
    Join Date
    Oct 2017
    Posts
    523

    Default

    Which wiki? And what's ashref?

    I added my_garden_type to the only wiki I know about after it was implemented.
    Originally Posted by Ryo_Sangnoir View Post
    That wiki you linked. You added a page for it, but it was not listed in the master function list here
    https://wiki.kolmafia.us/index.php?title=Ash_Functions
    which is where I added it. Sorry for being unclear

    I went ahead and compared to the ashref file and added all missing 14 functions from the letter m...
    25 letters left to go...

  8. #8
    Senior Member
    Join Date
    Aug 2009
    Posts
    139

    Default

    Woah, awesome. This is going to make writing scripts a lot easier.

    Sorry for hijacking your thread.

Posting Permissions

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