Help with understanding run_combat()

Rax

New member
Hello. I'm looking for some advice on run_combat() please. I'm looking to perform a specific set of actions against e.g. a faxed monster. Here's an extract of where I'm at:

void combattest () {
steal();
use_skill($skill[Sing Along]);
use_skill($skill[Summer Siesta]);
}

void main () {
set_auto_attack(0);
use($item[photocopied monster]);
run_combat("combattest");
}

This doesn't do what I wanted since the CCS I am currently using just kicks in instead. I know it's pretty basic but I'm having trouble understanding why passing "combattest" to run_combat does not override the CCS (so I may be misunderstanding how / if this works). I thought that disabling autoattack would solve the issue, but this doesn't seem to be the case. At the moment I've not put anything in the CCS to point at "combattest" - I'm trying to avoid using CCS. Is this doable, or is the problem arising because I have to use CCS, and haven't yet told it to consult anything?

The main reason I don't want to use CCS is because I don't want to switch manually back and forth. Or do most people just use one CCS that contains everything they would want to do in various conditions? I'm wondering if that would slow Mafia down a lot?

If it's not possible to put the combat actions I want inside the script itself, is it possible to tell run_combat() to use a specific CCS name, instead of whatever I have set at the time? This is what I tried initially, but I couldn't get that to work either.

I've also seen that the consult script example on the kolmafia wiki is set up with (int initround, monster foe, string page), but I'll be honest and say that I'm not sure how to work with this or if and how I need to pass values to the function.

Finally, I have no ideal if "steal();" would actually do anything. I saw it in another script and, well, stole it.

Many thanks.
 

Rax

New member
Ah - after a bit more digging I found this from several years ago. Thanks to ckb.

set_property("battleAction","custom combat script");
set_property("customCombatScript","myccs.ccs");

This means I can just set the CCS I want to use at a specific point in the script (and change back after), so I don't need to bother passing anything to run_combat().
 

ckb

Active member
Ah - after a bit more digging I found this from several years ago. Thanks to ckb.

Yeah for me!
Also - using a photocopied monster (and spooky putty monster, and Rain-Doh box full of monster, and probably some others) will cause Mafia to automatically run the fight for you, so no need to call run_combat().
In fact, I think setting your CCS beforehand may be the only way to set a CSS for using a photocopied monster. run_combat() is often only used in combination with visit_url() if that results in a combat.
 
Top