Difference between revisions of "In hardcore"

From Kolmafia
Jump to navigation Jump to search
imported>Degrassi
m (Clean up example - code box was ending before the code did.)
imported>Zarqon
(better example, wiki formatting, logged-out info)
Line 1: Line 1:
[[boolean]] [[In_hardcore()]]
+
[[boolean]] [[in_hardcore()]]
  
This function returns <i>true</i> if the logged-in character is currently subject to the restrictions of a hardcore ascension. If not subject to such restrictions this function returns false.
+
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''.
 +
 
 +
The following example attempts to pull items from storage if the character is in Ronin:
  
 
<code>
 
<code>
if(in_hardcore())  
+
  if (![[can_interact()]] && ![[in_hardcore()]] && [[storage_amount()|storage_amount]]($[[item]][not-a-pipe]))  
  {
+
    [[take_storage()|take_storage]](3,$[[item]][not-a-pipe]);
  buy(3,$[[item]][hot hi mein]);
 
  }
 
 
</code>
 
</code>
 
 
[[Category:Your Character | In hardcore()]]
 
[[Category:Your Character | In hardcore()]]
 
[[Category:Ash Functions |In hardcore()]]
 
[[Category:Ash Functions |In hardcore()]]
 +
 +
When not logged in, this function returns ''false''.

Revision as of 07:22, 29 January 2009

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.

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])) 
   take_storage(3,$item[not-a-pipe]);

When not logged in, this function returns false.