Difference between pages "Put display" and "Autosell price"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Heeheehee
m (Save a few server hits, if someone actually copies this code and executes it.)
 
imported>StDoodle
m
 
Line 1: Line 1:
{{
+
{{#vardefine:name|autosell_price}}
#vardefine:name|put_display}}{{
+
{{#vardefine:return_type|int}}
#vardefine:return_type|boolean}}{{
 
  
FunctionPage|
+
{{FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
 +
function_category=Item Management|
  
 
function1={{Function|
 
function1={{Function|
Line 11: Line 11:
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
return_also={{#var:return_also}}|
parameter1={{Param|int|qty}}|
+
parameter1={{Param|item|it}}|
parameter2={{Param|item|it}}|
+
p1desc={{pspan|it}} is the item to check the price of|
p1desc={{pspan|qty}} is the quantity to move|
 
p2desc={{pspan|it}} is the item to move|
 
}}|
 
 
 
function_description=Attempts to move {{pspan|qty}} of {{pspan|it}} to your display case from your main inventory. Returns true if the move succeeds and false if it does not.|
 
 
 
code1={{CodeSample|
 
title=Code Sample|
 
description=The following code will put 1 of each Club, Diamond, Heart, and Space necklace into the display case.|
 
code=<syntaxhighlight>
 
batch_open();
 
foreach necklace in $items[ 1995, 2016, 2017, 2018 ]
 
{
 
  if ( item_amount( necklace ) > 0 )
 
      put_display( 1 , necklace );
 
  else
 
      print( "You don't have any " + necklace.to_plural() );
 
}
 
batch_close();
 
</syntaxhighlight>
 
 
}}|
 
}}|
  
 +
function_description=Returns the autosell price of item {{pspan|it}}, or a value <= 0 if the item cannot be autosold. For most items that cannot be autosold, such as common Quest Items, this value will be 0. The value will be presented as a negative number in a few unusual cases where an item can't be autosold, but does have a defined value detectable by other means: a Mall minimum price other than 100, or a price in one of the sign restaurants.  The laser-broiled pear is an example of a non-autosellable item with a value detectable both ways.|
  
 +
needscode=yes|
  
see_also={{SeeAlso|put_closet|put_stash|take_display}}|
+
see_also={{SeeAlso|autosell}}|
cli_equiv=The CLI command "display" with the parameter "put" works similarly.
 
 
}}
 
}}
 
[[Category:Item Management]]
 

Revision as of 14:48, 5 March 2010



needs(code_samples);

Function Syntax

int autosell_price(item it )

  • it is the item to check the price of

Returns the autosell price of item it, or a value <= 0 if the item cannot be autosold. For most items that cannot be autosold, such as common Quest Items, this value will be 0. The value will be presented as a negative number in a few unusual cases where an item can't be autosold, but does have a defined value detectable by other means: a Mall minimum price other than 100, or a price in one of the sign restaurants. The laser-broiled pear is an example of a non-autosellable item with a value detectable both ways.

See Also

autosell()