Can eat: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Efilnikufecin
No edit summary
 
imported>Bale
mNo edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[boolean]] can_eat()
{{
#vardefine:name|can_eat}}{{
#vardefine:return_type|boolean}}{{


This function returns <i>true</i> 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}}|


An example:
function1={{Function|
name={{#var:name}}|
aggregate={{#var:aggregate}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}
}}|


<code>
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.|
if(can_eat())  
 
  {
code1={{CodeSample|
   eat(3,$[[item]][hot hi mein]);
title=Code Samples|
  }
description=If the character is able to eat, this example will make them eat 3 hot hi meins.|
</code>
code=
[[Category:Your Character | Can eat()]]
<syntaxhighlight>
[[Category:Ash Functions |Can eat()]]
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.
}}
 
[[Category:Your Character]]

Latest revision as of 21:38, 21 May 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.