Edscension - Your #1 Karma Farming Script

Zen00

Member
And mafia is telling you that you screwed up by trying to switch to a servant you don't have. You can check have_servant() to not run into that.

I was trying to get it to check by using the built in boolean function. It works, but it complains each time which I'd prefer if it didn't. Of course that's why Cheesecookie wrote a completely new function that passes the servant through then silently checks if you have it, but for some reason that broke I could never figure out why.
 

Veracity

Developer
Staff member
I was trying to get it to check by using the built in boolean function. It works, but it complains each time which I'd prefer if it didn't.
I have no idea what you are talking about.

> ash have_servant( $servant[ bodyguard ] )

Returned: true

> ash have_servant( $servant[ assassin ] )

Returned: false
That is the "built in boolean function" that lost specifically told you to use to check if you have a servant before trying to use it.

use_servant is also a "built in boolean function", but if you pass it a servant you don't have, it logs an error and fails. Since it is implemented in terms of the CLI "servant" command, which wants to print user visible error messages, it logs an error.

I see no bug in that. If you are scripting in ASH, there is nothing in the world preventing you from simply Not Doing That.
 

fronobulax

Developer
Staff member
Just started using this. Some of these comments are addressed at other users and not the author.

Very nice relay script to set some variables. A nice touch even if leaving them at the default is a reasonable action.

I run scripts by Scripts->Load Script and then selecting the script from the file chooser. They are all in scripts/Edscension which threw me off because I do not organize my scripts into subdirectories. I won't complain about this because I did complain about name conflicts and this is certainly one solution to that.

I started an Ed run with a semi-skilled character a couple of days ago. I jumped in with ed_ascend. It is complaining that "You're a little short on time or cash to do this, come back once you've fixed this?" but instead of stopping to let me fix, it kept looping until I aborted it. I think it is trying to do something in the Guano Junction but the gCLI by itself does not make it clear what I am supposed to fix. I'm off to see what I can do manually to discover what to fix and then fix it.

Thanks.

P.S. - It looks like the issue is trying to adventure in Guano Junction without stench resistance. As it turns out there is nothing in inventory that provides it so a fully automated, idiot proof script would recognize that and adventure to resolve it first. off to do that manually.
 
Last edited:

Zen00

Member
That is the "built in boolean function" that lost specifically told you to use to check if you have a servant before trying to use it.

use_servant is also a "built in boolean function", but if you pass it a servant you don't have, it logs an error and fails. Since it is implemented in terms of the CLI "servant" command, which wants to print user visible error messages, it logs an error.

I see no bug in that. If you are scripting in ASH, there is nothing in the world preventing you from simply Not Doing That.

Never was claiming it was a bug, just that I wanted to find a way to use the boolean function of the use servant function without having the error log, in essence having the use servant and have servant function combined into one. Currently I use this to handle servants.

Code:
if((loc == $location[The Defiled Nook]))
	{
		if(!use_servant($servant[Cat]))
		{
			if(!use_servant($servant[Scribe]))
			{
				use_servant($servant[Maid]);
			}
		}
	}

To get it to be silent I'll have to turn that into a bunch of else ifs that will include the have servant function I believe.
 

fronobulax

Developer
Staff member
Won't edit because there is something intervening.

Got bumcheek and it at least started adventuring. It is now trying to adventure at the Hippy Camp which is not available but it keeps trying :)
 

Zen00

Member
The script will try to use Hide of Sobek before adventuring in Guano Junction, so no idea what the problem is unless somehow you managed to get to the bat cave without it. Only way meat could be a problem is if you were adventuring at Conspiracy Island to level, which I haven't tested for the obvious reasons. :p
 

fronobulax

Developer
Staff member
Manually got the Junk Junk to open island. Script burned a turn or two in the hippy camp and then got the dinghy. Id did not need to do that :)

If I end up in the relay browser and press the Script button then I get an abort because the macro had 37 empty actions or something like that. Is pressing the Script button one of those "Don't Do That" things? If not it might be nice if the CCS switched to WHAM or otherwise offered something more useful.

Thanks.
 

Zen00

Member
A bug you should know about, I noticed that there was a potential crash you could hit involving the pirate map. In trying to fix that I have inadvertently created a new bug where it will try to beer pong without any insults learned. It's fixed now (and the original bug is fixed too still) so download hotfix 1.0.2.1 for the pickup.
 

chown

Member
So, I've modified my local copy of ed_combat.ash so that it always selects Fist of the Mummy if Storm of the Scarab isn't available. This works perfectly fine for me. Sometimes it takes a second spell to finish the opponent, with perhaps a quick visit to the underworld, but that's not a problem.

I've noticed that while adventuring in some locations, there's a lot of unnecessary switching of servants, even aside from attempts to use unavailable ones. For example:

Code:
> Oil Peak with ML: 30

equip hat Crown of the Goblin King

equip pants filthy corduroys

equip acc3 batskin belt
Visiting The Servants' Quarters
Putting your Priest to work
Current servant: Imamut, the Priest (lvl. 16, 280 xp)
Visiting The Servants' Quarters
Putting your Priest to work
Current servant: Imamut, the Priest (lvl. 16, 280 xp)
Visiting The Servants' Quarters
Putting your Cat to work
Current servant: Temmayaerit, the Cat (lvl. 7, 55 xp)
> Pre Adventure done, beep.
> Starting Ed Battle at Oil Peak

[388] Oil Peak

That slows things down a bit, since there are multiple unnecessary (afaict) KoL requests involved. (My servant from the previous adventure was already the cat, so there is no net effect.)

Also, the "Such Great Heights" choice at the Hidden Temple didn't get automated.

That's all. I did have to manually drink before it would get the spookyraven library key, but that's clearly expected.
 
Last edited:

Zen00

Member
The Hidden Temple adventures are handled by hard coding (to account for wandering monster interrupts), however if you get a NC when semi-raring for BaaBaa on a false number from a fortune cookie that will cause a problem, a rare event, but I have had it happen once. :/

Excessive servant handling happens because of decision pathing, it will flip to the priest as the default, then to a scribe if you're not at a level goal and have enough ka, then to cat if you're at the level goal and have enough ka (to xp farm it for the gift of the cat) and finally it then swaps to per-location settings. I can write it better, but it will take some time. It works well enough now (runs all my daily turns in under an hour) even with the excessive switching, so I'll think about it after getting eating/drinking working.
 
Last edited:

chown

Member
To get it to be silent I'll have to turn that into a bunch of else ifs that will include the have servant function I believe.

Forgive me if I'm misunderstanding, but just make a function that has the behavior you'd like. Say:

Code:
boolean ed_use_servant(servant which) {
        return have_servant(which) ? use_servant(which) : false;
}

...and then s/use_servant/ed_use_servant/

Although, I would also suggest that you might want to instead set a global variable to the selected servant, and then call use_servant once per adventure.
 

Zen00

Member
That's the way it was originally set up, but then for some reason it stopped working, I have no idea why because I had never touched that code, but one day it decided it no longer wanted to work.
 

chown

Member
So, for my day 4 I have a bunch more feedback to report:

First, I'll comment that I actually made the change I described above, and it appears to have greatly reduced the amount of servant-switching that was going on. Of course, I may also have introduced new bugs, so if (when...) I report anything else funny about servant-switching I'll be sure to also point out that it's quite likely my own issue. Also, when I reached level 12, it released the belly-dancer, which has gone unused. Should it perhaps have released the maid instead, in order to speed up the nuns?

Also, I'll note that I manually stopped the script a couple of times when it was adventuring in the Gallery, in order to clover the Bathroom instead. I'm not sure if the script was saving them for something else, but since my run will (presumably) take five days I'm guessing that I can maybe be a bit less thrifty than whatever it may be planning.

There seems to have been some additional difficulty caused by my manual adventuring in the Barrr earlier in the run. The script started reporting "Insult gathering party." before each adventure, and was equipping the swashbuckling outfit. However, before any actual adventuring it would swap it back out, and adventure in some other place. It's a fairly minor thing, (particularly since it was due to my manual adventuring) but the check that concludes that there is no need to visit the Barrr could be made before the "Insult gathering party" & associated gear/servant changes. Or, that check might be deemed incorrect, because I had not yet gotten the Frat blueprints, and therefore did indeed need to visit the Barrr. Either way, the checks before and after that message should be more consistent about which thing should be done next.

In order to get rid of the equipment-swapping situation described above, I manually visited the Barrr to get the blueprints. When I re-started the script, it proceeded to open up the F'c'le. So that appears to be fine now.

Later, there was also a bit of fallout from my having manually gotten the Nostril of the Serpent earlier in the run. Today, after defeating Lord Spookyraven, the script attempted to adventure in the not-yet-opened Hidden City. So I stopped the script and manually opened it. Amusingly, when I re-started the script, it then complained about not having the Stone-Faced effect. which it presumably wants in order to get the Nostril:

Code:
Must get a snake nose.
choiceAdventure579 => 2
We are not Stone-Faced. Please get a stone wool and run me again or we'll just do this manually.
Countdown: 20 seconds...

After looking at the logic in the script, I tried doing "set ed_hiddenunlock = true" to get past that. It seemed to work.

Also, while the script was doing the Hidden City, Mafia started printing some messages to the console where I had run it:

Code:
Invalid setting 2 for choiceAdventure781.
Invalid setting 2 for choiceAdventure781.
Invalid setting 2 for choiceAdventure785.
Invalid setting 2 for choiceAdventure781.
Invalid setting 2 for choiceAdventure783.
Invalid setting 2 for choiceAdventure785.
Invalid setting 2 for choiceAdventure781.
Invalid setting 2 for choiceAdventure783.
Invalid setting 2 for choiceAdventure785.
Invalid setting 2 for choiceAdventure787.

These now appear periodically. They don't appear to have adversely affected the script. At this point, it has opened up the Ziggurat, but has not fought the protector spectre.

Immediately after hitting level 12, I got:
Code:
parent.charpane.location.href="charpane.php";
Since you have no access to the Clan VIP lounge, you may not visit the Speakeasy.
Servant points found: 1
ed_edSkills => 12
Maximizing...
60 combinations checked, best score 8.84
Putting on Bonerdagon necklace...
Equipment changed.
Putting on outfit: Filthy Hippy Disguise
Equipment changed.
Must save the ferret!!
You need 1 more beer helmet to continue.
You need 1 more distressed denim pants to continue.
You need 1 more bejeweled pledge pin to continue.
Unable to wear outfit Frat Warrior Fatigues.
Gremlin prep
ed_gremlins => start
Mind control device already at 10
Since you have no access to the Clan VIP lounge, you may not visit the Speakeasy.
Maximizing...
128 combinations checked, best score 8.84
Putting on fuzzy earmuffs...
Equipment changed.
Putting on bloodied surgical dungarees...
Equipment changed.
Putting on outfit: Filthy Hippy Disguise
Equipment changed.
Must save the ferret!!
You need 1 more beer helmet to continue.
You need 1 more distressed denim pants to continue.
You need 1 more bejeweled pledge pin to continue.
Unable to wear outfit Frat Warrior Fatigues.
Doing them gremlins

... which looped until I stopped it & manually got the outfit.

While doing the gremlins, I got killed more times than I think the script was prepared for. It appears to have never switched away from a strategy of flyer-then-dictionary. Eventually it stopped when it had to pay 4 Ka to UNDIE. I did the gremlins manually.

While doing Sonofa, it got beaten up by a Zerg Rush, and stopped. I applied a linen bandage & re-started the script, but then stopped it again when it started fighting, because it was still flyering & I wasn't sure how much Ka it was going to spend on that. (I probably should have just risked it, since it probably would have stopped again at 4, but whatever.) I manually fought a couple of lobsterfrogmen to finish the flyer quest, and then re-started the script.

The script continued fine. The second filthworm gland didn't drop for it, though. It appears to be using the scribe, when it should probably use the cat. As noted earlier, I may have to double-check my changes. Anyway, I should have more Renenutets available tomorrow, so I stopped it there.
 

Zen00

Member
When doing the gremlins, it uses a separate CCS for killing them. So if you're somehow getting the normal CCS, then I don't know what you're doing. :p

As for why it sometimes decides to die without getting the outfit, I don't know, I had it happen once, but never shown up again.

The invalid choice thingy is because I need to spend some more time on that code, I jammed together something that I hoped would work if for some reason you only got 1 stone wool (like I did this run, but it worked fine for me?) but in most circumstances should never be seen.

All warranties are void when you perform turns manually. :p
However I do plan on swapping over eventually to quest log checking for steps and such, which should make planning out quests much simpler.
 

chown

Member
By the way, those choice adventures are for the hidden city shrines. It's not clear to me that you would need to do anything with them to handle a case where the hidden city itself gets unlocked a bit differently. The Mafia GUI lets me set them to "0" for stop-in-the-relay-browser or "1" for (iiuc) unlock-city-buildings-and-then-get-stone-triangles. You probably want "1"?

Just to make sure we're clear, manual adventuring ought to be the normal way to recover whenever the script aborts or does something obviously wrong. If you can keep it from ever doing those things, then I have no complaint. (Remember, the script aborted when it encountered the Nostril choice earlier in the run. I doubt it would have recovered if I had simply re-run it without finishing the adventure. It may possibly have recovered if I had let KoL abort the adventure during rollover; but that would be a painfully slow way to test things, and certainly not acceptable for anyone who is actually trying to use the script for karma farming.) And in general, you can't keep it from doing those things. If someone's internet connection dies while they are running your script, it's just not possible for it to know whether or not KoL got the last request it sent. So, when you re-start the script, it should generally handle discrepancies between its tracked state and what the actual situation is in KoL. The "ed_foo" settings are fine for figuring out where to try to start doing things, but they can't always be right.

And the script is still usable, even with all the issues I've noted. Even accounting for time spent getting it to go & typing up daily reports here, I've probably still spent less time on this ascension than I would have if I had done the whole thing manually. Speaking of which, here are the few minor things I ran into on day 5:

1. got beaten up by Wisnewski. I manually spent a few (7?) Ka to finish him.

2. got beaten up by The Horror. I manually did the quest, spending a few adventures at the Palindome for recovery purposes. (And advancing the quest there by a couple shelf items.)

3. got beaten up by You the Adventurer, as well. Totally not a big deal. I spent one Ka to UNDIE. Just mentioning it for completeness.

4. script aborted with "Transfer failed for Thwaitgold scarab beetle statuette" after that. I don't have a display case. I "set ed_sorceress = true" to get around it.
 

fronobulax

Developer
Staff member
All warranties are void when you perform turns manually.

*snicker* But we report these things so we don't have to perform turns manually while waiting for unexpected features to be addressed.

Mafia reports 5 or more writing desks defeated yet we are still looking for them? Give Lady Spookyraven her necklace?

The char pane says
Lady Spookyraven wants to dance again, but first she needs:
* her powder puff
* her gown from the Haunted Bedroom
* her shoes
with the puff and shoes crossed out.

My In Progress Quest Log says
Other Quests:

Lady Spookyraven's Dance
Lady Spookyraven wants to dance again, but first she needs:
* her powder puff
* her gown from the Haunted Bedroom
* her shoes
with the puff and shoes crossed out.


I think the relevant entries from the settings are

questM17Babies=unstarted
questM20Necklace=finished
questM21Dance=step1

It appears that something is missing or out of synch but I'm not sure what.

Tangentially, I see both "ed_combatHandler" and "ed_edCombatHandler=(lashofthecobra)" in my settings (plus a couple with the extra ed that don't seem to be duplicates). Error, by design or residual from previous versions?

Thanks
 

Zen00

Member
Residual stuff I think from the alternative CCS that I deleted. There's a whole bunch of mess in there, but I won't have time to fix it up for a while, especially since I'm working on my website right now, and my Android app development. :/
 

chown

Member
Yeah, I also noticed that the scripts use a few settings that aren't prefixed with "ed_":

Code:
        set_property("delayToDayFour", FALSE);
        set_property("ed_disableAdventureHandling", "no");
        set_property("ed_doCombatCopy", "no");
        set_property("doNunsRegardless", FALSE);

Also, I started a new run with grep, who has now completed an Ed ascension. If you would like me to do more no-relevant-hardcore-skills-and-no-previous-Ed-ascensions runs, let me know; I have another character that I can use for more testing.

I, unfortunately, had counterScript set to CounterChecker.ash, which interfered with ed_ascend. In my local copy, I added a line near those ones that I quoted above, to disable counterScript. Ideally, the script should probably remember any previous non-"ed_" settings that it changes, so that it can change them back. (I see that it does do this for KoL's character pane setting, and something with CHIT. counterScript and afterAdventureScript should probably be handled in a similar manner.)

Nothing else in particular to report. I did step in and buy some legs at the start of the run, but partly just because I had gotten interrupted & needed to stop the script anyway. I saw that it was having trouble with the first Hippy that it had encountered, just like the previous run. Since I happened to have stopped it just then, I figured I'd go ahead and get the Upgraded Legs manually.
 

Zen00

Member
I should mention that if you're using a mafia build newer than 16170ish, the script will fail unless you want to bother differentiating between male/female clingy pirates.
 

kol honey

New member
I should mention that if you're using a mafia build newer than 16170ish, the script will fail unless you want to bother differentiating between male/female clingy pirates.

If you want to change it yourself, clingy pirate should be appended with (male) or (female) and the logic modified accordingly.

(this is an example I did from another script that hadn't updated)

changing
$monster[clingy pirate]

to
$monster[clingy pirate (male)]

and if using it in logic:
changing
!$monster[clingy pirate (male)].is_banished()
to
((!$monster[clingy pirate (male)].is_banished() || !$monster[clingy pirate (female)].is_banished())
would suffice. probably.
I'm only an undergrad CS major so don't take my word for it.
 
Top