Cargo Shorts Chess Set Collector Script

Ethelred

Member
I'm currently farming karma in GooCore. I cobbled together a little script to collect the chess set, both alabaster and onyx pieces, from the cargo shorts. I decided to use my display case to house the collected pieces and also keep track of my progress. I don't do any testing for the display case, so if you don't have one, this script will probably fail. It's not rocket science, but I thought I'd share it. I have successfully collected chess sets for all my chars now. Here it is - CargoChess.ash:

Code:
#
# CargoChess.ash        Get Chess Sets from cargo shorts
#
# Vers. 1.00 9/16/2020 Ethelred the Unready
#
#    This script is in the public domain.
#


    int today;

void Pick( int pocket )    
{
    cli_execute( "cargo " + to_string( pocket ));
}


void Report( item article, int goal, int checkday, int pocket )    
{
    int ni;
    int nd;
    int ns;
    int tot;
    int diff;
    
    ni = item_amount( article);
    nd = display_amount( article );
    ns = storage_amount( article );
    tot = ni + nd + ns;
    diff = goal - tot;
    if( diff > 0 && today == checkday && !to_boolean(get_property("_cargoPocketEmptied")))
    {
        Pick( pocket );
        ni = item_amount( article);        
        if( ni > 0 )
        {
            put_display( ni, article );
            ni = 0;
            nd = display_amount( article );
            tot = ni + nd + ns;
            diff = goal - tot;            
        }
    }
    if( diff == 0 ) 
    {
        print( "You currently have " + to_string( tot ) + " " + to_string( article ) + "(s).", "green");    
    }
    else
    {
        print( "You are currently missing " + to_string( diff ) + " of " +  to_string( goal )
             + " " + to_string( article ) + "(s).", "red");    
    }    
}


void main(  )
{
    
    today = my_daycount();
    
    print( "Starting Cargo Shorts Chess Set test.", "green");    
    print( "++++", "blue" );
    
    report( $item[ alabaster king ], 1, 1, 523 );
    report( $item[ alabaster queen ], 1, 1, 651 );
    report( $item[ alabaster rook ], 2, 1, 111 );
    report( $item[ alabaster bishop ], 2, 1, 567 );
    report( $item[ alabaster knight ], 2, 1, 275 );
    report( $item[ alabaster pawn ], 8, 2, 46 );
    
    report( $item[ onyx pawn ], 8, 3, 105 );
    report( $item[ onyx knight ], 2, 1, 4 );
    report( $item[ onyx bishop ], 2, 2, 537 );
    report( $item[ onyx rook ], 2, 3, 197 );
    report( $item[ onyx queen ], 1, 1, 506 );
    report( $item[ onyx king ], 1, 2, 88 );
        
    print( "++++", "blue" );
    print( "Ending Cargo Shorts Chess Set.", "green");    
        
    return;

}
 
Top