Gameday to int: Difference between revisions
Jump to navigation
Jump to search
imported>Bale fixed range |
imported>Bale m markup fix |
||
(One intermediate revision by the same user not shown) | |||
Line 38: | Line 38: | ||
}} | }} | ||
== Notes == | == Notes == | ||
The value returned prints actual game date, so it is influenced by rollover. | The value returned prints actual game date, so it is influenced by rollover. {{f|today_to_string}} is determined by your computer's own clock. | ||
{{SeeAlso|today_to_string| | {{SeeAlso|today_to_string|gameday_to_string|time_to_string|now_to_string}} | ||
[[Category: | |||
[[Category:Miscellaneous Functions]] |
Latest revision as of 08:56, 27 April 2011
Function Syntax
int gameday_to_int()
Returns the current KoL game date using the in game calendar as an integer from 0 to 95 where "Jarlsuary 1" is 0 and "Dougtember 8" is 95.
Code Samples
This code will tell you how many game days it has been since you last logged into KoL.
int last = get_property("currentLogin").to_int();
if(last == gameday_to_int())
print("You've already logged in today.");
else if((last + 1) % 96 == gameday_to_int())
print("There has been one rollover since your last login.");
else {
int interval;
if(gameday_to_int() > last)
interval = gameday_to_int() - last;
else
interval = 95 - last + gameday_to_int();
print("It has been "+interval +" days since last your login.");
}
set_property("currentLogin", gameday_to_int());
CLI Equivalent
The CLI command "moon" will also print the current game date along with other information.
Notes
The value returned prints actual game date, so it is influenced by rollover. today_to_string()
is determined by your computer's own clock.