First Things First -- a multipurpose pre-combat consult script

Status
Not open for further replies.
Yeah, Bale. I wish you'd stop being so attentive. :)

I'm trying to manage scripts across three accounts, on two machines, one of which runs largely unattended (and so all sorts of havoc is caused when the upgrade notification fires). I like big scripts with configuration options (STASIS = true) vs. lots of small scripts that clutter the directory, require separate versioning, and have separate threads on the board.

But I suppose it comes down to preference.
 
@chown: In the case of wanting to save a bounty for tomorrow, just accept the bounty after you're done with adventuring for the day.

I'm not sure if you understand the scenario that I find problematic. Let's suppose I start a bounty at the Valley, and don't complete it. The next day, as part of my automated adventuring, I use your excellent-in-most-respects First Things First scipt! One of the things that my automated adventuring includes is burning off some remaining Preternatural Greed at the Castle. And what happens? I start trailing Raver Giants, of course! And this makes no sense to me.

You'll notice that there's no way that I can accept yesterday's bounty after adventuring today. And just in case it's not obvious, I'm not going to abandon yesterday's bounty either, since I would like to take advantage of some sammich crusts I already collected yesterday. Completing yesterday's bounty before doing today's automated adventures could work. But this is still unnecessarily restrictive.

@Rinn:

I agree that there are still scenarios where one would not get the behavior that one wants from my proposed solution. Personally, I find the behavior in the case that you describe to be completely understandable. Nevertheless, it would be more convenient to users for "olf[m] == true" to continue to mean "try to use olfaction when not on a bounty hunt". After all, it is still possible for us to add olfaction to our CCS before we consult FirstThingsFirst. It's not as easy to prevent the consult script from olfacting. So:

Code:
if (olf[m] && get_property("currentBountyItem") != 0) return page;
if (!olf[m] && !(item_drops(m) contains to_item(get_property("currentBountyItem")))) return page;
 
This version of handle_olfaction should putty bounty monsters, and if you're out of putty, olfact them. Note that you must use a modified version of bounty.ash with this or the monster sheets will never get used. I'll post the mod over in the bounty.ash thread.

Code:
string handle_olfaction(monster m, string page) {
   if (should_autofact()) print("(Auto-olfacting would go here...)","gray");
   if (have_effect($effect[on the trail]) == 0 && olf contains m) {
      if ((!olf[m] && get_property("currentBountyItem") == "0") ||
          ( olf[m] && get_property("currentBountyItem") != "0")) return page;
      if ((!olf[m] && get_property("currentBountyItem") != "0") &&
      ((item_amount($item[spooky putty sheet]) != 0 || 
        to_int(get_property("spookyPuttyCopiesMade")) < 5)))
    return act(throw_item($item[spooky putty sheet]));
      else
    return try_skill(page,$skill[transcendent olfaction]);
   }
   return page;
}
 
3.0 Updates!

This update is pretty massive. And also, pretty massively untested. I have done a bit of testing and the new Olfaction thing is working great, but the new putty thing has not yet been tested much.

Note the changes to Olfaction described in the ALSO NOTE in the first post. Olfacting specified non-bounty monsters will now happen outside of the bounty location. In the bounty location, only the bounty monster will be olfacted. This should take care of the situation mentioned by chown.

The major new feature is that puttying has been added for bounty monsters. It is calculated semi-independently of olfacting, so you may end up both puttying and olfacting a bounty monster, although if you will complete the bounty using only putty monsters, it shouldn't Olfact.

For puttying to work correctly, you will need something in your betweenBattleScript to fight putty monsters. I recommend using my just-released Best Between Battle Script Ever. I am still a bit unsure whether this works perfectly and would enjoy hearing your feedback.
 
Last edited:
Hmm maybe I am missing something or I am really stupid :)
I downloaded FirstThingsFirst.ash and Zlib.ash
But when I try to run FirstThingsFirst.ash

It shows:

1. Please input a value for int initround
2. Please input a value for a monster foe

What should I iput or better where I could find some basic quidelines to using scripts ?
Thanks in advance
 
you just got to follow the directions
you need to edit your CCS to include this:

[ default ]
1: consult FirstThingsFirst.ash
2: attack

Then make sure you are running "custom combat script"

The script will then be called by mafia when you enter battle against any monster foe. Mafia will enter the round variable (what round you are fighting) and foe (monster type) automatically when done this way. It will execute the FTF script then do the next step, which is attack.

Kain has a basic combat script that you may be interested in to handle combat called "casualcombat.ash"

If you download it and want to run them both you would need something like this:

[ default ]
1: consult FirstThingsFirst.ash
2: consult casualcombat.ash

hope that helped.
 
I'm getting a strange readout, this has only changed since I upgraded to FTF3:

[14762] Haunted Gallery
Encounter: cubist bull
Strategy: E:\KoL Mafia\ccs\default.ccs [default]
Round 0: cashflake loses initiative!
back 40
other back 40
Multiple matches against 0.
back 40
other back 40
Multiple matches against 0.
back 40
other back 40
Multiple matches against 40.
back 40
other back 40
Multiple matches against 0.
back 40
other back 40
Multiple matches against 4.
back 40
other back 40
Multiple matches against 0.
back 40
other back 40
Multiple matches against 40.
back 40
other back 40
Multiple matches against 0.
goat party
goatlet
Multiple matches against goat.
back 40
other back 40
Multiple matches against 0.
back 40
other back 40
Multiple matches against 40.
back 40
other back 40
Multiple matches against 0.
haunted wine cellar (automatic)
haunted wine cellar (northeast)
haunted wine cellar (northwest)
haunted wine cellar (southeast)
haunted wine cellar (southwest)
Multiple matches against Haunted Wine Cellar.
back 40
other back 40
Multiple matches against 0.
back 40
other back 40
Multiple matches against 0.
back 40
other back 40
Multiple matches against 0.
Round 1: cashflake attacks!
You gain 370 Meat
You acquire an item: non-Euclidean hoof
You gain 22 Strongness
You gain 39 Enchantedness
You gain 28 Smarm

It then stops adventuring. It happens anywhere I go, stops FTF from doing what its supposed to do, and only happens when I call First Things First. Would like to see this fixed, I loved the script until I upgraded!
 
@Anne: looks like you have a bad bounty.txt file, which is probably caused by running an older version of bounty.ash. See the discussion on the last page or two of the bounty.ash thread, where people were getting similar errors. I copied and pasted my entire bounty.txt there in case someone needed it, if the prescribed methods don't work you could just overwrite your bounty.txt with that.
 
Will try that this afternoon, thanks for the advice. Could indeed be an old bounty.txt - hadn't realized your script used it.
 
Something is up in either SS or FTF.

I change my CCS inside of Mafia and the changes are not picked up.

I changed and saved my CCS to be this:

[default]
consult SmartStasis.ash
skill moxi

This is what my next combat came out being:
[611] Fantasy Airship
Encounter: Irritating Series of Random Encounters
Strategy: E:\Games\KoL\Current Builds\JoeMomma\ccs\impromptu.ccs [default]Yep - this is the correct CCS
Round 0: JoeMomma loses initiative!
Round 1: JoeMomma casts DISCO DANCE OF DOOM!
Round 1: ZOMFG! NPZR! does a pelvic thrust at your opponent. A piece of toast ricochets off their head, momentarily stunning them (and/or driving them insa-a-a-a-ane.)
Round 1: irritating series of random encounters takes 15 damage.
You acquire an item: toast
Round 2: JoeMomma casts DISCO DANCE II: ELECTRIC BOOGALOO!
Round 2: irritating series of random encounters takes 16 damage.
You acquire an effect: Disco Nirvana (duration: 1 Adventure)
Round 3: JoeMomma uses the turtle totem!
Round 3: ZOMFG! NPZR! shambles up to your opponent with a "Graaaaagh," and bites them on the head. They seem a little dazed by the experience.
Round 3: irritating series of random encounters takes 1 damage.
Round 4: JoeMomma uses the turtle totem!
Round 4: ZOMFG! NPZR! bleeps, "MEDICAL SYSTEMS ACTIVATED," and fires a dart into your neck. You suddenly feel much better.
Round 4: irritating series of random encounters takes 1 damage.
You gain 65 hit points
You gain 65 Mojo Points
Round 5: JoeMomma uses the turtle totem!
Round 5: You hear a faint howling of wind, and ZOMFG! NPZR! suddenly appears out of the shadows, holding your opponent's meat pouch.
Round 5: irritating series of random encounters takes 1 damage.
You gain 187 Meat
Round 6: JoeMomma uses the turtle totem!
Round 6: irritating series of random encounters takes 1 damage.
Round 7: JoeMomma uses the turtle totem!
Round 7: irritating series of random encounters takes 1 damage.
Round 8: JoeMomma uses the turtle totem!
Round 8: irritating series of random encounters takes 1 damage.
Round 9: JoeMomma uses the turtle totem!
Round 9: ZOMFG! NPZR! does a pelvic thrust at your opponent. A piece of toast ricochets off their head, momentarily stunning them (and/or driving them insa-a-a-a-ane.)
Round 9: irritating series of random encounters takes 1 damage.
You acquire an item: toast
Round 10: JoeMomma uses the turtle totem!
Round 10: ZOMFG! NPZR! bleeps, "MEDICAL SYSTEMS ACTIVATED," and fires a dart into your neck. You suddenly feel much better.
Round 10: irritating series of random encounters takes 1 damage.
You gain 66 hit points
You gain 66 Mojo Points
Round 11: JoeMomma uses the turtle totem!
Round 11: irritating series of random encounters takes 1 damage.
Round 12: JoeMomma uses the turtle totem!
Round 12: ZOMFG! NPZR! bleeps, "MEDICAL SYSTEMS ACTIVATED," and fires a dart into your neck. You suddenly feel much better.
Round 12: irritating series of random encounters takes 1 damage.
You gain 66 hit points
You gain 66 Mojo Points
Round 13: JoeMomma uses the turtle totem!
Round 13: ZOMFG! NPZR! shouts "Yarrrr!" and battens your opponent's hatches for them. Violently. For 58 damage.
Round 13: irritating series of random encounters takes 59 damage.
Round 14: JoeMomma uses the turtle totem!
Round 14: irritating series of random encounters takes 1 damage.
Round 15: JoeMomma uses the turtle totem!
Round 15: ZOMFG! NPZR! shouts "Yarrrr!" and battens your opponent's hatches for them. Violently. For 58 damage.
Round 15: You gain 204 Meat
Round 15: irritating series of random encounters takes 59 damage.
You gain 204 Meat
You acquire an item: cocoa eggshell fragment
You gain 6 Strongness
You gain 7 Enchantedness
You gain 18 Smarm
You gain a Moxie point!
 
Looks like it's working as designed and advertised. SmartStasis is seeing your NPZR and doing a disco combo and then stasising for meat and healing/MP.
 
Why isn't it running the combos I defined though?

I don't understand that. I understand the stasis aspects vs using FTF.

Or am I missing something in the configuration of SS to define, yes I would like to combo to enable the Disco Bleeding combo? And yes, I know the Bleeding combo is Boog-Doom-Stab. :-)

Basically, I thought the sequence was:
Do stasis stuff based on the rules / logic
Do the DB combos as listed
 
Last edited:
I probably should actually post this in SS, rather than here, but the basic logic I was thinking of was like this for my NPZR:

[default]
consult FirstThingsFirst.ash
item turtle totem
item turtle totem
item turtle totem
item turtle totem
item turtle totem
item turtle totem
item turtle totem
item turtle totem
item turtle totem
item turtle totem
item turtle totem
skill boog
skill doom
skill stab

Yeah - kinda nasty.
 
Basically, I thought the sequence was:
Do stasis stuff based on the rules / logic
Do the DB combos as listed

This is exactly what is happening. When you type "consult scriptname" as an action in a CCS, mafia hands the combat to the script. When the script finishes doing whatever it does, mafia resumes your CCS. In the example you posted, SS never gave your combat back to mafia because it was continuing to stasis (you probably needed MP), and your NPZR's attacks killed the monster before SS was done stasising.

If you want to do Disco combos before stasising, either 1) put them first, before SS, 2) edit the script yourself to make it cast those combos, or 3) always adventure with completely full MP.

A quick question:
How do I change the script that it always uses the putty sheet on the goth giant?

Change this line (146)

Code:
   if (should_putty ||

to this:

Code:
   if (should_putty || m == $monster[goth giant] ||
 
Last edited:
Status
Not open for further replies.
Back
Top