FightOptimizer.ash

izchak

Member
Yeah, something seems to have changed with custom combat scripts. Specifically, it executes the script, but it doesn't enter the void main(string, string, string) function.
So, effectively, custom combat scripts don't work. Does anyone have any idea why custom combat scripts have changed? Is it a bug, or is there a new way we're supposed to use combat scripts?
I found this out by putting print statements everywhere in a custom combat script. It executes it from start to finish, without ever entering the void main() function...
 

Veracity

Developer
Staff member
Well, let's see.

- I turned off auto-attack in my account settings.
- I set up Custom Combat:

[ default ]
1: consult consult.ash

- I installed consult.ash:

Code:
void main( string r, string encounter, string text )
{
        int round = r.to_int();
        print( "Round = " + round + " Encounter = " + encounter );
        if ( r == 1 )
                steal();
        else
                attack();
}

- I told KoLmafia to go to the Castle:

Visit to Beanstalk: Giant's Castle in progress...
Encounter: Goth Giant Strategy: custom combat script
Round 0: Brianna wins initiative!
Round = 1 Encounter = goth giant
Round 1: Brianna tries to steal an item!
You acquire an item: thin black candle
Round = 2 Encounter = goth giant
Round 2: Brianna attacks!
You gain 429 Meat
You gain 8 Strengthliness
You gain 9 Enchantedness
You gain 19 Chutzpah

I don't see a problem.
 

izchak

Member
Weird. I just checked again, and it does work, just as it should. Mysterious!
At the time of posting my previous post, I had inserted print statements all over the FightOptimizer.ash script, including the start, middle, just after void main(), and the final line. The print statement following void main() didnt print, but the rest did. Then mafia just hung until I typed 'abort'. Crazy!
I also tried a few of my own custom combat scripts, and a few others. I didn't note which build I was using at the time, which might have something to do with it.
Maybe I'm just going crazy...

Well, whatever the reason, I'm glad it was fixed/works now.

Thanks for pointing out that it works just fine, and/or that it never was broken (and I'm just going crazy), Veracity!
 

ironsting

Member
First thank you for writing a great script.

When using a ranged weapon FO will sometimes try and LTS or TS.

Thanks again.

Edit: Reread the whole thread and found the answer. If ignoring LTS and TS are still the only options then disregard this post.
 

Mercantilia

New member
Right, just a little little bug (when skimming):

590 string[item] outfit_pieces;
591 outfit_pieces[$item[bugbear beanie]] = "bugbear costume, 0.5";
592 outfit_pieces[$item[bugbear bungguard]] = "bugbear bungguard, 0.5";
593 outfit_pieces[$item[filthy knitted dread sack]] = "filthy hippy disguise, 0.5";

line 592 should be:

592 outfit_pieces[$item[bugbear bungguard]] = "bugbear costume, 0.5";

That's all :)
 

dornbeast

New member
[quote author=GhettoTrucker link=topic=983.msg5973#msg5973 date=1193422100]
Is the script broken? ???
[/quote]

It's out of date, certainly. As an incomplete list: it needs at least one "+ to damage" item added, it needs Flavour's +10 to damage added in, and the spell cap calculations are off. While the first two items are trivial, fixing the spell cap calculations isn't.
 

dj_d

Member
What an awesome script! I haven't updated any calculations etc, but I unbroke it by fixing some changes introduced during Pastamancer Appreciation Day, among other things. This version appears to work fine although I haven't tested it extensively. It's slow as bananas on my machine, though.
 

Attachments

  • FightOptimizer.ash
    122.9 KB · Views: 45

therealtahu

New member
I didn't expect someone else to be working on this script as well. I've unbroken it, added most of the new shields, did the pastamancer fixes and changed crossbow fever to disco fever and updated the formula for that. Sadly, the sticker tome is not supported. It gets pretty confusing when you think about how the sword/crossbow works in hardcore and out of hardcore. That's not even taking into effect the stickers. I've also added some items from the database, but this list is far from complete. There seems to be some newer things that affect a spell only if the spell is of a certain element. That kind of gets confusing. I'm thinking about splitting the script into two parts, a modifier script and the actual working script.
 

Attachments

  • FightOptimizer.ash
    129.8 KB · Views: 53

dj_d

Member
Cool! Sounds like you did a lot more than I. Look forward to trying your version (and hoping you built in haiku katana support, which was my next todo :) )
 

dj_d

Member
Any progress updating this? I can't figure out how to add haiku katana support so I'm eager to see what others have done...
 

therealtahu

New member
I was fixing some old broken formulas. The hit chance for thrust smack and LTS were under-predicting the hit chances. The damage for LTS is still a bit low, I'm looking into the formulas for that.

I wish I had a haiku katana to test with. I can add basic support such as adding the skills and what not, but I'll have to see how I can set a limit to how many times you can use a haiku skill. I read that there were a ton of conditions such as how many swords you have equipped or something.

Another thing that I'm adding is hobo skill support. (Though they DO cost a ton of MP to cast and probably won't be picked often. I'll leave the equipment effects unfinished for now...

Right now I'm dealing with university applications. I'll add and upload my basic katana support attempt later tonight. I can't test the skills but I hope you could tell me if something is wrong.
 

dj_d

Member
Happy to test it for you. They're also pretty worth owning, though, if you do softcore runs, and you can always sell it for as much or more than you paid for it... I was lucky enough to stumble on a 17-ball a few months ago, and summer siesta + 17-ball sure makes the early combats go fast!
 

therealtahu

New member
I think I have the Winter's Bite Technique and Summer Siesta working, but it isn't integrated into the script properly. I also haven't taken into account the +50% weapon damage that comes along with the katana. But the script doesn't crash (as far as I'm aware).

It's also not compatible with the new current crimbo monsters.
 

Attachments

  • FightOptimizer.ash
    136.7 KB · Views: 84

ch33se

New member
I'm getting an error when loading the script:
Bad skill value: "Minor Ray of Something" (FightOptimizer.ash, line 102)
What to do?
 

therealtahu

New member
You're using one of the outdated versions of the script. The latest ones are near the end of the thread.

I've been busy lately so I haven't been able to add anything new. However, I'm working on trimming down the script since there have been changes to KolMafia that added modifiers. This would virtually eliminate the need to update for new equipment in KOL.
 

Braska

Member
I notice that the Ash file is receiving updates, but not the data files, so will the original data files still work with new versions of the ash script? (Not really sure how that all works)
 
Top