Difference between revisions of "Total free rests"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(add category, seealso and formatting help)
imported>Bale
(Huh. Those lines actually matter?)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{
 
{{
 
#vardefine:name|total_free_rests}}{{
 
#vardefine:name|total_free_rests}}{{
#vardefine:return_type|int}}
+
#vardefine:return_type|int}}{{FunctionPage|
 
 
{{FunctionPage|
 
 
name={{#var:name}}|
 
name={{#var:name}}|
  
Line 14: Line 12:
  
 
function_description=This function will the total number of free rests available to your character. These rests can come from multiple sources, such as skills or familiars.</p>
 
function_description=This function will the total number of free rests available to your character. These rests can come from multiple sources, such as skills or familiars.</p>
<p>This can be compared against the preference ''timesRested'' to see how many free rests you have remaining.|
+
<p>This can be compared against the preference <code> timesRested </code> to see how many free rests you have remaining.|
  
 
code1={{CodeSample|
 
code1={{CodeSample|

Latest revision as of 22:15, 26 November 2014

Function Syntax

int total_free_rests()

This function will the total number of free rests available to your character. These rests can come from multiple sources, such as skills or familiars.

This can be compared against the preference timesRested to see how many free rests you have remaining.

Code Sample

Show how many free rests you have remaining.

int rests_used=get_property("timesRested").to_int();
int rests_left=total_free_rests()-rests_used;
print("You have "+rests_left+" remaining.");

See Also

my_adventures() | have_skill()