Bad Moon lucre checker

gemelli

Member
I recently entered Bad Moon hell, and to be honest the thing that I find most unsettling is that I can't keep track of how my lucre collection is growing.  (Since you can't get to Hagnk's from the relay browser, and Mafia disables storage checking when you're in Bad Moon, this wasn't information I could get to from Mafia.)

Because I'm obsessive-compulsive about the BHH, I wrote a simple ASH script to peek into your inventory and storage, and add up the number of lucre you've currently collected.  There are almost certainly more efficient ways to do this, but my time is tight today.  Comments welcome!

Code:
void main()
{
    string storage=visit_url("storage.php");

    item lucre=$item["filthy lucre"];
    int held_lucre=item_amount(lucre);
    
    int stored_lucre=0;

    if(contains_text(storage,"filthy lucre")) {
         int startpoint=index_of(storage,"filthy lucre");
         string smallstorage=substring(storage,startpoint);
    
         startpoint=index_of(smallstorage,"(");
         int endpoint=index_of(smallstorage,")");

         string amt_string=substring(smallstorage,startpoint+1,endpoint);
         stored_lucre=to_int(amt_string);
    }
    
    int total_lucre=stored_lucre+held_lucre;
    
    print("You have "+stored_lucre+" lucre in storage.");
    print("You have "+held_lucre+" lucre on hand.");
    print("TOTAL: "+total_lucre+" lucre.");
    
}
 

th3y

Member
That's cool... A lot of people keep their lucre in their display case instead of storage, and stash newly-earned lucre in the DC each day. I know you can stash while in HC/Oxy, so I presume you can stash in Bad Moon as well. From the CLI, you can "display put * filthy lucre"

Of course you can't retrieve the lucre until out of ronin...

-TH3Y
 
Top