In casual: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
Create page, used in_hardcore() as a template
 
m example whitespace
 
Line 1: Line 1:
{{
{{
#vardefine:name|in_casual}}{{
#vardefine:name|in_casual}}{{
#vardefine:return_type|boolean}}{{
#vardefine:return_type|boolean}}{{FunctionPage|
 
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|


Line 20: Line 18:
code=
code=
<syntaxhighlight>
<syntaxhighlight>
if(in_casual() && available_amount($item[smut orc keepsake box]) < 1) {
if (in_casual() && available_amount($item[smut orc keepsake box]) < 1) {
   buy(1 , $item[smut orc keepsake box]);
   buy(1, $item[smut orc keepsake box]);
}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 18:42, 23 June 2022

Function Syntax

boolean in_casual()

This function returns true if the logged-in character is currently in a Casual ascension. In any other path (including Unrestricted) this function returns false.

Code Samples

The following example attempts to buy items from the mall if the character is in a Casual ascension

if (in_casual() && available_amount($item[smut orc keepsake box]) < 1) {
   buy(1, $item[smut orc keepsake box]);
}

See Also

can_interact() | in_hardcore()

Special

When not logged in, this function returns false.