Difference between pages "User:StDoodle/Person" and "Pulls remaining"

From Kolmafia
< User:StDoodle(Difference between pages)
Jump to navigation Jump to search
imported>StDoodle
m
 
imported>StDoodle
m
 
Line 1: Line 1:
His name is {{{name}}} and he is {{{age}}}{{#if: {{{job|}}}|&nbsp;and for work he does {{{job}}}|&nbsp;but we don't know his occupation.}}
+
{{
 +
#vardefine:name|pulls_remaining}}{{
 +
#vardefine:return_type|int}}{{
 +
 
 +
FunctionPage|
 +
name={{#var:name}}|
 +
function_category=Item Management|
 +
 
 +
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}|
 +
}}|
 +
 
 +
function_description=Returns the number of pulls remaining for the day for characters in-Ronin, or 0 otherwise.|
 +
 
 +
code1={{CodeSample|
 +
title=Code Sample|
 +
description=The following checks to see if you've forgotten to use up your daily pulls.|
 +
code=
 +
<syntaxhighlight>
 +
if (pulls_remaining() > 0) {
 +
  print("You still have " + pulls_remaining() + " pulls you can make today.");
 +
} else {
 +
  print("You're all set on daily pulls.");
 +
}
 +
</syntaxhighlight>}}|
 +
special=Returns 0 when not logged in.
 +
}}

Revision as of 20:27, 8 March 2010

Function Syntax

int pulls_remaining()

Returns the number of pulls remaining for the day for characters in-Ronin, or 0 otherwise.

Code Sample

The following checks to see if you've forgotten to use up your daily pulls.

if (pulls_remaining() > 0) {
   print("You still have " + pulls_remaining() + " pulls you can make today.");
} else {
   print("You're all set on daily pulls.");
}

Special

Returns 0 when not logged in.