In hardcore: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
better example, wiki formatting, logged-out info
imported>That FN Ninja
No edit summary
Line 6: Line 6:


<code>
<code>
   if (![[can_interact()]] && ![[in_hardcore()]] && [[storage_amount()|storage_amount]]($[[item]][not-a-pipe]))  
   if (![[can_interact()]] && ![[in_hardcore()]] && [[storage_amount()|storage_amount]]($[[item]][not-a-pipe]) > 0)  
     [[take_storage()|take_storage]](3,$[[item]][not-a-pipe]);
     [[take_storage()|take_storage]](1,$[[item]][not-a-pipe]);
</code>
</code>
[[Category:Your Character | In hardcore()]]
[[Category:Your Character | In hardcore()]]

Revision as of 05:16, 23 December 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]) > 0) 
   take_storage(1,$item[not-a-pipe]);

When not logged in, this function returns false.