My turncount: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
m more links
imported>Bale
see also total_turns_played
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[int]] [[my_turncount()]]
{{
#vardefine:name|my_turncount}}{{
#vardefine:return_type|int}}{{


This function returns the total number of adventures used thus far by the logged-in character during the current ascension as an [[int]].  With the introduction of [[can_interact()]], the use of this function to determine whether a softcore character is still in Ronin is no longer required, but it can still be used for logging:
FunctionPage|
name={{#var:name}}|


<code>
function1={{Function|
[[int]]<nowiki>[</nowiki>[[string]]<nowiki>]</nowiki> accomplishments;
name={{#var:name}}|
aggregate={{#var:aggregate}}|
if ([[adventure()|adventure]](1,$[[location]][The Boss Bat's Lair]) {
return_type={{#var:return_type}}|
  accomplishments["Defeated Boss Bat"] = [[my_turncount()]];
return_also={{#var:return_also}}|
}
}}|
</code>
[[Category:Your Character | My turncount()]]
[[Category:Ash Functions |My turncount()]]


When not logged in, this function returns 0.
function_description=This function returns the total number of adventures used thus far by the logged-in character during the current ascension.|
 
code1={{CodeSample|
title=Code Sample|
description=|
code=
<syntaxhighlight>
// mocks you if you've spent too many turns this ascension
if (my_turncount() > 2000) {
  print("Shouldn't you ascend soon?");
}
</syntaxhighlight>
}}|
 
see_also={{SeeAlso|my_daycount|can_interact|total_turns_played}}|
special=When not logged in, this function returns 0.
}}
 
[[Category:Your Character]]

Latest revision as of 07:09, 4 November 2014

Function Syntax

int my_turncount()

This function returns the total number of adventures used thus far by the logged-in character during the current ascension.

Code Sample

// mocks you if you've spent too many turns this ascension
if (my_turncount() > 2000) {
   print("Shouldn't you ascend soon?");
}

See Also

my_daycount() | can_interact() | total_turns_played()

Special

When not logged in, this function returns 0.