Is this possible for ccs - use fury skill only at maxfury

fronobulax

Developer
Staff member
Yes. You might get more useful answer if you tell us what you tried, what you expected and what you observed.

The line "consult furiouswallop.ash" needs to be in the CCS, probably in the [default} section.

furiouswallop.ash needs to be in the scripts directory. It needs to be a "correct" ash script. I am not confirming that syntax of function names are correct.

I observe that the script will do nothing if fury is not available. I don't remember the subtle points of a CCS but I am pretty sure furiouswallop, as written, will either not finish the fight or will do so with some default action which is probably not what you want.
 

ckb

Minion
Staff member
You ash is missing some things.
the if statement needs the expression inside parenthesis.
You need to understand how equals signs are used: A single equals sign will set the left side expression to the right side, a double equals sign will do a comparison and return a boolean value (true or false).
Ash code statements that execute a command need to end in a semicolon

So your furiouswallop.ash should look like this:
Code:
if (my_fury() == my_maxfury()) {
use_skill($skill[furious wallop]);
}

You can check this without running the whole thing by using the 'verify' command in the CLI:
Code:
> verify furiouswallop.ash
 

NotSoFastKiddo

New member
Ok, so I got the directories right, I didn't run it because I don't have a character free for combat,

I've fixed the "==" comparison

verify command looks very useful! It returned 2 lines of "expected", I think that's right.

So far yes, this script does only two things and doesn't finish the fight, I'm going line by line to making sure the code is correct.

Thank you for your feedback!
 

heeheehee

Developer
Staff member
You probably want to wrap this in a special main function, as in https://wiki.kolmafia.us/index.php/Custom_Combat_Script#Consult_Scripts:

Code:
void main(int initround, monster foe, string page) {
  if (my_fury() == my_maxfury()) {
    use_skill($skill[Furious Wallop]);
  }
}

Further, as fronobulax mentions, note that if your consult script is not capable of completing the combat on its own, then you'll want to tell your CCS to perform `attack` or some other sequence of actions to wrap up the fight after your consult script runs.
 

heeheehee

Developer
Staff member
That said, from staring at Mafia's code, it seems that it'll execute top-level code as you've written, and if it can't find the main function, then it'll silently exit. So you're probably running into the point that frono raised.

(I've also run a few turns and confirmed that your script as written works just fine.)
 

NotSoFastKiddo

New member
You probably want to wrap this in a special main function, as in https://wiki.kolmafia.us/index.php/Custom_Combat_Script#Consult_Scripts:

Code:
void main(int initround, monster foe, string page) {
  if (my_fury() == my_maxfury()) {
    use_skill($skill[Furious Wallop]);
  }
}

Further, as fronobulax mentions, note that if your consult script is not capable of completing the combat on its own, then you'll want to tell your CCS to perform `attack` or some other sequence of actions to wrap up the fight after your consult script runs.
Thank you sir I'll try this one
 
Top