Difference between revisions of "My meat"

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
imported>StDoodle
m
Line 1: Line 1:
[[int]] [[my_meat()]]
+
{{#vardefine:name|my_meat}}
 +
{{#vardefine:return_type|int}}
  
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.
+
{{FunctionPage|
 +
name={{#var:name}}|
 +
function_category=Item Management|
  
The following sample checks to see if you have enough meat to buy a hermit permit and if you do, it will buy one.
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
}}|
  
<code>
+
function_description=Returns the amount of meat you currently have in your inventory.</p>
  if ([[my_meat()]] >= 100) {
+
<p>This does not include meat you have in your Colossal Closet or Hagnk's storage.|
    [[buy()|buy]](1, $[[item]][hermit permit]);
 
  }
 
</code>
 
  
More complicated example: this makes sure you have enough meat before trying to get a dead mimic:
+
code1={{CodeSample|
 +
title=Code Sample|
 +
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=
 +
<syntaxhighlight>
 +
if (my_meat() >= 100) {
 +
  buy(1 , $item[hermit permit]);
 +
}
 +
</syntaxhighlight>}}|
  
<code>
+
code2={{CodeSample|
  while ([[my_meat()]] < 5000) {
+
description=This more complex example makes sure you have enough meat before trying to get a dead mimic:|
    [[adventure()|adventure]](1,$[[location]][knob goblin treasury]);
+
code=
    [[cli_execute()|cli_execute]]("sell * meat stack");
+
<syntaxhighlight>
  }
+
while (my_meat() < 5000) {
  [[cli_execute()|cli_execute]]("conditions clear; conditions add 1 dead mimic");
+
  adventure(1 , $location[knob goblin treasury]);
  if ([[adventure()|adventure]]([[my_adventures()]],$[[location]][dungeons of doom]))
+
  autosell(item_amount($item[meat stack]) , $item[meat stack]);
    [[print()|print]]("You didn't get a mimic!");
+
}
</code>
+
cli_execute("conditions clear; conditions add 1 dead mimic");
 +
if (adventure(my_adventures(), $location[dungeons of doom])
 +
  print("You didn't get a mimic!");
 +
</syntaxhighlight>}}|
  
When not logged in, this function returns 0.
+
see_also={{SeeAlso|adventure|autosell|cli_execute|item_amount|my_adventures|my_closet_meat|print}}|
 
+
special=When not logged in, this function returns 0.
<center><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;">
 
'''See Also:''' <br> [[my_closetmeat()]] || [[item_amount()]]</td>
 
</tr></table></center>
 
 
 
[[Category:Item Management | My meat()]]
 
[[Category:Ash Functions | My meat()]]
 

Revision as of 13:04, 1 March 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 Sample

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.