Difference between revisions of "My meat"

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
(another example, more links, consistent formatting, categories)
imported>Grotfang
Line 22: Line 22:
 
     [[print()|print]]("You didn't get a mimic!");
 
     [[print()|print]]("You didn't get a mimic!");
 
</code>
 
</code>
[[Category:Your Character | My meat()]]
 
[[Category:Ash Functions | My meat()]]
 
  
 
When not logged in, this function returns 0.
 
When not logged in, this function returns 0.
Line 31: Line 29:
 
'''See Also:''' <br> [[my_closetmeat()]] || [[item_amount()]]</td>
 
'''See Also:''' <br> [[my_closetmeat()]] || [[item_amount()]]</td>
 
</tr></table></center>
 
</tr></table></center>
 +
 +
[[Category:Item Management | My meat()]]
 +
[[Category:Ash Functions | My meat()]]

Revision as of 15:16, 22 February 2010

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.

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]);
 }

More complicated example: this makes sure you have enough meat before trying to get a dead mimic:

 while (my_meat() < 5000) {
   adventure(1,$location[knob goblin treasury]);
   cli_execute("sell * 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!");

When not logged in, this function returns 0.

See Also:
my_closetmeat() || item_amount()