Difference between revisions of "My meat"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m
imported>Bale
m
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#vardefine:name|my_meat}}
+
{{
{{#vardefine:return_type|int}}
+
#vardefine:name|my_meat}}{{
 +
#vardefine:return_type|int}}{{
  
{{FunctionPage|
+
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Item Management|
 
  
 
function1={{Function|
 
function1={{Function|
Line 17: Line 17:
  
 
code1={{CodeSample|
 
code1={{CodeSample|
title=Code Sample|
+
title=Code Samples|
 
description=The following sample checks to see if you have enough meat to buy a hermit permit and if you do, it will buy one:|
 
description=The following sample checks to see if you have enough meat to buy a hermit permit and if you do, it will buy one:|
 
code=
 
code=
Line 24: Line 24:
 
   buy(1 , $item[hermit permit]);
 
   buy(1 , $item[hermit permit]);
 
}
 
}
</syntaxhighlight>}}|
+
</syntaxhighlight>}}
 
+
{{CodeSample|
code2={{CodeSample|
 
 
description=This more complex example makes sure you have enough meat before trying to get a dead mimic:|
 
description=This more complex example makes sure you have enough meat before trying to get a dead mimic:|
 
code=
 
code=
Line 42: Line 41:
 
special=When not logged in, this function returns 0.
 
special=When not logged in, this function returns 0.
 
}}
 
}}
 +
 +
[[Category:Item Management]]

Latest revision as of 21:44, 21 May 2010

Function Syntax

int my_meat()

Returns the amount of meat you currently have in your inventory.

This does not include meat you have in your Colossal Closet or Hagnk's storage.

Code Samples

The following sample checks to see if you have enough meat to buy a hermit permit and if you do, it will buy one:

if (my_meat() >= 100) {
   buy(1 , $item[hermit permit]);
}

This more complex example makes sure you have enough meat before trying to get a dead mimic:

while (my_meat() < 5000) {
   adventure(1 , $location[knob goblin treasury]);
   autosell(item_amount($item[meat stack]) , $item[meat stack]);
}
cli_execute("conditions clear; conditions add 1 dead mimic");
if (adventure(my_adventures(), $location[dungeons of doom])
   print("You didn't get a mimic!");

See Also

adventure() | autosell() | cli_execute() | item_amount() | my_adventures() | my_closet_meat() | print()

Special

When not logged in, this function returns 0.