Not sure if this is a bug or not, problem with CCS

slyz

Developer
@Camber: I don't think he means that he's using an older version of Mafia, he just prefers to use a .exe instead of a .jar.

@Braska: If you use windows, as long as you put the new .jar next to your old .exe in the kolmafia folder, it will use the same settings and scripts. If double clicking the .jar doesn't open Mafia, follow Theraze's advice.

(and yes, I do think)
 

Theraze

Active member
Heh.

And from the bit of description, if he's not sure where his data files live, it sounds possible that his wrapper is actually unwrapping his JAR in either the temporary folder, or just A temporary folder, and running it there. Either way, if the data files aren't obviously running out of the folder where the EXE is being executed, something's wrong...
 

Braska

Member
Alright, I downloaded the .jar from here, made sure it was in the same folder, and all of my settings moved over just fine. That being said, my CCS is still not working. I have, however, realized what an idiot I am. I cannot right click to copy and paste the debug, but, I can copy with shortcuts. You may all slap me right now.

[6856] Fernswarthy's Basement (Level 0)
Encounter: The Beast with 4,966 Eyes
Round 0: braska loses initiative!
Round 1: Checkers produces a tubular red firecracker labeled M-76, lights the long fuse, and tosses it behind your opponent.
Generated macro:
sub mafiaround
endsub#mafiaround
sub mafiamp
if hascombatitem 465
call mafiaround; use 465
goto mafiampexit
endif
if hascombatitem 1965
call mafiaround; use 1965
goto mafiampexit
endif
if hascombatitem 345
call mafiaround; use 345
goto mafiampexit
endif
abort "No MP restoratives!"
mark mafiampexit
endsub#mafiamp
#mafiaheader
mark mafiafinal
call mafiaround; attack
goto mafiafinal

Round 1: braska executes a macro!
Round 1: braska attacks!
Round 2: braska attacks!
You lose 626 hit points
Round 3: braska attacks!
You lose 631 hit points
Round 4: braska attacks!
Round 5: braska attacks!
Round 6: braska attacks!
Round 7: braska attacks!
Round 8: braska attacks!
Round 9: braska attacks!
Round 10: braska attacks!
You lose 642 hit points
Round 11: braska attacks!
You lose 627 hit points
Round 12: braska attacks!
You lose 628 hit points
Round 13: braska attacks!
You lose 633 hit points
Round 14: braska attacks!
Round 15: braska attacks!
Round 16: braska attacks!
Round 17: braska attacks!
Round 18: braska attacks!
Round 19: braska attacks!
Round 20: braska attacks!
Round 21: braska attacks!
You lose 620 hit points
Round 22: braska attacks!
Round 23: braska attacks!
You lose 640 hit points
You lose an effect: Beaten Up
lost the fight, quitting
Basement sucessfully automated for 0 out of 1 adventures.

Those are the results of my calling autoBasement.ash. And to answer other questions, I am using 8809 jar, and running Windows 7.
 

Winterbay

Active member
The generated macro is basically what you get if you've set Mafia to restore MP in battle and have the only combat action "attack with weapon".
Code:
> ash to_item(465)

Returned: blue pixel potion

> ash to_item(1965)

Returned: bottle of Monsieur Bubble

> ash to_item(345)

Returned: Knob Goblin superseltzer

All the combat items listed are MP-restorers. This is not what I would expect if the CCS you posted was used.
 

slyz

Developer
Just to add a bit of background, combats in autobasement.ash are managed by running:
PHP:
page = visit_url("basement.php?action=1&pwd");
page = run_combat();
My guess is that, when using visit_url(), the monster and location aren't initialized in FightRequest.java, so the [ default ] section of the CCS is used. If this is the case, maybe SmartStasis.ash isn't called because Mafia thinks you are on round 2 when run_combat() is called.

If this is the problem, it would probably have been reported earlier so this is probably a bad guess (I still have problems figuring my way around the code when requests are created and posted...).

@Braska : can you try creating a new CCS that contains just this:
Code:
[ default ]
1: skill entangling noodles
2: skill spectral snapper
and try again?
 
Last edited:

Braska

Member
Yes, I'll try it tomorrow, drunk now, but I'll post the results. Btw, I took SmartStasis out entirely. The only difference in my CCS right now from the recommended one is that I have mine set for [ basement ] instead of [ default ].
 

Braska

Member
Here are the results, after simply changing [ basement ] to [ default ] :

[7150] Fernswarthy's Basement (Level 0)
Encounter: The Beast with 4,966 Eyes
Round 0: braska loses initiative!
Round 1: Checkers produces a tubular red firecracker labeled M-74, lights the long fuse, and tosses it behind your opponent.
You lose 571 hit points
Generated macro:
sub mafiaround
endsub#mafiaround
sub mafiamp
****if hascombatitem 465
********call mafiaround; use 465
********goto mafiampexit
****endif
****if hascombatitem 1965
********call mafiaround; use 1965
********goto mafiampexit
****endif
****if hascombatitem 345
********call mafiaround; use 345
********goto mafiampexit
****endif
****abort "No MP restoratives!"
****mark mafiampexit
endsub#mafiamp
#mafiaheader
if hasskill 3004
****call mafiaround; skill 3004
endif
mark mafiafinal
if hasskill 2022
****call mafiaround; skill 2022
endif
goto mafiafinal

Round 1: braska executes a macro!
Round 1: braska casts ENTANGLING NOODLES!
Round 2: braska casts SPECTRAL SNAPPER!
Round 3: braska casts SPECTRAL SNAPPER!
Round 4: braska casts SPECTRAL SNAPPER!
Round 5: braska casts SPECTRAL SNAPPER!
Round 6: braska casts SPECTRAL SNAPPER!
Round 7: braska casts SPECTRAL SNAPPER!
After Battle: Checkers sets off a lovely little cluster rocket, and smiles broadly as it explodes.
After Battle: Checkers leans against a cactus, produces a bottle of tequila, and drinks it. A few minutes later, he belches some murky fluid back into the bottle and hands it to you.
You acquire an item: agua de vida
You gain 302 Beefiness
You gain 656 Magicalness
You gain a Mysticality point!
You gain 293 Cheek
Basement sucessfully automated for 1 adventures

As you all can see, that fixed the problem of not being able to automate the basement, the question now though, is why does it not work with the [ basement ] requirement? I would rather not fight all of my adventures with that ccs, just the basement... :p
 

Camber

Member
My CCS looks like so:

[ basement ]
1: skill entangling noodles
2: skill spectral snapper

[ default ]
1: consult SmartStasis.ash
2: attack with weapon

[basement] isn't a standard CCS category. The categories are monster names, or parts thereof. You can make it one by breaking out the monsters by name that then call that section. This preserves the Default section for other combat. Change your CCS thusly:

PHP:
	[ bottles of beer on a golem ]
	1: section basement

	[ ghost of fernswarthy ]
	1: section basement

	[ basement ]
	1: skill entangling noodles
	2: skill spectral snapper

	[ default ]
	1: consult SmartStasis.ash
	2: attack with weapon
 

xKiv

Active member
Actually, CSS section *do* match on zone names too ... well, the comment in code says "against the adventure location", but it checks against the lastAdventure property, which I don't know if it is location name at that point (it's set to adventureName in KoLAdventure.run(), then to location in KoLAdventure.recordToSession()).
What I know is that I had to change [ boss bat ] to [ the boss bat ] when I wanted it to fire on the boss bat only ( [ boss bat ] fired on all bats in his lair ).

So ... what's in lastAdventure during/after a basement battle?
 

jasonharper

Developer
There's definitely something screwy going on here - an automated combat should have a "Strategy:" line near the top (in the CLI), telling you what battle action or CCS section was used.
 

Braska

Member
Ok, what can I do to help? I may not understand a lot, but I'm pretty good at following straightforward instructions.

Also, has anyone tried to replicate this problem, or is it only being weird for me?
 

slyz

Developer
He is using autobasement.ash, which handles the fights like this:
PHP:
page = visit_url("basement.php?action=1&pwd");
page = run_combat();
 

Theraze

Active member
So why does it work 'normally' normally? Or is the standard thing with autobasement to just change your default?
 

Braska

Member
The confusing thing to me, is that I used autoBasment.ash just fine about 8 months ago, ccs worked perfectly then, no problems. Now, this is my first real amount of time spent playing since May, and it is acting all wonky. I just don't know what changed in the course of 8 months that would make [ basement ] not work like it used to.
 

Bale

Minion
There's definitely something screwy going on here - an automated combat should have a "Strategy:" line near the top (in the CLI), telling you what battle action or CCS section was used.

Could that be because the combat is initiated with the following? And if so, is that a bug?

PHP:
page = visit_url("basement.php?action=1&pwd");
page = run_combat();
 

Theraze

Active member
Here's something odd I've noticed changing in the last week or three... run_combat() no longer appears to pause other actions while it's happening. The Spooky Forest/Tavern handler that I'm using that uses visit_url, parses the page, and does run_combat() if it's a combat page... no longer waits for combat to finish before launching a new page. It completes one action, then runs the next CCS step when the next page is visited. I manually put a waitq(5) in there, and that makes it finish properly because my combats don't take that long normally... but it's a change and one I'd prefer not to have to kludge past. Guessing this may be what changed for Braska as well.
 
Top