Kasekopf / looprobot

Apache License 2.0
1 stars 9 forks source link

Combat macro is not cleared when script ends with an exception #18

Open ianknowles opened 2 months ago

ianknowles commented 2 months ago

This can often result in unintended banishes or runs if not manually cleared.

Kasekopf commented 2 months ago

What do you mean by cleared? In mafia or in KoL?

ianknowles commented 2 months ago

There might be more conditions to this or it might be on failure only. Today when I checked after a completed run the combat macro was disabled and the ccs was set to my default. There have been many times when its not and its ended up autokilling or banishing something I found after the loop, will have to take a better look next time it happens. Its usually the combat macro set to something instead of disabled.

ianknowles commented 1 month ago
> looprobot

Running looprobot version [765a14b] in KoLmafia r28032
hpAutoRecoveryTarget => 0.0
Preference hpAutoRecoveryTarget changed from 1.0 to 0.0
mpAutoRecoveryTarget => 0.0
Preference mpAutoRecoveryTarget changed from 0.65 to 0.0
CCS set to grimoire_macro
choiceAdventureScript => looprobot_choice.ash
Preference choiceAdventureScript changed from to looprobot_choice.ash
mpAutoRecoveryItems => phonics down;knob goblin superseltzer;psychokinetic energy blob;mountain stream soda;magical mystery juice;knob goblin seltzer;doc galaktik's invigorating tonic;cherry cloaca cola;soda water;black cherry soda
Preference mpAutoRecoveryItems changed from phonics down;knob goblin superseltzer;psychokinetic energy blob;mountain stream soda;magical mystery juice;knob goblin seltzer;doc galaktik's invigorating tonic;cherry cloaca cola;soda water to phonics down;knob goblin superseltzer;psychokinetic energy blob;mountain stream soda;magical mystery juice;knob goblin seltzer;doc galaktik's invigorating tonic;cherry cloaca cola;soda water;black cherry soda
choiceAdventure1340 => 3
Preference choiceAdventure1340 changed from 1 to 3

Executing Tower/Post-NS Chronolith [Use cosmic bowling ball]
Holding carnivorous potted plant...
Equipment changed.
Putting on lucky gold ring...
Equipment changed.
Preference lastEncounter changed from the Nautomatic Sorceress to Adjust your Parka
Encounter: Adjust your Parka
Preference parkaMode changed from ghostasaurus to kachungasaur
Your parka is now set to kachungasaur mode.
hpAutoRecoveryItems => scroll of drastic healing;cannelloni cocoon;tongue of the walrus;lasagna bandages;doc galaktik's homeopathic elixir;relaxing hot tub
Preference hpAutoRecoveryItems changed from scroll of drastic healing;cannelloni cocoon;tongue of the walrus;lasagna bandages;doc galaktik's homeopathic elixir to scroll of drastic healing;cannelloni cocoon;tongue of the walrus;lasagna bandages;doc galaktik's homeopathic elixir;relaxing hot tub
CCS set to grimoire_macro
choiceAdventure1468 => 1
Preference choiceAdventure1468 changed from 2 to 1
choiceAdventure1472 => 2
Preference choiceAdventure1472 changed from 1 to 2
choiceAdventure1473 => 2
Preference choiceAdventure1473 changed from 1 to 2
stillsuitFamiliar => Gelatinous Cubeling
Preference stillsuitFamiliar changed from to Gelatinous Cubeling

[485] Collecting energy
You gain 17 Energy
Preference _energyCollected changed from 5 to 6
Preference _concoctionDatabaseRefreshes changed from 1197 to 1198

Activating the Chronolith
You gain 10 Adventures
Preference _chronolithNextCost changed from 106 to 108
Preference _chronolithActivations changed from 43 to 44
Preference _concoctionDatabaseRefreshes changed from 1198 to 1199
Tower/Post-NS Chronolith completed!
hpAutoRecoveryTarget => 1
Preference hpAutoRecoveryTarget changed from 0.0 to 1
mpAutoRecoveryTarget => 0.65
Preference mpAutoRecoveryTarget changed from 0.0 to 0.65
choiceAdventureScript =>
Preference choiceAdventureScript changed from looprobot_choice.ash to
CCS set to grimoire_macro
mpAutoRecoveryItems => phonics down;knob goblin superseltzer;psychokinetic energy blob;mountain stream soda;magical mystery juice;knob goblin seltzer;doc galaktik's invigorating tonic;cherry cloaca cola;soda water
Preference mpAutoRecoveryItems changed from phonics down;knob goblin superseltzer;psychokinetic energy blob;mountain stream soda;magical mystery juice;knob goblin seltzer;doc galaktik's invigorating tonic;cherry cloaca cola;soda water;black cherry soda to phonics down;knob goblin superseltzer;psychokinetic energy blob;mountain stream soda;magical mystery juice;knob goblin seltzer;doc galaktik's invigorating tonic;cherry cloaca cola;soda water
hpAutoRecoveryItems => scroll of drastic healing;cannelloni cocoon;tongue of the walrus;lasagna bandages;doc galaktik's homeopathic elixir
Preference hpAutoRecoveryItems changed from scroll of drastic healing;cannelloni cocoon;tongue of the walrus;lasagna bandages;doc galaktik's homeopathic elixir;relaxing hot tub to scroll of drastic healing;cannelloni cocoon;tongue of the walrus;lasagna bandages;doc galaktik's homeopathic elixir
choiceAdventure1340 => 1
Preference choiceAdventure1340 changed from 3 to 1
choiceAdventure1468 => 2
Preference choiceAdventure1468 changed from 1 to 2
choiceAdventure1472 => 1
Preference choiceAdventure1472 changed from 2 to 1
choiceAdventure1473 => 1
Preference choiceAdventure1473 changed from 2 to 1
stillsuitFamiliar =>
Preference stillsuitFamiliar changed from Gelatinous Cubeling to
You Robot complete!
Adventures used: 485
Adventures remaining: 12
Time: 1 hours, 46 minutes, 58 seconds since first run today started
Pulls used: 18 (0 remaining)
ianknowles commented 1 month ago

At the end of the main run, and re-rerunning, the ccs in mafia and combat macro in kol are set to grimoire_macro.

It was the previous aborts I encountered in the run, with the Cranny boss, and lack of adventures for Ed. When the cranny abort occurred the macro wasn't cleared when it errored, and then rerunning it is now setting this on exit.

Kasekopf commented 1 month ago

I took a look at this and don't see an issue around setting the mafia CCS back. The example you showed seems correct since your CCS was already set to grimoire_macro at the start of the script. Could you share an example where it is wrong?

I could definitely imagine a case where you halt the script by mashing escape and also interrupt the resetting of the CCS, but I'm not sure if there's anything the script can do about that.

On the KoL side, the script was indeed not always clearing the autoattack on a script crash. It should now.

ianknowles commented 1 month ago

grimoire_macro was not set before the first run of looprobot. It was just the same situation as the autoattack, with an exception its not cleared. So the second time you run looprobot grimoire_macro is still set from the crash and is carried forward.

Kasekopf commented 1 month ago

I meant do you have that log of that first run of looprobot where it didn't reset the CCS? Mainly I want to know what kind of error it was. It seems like the normal error path should reset it.