Take storage

From Kolmafia
Jump to navigation Jump to search

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. This will retrieve an item that is a free pull, with one exception. If you are in Bad Moon, this command will not take the VIP Key from Storage.

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" );
      print( "Pulled " + req_num + " of " + it );

CLI Equivalent

The CLI commands "pull" and "hagnk" function similarly.

See Also

take_closet() | take_display() | take_stash()

More Information

Information on handling free pulls is at Tips, Tricks and Workarounds.