Guardians: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
Created page with '{{ #vardefine:name|guardians}}{{ #vardefine:return_type|item}}{{ FunctionPage| name={{#var:name}}| function_category=Adventuring| function1={{Function| name={{#var:name}}| aggr…'
 
imported>Bale
added code sample and RFI
Line 16: Line 16:
function_description=Attempts to pass the six levels of the NS Tower. If successful, or if you don't currently have access to the tower, this function returns $item[none]. Otherwise, if you are prevented from going further because you lack the required item, it returns that item.|
function_description=Attempts to pass the six levels of the NS Tower. If successful, or if you don't currently have access to the tower, this function returns $item[none]. Otherwise, if you are prevented from going further because you lack the required item, it returns that item.|


needscode=yes|
code1={{CodeSample|
title=Code Sample|
description=Defeat the six tower monsters at the NS lair.|
code=
<syntaxhighlight>
item missing = guardians();
if(missing == $item[none])
  print("You defeated the six tower monsters.");
else print("You need a "+ missing +" to continue.");
</syntaxhighlight>
}}|


cli_equiv=The CLI command "guardians" works similarly.|
cli_equiv=The CLI command "guardians" works similarly.|
}}
}}
{{RFI|What happens if you don't have enough adventures to complete the tower?}}

Revision as of 20:10, 10 March 2010

Function Syntax

item guardians()

Attempts to pass the six levels of the NS Tower. If successful, or if you don't currently have access to the tower, this function returns $item[none]. Otherwise, if you are prevented from going further because you lack the required item, it returns that item.

Code Sample

Defeat the six tower monsters at the NS lair.

item missing = guardians();
if(missing == $item[none])
   print("You defeated the six tower monsters.");
else print("You need a "+ missing +" to continue.");

CLI Equivalent

The CLI command "guardians" works similarly.


Attention KoLmafia Experts!

We need your help; some details of this function's operation are unknown or unclear.

The following specific question has been raised:

  • What happens if you don't have enough adventures to complete the tower?