Difference between revisions of "Autosell"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m (moved Autosell() to Autosell)
imported>StDoodle
Line 1: Line 1:
'''boolean autosell( int quantity, item it )'''<br />
+
{{#vardefine:name|autosell}}
Autosells the given items.
+
{{#vardefine:return_type|boolean}}
 +
{{FunctionPage|
 +
name={{#var:name}}|
 +
function_category=Item Management|
  
<p><pre># small scriptlet (taken from my aftercore.ash)) that autosells all of your Castle combat items
+
function1={{Function|
# ... unless you have more than 1000 of each, which you shouldn't, unless you're collecting.
+
name={{#var:name}}|
void castlesell() {
+
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|int|qty}}|
 +
parameter2={{Param|item|it}}|
 +
p1desc={{pspan|qty}} is the quantity to sell|
 +
p2desc={{pspan|it}} is the item to sell|
 +
}}|
  
use(1000, $item[Warm Subject gift certificate]);
+
function_description=Attempts to autosell {{pspan|qty}} of {{pspan|it}}. Returns true if all items are sold as specified, or as many as possible, and false.</p>
autosell(1000, $item[heavy D]);
+
<p>Note that specifying a higher {{pspan|qty}} than you have of an item, or an item that cannot be autosold, will still return true as the function has done as much as it could.|
autosell(1000, $item[original G]);
 
autosell(1000, $item[disturbing fanfic]);
 
autosell(1000, $item[furry fur]);
 
autosell(1000, $item[wolf mask]);
 
autosell(1000, $item[awful poetry journal]);
 
autosell(1000, $item[thin black candle]);
 
autosell(1000, $item[chaos butterfly]);
 
autosell(1000, $item[plot hole]);
 
autosell(1000, $item[probability potion]);
 
autosell(1000, $item[procrastination potion]);
 
autosell(1000, $item[angry farmer candy]);
 
autosell(1000, $item[giant needle]);
 
autosell(1000, $item[Mick's IcyVapoHotness Rub]);
 
autosell(1000, $item[rave whistle]);
 
  
}</pre>
+
needscode=yes|
 +
 
 +
cli_equiv=The CLI commands "sell" and "autosell" function similarly.|
 +
}}

Revision as of 00:47, 5 March 2010


needs(code_samples);

Function Syntax

boolean autosell(int qty ,item it )

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

Attempts to autosell qty of it. Returns true if all items are sold as specified, or as many as possible, and false.

Note that specifying a higher qty than you have of an item, or an item that cannot be autosold, will still return true as the function has done as much as it could.

CLI Equivalent

The CLI commands "sell" and "autosell" function similarly.