Access to dusty output via script?

juyes

New member
I was toying with improving EatDrink.ash by adding dusty wine bottle support, but I am stuck. It seemed like using the cli 'dusty' command combined a matcher should be able to identify the bottles, but I don't know how to get the output of the cli command into a string. Which leads to 2 questions:

1) Is there some more obvious way (in ash) to get which dusty wine is the great one?
2) Failing that, is there a way to get cli output into a string so I can do the mathcing?

Cheers, juyes
 

matt.chugg

Moderator
you could read the descriptions with visit_url and check for the glyphs or probably more helpful you could read the properties in local_prefs

Code:
lastDustyBottle2271=0
lastDustyBottle2272=0
lastDustyBottle2273=0
lastDustyBottle2274=0
lastDustyBottle2275=0
lastDustyBottle2276=0

I am level 5 currently, so I don't know what they are this run, but I expect the value is the glyph number, I think you are after glyph4 ?

http://kol.coldfront.net/thekolwiki/index.php/Dusty_bottle_of_wine
 
Last edited:

juyes

New member
I am level 5 currently, so I don't know what they are this run, but I expect the value is the glyph number, I think you are after glyph4 ?

Thanks, this was extremely helpful. The values of the lastDusty properties do seem to be the glyph number! I don't suppose you happen to know when those properties get set? Can I could on them being there if you could id the bottles, or would running the cli command dusty first help to set them?

Cheers, juyes
 

lostcalpolydude

Developer
Staff member
If you get the glasses in mafia, that's when they get identified. Otherwise, you can use the CLI command dusty to make mafia identify them.
 

mredge73

Member
This works:

Code:
item BestDusty()
{
    if (my_ascensions( )!= get_property("lastDustyBottleReset").to_int())
    {
        cli_execute("dusty");
        if (my_ascensions( )!= get_property("lastDustyBottleReset").to_int())
            return $item[none];    
    }
    
    switch
    {
    case get_property ("lastDustyBottle2271").to_int()==4 :
        return to_item(2271);
    case get_property ("lastDustyBottle2272").to_int()==4 :
        return to_item(2272);
    case get_property ("lastDustyBottle2273").to_int()==4 :
        return to_item(2273);
    case get_property ("lastDustyBottle2274").to_int()==4 :
        return to_item(2274);
    case get_property ("lastDustyBottle2275").to_int()==4 :
        return to_item(2275);
    case get_property ("lastDustyBottle2276").to_int()==4 :
        return to_item(2276);
    }
    return $item[none];    
}
 

mredge73

Member
This is a little more extensive:

to test:
print (Dusty(4)); //prints your best dusty wine
print (Dusty(1)); //prints your next best, Average wine

to drink:
DrinkBestDusty(9); //Drinks 9 of your best dusty wine

Code:
//returns true if you have item in inventory or equiped
//does not unequip
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
boolean haveItem(item thingy)
{
    if(item_amount(thingy)>0)
        return true;
    if(have_equipped( thingy ))
        return true;
        
    return false;
}

// Identify Dusty Bottles
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

// Return true if you are cabable of identifing the wine bottles
boolean WineIdentifable()
{
    if (!haveItem($item[Lord Spookyraven's spectacles]))
        return false;
        
    if (my_ascensions( )!= get_property("lastDustyBottleReset").to_int())
    {
        cli_execute("dusty");
        if (my_ascensions( )!= get_property("lastDustyBottleReset").to_int())
            return false;    
    }
    
    return true;
}

// Returns Dusty bottle based on what type you are asking for:
// 1= Average wine
// 2= Vinger wine
// 3= Spooky wine (Kiss of the Black Fairy)
// 4= Great wine
// 5= Glassy wine
// 6= Bad wine
item Dusty(int Type)
{
    if (!WineIdentifable())
        return $item[none];    
        
    switch
    {
    case get_property ("lastDustyBottle2271").to_int()==Type :
        return to_item(2271);
    case get_property ("lastDustyBottle2272").to_int()==Type :
        return to_item(2272);
    case get_property ("lastDustyBottle2273").to_int()==Type :
        return to_item(2273);
    case get_property ("lastDustyBottle2274").to_int()==Type :
        return to_item(2274);
    case get_property ("lastDustyBottle2275").to_int()==Type :
        return to_item(2275);
    case get_property ("lastDustyBottle2276").to_int()==Type :
        return to_item(2276);
    }
    return $item[none];    
}

//Drinks x number of your best dusty wine 
boolean DrinkBestDusty(int howmany)
{
    if(drink( howmany, Dusty(4) ))
    return true;
    else
    return false;
}
 
Last edited:

dj_d

Member
Note that the latest test version of eatdrink (posted at the end of the thread for now - the first post will be updated soon) now supports dusty wines.
 
Top