Difference between revisions of "Can drink"

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
m (moved Can drink() to Can drink)
imported>Grotfang
Line 1: Line 1:
[[boolean]] [[can_drink()]]
+
{{#vardefine:name|can_drink}}
 +
{{#vardefine:return_type|boolean}}
  
This function returns ''true'' if the logged-in character is not subject to the dietary restrictions of a Teetotaler 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_drink()]])
+
name={{#var:name}}|
    [[drink()|drink]](3,$[[item]][bottle of gin]);
+
aggregate={{#var:aggregate}}|
</code>
+
return_type={{#var:return_type}}|
[[Category:Your Character | Can drink()]]
+
return_also={{#var:return_also}}
[[Category:Ash Functions |Can drink()]]
+
}}|
  
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 Teetotaler 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 drink, this code will make them drink 3 bottles of gin.|
 +
code=
 +
<syntaxhighlight>
 +
if(can_drink()) {
 +
  drink(3 , $item[bottle of gin]);
 +
}
 +
</syntaxhighlight>
 +
}}|
 +
 
 +
see_also={{SeeAlso|can_eat|drink}}|
 +
special=When not logged in, this function returns true.
 +
}}

Revision as of 14:14, 1 March 2010



Function Syntax

boolean can_drink()

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

Code Samples

If the character is able to drink, this code will make them drink 3 bottles of gin.

if(can_drink()) {
   drink(3 , $item[bottle of gin]);
}

See Also

can_eat() | drink()

Special

When not logged in, this function returns true.