Difference between revisions of "Can eat"

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
(more links, logged out info, consistent formatting)
imported>Bale
m
 
(3 intermediate revisions by 2 users not shown)
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}}|
  
<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.
 +
}}
 +
 
 +
[[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.