In hardcore: Difference between revisions

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


This function returns ''true'' if the logged-in character is currently subject to Hardcore restrictions.  If not subject to such restrictions this function returns ''false''.
{{FunctionPage|
name={{#var:name}}|
function_category=Your Character|


The following example attempts to pull items from storage if the character is in Ronin:
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 currently subject to Hardcore restrictions.  If not subject to such restrictions this function returns false.|
  if (![[can_interact()]] && ![[in_hardcore()]] && [[storage_amount()|storage_amount]]($[[item]][not-a-pipe]) > 0)
    [[take_storage()|take_storage]](1,$[[item]][not-a-pipe]);
</code>
[[Category:Your Character | In hardcore()]]
[[Category:Ash Functions |In hardcore()]]


When not logged in, this function returns ''false''.
code1={{CodeSample|
title=Code Samples|
description=The following example attempts to pull items from storage if the character is in Ronin.|
code=
<syntaxhighlight>
if(!can_interact() && !in_hardcore() && storage_amount($item[not-a-pipe]) > 0) {
  take_storage(1 , $item[not-a-pipe]);
}
</syntaxhighlight>
}}|
 
see_also={{SeeAlso|can_interact|storage_amount|take_storage}}|
special=When not logged in, this function returns false.
}}

Revision as of 14:21, 1 March 2010



Function Syntax

boolean in_hardcore()

This function returns true if the logged-in character is currently subject to Hardcore restrictions. If not subject to such restrictions this function returns false.

Code Samples

The following example attempts to pull items from storage if the character is in Ronin.

if(!can_interact() && !in_hardcore() && storage_amount($item[not-a-pipe]) > 0) {
   take_storage(1 , $item[not-a-pipe]);
}

See Also

can_interact() | storage_amount() | take_storage()

Special

When not logged in, this function returns false.