Difference between pages "Refresh shop" and "Soulsauce cost"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(r17166: refresh shop)
 
imported>Darzil
(Created page with "{{ #vardefine:name|soulsauce_cost}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:name}}| aggregate={{#var:aggregate}...")
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|refresh_shop}}{{
+
#vardefine:name|soulsauce_cost}}{{
#vardefine:return_type|void}}{{
+
#vardefine:return_type|int}}{{
  
 
FunctionPage|
 
FunctionPage|
 +
 
name={{#var:name}}|
 
name={{#var:name}}|
  
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|skill|use_me}}|
 +
p1desc={{Pspan|use_me}} is the skill to check the cost of|
 
}}|
 
}}|
  
function_description=Forces mafia to re-check your mall store (useful since it's impossible for mafia to internally track this section of "your" inventory).|
+
function_description=Returns the Soulsauce cost for the next cast of the given skill {{pspan|use_me}}.
 
 
code1={{CodeSample|
 
title=Code Samples|
 
description=Following example uses refresh_shop to create an auto stocker for your shop that prevents you from flooding the market.|
 
code=
 
<syntaxhighlight>
 
void shop_stocker (item selling, int amount_in_store, float mallprice_factor) {
 
  while (item_amount(selling) > 0) {
 
      int current;
 
      refresh_shop();
 
      current = shop_amount(selling);
 
      if (current < amount_in_store) {
 
        int amount = amount_in_store - current;
 
        int price = mall_price(selling);
 
        price = round(price * mallprice_factor);
 
        print("Currently have "+current+" "+selling+" in store. Putting "+amount+" more up for "+price+".", "blue");
 
        put_shop(price, 0, amount, selling);
 
      }
 
      else print("Currently have "+current+" "+selling+" in store. Have not sold any recently.", "red");
 
      print("Waiting....", "purple");
 
      waitq(300); //wait 5 mins
 
  }
 
}
 
 
 
shop_stocker ($item[mae west], 5, .99);
 
</syntaxhighlight>|
 
}}|
 
  
cli_equiv=The CLI command "refresh" with the parameter "shop" has the same function.|
 
 
}}
 
}}
  
[[Category:Item Management]]
+
[[Category:Skills and Effects]]

Revision as of 13:12, 4 August 2014

Function Syntax

int soulsauce_cost(skill use_me )

  • use_me is the skill to check the cost of

Returns the Soulsauce cost for the next cast of the given skill use_me.