My adventures: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Metraxis
m Grammar
imported>Metraxis
m typo
Line 8: Line 8:
   if(use(1,$[[item]][dance card])) {
   if(use(1,$[[item]][dance card])) {
     adventure(3,$[[location]][Haunted Gallery]);
     adventure(3,$[[location]][Haunted Gallery]);
     adventure(3,$[[location]][Haunted Ballroom]);
     adventure(1,$[[location]][Haunted Ballroom]);
   }
   }
  }</code>
  }</code>

Revision as of 07:48, 19 January 2007

int my_adventures()

This function returns the logged-in character's current number of remaining adventures as an int. Use of this function is essential in any kind of goal-seeking loop, lest it run on forever trying to adventure with no way to do so.

An example:

while(my_adventures() >= 4) {
  if(use(1,$item[dance card])) {
    adventure(3,$location[Haunted Gallery]);
    adventure(1,$location[Haunted Ballroom]);
  }
}