Difference between pages "Append" and "Take stash"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Cheesecookie
m (Append returns the result, it does not change the original.)
 
imported>StDoodle
m
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|append}}{{
+
#vardefine:name|take_stash}}{{
#vardefine:return_type|buffer}}{{
+
#vardefine:return_type|boolean}}{{
  
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
 +
function_category=Item Management|
  
 
function1={{Function|
 
function1={{Function|
Line 11: Line 12:
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
return_also={{#var:return_also}}|
parameter1={{Param|buffer|original}}|
+
parameter1={{Param|int|qty}}|
parameter2={{Param|string|add}}|
+
parameter2={{Param|item|it}}|
p1desc={{Pspan|original}} is the buffer to add to|
+
p1desc={{pspan|qty}} is the quantity to move|
p2desc={{Pspan|add}} is a string to add on|
+
p2desc={{pspan|it}} is the item to move|
 
}}|
 
}}|
  
function_description=Returns a buffer containing {{pspan|original}} with {{pspan|add}} tacked on to the end.|
+
function_description=Attempts to move {{pspan|qty}} of {{pspan|it}} from your clan stash to your main inventory. Returns true if the move succeeds and false if it does not.|
  
code1={{CodeSample|
+
needscode=yes|
title=Code Sample|
 
description=Print a list of all items currently equipped.|
 
code=
 
<syntaxhighlight>
 
buffer gear;
 
  
foreach slot in $slots[]
+
see_also={{SeeAlso|put_stash|refresh_stash|stash_amount|take_closet|take_display|take_storage}}|
  if(equipped_item(slot) != $item[none]) {
+
cli_equiv=The CLI command "stash" with the parameter "take" works similarly.
      if(length(gear) != 0)
 
        gear = append(gear, ", ");
 
      gear = append(gear, to_string(equipped_item(slot)));
 
  }
 
 
 
print("I am wearing: "+ gear);
 
</syntaxhighlight>
 
}}|
 
 
 
see_also={{SeeAlso|append_tail}}|
 
 
}}
 
}}
 
[[Category:String Handling Routines]]
 

Revision as of 21:11, 8 March 2010

needs(code_samples);

Function Syntax

boolean take_stash(int qty ,item it )

  • qty is the quantity to move
  • it is the item to move

Attempts to move qty of it from your clan stash to your main inventory. Returns true if the move succeeds and false if it does not.

CLI Equivalent

The CLI command "stash" with the parameter "take" works similarly.

See Also

put_stash() | refresh_stash() | stash_amount() | take_closet() | take_display() | take_storage()