My meat: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Metraxis
m My meat moved to My meat(): Spelling correction
imported>Zarqon
another example, more links, consistent formatting, categories
Line 1: Line 1:
<strong>int my_meat()</strong><br />
[[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.
 
<br />
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.
<br />
 
<br />
The following sample checks to see if you have enough meat to buy a hermit permit and if you do, it will buy one.
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>
   int a = my_meat();
   if ([[my_meat()]] >= 100) {
  if(a <= 100)
     [[buy()|buy]](1, $[[item]][hermit permit]);
    {
  }
     buy(1, $item[hermit permit]);
</code>
    }
 
</code>  
More complicated example: this makes sure you have enough meat before trying to get a dead mimic:


The following code does the same, but places my_meat in the if statement rather than storing it in a variable first.
<code>
<code>
   if(my_meat() <= 100)
   while ([[my_meat()]] < 5000) {
    {
     [[adventure()|adventure]](1,$[[location]][knob goblin treasury]);
     buy(1, $item[hermit permit]);
     [[cli_execute()|cli_execute]]("sell * meat stack");
     }
  }
  [[cli_execute()|cli_execute]]("conditions clear; conditions add 1 dead mimic");
  if ([[adventure()|adventure]]([[my_adventures()]],$[[location]][dungeons of doom]))
    [[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.


<Center>
<center><table style="width:80%;margin-top:+.7em;background-color:#F4DF3B;border:2px solid #8663A8"><tr>
<table style="width:80%;margin-top:+.7em;background-color:#F4DF3B;border:2px solid #8663A8">
  <tr>
     <td class="box_tgen" style="text-align:center;color:#000;font-size:90%;border:none;margin: 0;padding:.1em;">
     <td class="box_tgen" style="text-align:center;color:#000;font-size:90%;border:none;margin: 0;padding:.1em;">
'''See Also:''' <br> [[my_closetmeat]] || [[item_amount]]</td>
'''See Also:''' <br> [[my_closetmeat()]] || [[item_amount()]]</td>
  </tr>
</tr></table></center>
</table>
</Center>

Revision as of 08:02, 30 January 2009

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()