Get ccs action: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
Created page with '{{RFI}}'
 
imported>Bale
No edit summary
Line 1: Line 1:
{{RFI}}
{{#vardefine:name|get_ccs_action}}
{{#vardefine:return_type|string}}
 
{{FunctionPage|
name={{#var:name}}|
function_category=Combat|
 
function1={{Function|
name={{#var:name}}|
aggregate={{#var:aggregate}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
parameter1={{Param|int|round}}|
p1desc={{pspan|round}} is the current round of combat|
}}|
 
function_description=This function will return the [[Custom Combat Script|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.|
 
code1={{CodeSample|
title=Code Sample|
description=This incredibly basic combat filter will simply do exactly what the CCS instructs.|
code=
<syntaxhighlight>
string run_combat(int round, string opp, string text) {
  return get_ccs_action(round);
}
</syntaxhighlight>}}|
 
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.|
code=
<syntaxhighlight>
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();
  }
}
</syntaxhighlight>}}|
 
see_also={{SeeAlso|adventure|adv1}}|
}}

Revision as of 21:34, 3 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()