Manaburning in the Castle

Egs

New member
Okay, so while I NPZR farm the Castle, I tend to generate a lot of MP on the side.
I'd like to use it for Candy Hearts, but the script I wrote doesn't quite work as wished.

If I call it KoLmafia returns
"Expected ), found * (crude.ash, line 5)"
I'd prefer using a simple approach for this, so I thought I'd ask before doing any potentially superfluous work. Is there any easy way to instruct KoLmafia to maxcast in ASH scripts? In CLI the * works nicely but as noted, not so in ASH.

(In case anyone is going to ask why I'm doing this in ASH: based on examining what flow control CLI has, I didn't find any way of doing the same without having duplicate "adventure 1 castle; cast * hearts" as many times as how many adventures I want to spend.)
Here's the little thingy I'm working on:
 

Attachments

  • crude.ash
    163 bytes · Views: 52

izchak

Member
try cli_execute("cast * candy");
Yep, the simple approach. cli_execute is surprisingly useful in ASH, the CLI has lots of useful features that way.

EDIT: alternatively, you can do it the complicated way, looping with ASH. I wrote this back when candy hearts were new, and you couldn't just do "cast * candy"...

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
[quote author=izchak link=topic=1199.msg5653#msg5653 date=1188473279]
try cli_execute("cast * candy");
Yep, the simple approach. cli_execute is surprisingly useful in ASH, the CLI has lots of useful features that way.
[/quote]
Argh, my memory sucks. >.< This wouldn't be nearly as embarrassingly stupid if I hadn't arrived to that snippet myself earlier. I didn't remember it until you showed up and reminded me of the other topic I started a while back.

[quote author=holatuwol link=topic=1199.msg5656#msg5656 date=1188491695]
http://kolmafia.us/index.php/topic,730.msg3718.html#msg3718

Code:
set betweenBattleScript=cast * candy
adventure * castle
[/quote]
Yeah, that would be the level of simplicity I was thinking of, thanks Hola!

P.S. Overall apologies for my utter n00bness
 
Top