Difference between pages "Knoll available" and "Npc price"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Bale
(r9308)
 
imported>Theraze
(Created page with "{{ #vardefine:name|npc_price}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:name}}| aggregate={{#var:aggregate}}| return...")
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|knoll_available}}{{
+
#vardefine:name|npc_price}}{{
#vardefine:return_type|boolean}}{{
+
#vardefine:return_type|int}}{{
  
 
FunctionPage|
 
FunctionPage|
Line 8: Line 8:
 
function1={{Function|
 
function1={{Function|
 
name={{#var:name}}|
 
name={{#var:name}}|
return_type={{#var:return_type}}
+
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
parameter1={{Param|item|shop_for}}|
 +
p1desc={{Pspan|shop_for}} is the item to inquire on the npc price and availability of.|
 
}}|
 
}}|
  
function_description=This function returns true if the logged-in character has has access to the inside of Degrassi Knoll.|
+
function_description=Returns the current price of the given item from NPC shops, given availability to the player. This function runs a new check each time it is called, so if you call this function and then unlock a new NPC store, calling this function again will return the new availability state of the item.|
  
code1={{CodeSample|
+
see_also={{SeeAlso|historical_price|buy|mall_price|retrieve_item}}|
title=Code Samples|
+
special=Items not currently available will return 0. When not logged in, this function returns 0 for all items, as none of them are available to you at the time.|
description=This will purchase a detuned radio if you can.|
 
code=
 
<syntaxhighlight>
 
if(item_amount($item[detuned radio]) < 1 && knoll_available() && my_meat() >= 300)
 
  buy(1, $item[detuned radio]);
 
</syntaxhighlight>
 
}}|
 
 
 
see_also={{SeeAlso|gnomads_available|canadia_available}}|
 
special=When not logged in, this function returns false.
 
 
}}
 
}}
  
[[Category:Your Character]]
+
[[Category:Item Management]]

Revision as of 13:42, 19 May 2011

Function Syntax

int npc_price(item shop_for )

  • shop_for is the item to inquire on the npc price and availability of.

Returns the current price of the given item from NPC shops, given availability to the player. This function runs a new check each time it is called, so if you call this function and then unlock a new NPC store, calling this function again will return the new availability state of the item.

See Also

historical_price() | buy() | mall_price() | retrieve_item()

Special

Items not currently available will return 0. When not logged in, this function returns 0 for all items, as none of them are available to you at the time.