Get ccs action: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
m moved Get css action to Get ccs action: stupid mispeeling
imported>Heeheehee
m Format-fixing.
Line 26: Line 26:
   return get_ccs_action(round);
   return get_ccs_action(round);
}
}
</syntaxhighlight>}}|
</syntaxhighlight>}}
 
{{CodeSample|
code2={{CodeSample|
description=This is a function designed for use in a combat consult script that has parameters contained in a note field of the CCS.|
description=This is a function designed for use in a combat consult script that has parameters contained in a note field of the CCS.|
code=
code=

Revision as of 13:54, 27 March 2010

Function Syntax

string get_ccs_action(int round )

  • round is the current round of combat

This function will return the CCS command for a given round in the current combat. This will use the section of the CCS for the monster that is currently being fought. See adventure() for more details.

Code Sample

This incredibly basic combat filter will simply do exactly what the CCS instructs.

string run_combat(int round, string opp, string text) {
   return get_ccs_action(round);
}

This is a function designed for use in a combat consult script that has parameters contained in a note field of the CCS.

string get_parameter() {
   for i from 0 upto 30 {
      ccs_line =  get_ccs_action(i).to_lower_case();
      if(ccs_line.substring(0, 5) == "note ")
         return get_ccs_action(i).to_lower_case();
   }
}

See Also

adventure() | adv1()


Attention KoLmafia Experts!

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

The following specific questions have been raised:

  • I've seen references to the note field of a CCS before, but don't understand how it needs to be formatted:
  • Is it included in each monster / location spec?
  • Is it off on its own somewhere in the CCS?
  • Does it need to have each line prefixed with "note:" or something?