Bug - Fixed Clingy rats don't play nice with Tavern Quest

Bale

Minion
Ran into a clingy rat in the Tavern Cellar while using KoLmafia's Tavern Quest (faucet) automation.

After killing the clingy rat, it then moved on to the next square (it believed) and proceeded to fight a rat there. Of course, it didn't really expose that square, it just thought that it did since it was really fighting the same rat all over again.

Then it tried to check the square after that and failed. After that things got a bit haywire until it got to a square that it actually could check which wasn't a square I would have even wanted it to consider.

Finally I aborted the script before it wasted too many turns and finished it manually.
 

Veracity

Developer
Staff member
Could I see your session log for the clingy rat encounter, please?

I expect that the following code in TavernManager.exploreTavern:

Code:
			// Tell TavernRequest to visit the next unexplored square
			TavernManager.overrideSquare = TavernManager.nextUnexploredSquare() - 1;
			RequestThread.postRequest( adventure );
			TavernManager.overrideSquare = -1;
needs to have the "postRequest" in some sort of loop that checks for FightRequest.inMultiFight.

I expect that KoL just redirects to fight.php when we submit a request to cellar.php?action=explore&whichspot=XXX while in a multi-fight, but I'm curious to see how it logs.
 

Bale

Minion
761 is when I encounter the clingy rat
762 is when I encounter another clingy rat even though mafia failed to expose row 1, col 2.
763 is when I encounter the rat yet again even though mafia failed to expose row 1, col 3.
764 is a succession of failed squares until it finds one that it can activate on row, 2 col 4.

Code:
[761] The Typical Tavern Cellar (row 1, col 4)
Encounter: tie-dyed, broke, turgid, clingy bunch of drunken rats
Round 0: bale loses initiative!
> scrollwhendone; skill 7245; sub finito; attack; endsub; call finito; repeat !times 1
Round 1: bale executes a macro!
Round 1: bale casts SUMMON LOVE MOSQUITO!
Round 2: bunch of drunken rats takes 11 damage.
You gain 11 hit points
Round 2: bunch of drunken rats takes 3 damage.
Round 2: bale attacks!
Round 3: bunch of drunken rats takes 410 damage.
Round 3: bunch of drunken rats takes 3 damage.
Round 3: bale wins the fight!
After Battle: Dismal Jasper points ponderously at some extra meat you'd overlooked.
You gain 18 Meat
After Battle: Dismal Jasper snaps his stone fingers to get your attention and points grimly at some items lying by your fallen foes.
You acquire an item: rat whisker
You acquire an item: rat appendix
You acquire an item: rat appendix
You acquire an item: filthy corduroys
You acquire an item: beach glass bead
You gain 26 Muscleboundness
You gain 12 Wizardliness
You gain 7 Smarm

[762] The Typical Tavern Cellar (row 1, col 3)

[762] The Typical Tavern Cellar (row 1, col 3)
Encounter: fratty, generous, clowning, clingy bunch of drunken rats
Round 0: bale loses initiative!
> scrollwhendone; skill 7245; sub finito; attack; endsub; call finito; repeat !times 1
Round 1: bale executes a macro!
Round 1: bale casts SUMMON LOVE MOSQUITO!
Round 2: bunch of drunken rats takes 7 damage.
You gain 7 hit points
Round 2: bunch of drunken rats takes 4 damage.
Round 2: bale attacks!
Round 3: bunch of drunken rats takes 416 damage.
Round 3: bunch of drunken rats takes 3 damage.
Round 3: bale wins the fight!
After Battle: Dismal Jasper tips you a grim wink. You see some extra meat you'd missed before.
You gain 60 Meat
After Battle: With the grinding of stone on stone, Dismal Jasper points at some items you hadn't spotted.
You acquire an item: rat whisker
You acquire an item: rat whisker
You acquire an item: rat whisker
You acquire an item: rat appendix
You acquire an item: rat appendix
You acquire an item: Orcish baseball cap
You acquire an item: deodorant
You acquire an item: homoerotic frat-paddle
You acquire an item: big bass drum
You acquire an item: bloody clown pants
You gain 30 Fortitude
You gain 6 Magicalness
You gain 8 Smarm

[763] The Typical Tavern Cellar (row 1, col 2)

[763] The Typical Tavern Cellar (row 1, col 2)
Encounter: hopping-mad, narcissistic, hot, hilarious bunch of drunken rats
Round 0: bale loses initiative!
You lose 122 hit points
> scrollwhendone; skill 7245; sub finito; attack; endsub; call finito; repeat !times 1
Round 1: bale executes a macro!
Round 1: bale casts SUMMON LOVE MOSQUITO!
Round 2: bunch of drunken rats takes 7 damage.
You gain 7 hit points
Round 2: bunch of drunken rats takes 5 damage.
Round 2: bale attacks!
Round 3: bunch of drunken rats takes 416 damage.
Round 3: bale wins the fight!
After Battle: Salad love firefly flits flirtatiously around your head.
You gain 5 Magicalness
After Battle: Dismal Salad grimly points at some salad lying on the salad.
You gain 63 Meat
After Battle: Dismal Salad salad ponderously, salad one salad, salad then salad salad, in a salad ceremonial salad.
You acquire an item: rat whisker
You acquire an item: rat appendix
You acquire an item: rat appendix
After Battle: Dismal Jasper chisels a bit salad grimstone salad of his body salad fashions it into a rudimentary salad.
You acquire an item: grimstone mask
You gain 21 Strongness
You gain 12 Wizardliness
You gain 10 Cheek
Unknown last adventure: id = '1018' name = 'The Typical Tavern Cellar' URL = 'cellar.php' container = 'tavern.php'

[764] The Typical Tavern Cellar (row 1, col 1)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 2, col 1)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 3, col 1)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 4, col 1)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 5, col 1)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 5, col 2)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 4, col 2)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 5, col 3)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 5, col 4)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 5, col 5)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 3, col 2)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 2, col 2)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 2, col 3)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 3, col 3)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 4, col 3)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 4, col 4)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 3, col 4)
Encounter: The Tavern Cellar

[764] The Typical Tavern Cellar (row 2, col 4)
Encounter: skinny, 1337, hilarious, cloud-based drunk3n r47 k1ng
Round 0: bale loses initiative!
> scrollwhendone; skill 7245; sub finito; attack; endsub; call finito; repeat !times 1
Round 1: bale executes a macro!
Round 1: bale casts SUMMON LOVE MOSQUITO!
Round 2: drunken rat king takes 7 damage.
You gain 7 hit points
Round 2: bale attacks!
Round 3: bale wins the fight!
After Battle: Salad Jasper slowly and painstakingly salad salad opponent's salad salad extra meat.
You gain 123 Meat
After Battle: Salad Jasper snaps salad stone fingers to get salad salad and salad grimly salad salad salad lying salad your salad salad.
You acquire an item: rat whisker
You acquire an item: rat whisker
You acquire an item: rat appendix
You acquire an item: tangle of rat tails
You gain 24 Strengthliness
You gain 10 Wizardliness
You gain 15 Roguishness

[765] The Typical Tavern Cellar (row 2, col 5)
Encounter: ghostly, filthy, disguised, hot drunken rat king
Round 0: bale loses initiative!
You lose 120 hit points
You lose 80 hit points
You lose 1 hit point
> scrollwhendone; skill 7245; attack; attack; attack; 
Round 1: bale executes a macro!
Round 1: bale casts SUMMON LOVE MOSQUITO!
Round 2: drunken rat king takes 2 damage.
You gain 2 hit points
Round 2: drunken rat king takes 1 damage.
Round 2: bale attacks!
Round 3: drunken rat king takes 88 damage.
Round 3: drunken rat king takes 1 damage.
You lose 127 hit points
You lose 75 hit points
Round 3: bale attacks!
Round 4: drunken rat king takes 89 damage.
Round 4: drunken rat king takes 1 damage.
Round 4: bale wins the fight!
After Battle: A love cricket plays a jaunty tune for you. You tap your feet.
After Battle: Dismal Jasper tips you a grim wink. You see some extra meat you'd missed before.
You gain 105 Meat
After Battle: The yellow glow from Dismal Jasper's empty eye sockets makes it easier to search for extra items you might have missed.
You acquire an item: rat whisker
You acquire an item: rat whisker
You acquire an item: rat appendix
You acquire an item: tangle of rat tails
You gain 35 Muscleboundness
You gain 7 Mysteriousness
You gain 8 Chutzpah

[766] The Typical Tavern Cellar (row 3, col 5)
Encounter: Australian, huge, stinky, optimal bunch of drunken rats
Round 0: bale loses initiative!
You lose 5 hit points
You lose 1 hit point
> scrollwhendone; skill 7245; sub finito; attack; endsub; call finito; repeat !times 1
Round 2: bale executes a macro!
Round 2: bale casts SUMMON LOVE MOSQUITO!
Round 3: bunch of drunken rats takes 8 damage.
You gain 8 hit points
Round 3: bunch of drunken rats takes 3 damage.
Round 3: bale attacks!
Round 4: bunch of drunken rats takes 440 damage.
Round 4: bunch of drunken rats takes 6 damage.
Round 4: bale wins the fight!
After Battle: Dismal Jasper slowly and painstakingly rifles your opponents' pockets for extra meat.
You gain 60 Meat
After Battle: Dismal Jasper stomps ponderously, first one foot, and then the other, in a slow ceremonial dance.
You acquire an item: rat whisker
You acquire an item: rat whisker
You acquire an item: rat appendix
You gain 29 Fortitude
You gain 15 Mysteriousness
You gain 5 Cheek

[766] The Typical Tavern Cellar (row 4, col 5)
Encounter: drunk, pixellated, 1337, unlucky bunch 0f drunk3n r475
Round 0: bale loses initiative!
 
Last edited:

Veracity

Developer
Staff member
The "No! Don't leave me!" link goes to fight.php. Here is a clingy drunken rat that I defeated and then clicked on that link.

Code:
[1092] The Typical Tavern Cellar (row 3, col 5)
Encounter: dancin', annoying, artisanal, 1337, hilarious, clingy drunk3n r47
Round 0: Veracity wins initiative!
Round 1: Veracity attacks!
Round 2: drunken rat takes 82 damage.
Round 2: Veracity wins the fight!
After Battle: Salad love cricket salad a jaunty tune for you. You tap your feet.
You gain 29 Meat
After Battle: Salad spins and whirls salad the breeze, salad salad spicy salad dust devil.
You acquire an item: rat whisker
You acquire an item: rat appendix
After Battle: Salad salad salad salad pothole, and a salad goes salad.
You acquire an item: yellow pixel
You gain 4 Strongness
You gain 8 Mysteriousness
You gain 5 Cheek

[1093] null
Encounter: Australian, short, untouchable, wet, fratty, frozen drunken rat
Round 0: Veracity wins initiative!
 

Veracity

Developer
Staff member
How annoying. I cannot connect to KoL at the moment: "ping: cannot resolve www.kingdomofloathing.com: Unknown host". I was up and then lost connectivity to it. So, there I am, being repeatedly attacked while trying to debug this issue.

Assuming I can connect again eventually, I'm just going to ascend and debug this in my next aftercore, in a few days.
 

Theraze

Active member
When I tried to connect around then, it appeared that it was simply the DNS failing. I successfully connected by telling mafia to use IP rather than hostname in the connection options.
 

Veracity

Developer
Staff member
Try revision 15917. I believe I figured out the issues with clingy rats and they should log correctly and the script should fight all iterations of such before moving on to the next square (I had a clingy rat spawn another clingy rat), but I didn't actually test using the script.

I'll try that in a few days; I just ascended and have no reason to do this quest early, so perhaps just before I go after Ed...

Since you use the script, tell me how it works for you.

(I wonder if you can have clingy topiary critters in the Hedge Maze. If so, the Hedge Maze script needs some work, too. Since I always use the 4-turn all traps route, I never see them any more.)
 

Bale

Minion
I believe that uncopyable monsters cannot be clingy so it is quite possible that topiary monsters won't have that problem.
 

Veracity

Developer
Staff member
OK, it doesn't quite work. I found a clingy drunken rat, it killed it, and then it submitted a request to fight.php, as expected - but it did not automate the fight correctly; after the initial response came back, apparently it returned to the script, which simply submitted fight.php again.

I'll see what I can figure out, although I might wait until aftercore to try again...
 

Veracity

Developer
Staff member
Revision 15921 will (hopefully) automate the fight when it finds a clingy rat. I told the script to go on and find the Baron's mansion for me, but no clingy rats came up, and I don't feel like wasting the turns in-run to explore the rest of the cellar, so that will have to wait until aftercore.

But, I have high hopes for it, so feel free to test it for me, if you get to the cellar sooner than I do. :)
 

Bale

Minion
I somehow manage to explore the entire cellar today, without seeing a single clingy rat. :confused:
 

Veracity

Developer
Staff member
I freed the king and then did the Tavern Quest (explore) script.

Code:
[813] The Typical Tavern Cellar (row 5, col 5)
Encounter: shy, tiny, phase-shifting, throbbing, floating, foul-mouthed, hot drunken rat
Round 2: Veracity wins the fight!

[814] The Typical Tavern Cellar (row 3, col 2)
Encounter: shy, huge, tie-dyed, quacking, haunted, artisanal, invisible drunken rat
Round 2: Veracity wins the fight!

[815] The Typical Tavern Cellar (row 2, col 2)
Encounter: skinny, drunk, quacking, electrified, narcissistic, artisanal, ticking drunken rat
Round 2: Veracity wins the fight!

[816] The Typical Tavern Cellar (row 2, col 3)
Encounter: Australian, blurry, floating, askew, hot, cloned, clingy drunken rat
Round 2: Veracity wins the fight!

[817] The Typical Tavern Cellar
Encounter: tiny, untouchable, disguised, wet, American, frozen, ticking drunken rat
Round 2: Veracity wins the fight!

[818] The Typical Tavern Cellar (row 3, col 3)
Encounter: 1984 Had Nothing on This Cellar
You acquire rat whisker (4)

[819] The Typical Tavern Cellar (row 4, col 3)
Encounter: Staring Down the Barrel
You acquire ice-cold Willer (4)

[820] The Typical Tavern Cellar (row 4, col 4)
Encounter: dancin', shaky, blurry, floating, yuletide, American, fratty drunken rat
Round 2: Veracity wins the fight!

[821] The Typical Tavern Cellar (row 3, col 4)
Encounter: shy, huge, lazy, untouchable, disguised, hilarious, generous drunken rat
Round 2: Veracity wins the fight!

[822] The Typical Tavern Cellar (row 2, col 4)
Encounter: skinny, short, broke, untouchable, artisanal, unstoppable, hilarious drunken rat
Round 2: Veracity wins the fight!

[823] The Typical Tavern Cellar (row 2, col 5)
Encounter: ghostly, bouncing, electrified, cowardly, cloned, frozen, ticking drunken rat
Round 2: Veracity wins the fight!

[824] The Typical Tavern Cellar (row 3, col 5)
Encounter: jittery, floating, bouncing, askew, narcissistic, unstoppable, 1337 drunk3n r47
Round 2: Veracity wins the fight!

[825] The Typical Tavern Cellar (row 4, col 5)
Encounter: cartwheeling, broke, foul-mouthed, turgid, invisible, 1337, red-hot drunk3n r47
Round 2: Veracity wins the fight!

Faucet found in row 4, column 1
Done exploring.
In the 12 remaining squares, I found 1 clingy rat. It fought it and moved on successfully.

This is fixed.
 
Top