Take storage
Function Syntax
boolean take_storage(int qty ,item it )
- qty is the quantity to move
- it is the item to move
Attempts to move qty of it from Hagnk's Ancestral Storage to your main inventory. Returns true if the move succeeds and false if it does not.
Code Sample
The following code will use a pull list loaded from a text file.
int day = 2;
int [int, item] static_pulls; //Items that are always included in a pull list.
file_to_map( "static_pulls.txt" , static_pulls );
foreach it, req_num in static_pulls[ day ]
{
if ( !take_storage( req_num , it ) )
print( "Dang! Something went wrong while pulling " + it + ", maybe you don't have enough of those." , "red" );
else
print( "Pulled " + req_num + " of " + it );
}
CLI Equivalent
The CLI commands "pull" and "hagnk" function similarly.