Feature - Implemented Built-in Naughty Sorceress Scripts

Veracity

Developer
Staff member
I am going to remove all of the existing ones - and the CLI commands and the ASH functions - since none are of the slightest use currently. This thread is to discuss what we could (eventually) replace them with. Here are my thoughts:

First off, the old scripts would go look at the tower in order to figure out how much you've done. We can still do that - much more accurately. As I mentioned in the Naughty Sorceress Quests thread, there are 11 steps, and you can detect exactly which step you are at by looking at the tower and seeing which of 11 places are clickable. We can avoid the server hit if we have a Quest setting which accurately tracks those locations - especially if it can be set correctly from the Quest Log - but, at worst, we can figure it out with one server hit to look at the tower.

Determining where you are within a step may require another server hit, if our internal settings are not up-to-date.

1) The Contest Booth.

This is not an adventuring location. One reasonable way to handle it would be this:

If we have not already figured out (via our telescope or a previous visit) what the contests are, visit the booth and let our (forthcoming) automatic contest recognition figure it out.

Step 1) Register for all contests that we have not previously registered for:

maximize initiative
register for Fastest Adventurer contest
maximize (stat)
register for (stat) Adventurer contest
maximize (element) damage + (element) spell damage
register for (element) Adventurer contest

Step 2) Normal adventuring in the three crowds until they are done

Step 3) Visit the contest booth again and claim your prize.

I propose that Steps 1 and 3 be a "Contest Booth" script; #2 can be normal auto-adventuring.

2) The Closing Ceremony

Simple: set the 3 choices to their single option (which are the defaults, but make it so regardless) and visit the place and automatically do the choices. I propose this is the "Closing Ceremony" script.

3) The Hedge Maze

Four choices for a built-in script:

- 4 turns, 0 monsters, 0 nugglets = the 3 Elemental tests.
- 7 turns, gopher + duck, 4 nugglets
- 7 turns, chihuahua herd + kiwi, 4 nugglets
- 9 turns, 8 nugglets

The first one should maximize for generic elemental resistance - or the specific elements, if you know what they are, either via telescope or via having failed one of them. Fail if it cannot achieve level 7 (?) - or, perhaps, less, if it knows you are starting in a later room.

4) The Tower Door

It could look to see which locks are there, if we don't trust our setting. (I.e., to allow for users who do some things out of our sight.)

Then, "acquire" all the missing keys (and fail if you can't), and simply use each key in turn and activate the doorknob. The KoLHS universal key remains an unknown.

And that's it. Everything else is an Adventuring location with known monsters.

So, 4 scripts:

Contest Booth - maximize for and enter all contests or, once crods are defeated, collect reward
Closing Ceremony - set 3 choices and go there
Hedge Maze - 4 built-in paths. Want something else? Set your own choice adventures and adventure once in the Hedge Maze after buffing up as desired.
Tower Door - open all locks and open the door

Setting choice adventures and submitting URLs is not hard. Using quest status to determine what is valid and what remains to be done, and calling the maximizer appropriately are much trickier.

Thoughts?
 

Theraze

Active member
For the tower proper, would it make sense to automate that, since it's basically just throw beehive, maximize for meat (and the proper weapon type, if not myst) and auto-adventure until done, throw knife, take configured choice, auto-heal shadow, and then the normal NS fight.

Specifically, since the shadow is a unique fight that mafia can currently handle, having mafia still handle that might be useful for basic scripters.
 
Is a high level of inbuilt automation for the new tower necessary / desirable anymore?

I used mafia's inbuilt automation for the old entryway, and for the puzzles immediately prior to the shadow, since those were relatively tedious to complete and had nothing to optimize or play in the sense of the base game.
I personally don't think I'd use inbuilt automation for any parts of the new tower, most of which is a lot more like the base game now.

It doesn't really make sense to me having inbuilt automation for completing say, the registration desk, when that kind of functionality is more usually the job of external scripters elsewhere in the game.
 

Fluxxdog

Active member
I have to admit, I liked having the choice to clear the tower up to OR including your shadow. Can you keep that intact?
 

Bale

Minion
I definitely want a function for the tower door. Let it automate making the legend keys from loot tokens, skeleton key and others. That's all clicky-clicky and I only enjoyed it twice.

As for the Hedge Maze, a goal oriented choice adventure setting is all it needs. I'd visit it in the relay browser and click "Go to Goal." I believe you outlined the only 4 options that matter. I'd be perfectly happy doing the elemental resistance maximization myself.

Registration Desk maximization and registration? I'm a little fuzzy on that being a good idea. Sure, getting into the right equipment is nice enough, but which potions should it use? Too many choices that I wouldn't let Mafia make for me.

Similarly the others... I might not have a boning knife and need to kill the wall of bones. Which potions do I want to use to increase meat drops for the wall of meat. These are all more complicated than mafia should be concerned with.

I think that all we need is a door function and goal oriented choice settings for the Hedge Maze.
 
Last edited:

Veracity

Developer
Staff member
For the tower proper, would it make sense to automate that.
I have to admit, I liked having the choice to clear the tower up to OR including your shadow. Can you keep that intact?
Since the new tower is all "Adventure in location Tower Level X", I see no need to have built-in automation for it.

Nor do I see any need to having special "fight the shadow" code, even though our old code was willing to use red pixel potions or filthy poultices/gauze garters - but nothing else. Not that I would, but I've heard of people using scented massage oil, and I know there are other options.

I never automated the shadow, but I think a simple CCS would be more than sufficient to do that.

Is a high level of inbuilt automation for the new tower necessary / desirable anymore?
That question was the point of this thread. I can only speak for what _I_ would use.

I used mafia's inbuilt automation for the old entryway, and for the puzzles immediately prior to the shadow, since those were relatively tedious to complete and had nothing to optimize or play in the sense of the base game.
Me too. I did the Hedge Maze and the Shadow in the Relay Browser, but automated the rest.

I personally don't think I'd use inbuilt automation for any parts of the new tower, most of which is a lot more like the base game now.
Thanks for the data point.

It doesn't really make sense to me having inbuilt automation for completing say, the registration desk, when that kind of functionality is more usually the job of external scripters elsewhere in the game.
Except, I, personally, am not willing to use "external scripts". I WOULD use a built-in script that behaved like I described.
 

fronobulax

Developer
Staff member
Since I am suboptimal I would use whatever mafia had built in, if available, followed by an external script, for what was not. I don't have enough experience with the new Tower to know what feels tedious to me.
 

Veracity

Developer
Staff member
By the way - I am planning on REMOVING the old scripts - from the Quests menu, the CLI, and from ASH.
If and when we write new ones, we can insert the new ones.

The thing is, the new ones will certainly not be direct replacements for the old ones. So, if you have a script which depends on KoLmafia to automate the (old) Lair for you?

1) It can call the existing functions - which are completely empty, since I removed the code - and get no feedback that no progress has been made through the lair. Net result: the script is broken.
2) It can call the existing functions - and I could change them to force an error - and your script will abort. Net result: the script is broken.
3) I can outright remove the existing functions - and your script will get a compile error before you execute it. Net result: your script is broken, but perhaps you have been alerted to that fact.

I'm planning on option #3, unless I hear a compelling (to me) argument to do something else. "I'm too lazy to remove known-to-be-bad code from my script" is not "compelling".
 

fronobulax

Developer
Staff member
I'm planning on option #3, unless I hear a compelling (to me) argument to do something else. "I'm too lazy to remove known-to-be-bad code from my script" is not "compelling".

I think I am fine with #3 because people need to fix or retire scripts. If you do it in commit rxyzzy then anyone with a short term problem with that decision can run a version earlier than rxyzzy and decide which is worse - having mafia drift out of date or dealing with the script's required changes.
 

Veracity

Developer
Staff member
I like #3 because the scripts actually broke 3 weeks ago, when the new tower rolled out. If a script author couldn't be bothered to fix their script in that period of time, perhaps they need a little nudge. ;)
 

Theraze

Active member
Not sure what script is crashing. Nothing that would make sense. This happens on login.
The Hermit has 0 clovers available today.
No method found for built-in function: entryway
No method found for built-in function: hedgemaze
No method found for built-in function: guardians
No method found for built-in function: chamber
today: 20150122
I call hermit, then the ideas.ash script from DoctorRotelle (v413). But that script doesn't have entryway in it...
 
Last edited:

Veracity

Developer
Staff member
I expect you want revision 15256, which was submitted 7 minutes before you made that report. ;)
 

Veracity

Developer
Staff member
Revision 15256 parses the tower when we visit it and sets Quest.FINAL to the appropriate step. This is all that we need to enable the development of Sorceress scripts; they can do a PlaceRequest( "nstower" ) and the quest setting will say if you are at the right place to execute them. Eventually, when we parse the Quest Log to determine that same info, that server hit will be unnnecessary (although harmless).

If we do eventually have a Contest Booth script, the response to PlaceRequest( "nstower", "ns_01_contestbooth" ) will tell us which contests have not been entered, which are finished, and which are in progress (and how much remains). Presumably that will get stored in settings, too, although it is not, yet.
 

Veracity

Developer
Staff member
Revision 15288 has a first attempt at two scripts. Both are currently available only via the Quests menu.

Hedge Maze (Traps)
Hedge Maze (Gopher & Duck)
Hedge Maze (Chihuahua Herd & Kiwi)
Hedge Maze (Nugglets)

Each of these verifies that the Hedge Maze is available to you and then sets up all nine choices to take you through a particular path. (All nine are not necessary, except for Nugglets, unless you have already started the Hedge Maze, in which case the settings will steer you back on-course.)

Traps does rooms 1, 4, 7, and 9. It makes no effort to buff you. Nor does it warn you if your current level of elemental resistance will be inadequate to get all the way through. It could, and that would be a fun-ish improvement, but it's not essential. Heck, you could pass trap 1, fail on trap 2, heal & restart, pass 2, fail on 3, and so on; it's not up to us to refuse to let you try.

The ones with the monsters go for nugglets after the 2nd monster - although they could save a turn or two by taking a trap. These are not tested and I am not completely sure that they work: we are used to automating choices that lead to fights, but not the reverse. It attempts to simply resubmit place.php&whichplace=ns_03_hedgemaze each time automation stops and we are not in an error state (beaten up, for example), which I assume will just redirect to the correct choice. I'll try it in 4 days or so, but if someone tries it before, I'd be curious to hear about it.

The nugglet one is all "go left" and was tested.

I am not sure what happens if you run out of turns in the middle. We count turns on the path, starting from your current room and going to the exit, and tell you how long it will take - but I doubt KoL prevents you from starting the maze if you don't have X turns; the label says (1). (Fun fact: the Haunted Bedroom fight that leads to a choice that leads to a fight with the jilted mistress takes 2 turns - one for the original monster/choice, and one for the second fight - but you can get that choice with one turn remaining and take the mistress fight with 0 turns remaining, and KoL lets you do it.)

Tower Door

This verifies that you are at the door. It then looks at it, to refresh its knowledge of which locks remain, attempts to "acquire" all needed keys (bailing if it can't), opens the locks, and turns the doorknob. It has no knowledge of KOLHS universal keys - because we have no idea how KoL itself deals with those with the new tower.

This, too, I tested, and it seemed to not update the quest status correctly. Looking at my log, I see this:

Requesting: http://www.kingdomofloathing.com/place.php?whichplace=nstower_door&action=ns_doorknob
Retrieved: http://www.kingdomofloathing.com/place.php?whichplace=nstower_door&action=ns_doorknob
Field: Location = [place.php?whichplace=nstower]
Redirected: place.php?whichplace=nstower

and we did not follow the redirect.

> get questL13Final

step4

and we therefore did not update the quest.

Immediately thereafter:

Requesting: http://www.kingdomofloathing.com/game.php
IOException retrieving server reply (game.php).
class java.net.UnknownHostException: www.kingdomofloathing.com

... my internet connection went down. We are in the tail end of a blizzard, and my Internet service is the opposite of reliable, at the moment.
 

Bale

Minion
It has no knowledge of KOLHS universal keys - because we have no idea how KoL itself deals with those with the new tower.

Last I heard, there was a bug which kept Universal Keys from being used there, so this behavior is 100% correct. If we hear that the keys were fixed, only then would it be worth doing a KOLHS run to test them.

... my internet connection went down. We are in the tail end of a blizzard, and my Internet service is the opposite of reliable, at the moment.

I was very lucky not to lose my connection due to blizzard at that time.
 

Darzil

Developer
Lost most of my internet today for a few hours. Or at least my internet was fine, but the providers links to most of the outside world got flaky. My work VPN worked, my email worked, twitter worked (slowly), these forums worked (slowly), but pretty much everything else was unobtainable! Quite unusual.
 
Top