Difference between revisions of "Is tradeable"

From Kolmafia
Jump to navigation Jump to search
imported>Heeheehee
m (Added code example.)
imported>Bale
(slightly better-er.)
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Item Management|
 
  
 
function1={{Function|
 
function1={{Function|
Line 16: Line 15:
 
}}|
 
}}|
  
function_description=This function checks to see if the item {{pspan|check_me}} can be traded, returning true if it can and false otherwise.|
+
function_description=This function checks to see if the item {{pspan|check_me}} can be traded via the Mall, returning true if it can and false otherwise.|
  
 
code1={{CodeSample|
 
code1={{CodeSample|
Line 26: Line 25:
 
   if(have_shop()) {
 
   if(have_shop()) {
 
       foreach i in get_inventory()
 
       foreach i in get_inventory()
         if(is_tradeable(i)) put_shop(0, item_amount(i), i);
+
         if(is_tradeable(i)) put_shop(0, 0, i);
 
   }
 
   }
 
}
 
}
Line 34: Line 33:
 
see_also={{SeeAlso|is_displayable|is_giftable}}|
 
see_also={{SeeAlso|is_displayable|is_giftable}}|
 
}}
 
}}
 +
 +
[[Category:Item Management]]

Latest revision as of 21:55, 20 August 2010

Function Syntax

boolean is_tradeable(item check_me )

  • check_me is an item to test

This function checks to see if the item check_me can be traded via the Mall, returning true if it can and false otherwise.

Code Samples

The following function dumps your entire inventory into your mall store.

void inv_dump() {
   if(have_shop()) {
      foreach i in get_inventory()
         if(is_tradeable(i)) put_shop(0, 0, i);
   }
}

See Also

is_displayable() | is_giftable()