Can eat: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
m moved Can eat() to Can eat
imported>Grotfang
No edit summary
Line 1: Line 1:
[[boolean]] [[can_eat()]]
{{#vardefine:name|can_eat}}
{{#vardefine:return_type|boolean}}


This function returns ''true'' if the logged-in character is not subject to the dietary restrictions of a Boozetafarian or Oxygenarian path. If the character is subject to those restrictions this function returns ''false''.
{{FunctionPage|
name={{#var:name}}|
function_category=Your Character|


<code>
function1={{Function|
  if ([[can_eat()]])
name={{#var:name}}|
    [[eat()|eat]](3,$[[item]][hot hi mein]);
aggregate={{#var:aggregate}}|
</code>
return_type={{#var:return_type}}|
[[Category:Your Character | Can eat()]]
return_also={{#var:return_also}}
[[Category:Ash Functions |Can eat()]]
}}|


When not logged in, this function returns ''true''.
function_description=This function returns true if the logged-in character is not subject to the dietary restrictions of a Boozetafarian or Oxygenarian path. If the character is subject to those restrictions this function returns false.|
 
code1={{CodeSample|
title=Code Samples|
description=If the character is able to eat, this example will make them eat 3 hot hi meins.|
code=
<syntaxhighlight>
if(can_eat()) {
  eat(3 , $item[hot hi mein]);
}
</syntaxhighlight>
}}|
 
see_also={{SeeAlso|can_drink|eat}}|
special=When not logged in, this function returns true.
}}

Revision as of 14:12, 1 March 2010



Function Syntax

boolean can_eat()

This function returns true if the logged-in character is not subject to the dietary restrictions of a Boozetafarian or Oxygenarian path. If the character is subject to those restrictions this function returns false.

Code Samples

If the character is able to eat, this example will make them eat 3 hot hi meins.

if(can_eat()) {
   eat(3 , $item[hot hi mein]);
}

See Also

can_drink() | eat()

Special

When not logged in, this function returns true.