Maxcasting through scripts

Egs

New member
Does KoLmafia have a CLI or an ASH command for maxcasting?
I've looked around but couldn't find anything on the subject. I could personally use it, since it would be tedious to have the script calculate how many times it can cast the skill in question when KoLmafia already has a function for it.

Implementing the command (if it doesn't exist) would be especially great for Summon Candy Hearts, because of its ever-changing mana cost.
 

izchak

Member
cli_execute("cast * empathy on jick");

And this is what I wrote for blowing MP on candy hearts. I've seen variations on this with MP caps, but I dont use a cap. As long as I have MP, I want to exchange it for candy hearts!

Code:
# this tries to burn MP on summoning candy hearts
void summon_candies() {
	while (  mp_cost($skill[Candy Hearts]) < my_mp() ) {
		print("summoning another candy heart for " + mp_cost($skill[Candy Hearts]) + " mp ...");
		use_skill( 1, $skill[Candy Hearts]);
	}
}
 

Egs

New member
Thanks for the code example, it'll certainly come in handy. It seems a bit bulky though, what would happen if you just used
Code:
cli_execute("cast * Summon Candy Hearts");
?

Edit/update: As far as I can tell, the above snippet works just as well as the manachecked version (if you don't feel the need to see the "summoning another candy heart for X mp" message).
 

izchak

Member
Huh. I originally wrote my summon_candies function when the candy heart skill was still relatively new, and I think that "cast * candy" didn't work then, and I simply never tried it after that.
Well, thank you, whoever added that feature to mafia!
I love it when mafia integrates features that most of us scripters have written scripts to do :)
 
Top