PDA

View Full Version : Scripting the birth of a new life.



Pages : [1] 2

Bale
10-12-2009, 07:32 AM
newLife 1.10.2

I began work on this script largely in response to a bug report concerning choice adventures at the Barrr. Since then it has grown more useful. It is a fact that many choice adventures have different optimal decisions based on your current class. It is tedious to manually change all those settings every time you ascend, so I used to ignore them until I was the appropriate level. Then I'd hope not to forget about them or miss one.

Wouldn't it be nice if all your ascension relevant choice adventures were automatically set every time you ascended?

Fortunately mafia has the ability to automatically run a script after ascending. I made use of that ability to write a script that will take care of all the little things I want to do whenever I ascend. It will set those niggling choice adventures at the Barrr to keep you from getting drunk. It will ensure the castle wheel is turned in the direction of your mainstat if you're moxie or mysticality. It even ensures you get your mainstat at Whitey's Grove from the one choice adventure that helps your mainstat while the others give an item. There are many more such choice adventures and I think I found them all.

This script will also reset a few other choice adventures that might get changed in aftercore and are important to ascension like your song choice in the ballroom. It will set automatic recovery to a level appropriate for level 1. It will get the free hat for your Bugged Baby Bugbear from the Arena and it even pulls your VIP Lounge Key to save you the trouble. (It's a free pull!) Finally it visits the Toot Oriole, since that is just annoying to click through.

You can use the script manually or set it to activate automatically every time you ascend. No muss, no fuss. Here's how to do that:
Download newLife.ash to your scripts directory.
Download zlib.ash (http://kolmafia.us/showthread.php?t=2072) to your scripts directory. (Lots of scripts use zlib, so you might already have it.)
In the CLI type:
set postAscensionScript = newLife.ash

Note that there are a few user configurable options in the script to suit your play style. These can be changed for specific characters from the CLI command line. Each character will need to change their preferences separately so you can have character specific behaviors. :)


Normally, this script will not call for the Guy Made of Bees in the Haunted Bathroom. If you like to set up the guy made of bees use the CLI command (capitalization counts, so use copy/paste):
zlib newLife_SetupGuyMadeOfBees = true

newLife will chose to get meat in the Bedroom instead of fighting bedstands. If you think you can defeat the bedstands use the CLI command (use copy/paste):
zlib newLife_FightBedstands = true

If you want the script to smash your hippy stone (it is best to break it before your first rollover) use the CLI command (use copy/paste):
zlib newLife_SmashHippyStone = true

There is an option to have the script sell off pork gets to ensure you acquire a detuned radio, seal tooth and stolen accordion. If you do want this, then use the CLI command (use copy/paste):
zlib newLife_SellPorkForStuff = true




Enjoy the script.

Bale
10-12-2009, 07:33 AM
Here's a sample output from my recent ascension as a Disco Bandit, to show you some of what it does:


Pulling items from storage...
You acquire an item: Clan VIP Lounge key
Resetting HP/MP restoration settings to minimal
hpAutoRecovery => 0.1
mpAutoRecovery => -0.05
mpAutoRecoveryTarget => 0.2
manaBurningThreshold => -0.05
Library's Rise of the House of Spookyraven: Unlock stairs
choiceAdventure80 => 99
Setting choice adventures for Moxie class.
Whitey's Grove: Get wedding cake and rice
choiceAdventure73 => 3
Whitey's Grove: Get Moxie stats
choiceAdventure74 => 1
Ballroom Curtains: get moxie
choiceAdventure90 => 2
Defiled Alcove: skip adventure
choiceAdventure153 => 4
Defiled Niche: get Moxie stats
choiceAdventure155 => 1
A Test of Testarrrsterone in Barrrney's Barrr: get lots of Moxie
choiceAdventure186 => 3
Chatterboxing in F'c'le: get Moxie stats
choiceAdventure191 => 1
Bathroom, Don't Hold a Grudge: Get Moxie stats
choiceAdventure402 => 3
Hippies on the Verge of War, Bait and Switch: Fight a cadet
choiceAdventure139 => 3
Hippies on the Verge of War, Thin Tie-Dyed Line: Get Moxie stats
choiceAdventure140 => 2
Frats on the Verge of War, Catching Some Zetas: Fight a pledge
choiceAdventure143 => 3
Frats on the Verge of War, One Less Room Than In That Movie: Get moxie stats
choiceAdventure144 => 1
Frats on the Verge of War, Fratacombs: Get food
choiceAdventure145 => 2
At the Poop Deck, take the Wheel and Sail to Moxie stats
oceanDestination => moxie
Optimal ascension choices set.
Getting your baby buggy bugbear balaclavaed.
Putting Lllama the Llama Lama back into terrarium...
Taking spartacus! the Baby Bugged Bugbear out of terrarium...
You acquire an item: bugged beanie
You acquire an item: lead necklace
You acquire an item: lead necklace
You acquire an item: lead necklace
Autoselling items to NPCs...
Items sold.
Using 1 bugged beanie...
You acquire an item: bugged balaclava
Finished using 1 bugged beanie.
Putting on bugged balaclava...
Equipment changed.
Putting spartacus! the Baby Bugged Bugbear back into terrarium...
Taking Lllama the Llama Lama out of terrarium...
The Oriole welcomes you back at Mt. Noob.
You acquire an item: letter from King Ralph XI
Opening letter from King Ralph XI.
Using 1 letter from King Ralph XI...
You acquire an item: stainless steel shillelagh
You acquire an item: pork elf goodies sack
You acquire an item: disassembled clover
Finished using 1 letter from King Ralph XI.
You are free to autosell pork elf stones now, if you wish.
Welcome to your new life as a Disco Bandit!

Tarko
10-13-2009, 02:47 AM
Nice, as always.

Thanks for the script, I'll use it everytime I ascend now.

halfvoid
10-13-2009, 06:16 AM
have you tried this out with ascend.ash and if so were there any compatibility issues you noticed?

Bale
10-13-2009, 06:32 AM
I haven't actually used ascend.ash, but I cannot imagine how they might conflict since they don't interact at all. When you ascend this will set your choice adventures, pull VIP Key and so forth. Then you would call ascend.ash so that it can do its thing.

Naturally I would like dj_d to correct me if I'm somehow mistaken, but I doubt it.

lostcalpolydude
10-13-2009, 11:39 PM
Nice script. The commands to equip starting gear will be wasted server hits in softcore since most people will pull something better.

codster62
10-14-2009, 12:08 AM
Well, I am not dj_d, but I guess since I use the script I can chime in. You're right bale, since the two scripts don't interact, there is not much harm that can be done. The only forseeable problem I can find is just from pullcrap.ash, which is called by ascend.ash. Because your script pulls the key if available, this may interfere with somebody's customizable pull list that ascend.ash uses, but if somebody pays attention and knows this script pulls the key, it will not be a problem. Otherwise, only 1 pull wasted. Other then that, like I said, no conflict should occur. Hope that helps. :)


Cody/CoolBufferBot(In-game)

lostcalpolydude
10-14-2009, 12:19 AM
VIP key is a free pull, and no one should have two of them anyway (DC collection maybe, but then it isn't in hagnk's to pull). There's nothing wrong with two scripts trying to pull it, especially since pullcrap.ash should be able to handle the case where someone doesn't have the key at all to pull it.

Bale
10-14-2009, 12:55 AM
VIP Key does not cost a pull so there's never a reason not to pull it.


Nice script. The commands to equip starting gear will be wasted server hits in softcore since most people will pull something better.
Good point. Fixed that. Now it only does that if you're in hardcore. New version can be downloaded from the first post.

codster62
10-14-2009, 01:04 AM
Haha. My bad, I haven't been ascending in a while, and I forgot it doesn't take a pull. :D

halfvoid
10-14-2009, 07:00 AM
i just wasn't sure if ascend.ash set choice adventures on its own. i know a couple other scripts change them. which would counteract the hard work of your script as soon as one of the others ran.

Bale
10-14-2009, 07:14 AM
I hope that ascend.ash sets choice adventures or else it won't work very well. I'd suspect it would change the same ones in which case there'd be a bit of redundancy, but that's not really a problem.

halfvoid
10-14-2009, 06:23 PM
well, regardless i'm gonna let it do its thing next time i ascend.

dj_d
10-17-2009, 05:29 AM
This looks super cool! Ascend.ash does set some choiceadvs. I just checked and it's nothing that would conflict with this (although a few might be redundant).

There is one big problem though: Pullcrap auto-registers itself as your preascension script, which will break this. I suggest including and running this script from pullcrap, which should solve the problem.

Bale
10-17-2009, 05:32 AM
If you'd like, you could add this to ascend.zip and include newLife in pullcrap. If you like this script, then I think that would be a perfect solution for anyone who uses ascend. It would also allow you to remove any redundancies.

dj_d
10-18-2009, 03:54 AM
I'll definitely do that when I get back to ascending- but that's a ways away. I need to get a hamster first. :)

Bale
10-20-2009, 09:04 PM
Found a bug. I was selecting the wrong choice for mysticality classes if you encountered "Don't Hold a Grudge".

Uploaded new version.

bumcheekcity
10-21-2009, 01:34 PM
Bale, as ever you are made out of win and cookies.

Bale
10-21-2009, 09:51 PM
Bale, as ever you are made out of win and cookies.
That's me. I'm a colony of chocolate chip cookies held together with win.

illarion
10-23-2009, 11:43 AM
Love the idea. Typically, I'd just started writing my own version of this the other day, and now I stumble across your (rather more complete/comprehensive) version :)

Couple of questions/opinions though:
1 - It looks like you're choosing to gain food from Fratacombs and Blockin' Out the Scenery, rather than starting the war? I can't see that ever being the desired choice.

2 - (HC perspective) I would never want hp/mp autorecovery set at the start of a run, personally. Granted, you only set hp recovery, but every resource is so precious early on that I think manual control is essential. Obviously I can turn it off myself - I'm just surprised this is the default.

Otherwise, nice job! Certainly saved me some time :)

Bale
10-23-2009, 05:40 PM
1 - It looks like you're choosing to gain food from Fratacombs and Blockin' Out the Scenery, rather than starting the war? I can't see that ever being the desired choice.

There are two different adventures with each of those names. Your outfit determines which you get. I'm setting the other one. For example, Fratacombs is adventures 145 and 146. Only 146 is capable of starting the way.

Bale
11-11-2009, 10:46 PM
Just bumping the thread to let people know that I've updated the script. Just little things really, like ensuring the choice is set to start the Frat-Hippy war and getting your free goofballs. Am I correct that nobody objects to the free sample of goofballs?

Batrachomyomachia
11-18-2009, 09:17 PM
hey, free goofballs!

What do you think of making it reset the dungeon of doom choiceadv to "dead mimic"? I just got bit by that one. (After I get the wand, I set it to "ignore adventure" because I needed to get more potions.)

Bale
11-18-2009, 10:11 PM
That's exactly the sort of silly careless problem that this script exists to fix. Choice adventure added to my script, so go download the new version I just uploaded and you'll never have to worry about skipping a mimic again. :D

Charles Haynes
11-19-2009, 01:40 AM
Grazie mille.

Bale
12-08-2009, 10:54 PM
New version.

A few tiny tweaks. (I'm afraid I didn't keep track of specifics.) The biggest difference is that it now makes use of zlib to keep track of character specific preferences.

Charles Haynes
12-09-2009, 02:29 AM
New version.

A few tiny tweaks. (I'm afraid I didn't keep track of specifics.) The biggest difference is that it now makes use of zlib to keep track of character specific preferences.

Diff sez you're using zlib, you rewrote set_choice to take a choice #, you got rid of gallery default get mainstat (did you really?), you changed the default mana burning threshold (thank you!),

Bale
12-09-2009, 06:07 AM
Ah thank you. I didn't get rid of gallery default to get mainstat, I merely changed the way I express that. Look closer at line 37. Yeah, that's what I meant by tiny tweaks.

Now that you mention it I remember that the other notable thing I did was to fix the mana burning threshold. That screwed me over and I was all like, "WTF?!" So I looked at newLife and I was all like, "What the duh? Was I, like, stoned?!" And then I fixed it. Yeah, that was important.


Unfortunately I just found an unfortunate bug, so please download it again while I slap myself on the head.

That FN Ninja
12-09-2009, 02:24 PM
That screwed me over and I was all like, "WTF?!" So I looked at newLife and I was all like, "What the duh? Was I, like, stoned?!" And then I fixed it. Yeah, that was important.

Bale, I think you should post your thought process more often! That was entertaining to read. :) LOL. Thanks for the pick me up, I needed it!

*back peddling a bit* I mean, not the fact that you got screwed over, just the way you articulated your thought process. ;)

Bale
08-06-2010, 04:34 AM
Uploading my current version of this script. There have been a few small improvements.

Raven434
08-09-2010, 02:19 PM
Yay!

:)

slyz
08-31-2010, 03:06 PM
I added a few lines after line 200 to get the bugged balaclava from the Arena:


if ( have_familiar( $familiar[ Baby Bugged Bugbear ] ) && available_amount( $item[ bugged balaclava ] ) == 0 ) {
familiar fam = my_familiar();
use_familiar( $familiar[ Baby Bugged Bugbear ] );
if ( available_amount( $item[ bugged beanie ] ) == 0 ) {
visit_url( "arena.php" );
if ( item_amount( $item[ lead necklace] ) > 3 )
cli_execute( "refresh all" );
else autosell( 3, $item[ lead necklace] );
}
use( 1,$item[ bugged beanie ] );
equip ( $item[ bugged balaclava ] );
use_familiar( fam );
}

The "refresh all" could probably be replaced by "refresh inv" (the refresh is to make sure Mafia isn't fooled into thinking you acquired 3 lead necklaces by visiting the arena).

EDIT: Added lost's suggestion of autoselling the non-existant lead necklaces instead, but left the cli_execute("refresh all") if you have more than 3 (one of them is true, and you probably wouldn't want to autosell it).

lostcalpolydude
08-31-2010, 05:14 PM
Telling mafia to autosell the lead necklaces works just as well and is probably less of a server hit.

slyz
08-31-2010, 05:30 PM
Nice, I'll edit it then.

Bale
08-31-2010, 07:37 PM
That's nice! I've added a tiny bit of fine tuning and updated the version in this thread.


if(have_familiar($familiar[Baby Bugged Bugbear]) && familiar_equipped_equipment($familiar[Baby Bugged Bugbear]) == $item[none]) {
vprint("Getting your baby buggy bugbear balaclavaed.", "olive", 2);
familiar fam = my_familiar();
use_familiar($familiar[Baby Bugged Bugbear]);
if(available_amount($item[bugged balaclava]) < 1) {
if(available_amount($item[bugged beanie]) < 1) {
visit_url("arena.php");
if(item_amount($item[lead necklace]) == 3)
autosell(3, $item[lead necklace]);
else cli_execute("refresh all");
}
use(1,$item[bugged beanie]);
}
equip($item[bugged balaclava]);
use_familiar(fam);
}

StDoodle
09-12-2010, 08:48 PM
Bale;

I wrote my own postAscension script a while back, so it took me a while to give yours a look. I finally tired of dealing with a few things that yours included and mine didn't, such as choice adventure settings, so I thought I'd give yours a poke and see what combining I could do. I WAS going to make a request that you re-write the script in such a way as to make it easy to import into my own script, and still be able to update, but you beat me to the punch by moving all of the actions to their own function and calling them from main()! Thanks again Bale.

Bale
09-12-2010, 11:06 PM
I'm glad that my orderliness helped you out. :) However I'm still curious what your postAscension script does that mine doesn't. If those aren't too specific to yourself or your characters I'm wondering what I might want to combine into mine.

StDoodle
09-13-2010, 03:21 AM
They're fairly specific, mostly. First, it autosells the pork gems. Then it buys a maiden wig, frilly skirt, and detuned radio if in a muscle sign, and equips the first two. Then it casts sugar twice and stickers once (because I'd done that backwards too many times). Finally, it grabs my hebo from the terrarium so I remember to red-ray first thing.

Everything else was stuff your script does that I've since taken out.

Bale
09-13-2010, 04:52 AM
Thanks. That's specific as you say. I don't think I'll add it.

Though, just for my personal use I might want to add pretty much everything you mention. Because I ALWAYS do that stuff. Just for my personal version of the script. But it isn't the sort of thing that should be enabled by default. Yeah, I'm getting a little tired of doing that EVERY ascension...

However I don't see any reason to buy the wig and skirt at the beginning of an ascension. I never do that.


void special() {
vprint("Now for a few things that only "+my_name()+" wants to do.", "blue", 2);
switch(my_name()) {
case "Bale":
if(item_amount($item[baconstone]) > 0)
autosell(1, $item[baconstone]);
else if(item_amount($item[hamethyst]) > 0)
autosell(1, $item[hamethyst]);
else autosell(1, $item[porquoise]);
buy(1, $item[detuned radio]);
change_mcd(10);
use_skill(2, $skill[Summon Sugar Sheets]);
use_skill(1, $skill[Summon Stickers]);
create(1, $item[sugar shirt]);
create(1, $item[sugar shield]);
use_familiar($familiar[He-Boulder]);
equip($item[sugar shield]);
equip($item[sugar shirt]);
break;
}
vprint("Go forth and defeat the Naughty Sorceress, young adventurer!", "green", 2);
}

heeheehee
09-13-2010, 06:19 AM
Low-level (no requirements) equips with half-decent (better than starter equips) DA, perhaps? But okay, I guess that might save a few hit points at best.

Bale
09-13-2010, 06:55 AM
Well, it would cost me 160 meat to get 200 DA instead of 80 DA to start which would mean absorbing 35% damage instead of 18% damage. (Passive sills are awesome.) For an unskilled character it would give them 70 DA (instead of 10) so that it can absorb 16% of damage.

That doesn't suck, but I wonder if it is worth 160 meat at the beginning of the game.

StDoodle
09-14-2010, 03:13 AM
I started doing it because it was good to have for a meat maid. But outside of oxy, you shouldn't really make one in-run anymore. However, I personally find the DA is worth it; at early levels that often means surviving one more hit without healing. But yeah, it depends on having Tao (not worth it without), and it probably still isn't worth it unless you're pumping ML quite a bit. (Which I am; <3 teh sauce, as ASS would say.)

StDoodle
09-21-2010, 11:45 AM
Request;

Could you add free pulling of all bricks, so that I can hit my clannies before they get their tent up? NB; storage_amount() doesn't seem to work on free pulls, but available_amount(); does.

Bale
09-21-2010, 10:31 PM
retrieve_item( available_amount($item[brick]), $item[brick] );

Seriously? That code is funny just to look at it. I doubt that's of general interest, so why don't you just add that to your personal stuff?

StDoodle
09-22-2010, 12:21 PM
Well, there are other ways you could code it, if that's your main concern. :p

Honestly, it just seemed useful. But I'm used to HCN, where we always try to brick each other before the tent is up. I have no idea if this is common elsewhere, as I don't really spend time elsewhere. If it's not, yeah, not worth adding. But it certainly wouldn't hurt, in any case, aside from code aesthetics. ;)

Bale
10-07-2010, 06:28 AM
The update to KoL yesterday broke a couple of lines in this script. :(

I've updated the script to account for the changes!

StDoodle
10-07-2010, 02:16 PM
Bale; while you're making changes, would you mind moving the set_choice() functions outside of new_ascension()? There are a couple of choice adventures I like to set differently than the script, and it would be awesome to have access to those functions in my script for clarity.

Bale
10-07-2010, 09:41 PM
StDoodle: Done. I updated the script in the first post, but I'm not changing the version number since it's functionally identical. Enjoy.

Also, you might note the special() section at the end. You can put your character's name there if you want those functions to execute.

jwylot
10-09-2010, 08:03 PM
Thanks Bale, this saves a lot of work when ascending and is well laid out so it was easy to modify to my preferred settings. I was wondering if it would be possible to modify the First things first settings from this. As an example, I would prefer only to olfact zombie waltzers as mox and not as a mus or mys. I'm a script virgin so forgive me if I'm asking the impossible :)

Bale
10-09-2010, 08:48 PM
That would quite be possible, it could easily reset zlib variables. I don't use FTF to control my olfaction settings, so I only have a vague idea of what you're asking. Please explain what you envision. In detail. Explain why those changes are likely to be universally accepted. I have no idea what the FTF issue is, so assume that I need the basics explained to me. (I only use FTF&SS for handling troublesome zones like the junkyard.)

Theraze
10-09-2010, 10:18 PM
Easy to set that it only happens when moxie... just put
if (my_primestat() == $stat[moxie])before what you're limiting.

Bale
10-10-2010, 03:55 AM
The script already has a switch on primestat. My question is regarding what he wants to do and why.

Perhaps I misread jwylot's question. I thought he was suggesting how I should alter the script, but maybe he was asking for help altering it himself. It would be easiest to tuck class specific stuff into the big switch-case statement that checks your primestat. Set the zlib variables appropriately there. Then at the bottom use updatevars() to save the new values for those zlib variables.

Theraze
10-10-2010, 05:43 AM
I think he's just asking for how to do it for himself. :) Though I might be misunderstanding.

slyz
10-10-2010, 06:30 AM
Just add something like this (after case $stat[moxie] I guess) :


vars["ftf_olfact"] = "blooper, dairy goat, shaky clown, some zombie waltzers, goth giant, knott yeti, hellion, violent fungus"


Add the same thing without the waltzers in the other cases.

StDoodle
10-10-2010, 06:47 AM
Bale, according to a recent (though I'm afraid I can't remember which) Diamond Radio Program, selecting the stats / mp / hp option in the Defiled Cranny is considered "optimal" under pretty much all circumstances. I'm not sure what your exact criteria are on some of the choice adventure settings, but just thought you may want to take that into account.

P.S. Thanks for the set_choice() access! Also, is there any particular reason that several scripters make lots of their functions encapsulated or whatever the terminology is that way? Except for the rare instance of a function that's only useful inside of another function, I don't understand why it's done.

Theraze
10-10-2010, 07:16 AM
Guessing a bit here, but in a lot of cases, it's significantly easier troubleshooting if you encapsulate your functions... you don't need to worry as much about whether or not the proper type/data will be sent, you just know it will work if nothing got broken. Also, if you're less sure about the proper initialization methods and the like, you can pass data between your functions more easily with encapsulated functions than you can with discrete ones...

Bale
10-10-2010, 07:38 AM
Sometimes I do it for the reasons that Theraze states. Other times I do it because I want to make use of a script's variable as a global to the function.


Just add something like this (after case $stat[moxie] I guess) :


vars["ftf_olfact"] = "blooper, dairy goat, shaky clown, some zombie waltzers, goth giant, knott yeti, hellion, violent fungus"


Add the same thing without the waltzers in the other cases.

And don't forget to updatevars()

jwylot
10-10-2010, 09:34 AM
Thanks guys, that's perfect. I use smartstasis through most of a run. As a mox, olfacting walters when I visit the ballroom to set the quartet or to open the wine cellar is fine as I might pick up a dancecard while waiting for the choice adventure but this isn't something I would want to do as another class. So being able to change the FTF olfact setting depending on class from New Life will make just one less thing to remember on ascension.

Once again, thanks for a great script.

zarqon
10-13-2010, 03:38 AM
StDoodle: In a way, a function is just another kind of flow control, like a while loop. If you have code which is going to be repeated in your function, putting it in a nested function can make a lot of sense.

For me the main reason to use a nested function rather than a loop is when I can use the return value to avoid declaring a temporary variable. As a fairly bad example, rather than


int a = item_amount(thingy);
if (a < 1) a = 1;
perform_action(a, thingy);

I can do


int max(int a, int b) { if (a > b) return a; return b; }
perform_action(max(1,item_amount(thingy)), thingy);

Basically, I really don't like declaring temporary variables which will stick around longer than their usefulness -- or overloading variables in-script, which can be confusing. Return values seem much more suited to the task. Since ASH is Java-based, I would assume that resources are eventually "garbage collected" rather than immediately freed, but it seems a better practice regardless.

Of course, in the end, it doesn't matter as long as the script works well. :)

jwylot
10-13-2010, 10:46 AM
Bale, according to a recent (though I'm afraid I can't remember which) Diamond Radio Program, selecting the stats / mp / hp option in the Defiled Cranny is considered "optimal" under pretty much all circumstances. I'm not sure what your exact criteria are on some of the choice adventure settings, but just thought you may want to take that into account.


I must admit I always run NCs and go for the mainstat choice in the appropriate area and the stat/restore choice in the cranny so I changed the script accordingly.

Bale
10-13-2010, 10:55 PM
I guess I've been setting it wrong all this time. Now version 1.52 goes for stats and restoration in the Cranny. Enjoy.

psly4mne
10-15-2010, 08:14 AM
Minor fix - the script currently doesn't equip old sweatpants.

Bale
10-15-2010, 08:36 AM
Fixed in v1.53

I completely missed that old sweatpants are starter equipment for most classes now. What sense does it make that accordion thieves are the only class which doesn't wear pants?

StDoodle
10-15-2010, 03:18 PM
Bale, the "no sweatpants for AT's" thing was a bug in the rollout that has since been fixed. (I wasn't able to find mention of this anywhere, other than one guy's notes on the old sweatpants talk page on coldfront, so I chatted with a couple of newly-ascended AT's to confirm.)

Bale
10-15-2010, 05:25 PM
Well it was weird, so I just told my script to equip sweatpants if you've got them. I figured that should cover all bases.

Theraze
10-23-2010, 06:45 AM
The new goofballs should be something like:
// Every ascension you can get a free sample of goofballs.
if(visit_url("tavern.php?place=susguy&pwd").contains_text("First bottle's free, man")) {
vprint("I know they're bad for me, but... \"Hey! Free Goofballs!\"", "olive", 2);
visit_url("tavern.php?action=buygoofballs&pwd");
}

Problem is, it might not be available until level 3.

Bale
10-23-2010, 06:53 AM
Problem is, it might not be available until level 3.

Yeah, I don't think that this can be part of the script anymore.

I'm removing this from the script now.

Theraze
10-23-2010, 07:36 PM
Question, would it make sense to have another script named something like "Scripting the end of an old life" or something like that as a postAscension script? Could put the parts like the goofballs check and stuff like that in there. :)

Bale
10-23-2010, 10:02 PM
That could be worthwhile, but honestly, I'll probably just get my own goofballs when the tavern opens up for me so I doubt I'd make that script. And even if I added it to my postAscensionScript, I've already got a lot of personal stuff in my current postAscensionScript that I don't intend to publish.

Someone else might start that script if they desire.

StDoodle
10-23-2010, 10:03 PM
There's already a preAscensionScript that can do exactly that. For safety's sake, you'd probably want to check that they were free before grabbing them (in some rare circumstances -- mostly basement related in my experience -- you may have actually used the free ones).

I've thought about putting such a script together for a while, and maybe I will. It should:
1) Get goofballs (if they're free)
2) Make pies out of all of your keys (needs fail-checking, but since the script won't fire until you're about to ascend, it doesn't hurt for it to use turns)
...and that's where I run out of ideas (which is why I haven't bothered yet).

Bale
10-23-2010, 10:15 PM
2) Make pies out of all of your keys (needs fail-checking, but since the script won't fire until you're about to ascend, it doesn't hurt for it to use turns)

My OCD Inventory script does that for me quite nicely already!

Theraze
10-23-2010, 10:33 PM
Yeah... if you're lazy, could just toss that bit from above on Goofballs into a script for preAscension, since that checks if they're free already. Possibly with OCD Inventory called as well.

Bale
10-23-2010, 11:43 PM
Yeah... if you're lazy, could just toss that bit from above on Goofballs into a script for preAscension, since that checks if they're free already. Possibly with OCD Inventory called as well.

Just make sure that you don't drop 1000 meat for a second bottle of Goofballs! ;)

Bale
10-24-2010, 01:21 AM
Incidentally, now mysticality classes get a Newbiesport™ tent when they ascend. Added it to v1.55

lostcalpolydude
10-24-2010, 04:19 AM
All classes, actually. At least, I got one for my seal clubber run.

Theraze
10-24-2010, 06:46 AM
Also got one on Turtle Tamer (as well as Seal Clubber). Assuming it's all at this point, not just Moxie-hate.

Bale
10-24-2010, 07:27 AM
Well, it'll work for every class if they get the tent. The wiki only says Myst classes here (http://kol.coldfront.net/thekolwiki/index.php/Newbiesport™_tent) and I've only been myst lately... (Only the Pasta and Sauce class pages have been updated with starting equipment...) Well, I guess I won't know about moxie classes having the tent until I get there.l

Winterbay
10-24-2010, 07:54 AM
My AT got a tent when I ascended recently so I would venture to guess that DBs do as well.

ETA: I ascended to an AT that is... :)

StDoodle
10-26-2010, 02:43 AM
Bale; on line 208, where you use the newb tent, you forgot to include a quantity, so the function is reported as undefined. Also, I don't WANT to automatically use my tent until my clannies have time to brick me. :(

Bale
10-26-2010, 04:22 AM
Okay, newbie tent use removed since it isn't as universally desirable as I though.

StDoodle
10-26-2010, 06:37 AM
Bale; how about just put all of the various sections -- choice adv. setting, autoselling stuff, using stuff -- in sep. functions? Then, it wouldn't matter for most people. But those weirdos who care (me) could simply call the choice adv. part and still get shiny update goodness. ;)

Also, despite the fact that I haven't seen you in a dif. clan as far as I can remember (not that I'm a stalker or anything), you really don't know modern HCN "culture." :P

Bale
10-26-2010, 06:51 AM
I'm just socially clueless. I've seen it goin on, but never quite connected. I'm like that IRL also. :(

It's a good idea to split it up into different sections. But not now. I'll do it tomorrow or so.

Winterbay
10-26-2010, 08:15 AM
I'm just socially clueless. I've seen it goin on, but never quite connected. I'm like that IRL also. :(

It's a good idea to split it up into different sections. But not now. I'll do it tomorrow or so.

Seeing as I have no idea why anyone would use a Brick at all on someone I don't think you're alone in that cluelessness :)

Bale
10-26-2010, 09:14 AM
Seeing as I have no idea why anyone would use a Brick at all on someone I don't think you're alone in that cluelessness :)

No, no. It's simple really. When someone ascends they copy-paste the Welcome back message into clan chat. Then when someone is bricked, the message is different if there is no dwelling so you know if he's got his tent up. There's a small, but measurable window of opportunity. It's a game of sorts. Silly of me to have been watching it all this time and not comprehending it.

The point of bricking is that you can toss them back and forth like hot potatoes without using them up and even pull them from Hangks for free so you always have them in hardcore.

Winterbay
10-26-2010, 10:07 AM
I quite often don't get my tent up until the 2nd or 3rd day (if at all) because I forget so the window of opportunity would be much larger for me :)

Veracity
10-26-2010, 03:33 PM
Reminds me of the one and only time I visited HCN to chat. I said "hello" and somebody immediately hit me with a jawbruiser - which sort of ruined my ability to chat.

I left and have not been back.

"Culture". Feh.

lostcalpolydude
10-26-2010, 04:14 PM
I thought the proper response to a jawbruiser was to use an SGEEA to remove the effect and laugh at them for wasting an item that costs 50k+.

StDoodle
10-26-2010, 04:55 PM
... the one and only time I visited HCN to chat ... I left and have not been back.

:( It's a very assorted mix there. I've had some really great conversations, but as with many groups, it only takes a few a**holes to ruin things, and we do have one or two.

Winterbay
10-26-2010, 08:59 PM
Ok, so what does HCN stand for that isn't Hardcore No-path which was what I thought first?

StDoodle
10-26-2010, 09:37 PM
Ok, so what does HCN stand for that isn't Hardcore No-path which was what I thought first?

HardCore Nation.

Bale: probably something that should be off / commented out by default, but for those who are mad about pvp, this could be useful in your script:


visit_url("campground.php?confirm=on&smashstone=Yep.&pwd");

Bale
10-26-2010, 10:21 PM
Also worth considering now that PvP is optimal in HC.

StDoodle
10-26-2010, 11:52 PM
Yeah, especially as rank is set based on level when you smash the stone. Doing so right away means more easy fights against HC PvP multis. ;)

I would hazard to suggest a zlib variable for it, perhaps?

Bale
10-27-2010, 12:03 AM
Yeah, especially as rank is set based on level when you smash the stone. Doing so right away means more easy fights against HC PvP multis. ;)

Are there dedicated PvP loser multis? Where is this list?


I would hazard to suggest a zlib variable for it, perhaps?

Yeah. That's what I'm thinking. I'd initialize the variable to false.

Heck, maybe I'll put the tent on a zlib variable also.

StDoodle
10-27-2010, 01:19 AM
Are there dedicated PvP loser multis? Where is this list?

So far, everyone I've seen in "PvP Fights Only," "Hobocore Nation," and "AFH: Away Team" has been a PvP "easy victory" multi. They all have a note about it on their profile (which I view from the mafia flower hunter interface, 'natch'.)

Bale
10-27-2010, 08:11 AM
Updated the script to v1.60

I've added everything StDoodle suggested, including brick pulling and refactoring the code into separate blocks for importing goodness. Added a bit more also. The script has these new zlib variables:


newLife_FightBedstands
newLife_SmashHippyStone
newLife_UseNewbieTent


Those options are all documented in the first post, but they do basically what you'd expect.

Winterbay
10-27-2010, 08:15 AM
I would just like to point out thatthe link to the issue in yoru first post is non-working. Most probably because it leads to a post in the old bug-report system.

Bale
10-27-2010, 09:14 AM
Thanks. I mourn the loss of that bug reporting system. Lots of interesting stuff is gone forever.

Bale
01-24-2011, 09:04 AM
Updated newLife to v1.61


The script will now properly set the new options for gaining the Ballroom Key in the Bedroom.

Added a new variable newLife_SellPorkForStuff which can be set to true if you want the script to automatically sell off your pork gems to acquire a detuned radio, seal tooth and stolen accordion.

StDoodle
01-26-2011, 02:58 PM
Geez Bale, pretty soon my postAscensionScript wrapper will be down to just a few lines.

Now that we have time functions, I was hoping you'd add the option of posting a "welcome back" message, along with a brick-waiting-delay on the tent. Perhaps it could be a single setting; I dunno if anyone outside of HCN does this stuff. It's worth noting that if you were in any other clan, I'd consider this a feature that I should take care of on my own; but you're one of us. ;)



string welcome_back() {
return now_to_string("MM/dd/yyyy hh:mm aaa") + " - Welcome Back to the Kingdom of Loathing. Noob.";
}


That will return the "normal" welcome back message, for use with chat_clan(). If you also add in the delay between message & tent, I would like to request at least 60 seconds. Thanks!

Theraze
01-26-2011, 04:12 PM
StDoodle, are you wanting this to return based on local time, or based on AZ time?

StDoodle
01-26-2011, 04:24 PM
Local; my desires for AZ / netural time were for something else (clan management-related; stash-sharing & such).

Bale
01-26-2011, 07:22 PM
It's worth noting that if you were in any other clan, I'd consider this a feature that I should take care of on my own; but you're one of us. ;)

I think I already volunteered, but there's no way I could turn down a brick guardian asking me for a favor. If I did, there's no telling what you'd do with those bricks. O.O



void campground() {
// If the player is in Hardcore Nation it is time to send a "Please brick me" announcement!
int my_clan;
matcher clan = create_matcher("whichclan\=(\\d+)", visit_url("showplayer.php?who="+ to_string(my_id())));
if(clan.find())
my_clan = clan.group(1).to_int();
if(my_clan == 41543)
chat_clan(now_to_string("MM/dd/yyyy hh:mm aaa") + " - Welcome Back to the Kingdom of Loathing. Noob.");
// Put up the tent... after a suitable bricking window.
if(vars["newLife_UseNewbieTent"] == "true" && item_amount($item[Newbiesport™ tent]) > 0) {
if(my_clan == 41543) {
vprint("We need to give all rivals... Um, I mean clannies a chance for bricking!", "olive", 2);
wait(60);
}
use(1, $item[Newbiesport™ tent]);
}
}


I think I'll make that non-optional for HCN clannies. If you ascend, it WILL inform everyone. If you it set to auto-tent it will then pause 60 seconds before tenting so that there is an adequate brick window.

I may put in a preference for non-clannies to enable it, but they won't have the 60 second wait time.

Expect the update sometime later tonight.

StDoodle
01-26-2011, 07:36 PM
Hmm... what happens if mafia & relay browser chat are closed and you use chat_clan()? I assume that as a void type it does nothing, but...

Bale
01-26-2011, 10:04 PM
Interesting question. I tested it in a private clan. Apparently this is what happens:


[18:01]
Players in channel clan:*Bale (1*total)

[18:01] Multi: Testing...
[18:01]
Players in channel clan:*Bale, Multi (2*total)

[18:02]
Players in channel clan:*Bale, Multi (2*total)

[18:03]
Players in channel clan:*Bale (1*total)


Multi did not open a chat window and was not using the relay browser at all, but it sent the chat_clan() message and appeared in chat for a few minutes and then disappeared. I'd say it worked.

Bale
01-26-2011, 10:30 PM
Updated newLife to v1.62

StDoodle will hate me for reorganizing many of the functions, forcing him to adapt his script that calls mine. :) I had reasons for all of that, but I hope it doesn't cause too much trouble.

The biggest difference is that HCN members will now find that they are shouting out their ascensions in clan chat and being forced to wait a mandatory 60 seconds to put up their tents. HCN members now have exactly 60 seconds to brick if the tent was automatic. Enjoy the clan awesomeness, like it or not!

roippi
01-26-2011, 10:45 PM
That's pretty awesome. A "bricking window"?

Bale
01-26-2011, 10:58 PM
I see you like my comment. ;)

StDoodle
01-26-2011, 11:39 PM
Ooh, one thing (that I keep forgetting, it's from a while ago):

Choice adventure #182, airship lack of an encounter: shouldn't this be set to combat for HC folks or lucrecore folks? I find it helpful for getting the metallic A (and obviously it'd be nice if on a hunt). This one's really marginal either way, but if you're going to make one decision vs. the other, I think the option that helps with an NS-required option seems safer. But to each their own. ;)

Also, I love the additions! My script is down to 20 lines (or less, since some are blank / comments) now. ;) If you're curious:


import "newLife.ash";

boolean sugar = true; //for below

void main() {
if (in_bad_moon()) abort("No automatic setup for Bad Moon; you're on your own!");
//do stuff from Bale's script
new_ascension();
//fix Bale's choice adv. 'mistakes'
set_choice(182, 1, "Fantasy Airship, Lack of an Encounter: Combat");
if (in_muscle_sign()) { change_mcd(10); }
else if (in_mysticality_sign()) { change_mcd(11); }
if (sugar) {
//use tomes
use_skill(2, $skill[Summon Sugar Sheets]);
use_skill(1, $skill[Summon Stickers]);
use_familiar($familiar[He-Boulder]);
cli_execute("make 1 sugar shirt; make 1 sugar shield; equip sugar shirt; equip sugar shield");
}
}

Bale
01-26-2011, 11:45 PM
Choice adventure #182, airship lack of an encounter: shouldn't this be set to combat for HC folks or lucrecore folks? I find it helpful for getting the metallic A (and obviously it'd be nice if on a hunt). This one's really marginal either way, but if you're going to make one decision vs. the other, I think the option that helps with an NS-required option seems safer. But to each their own. ;)

I use a script in my mood to fix that one, changing the adventure based on circumstances. You'd be right that the metallic A is a better default, but that is dependent on having +20ML which not everyone will have all the time. (It's really only easy to attain if the character has torso+armorcrafting or ur-kel's.) Without the ML, the adventure is a waste. :( That's why I made the decision that to set it this way. Obviously your millage varies.

StDoodle
01-27-2011, 02:30 AM
I forget that there are people who aren't running lots of ML... ;) Perhaps a have_skill() check?

Bale
01-27-2011, 03:22 AM
I forget that there are people who aren't running lots of ML... ;) Perhaps a have_skill() check?

Heh. Maybe that would be a worthwhile way to determine the default.

Bale
01-27-2011, 06:50 AM
Updated newLife to v1.63

This is the Fantasy Airship change that StDoodle just suggested where your preference is based on your permanent skills. Looks like StDoodle gets to remove another line from his script.





if (in_bad_moon()) abort("No automatic setup for Bad Moon; you're on your own!");

Really? I think that most, if not all, of my choice adventure settings are still relevant in Bad Moon. A lot of the rest also, though they are less troublesome to do manually.

StDoodle
01-27-2011, 10:33 AM
There are certain things, like meat management, that I'm much more careful of in bad moon (or would be, if I went back). Yeah, ideally, I'd just call a certain sub-set of the functions from your script. But since I haven't been BM in forever and don't plan to return soon... meh. ;)

Theraze
01-27-2011, 01:23 PM
Having been in Bad Moon for the last several months, have to say that I do still use most of the parts of the script in BM, though certain actions that wouldn't normally be so become more appealing... the 'trivial' meat gain in the bedrom of ~500 meat becomes relatively valuable, when it comes up. And I'll set all primestats to collect the ballroom curtain moxie, so I can outmoxie the various bosses that would otherwise be expensive/thoughtful to beat. But yeah, newLife is still useful for BM, in my case at least. :)

xKiv
01-27-2011, 02:22 PM
This is the Fantasy Airship change that StDoodle just suggested where your preference is based on your permanent skills.

How about a buggedbear? That can be +20 ML in HC too, right?

Bale
01-27-2011, 09:27 PM
How about a buggedbear? That can be +20 ML in HC too, right?

Yeah, it certainly can be. I like it so that I can easily run at +40ML. I huggle my buggedbear. However I'll leave it like this. If someone doesn't have those skills they might not be ready for surviving at that ML. That preference is one that needs to be adjusted in-run anyway, so it is really not a high priority to pre-set on ascension.

Weatherboy
02-06-2011, 02:12 AM
You know what I keep forgetting, since the 3 turns really don't mean that much to me... to visit the artist. Especially on my hc characters, whisker meat is pretty nifty.

Bale
02-06-2011, 04:10 AM
You could always edit that in, but I don't intend to add anything to this script that could cost a turn.

Weatherboy
02-06-2011, 05:36 AM
OK, this is going to sound like a stupid question. I got town_wrong.php?place=artist but how do I push the button on that page?

Winterbay
02-06-2011, 06:19 AM
Use the Mini-Browser and navigate to the artist and click the button. This will tell you the URL submitted to KoL.

Weatherboy
02-07-2011, 01:30 PM
OK, I found it. town_wrong.php?place=artist&getquest=1

Thanks. I think I'm going to make the Artist a zlib thing, cuz I kinda don't want to do it on my normal guy, but my hc people will really appreciate it until they get more skills. Or maybe i'll add it to special() as part of the switch() on names.

Theraze
02-07-2011, 01:45 PM
There's an artist unlock in the Rinn quest scripts as well... when I want the artist, I tend to run that when I have a few open adventures.

halfvoid
02-08-2011, 01:43 AM
I myself find rinn's super useful. Run that and bumcheekascend side by side on my hardcore runs.

Raven434
03-13-2011, 04:48 PM
As always, thanks Bale.

This makes stringing runs together *much* smoother.

/salute

Bale
03-13-2011, 06:36 PM
It's one of my favorite scripts despite its simplicity. Glad you like it also.

soirana
03-16-2011, 05:16 PM
sweet script, but...

from my HC perspective... Is it possible to set it to ---
A) autosell all gems
B) stop it getting seal tooth [i consider later waste of meat on day one as moxie class].

I can locate which part of script does it, just afraid can't fix it for myself as the scripting language sound rather wierd.

slyz
03-16-2011, 05:45 PM
A) autosell all gems

type zlib newLife_SellPorkForStuff = true in the gCLI.



B) stop it getting seal tooth [i consider later waste of meat on day one as moxie class].

type zlib newLife_SellPorkForStuff = false in the gCLI.

Do I smell a conundrum?

To stop it from getting a seal tooth, you can also delete this part (lines 283-288):


if(available_amount($item[seal tooth]) < 1) {
while(!worthless() && meat4pork(50))
use(1, $item[gum on a string]);
if(worthless() && (available_amount($item[hermit permit]) > 0 || meat4pork(100)))
hermit(1, $item[seal tooth]);
}

but you will have to do it at each update.

Theraze
03-16-2011, 06:42 PM
The bottom line regarding the seal tooth is that it now presents itself as the only easily available stasis item. As you will want some form of stasis by the time you hit the gremlins, it isn't a bad thing to have stasis prepared. Especially if you use a NPZR-class familiar... there's an 11% chance per round (in the first 10) of meat, meaning that you'll make up the meat before you hit day 2 with a stasis item. If you're using something else, it all depends on what you're using. :) But yeah, for the combination you want, you'll need to delete those lines, every time...

StDoodle
03-16-2011, 08:25 PM
Theraze, what you'll want by lv12 and what you'll want day 1 are vastly different in high-end HC. :p

Though, I honestly can't see why you wouldn't get the seal tooth day 1, as you're going to need worthless items unless you skip both shore & car & using a clover for sonar. (Possible under some circumstances.) I can, however, see many situations in which you'd at least want to put this off until after you sorted out your eating and drinking to some degree.

Theraze
03-16-2011, 08:30 PM
True, StDoodle, but if I'm actually playing optimally, I'm going to consider everything myself, not let a one-size-fits-most thing do... much of anything. :D Well, not without doing my own tweaks to it first.

Bale
03-16-2011, 11:06 PM
sweet script, but...

from my HC perspective... Is it possible to set it to ---
A) autosell all gems
B) stop it getting seal tooth [i consider later waste of meat on day one as moxie class].

I can locate which part of script does it, just afraid can't fix it for myself as the scripting language sound rather wierd.

Everyone else ha already said everything, except for this: newLife_SellPorkForStuff = true will allow the script to purchase a seal-tooth, but it will only sell the gems that are necessary to sell to buy stuff like the seal tooth and detuned radio. It won't sell all pork gems. I like to sell them off only as necessary. That's a quirk of mine, but if you use my script you're stuck with it unless you mod it for your own usage.

And I cannot imagine not wanting a seal tooth, even as a moxie class on day 1. I want that tooth for help with several things on day 1. (If nothing else, it helps me to be sure I can go 11 rounds without killing a monster while waiting for my red ray on turn 2.) So once again, you're stuck with it unless you mod the script.

I just don't like to add preferences for options that I cannot see as useful.

StDoodle
03-17-2011, 11:19 AM
I can understand the seal tooth part, as I was more playing "devil's advocate" than honestly seeing a situation where one wouldn't want the seal tooth early. (Actually, for the reason you mentioned, I've been quite upset the one time I forgot to get one while a new version of your script + my wrapper were causing errors.) The pork gem part is kinda confusing though; I can never imagine why you wouldn't sell them all, save for Veracity's weirdness (:p), except maybe in a myst sign. It just isn't the behavior that I expect from such a preference, I guess.

jwylot
03-17-2011, 03:39 PM
I'm with Bale on the seal tooth for day 1 but a switch to sell *all* pork gems would be nice as I never have too much meat when I'm pushing hard.

xKiv
03-17-2011, 03:59 PM
wouldn't[/i] sell them all

Smoldering box.
You won't sell them in BM, even if you want to :)
But that's obviously a weirdness too.

Theraze
03-17-2011, 05:26 PM
And in that case, you don't actually have the gems to sell... so it's not really an exception in that way.

soirana
03-17-2011, 06:22 PM
Everyone else ha already said everything, except for this: newLife_SellPorkForStuff = true will allow the script to purchase a seal-tooth, but it will only sell the gems that are necessary to sell to buy stuff like the seal tooth and detuned radio. It won't sell all pork gems. I like to sell them off only as necessary. That's a quirk of mine, but if you use my script you're stuck with it unless you mod it for your own usage.

And I cannot imagine not wanting a seal tooth, even as a moxie class on day 1. I want that tooth for help with several things on day 1. (If nothing else, it helps me to be sure I can go 11 rounds without killing a monster while waiting for my red ray on turn 2.) So once again, you're stuck with it unless you mod the script.

I just don't like to add preferences for options that I cannot see as useful.

will need to eviscerate script on my own in such case.

From HC perspective i do not see any use in other way....

Pork gems will always be autosold and let say suckerpunch does same for zero meat and mana as seal tooth.

EdFox
03-22-2011, 06:04 PM
The Suspicious Looking Guy has moved to the new tavern. I've noticed the last few ascentions NewLife didn't get the free goofballs.
I did my best to locate the line in newlife.ash that got them but I failed. Has that function been removed and I missed it in the discussion?

Anyway, here's the new URL, which is about as helpful as I can be: tavern.php?place=susguy

Bale
03-22-2011, 09:36 PM
Has that function been removed and I missed it in the discussion?

It was removed and you missed it. newLife cannot get you goofballs anymore since the tavern is not available until level 2. I've moved goofballs to my preAscensionScript. Put the following function into your preAscensionScript and you're good.


void goofballs() {
if(visit_url("tavern.php?place=susguy&pwd").contains_text("First bottle's free, man")) {
print("I know they're bad for me, but... \"Hey! Free Goofballs!\"", "olive");
visit_url("tavern.php?action=buygoofballs&pwd");
}
}

If you do not have a preAscensionScript, then copy/paste the following to preAscension.ash


void goofballs() {
if(visit_url("tavern.php?place=susguy&pwd").contains_text("First bottle's free, man")) {
print("I know they're bad for me, but... \"Hey! Free Goofballs!\"", "olive");
visit_url("tavern.php?action=buygoofballs&pwd");
}
}

void balloon_monkey() {
if(item_amount($item[balloon monkey]) > 0)
visit_url("lair2.php?preaction=key&whichkey=436&pwd");
}

void main() {
if(get_property("kingLiberated").to_boolean()) {
goofballs();
balloon_monkey();
} else abort("WTF!? Why is a preAscensionScript runnin'?");
}

Then in the CLI type: set preAscensionScript = preAscension.ash

EdFox
03-22-2011, 09:43 PM
It was removed and you missed it.

Ah, bugger. Sorry for the bother but thanks for the info.

deathprog23
03-27-2011, 04:03 PM
Today I got the following error and the script refused to run: Bad item value: "Newbiesportô tent" (newLife.ash, line 194)
I'm using mafia build r9190
Thanks for any insight!

Bale
03-27-2011, 06:55 PM
My only insight is that the error might happen if you edited the file yourself and used an editor that could not handle that character.

zarqon
03-29-2011, 03:39 AM
Thanks for this Bale! I finally had time to give this my pre-run inspection (mainly involves removing all ZLib settings that I'll never want to modify) and now it's installed on a couple characters. It's been wonderful not having to click so much the last several ascensions. The extra bits with the bugbear and selling gems for needed stuff was particularly nice.

I added my day-one pulls/summons/etc for various characters to the special() function, and I'm having lovely results. Cheers.

Bale
03-29-2011, 04:18 AM
I'm glad you like it. This is one of my simplest scripts, but I find it takes a lot of trouble out of my runs despite being so simple.

Bale
04-20-2011, 10:22 PM
Updated newLife to v1.64

The script has been vamped again. It will now skip all non-combats in the Cyrpt, except for the rattling draw that unleashes a swarm of ghuols. Obviously I've removed the zlib variable newLife_AutomaticallyFightCyrptBosses since that's no longer a choice option.

shazbot
04-22-2011, 07:42 PM
FYI, unicode characters, like you use for the NewbieSport tent on lines 198 and 203 cause the script to break on a Mac. At least on my system, using $item[Newbiesport tent] works just as well. You may want to consider striking it out in future versions.

Bale
04-23-2011, 05:11 AM
Thanks for the advice. I'm surprised it does not work on the mac. Can anyone else tell me if they have the same or different experience?

morgad
04-23-2011, 10:13 AM
Thanks for the advice. I'm surprised it does not work on the mac. Can anyone else tell me if they have the same or different experience?

Ubuntu Linux 8.04LTS

> call scripts/newLife.ash

Bad item value: "Newbiesport� tent" (newLife.ash, line 198


best regards
Dave

Bale
04-23-2011, 10:14 AM
Dang. I better change that!

morgad
04-26-2011, 07:14 PM
here is a local patch I will be testing next time I ascend (another 10 days)
Can anyone spot any errors I need to correct?

(used with zlib newLife_SnapShotScript = snapshot-2.2.ash)


fit@ubuntu-fitpc2:~/Public/mafia/scripts$ diff -uw newLife.ash.ref newLife.ash
--- newLife.ash.ref 2011-04-26 19:31:21.000000000 +0100
+++ newLife.ash 2011-04-26 19:59:13.000000000 +0100
@@ -21,6 +21,8 @@
// Use newbie tent if you don't want togive your clannes a fair shot at bricking you in the face!
setvar("newLife_SellPorkForStuff", FALSE);
// Sell pork gems to purchase detuned radio, stolen accordion & seal tooth
+setvar("newLife_SnapShotScript", "");
+ // Name of BCC snapshot script to run at, if any

void set_choice(string adventure, string choice, string purpose) {
if(get_property(adventure) != choice) {
@@ -344,6 +346,13 @@
cli_execute("breakfast");
}

+void run_snapshot() {
+ string script_name = vars["newLife_SnapShotScript"].to_string();
+ if (script_name == "") return;
+ vprint("running snapshot script "+script_name, "blue", 2);
+ cli_execute("script_name");
+}
+
void new_ascension() {
set_choice_adventures();
campground();
@@ -354,6 +363,7 @@
special();
}
check_breakfast();
+ run_snapshot();
vprint("Welcome to your new life as a "+my_class()+"!", "green", 2);
}


best regards
Dave

Bale
04-26-2011, 09:26 PM
Is there more than one possibility of snapshot script that you might run? I guess that covers you if it changes name so you decided not to make it boolean. Also, why not just tuck that into special()? Okay, I don't know why you only want it for one character, but if you want that then you could always put cli_execute("snapshot-2.2.ash") there instead of in main.

Of course that's just the way I think of it. There isn't anything obviously wrong with the way you want to do it, except that the change will be more extensive when I update.

xKiv
04-27-2011, 03:04 PM
cli_execute("script_name");


I think you want just

cli_execute(script_name)
without the quotes. Otherwise it doesn't matter what is the value of script_name.

Bale
05-18-2011, 12:34 AM
This script needs a serious overhaul.


I need to detect and equip the new astral gear you have.
I need to detect and equip the item your pen pal gives you if it doesn't conflict with the astral gear.
I need to not try to get a bugged bugbear beanie if you're afraid of bees.
Don't use the Newbiesport tent if it is scary.
Don't use any starting gear that you might be afraid of, like a seal-cubbing club for instance..
Don't make sugar shield if you have an astral pet blanket.
Don't make sugar shirt if you have an astral shirt.


FUN!

Nobody need to tell me about those things, just assume it will be done in a day or two when I have the time. If you have noticed any other changes I need to make, please point them out now.

Theraze
05-18-2011, 12:42 AM
Various in_sign changes, but those are mostly (all?) in your character section.

Bale
05-18-2011, 12:47 AM
Various in_sign changes, but those are mostly (all?) in your character section.

I'm not sure what you're talking about. I believe that in_muscle_sign() still gives useful information even though I'd now rather use knoll_available(). I'll change that, but it isn't broken. Were you referring to something else?

Theraze
05-18-2011, 01:25 AM
in_muscle_sign won't return whether or not you can get to the detuned radio... As Veracity said:
The existing ASH functions - in_muscle_sign(), in_mystiticality_sign(), and in_moxie_sign() - still exist, but only say whether your sign gives you stat gain benefits of the particular type.
I should provide knoll_available(), canadia_available(), and gnomads_available().

Can't get the detuned radio if you're in_muscle_sign, it's if knoll_available. Same on MCD 11... canadia_available instead of in_mysticality_sign.

Bale
05-18-2011, 07:26 AM
Okay, there is a new version of newLife with all the amazing changes in my earlier post, but it will not run on the current version of mafia because it references items that haven't been added yet. For that reason I'm not updating it in the first post yet.

You can find it right here so that you can use it as soon as the new astral gear is added to KoLmafia.

Theraze
05-18-2011, 01:17 PM
if((knoll_available() && available_amount($item[detuned radio]) > 0) || in_mysticality_sign())
change_mcd(10 + canadia_available().to_int());
Should be:
if((knoll_available() && available_amount($item[detuned radio]) > 0) || canadia_available())
change_mcd(10 + canadia_available().to_int());

Bale
05-18-2011, 08:34 PM
Nice catch. Updated it in previous post.

Bale
05-19-2011, 08:44 PM
Updated newLife to v1.71


Equip any new astral gear you have, except for the astral belt because you might not want +20ML on turn one.
Equip the item your Pen Pal gives you, if it doesn't conflict with the astral gear.
Equip any other starting gear if it doesn't conflict with an Astral or Pen Pal item.
Don't equip any of the above items if you're afraid of Bees and the gear looks scary.
Don't get a bugged bugbear's balaclava if you're afraid of bees.
Don't use the Newbiesport tent if you're afraid of Bees.
Don't make sugar shield if you have an astral pet blanket.
Don't make sugar shirt if you have an astral shirt.
Don't! (http://www.youtube.com/watch?v=6803Gu8tpuw)


Beware of Bees.

Weatherboy
05-27-2011, 06:20 AM
Problem with the astral pet sweater.


Resetting HP/MP restoration settings to minimal
hpAutoRecovery => 0.25
mpAutoRecovery => 0.0
mpAutoRecoveryTarget => 0.0
manaBurningTrigger => -0.05
manaBurningThreshold => 0.90
You have no familiar with you.

Bale
05-27-2011, 06:26 AM
I'm very sorry. I was aware of that bug and fixed it in my local copy, but I had forgotten to update it in this thread. Very belatedly I present...

Updated newLife to v1.72


Bug fixes.

Winterbay
05-27-2011, 06:27 AM
Isn't that more a problem with you not having a familiar rather than with the sweater? And that problem is either from KoL not leting you have a familiar when you ascend (but I don't think that is the case) or you having a familiar with the letter B in it when you ascended.

Edit: Ninjad by Bale :)

Bale
05-27-2011, 06:41 AM
Isn't that more a problem with you not having a familiar rather than with the sweater? And that problem is either from KoL not leting you have a familiar when you ascend (but I don't think that is the case) or you having a familiar with the letter B in it when you ascended.

I discovered that when I ascended and found myself familiarless. I believe because my familiar had a b. That's definitely a problem with the script though since there's no way for the user to control the issue short of remembering to use a legal familiar BEFORE entering the gash. I cannot consider that to be user error.

Winterbay
05-27-2011, 06:44 AM
True, especially since there really is no way to demand that people know what path they are going to end up in before they ascend :)

Bale
05-27-2011, 07:00 AM
Fortunately it wasn't hard for my script to check if you have a familiar. :) I just wish I'd rolled out that fix before it caused trouble for Weatherboy.

ziz
06-05-2011, 08:13 PM
I've run into a minor bug with 1.72:

Bad item value: "Newbiesportô tent" (newLife.ash, line 188)

Changing it from Newbiesport(character) tent to Newbiesport tent works as expected.

shazbot
06-06-2011, 03:50 AM
I've run into a minor bug with 1.72:

Bad item value: "Newbiesportô tent" (newLife.ash, line 188)

Changing it from Newbiesport(character) tent to Newbiesport tent works as expected.

FYI, this is an OSX specific bug, so the repeatability of it will be limited.

Veracity
06-06-2011, 04:33 AM
It's a bug in the script. The script SHOULD use item names with character entities, just like KoL and KoLmafia itself use, rather than operating system depending characters.

In particular, "Newbiesport&trade; tent".

Bale
06-06-2011, 04:38 AM
If this is a bug in the script, then shouldn't KoLmafia write character entities when it does a map_to_file()? Is that a bug with map_to_file()?

Though I agree that I should play nice with OSX. It's just too easy to forget about that problem. I'll fix this in my next update.

xKiv
06-06-2011, 06:31 PM
Mafia writes files in UTF-8 encoding, to my experience (and expects files in UTF-8).
NewLife.ash [1] is not in UTF-8. It's in some sort of 8-bit encoding, probably some "special" MS encoding (I tried iso-8859-1 through iso-8859-10 and none worked, cp1250 works and displays the character as superscript TM)

[1] at least as downloaded by firefox from the attachment in #1. But I am trying it on windows now, so 1) the broken thing is way before mafia even touches the script 2) not OSX specific at all

Veracity
06-06-2011, 08:48 PM
Your script has this:

use(1, $item[Newbiesport\231 tent]);

The actual name of the item is "Newbiesport&trade; tent".

Apparently, some systems are able to parse that original as a trademark symbol and some are not. I'm not sure what this has to do with writing items to maps, since your script doesn't do that. But I'll agree that if we read an item, we should probably normalize the name so that if you DO write it to a file, it will have the expected character entities and will be readable on any system.

Not that that would help with the strangely encoded character embedded right in the script, as in this case.

Veracity
06-06-2011, 09:09 PM
And revision 9406 does exactly that: when we create an item value, we normalize the name to the "data name". This script:

item [int] map;
map[0] = $item[newb tent];
print( map[0] );
map_to_file( map, "out.txt" );
generates this in the CLI:

> enc.ash

Newbiesport™ tent
and this map file:

0 Newbiesport&trade; tent

Bale
06-06-2011, 10:16 PM
Not that that would help with the strangely encoded character embedded right in the script, as in this case.

I understood that. I merely meant that since mine was an error, you should look at how KoLmafia does it also. I figured that might cause trouble on some systems also.

Bale
06-07-2011, 04:29 AM
Updated newLife to v1.73


Compatibility with r9408. Non-ascii characters are no longer permitted by KoLmafia's script parser.

shazbot
06-16-2011, 02:45 AM
Small feature request - automatic use of the astral food/drink/spleen containers.

Bale
06-16-2011, 03:29 AM
Small feature request - automatic use of the astral food/drink/spleen containers.

Good point! I'll add that later.

morgad
06-18-2011, 09:34 PM
Good point! I'll add that later.

If you use the containers, how do you stop eatdrink.ash scoffing the lot at level 1?

Dave

Bale
06-19-2011, 06:04 AM
You could put them in your closet if you don't want EatDrink to use them. Is that bad?

morgad
06-19-2011, 09:41 AM
You could put them in your closet if you don't want EatDrink to use them. Is that bad?

Not bad at all, I have just never used my closet, and was not sure I coud pull stuff back out of it in hardcore.

sorry for the noise

Dave

Theraze
06-19-2011, 03:51 PM
Closet can be used (or not) during hardcore as much as you want... the important thing there is that if you don't want it to be used automatically, be sure you have the preference to "take items from the closet whenever needed" off. :)

Veracity
06-19-2011, 03:58 PM
...which is the default setting for all new users, so you would have had to intentionally set it.

morgad
06-24-2011, 03:57 PM
You could put them in your closet if you don't want EatDrink to use them. Is that bad?

Of course this was assuming you could closet astral drinks :(


Placing items into closet...
Transfer failed for astral energy drink (3)

Dave

Theraze
06-24-2011, 06:20 PM
Or put them into the eatdrink_avoid list, so it won't try to use those items, just like with anything else...

Bale
06-25-2011, 05:33 AM
Of course this was assuming you could closet astral drinks :(

Right... Quest food. Do enough people really use EatDrink during hardcore/ronin that I should nix this?

Theraze
06-25-2011, 05:43 AM
I think eatdrink would automatically use the containers if it was going to eat the items anyways... if people want to avoid using them, set the avoid flag and you're set. If you don't set the flag, that's your choice.

lostcalpolydude
06-25-2011, 05:44 AM
Right... Quest food. Do enough people really use EatDrink during hardcore/ronin that I should nix this?

Probably a good portion of the people using bumcheekcity's ascension script use EatDrink during their run.

fronobulax
06-25-2011, 11:21 AM
Right... Quest food. Do enough people really use EatDrink during hardcore/ronin that I should nix this?

You mean I shouldn't?

Bale
06-25-2011, 09:03 PM
I guess I won't use the astral food/drink/spleen containers. That'd be troublesome to too many people.

zarqon
06-26-2011, 07:09 AM
Bale -- you could use them if EatDrink settings don't exist in vars[]. Would only cause problems in very few cases (regular users of EatDrink would be unaffected), and in my judgement the benefit is clear.

Bale
06-26-2011, 07:35 AM
Nah. That wouldn't work for me since I use EatDrink when I'm in aftercore so those settings are still there. I'd really need a newLife setting to control this if I was to add the feature. Annoying.

Is the benefit really clear? It's pretty simple to just use the container myself. Do people forget that they have them? Should I just consider auto-use of astral consumables to be an EatDrink bug?

zarqon
06-26-2011, 07:39 AM
My point was just that it would be helpful for non-EatDrink-users, without hurting anyone. It's not a universal solution, but it is an improvement. But if it doesn't help you personally then I understand your lack of motivation to add it.

Theraze
06-26-2011, 03:20 PM
Nah. That wouldn't work for me since I use EatDrink when I'm in aftercore so those settings are still there. I'd really need a newLife setting to control this if I was to add the feature. Annoying.

Is the benefit really clear? It's pretty simple to just use the container myself. Do people forget that they have them? Should I just consider auto-use of astral consumables to be an EatDrink bug?

EatDrink is a script to use whatever is 'best' at your current time. The astral food will almost always be 'best'. Though...
Cannot be traded
That line there means that it will use this part of EatDrink:
// Some items are nontradable, so their price can't be calculated. These items
// tend to be very good (e.g. pan-galactic gargleblaster). You may not want
// to consume them lightly, so set this at MAXMEAT. If you do want to eat
// the very best food available regardless of value, set this to 0.
setvar("eatdrink_priceOfNontradeables", MAXMEAT);
int PRICE_OF_NONTRADEABLES = to_int(vars["eatdrink_priceOfNontradeables"]);


Bottom line, 'standard' use of EatDrink won't auto-consume the astral things, because they're non-tradable. If people have told EatDrink to use all their food including untradable, it will, but it's not the default setting. I think you're fine to have NewLife auto-use the containers.

Bale
06-26-2011, 05:59 PM
Everyone has been panicking over nothing? That's fine then. I'll add the feature without further discussion.


Updated newLife to v1.7.4


Unpack astral consumables

Theraze
06-26-2011, 08:33 PM
Yep, the proper answer to this:
If you use the containers, how do you stop eatdrink.ash scoffing the lot at level 1?

DaveShould have been:
Since they're untradable, eatdrink won't scoff them, ever.

Shame on me for not checking the actual script for a week though. :(

shazbot
08-07-2011, 12:10 AM
Another feature which would reduce user error (and subsequently large amount of frustration) would be to either prompt the user or just clear the zlib variable 'is_100_run'.

Theraze
08-07-2011, 12:13 AM
I would hate that... I decide on what run I'm going to do JUST before ascension and set the value, so I can buy the familiar hatchling if needed, etc. Wiping it out would wreck my 100% runs...

I think that's one of those things that is the responsibility of the end-user. If you're going to set a 100% run, you should be aware that you're in a 100% run. It shouldn't be automated, unless the script is actually deciding what your next 100% run is and automatically setting that (and suggesting what class should be possible and not too painful).

Bale
08-15-2011, 06:32 AM
WARNING!

Don't use this script for the new challenge path "Way of the Surprising Fist"! There is an interesting restriction that will cause this script to do something unpleasant. And it may break when it tries to equip your gear.

I'll be rolling out a new version as soon as mafia adds recognition of the new path.

jwylot
08-16-2011, 10:47 AM
I have a suggestion which might help folk who want features which are possibly not universally useful. I know there is a section at the end of this awesome script which can be tailored to a specific character's requirements but this is cleared whenever a new version of new life is posted.

How about putting the special() routine in a separate file which is imported by new life? That way we can fine tune new life to our heart's content without having to do anything on future updates.

Weatherboy
08-16-2011, 02:37 PM
Or... the change I've made to special() is to call weathers_day1.ash. Yes, I have to edit it, but I only have to edit one line.

Bale
08-18-2011, 08:34 PM
Updated newLife to v1.8


Support for Surprise Fisting.


Turns out that I was able to use a workaround instead of waiting for mafia to add support.

Winterbay
08-19-2011, 06:30 AM
Good. Now I don't have to disable the script when I ascend into fistiness after perming that DB palm thing this run.

jwylot
08-20-2011, 11:11 PM
The script donated a pork gem to charity on my softcore character :) Do I need to reset SellPorkForStuff manually in fistcore?

Bale
08-21-2011, 04:22 AM
The most recent version will not sell pork in fistcore. It also won't summon stickers. It also won't try to equip anything in your hands.

jwylot
08-21-2011, 08:41 AM
The most recent version will not sell pork in fistcore. It also won't summon stickers. It also won't try to equip anything in your hands.
Sorry for not being clearer, Bale. I grabbed the new version before ascending. Log shows:

> Checking for updates (running newLife ver. 1.8)...
> You have a current version of newLife.
>.................
> Pork Elf stones are being autosold now to garner a detuned radio, stolen accordion and seal tooth.

autosell: 1 baconstone

StDoodle
08-21-2011, 02:51 PM
Bale, perhaps line 254 should go from its current:


if(!wotsf && item_amount($item[baconstone]) > 0 || item_amount($item[hamethyst]) > 0 || item_amount($item[porquoise]) > 0) {

to:


if(!wotsf && (item_amount($item[baconstone]) > 0 || item_amount($item[hamethyst]) > 0 || item_amount($item[porquoise]) > 0)) {

?

Bale
08-21-2011, 04:19 PM
jwylot , sorry. I thought you were asking what it would do if you used it. Now I understand you were reporting a bug.

StDoodle, thanks. That's definitely the problem.


Updated newLife to v1.8.1


Script is now less charitable.

jwylot
08-21-2011, 05:37 PM
Thanks :)

jwylot
08-31-2011, 04:10 AM
For fisting runs, would it be an idea to set both grabCloversHardcore and grabCloversSoftcore to false? This is a global preference unfortunately which could cause issues for multis running from the same folder.

Bale
08-31-2011, 04:48 AM
That might be a good idea, but I don't think it should be automated by newLife for the reasons that you state.

Anyway, I have my clover automation safely tucked into my loginScript where it only snatches them up when I can easily afford it. I'd suggest that you do the same.

Bale
09-14-2011, 11:25 PM
Improved Fisting support.

Updated newLife to v1.8.2


In Fistcore always fight Bedstands in the Bedroom even if you didn't set preference to fight.
You don't want wallets and you can kill them like a Drunken Baby.
In Hardcore Fisting get meat from The Cyrpt. (Alcove, Nich and Nook only.) You need it.
I discovered that meat isn't as tight in softcore (my experience) so I still skip noncoms.
Select turn 1 familiar since you start with none.
Smarter shield support. (It works the same, but better.)
Completely remove tome casting since Clip Art gives too many more interesting options.

Catch-22
09-15-2011, 01:26 AM
WARNING!

Don't use this script for the new challenge path "Way of the Surprising Fist"! There is an interesting restriction that will cause this script to do something unpleasant. And it may break when it tries to equip your gear.

I'll be rolling out a new version as soon as mafia adds recognition of the new path.

I guess whatever it was couldn't have been too disastrous as I had used the older version twice for the start of fist runs before seeing this :|

Bale
09-15-2011, 03:05 AM
The only disaster was selling off your pork gems to charity. That's unpleasant, but it wouldn't really harm your run. I wasn't more specific because I didn't want to give away spoilers when fistcore was so new.

Catch-22
09-15-2011, 11:43 PM
The only disaster was selling off your pork gems to charity. That's unpleasant, but it wouldn't really harm your run. I wasn't more specific because I didn't want to give away spoilers when fistcore was so new.

Ah, well I disable auto-pork selling anyhow so that would be why it hadn't affected me :) cheers!

Bale
09-20-2011, 08:49 PM
Ooops. My last update had an unpleasant bug! Please update if you're doing any hardcore fisting.

Updated newLife to v1.8.3


Confused two choice adventures and had wrong options to gain meat from the crypt. Now I'm stuck with a rusty bonesaw I don't need.

Winterbay
09-20-2011, 08:53 PM
Ooops. My last update had an unpleasant bug! Please update if you're doing any hardcore fisting.

Updated newLife to v1.8.3


Confused two choice adventures and had wrong options to gain meat from the crypt. Now I'm stuck with a rusty bonesaw I don't need.


Yeah, I thought those settings were a bit odd. Good thing I checked the settings before starting my adventures there... :)

Bale
09-20-2011, 09:00 PM
If only you'd pointed that out to me, I'd have 250 meat instead of a useless rusty bonesaw!

(I usually just click the automatic noncombat button in the relay browser instead of moving my mouse. Then I get surprised if it doesn't do what I thought I had scripted! That's what postAscensionScript and moodScript are supposed to do!)

fronobulax
09-21-2011, 01:40 AM
If only you'd pointed that out to me, I'd have 250 meat instead of a useless rusty bonesaw!

What's your IGN? I'd gladly send you 250 meat as thank for all of your contributions ;-)

Bale
09-21-2011, 04:54 AM
LoL

Winterbay
09-21-2011, 05:19 AM
If only you'd pointed that out to me, I'd have 250 meat instead of a useless rusty bonesaw!

(I usually just click the automatic noncombat button in the relay browser instead of moving my mouse. Then I get surprised if it doesn't do what I thought I had scripted! That's what postAscensionScript and moodScript are supposed to do!)

Well... since it last round set them to "skip" I wasn't sure if that was intended or not. It does after all prolong your ascension a bit by not doing optimal killings.

zarqon
09-21-2011, 07:05 AM
LoL

Bale's IGN is evidently LoL (#464911).

Bale
09-21-2011, 07:23 AM
I wish.


Well... since it last round set them to "skip" I wasn't sure if that was intended or not. It does after all prolong your ascension a bit by not doing optimal killings.

It seems that optimal Fisting requires going slightly slower through three zones of the Cyrpt. Once you have enough meat to avoid future farming you can switch those non-combats to skip. Have you done a fast hardcore fist run without getting any meat in the Cyrpt? (I'm defining fast as five days or less.) Perhaps if you got your hardcore fist run down to three days you'd want to skip those non-combats, I don't know. I do know that I got meat in the Cyrpt for my four and five day runs.

Winterbay
09-21-2011, 08:22 AM
I don't do fast... My runs are all along the lines of 6-7 days no matter what sort of restrictions I choose (my last softcore run was 5 days which made me realise that SC karma gathering wasn't for me...). It's a bit odd really...

Bale
09-21-2011, 08:38 AM
Perhaps if your run is that slow you'll have enough time to farm meat in fistcore that you won't need to spend those turns garnering it from the Cyrpt non-combat. On the other hand a few extra turns doesn't really matter for your runs.

Well that's my spirited defense of my newLife settings for the Cyrpt. I don't keep the non-combats set to meat though, once I garner enough I change the settings. ("Enough" means all I will need, minus 500 or so that I expect to farm later.)

Winterbay
09-21-2011, 08:53 AM
I like the settings, so no complaint really. I generally keep it on meat all the way since as my run is slower I generally feel the need to buy more NPC stuff to cover my food and booze requirements :)

Bale
11-15-2011, 05:58 AM
Updated newLife to v1.8.4


Added Trendy support. (Bugged balaclava was the only problem.)

Winterbay
11-15-2011, 06:07 AM
I think they should ban all items created before a year ago, would make playing as an AT slightly more difficult though I guess... :)

Theraze
11-15-2011, 02:09 PM
For curiosity... was this supposed to disable the HCN ascension greeting?

Bale
11-15-2011, 10:07 PM
Oh. Oops. That was an accident 'cause I didn't want it to happen multiple times while I was testing stuff. :(

I'll fix that and re-upload it now. All HCN clannies should re-download it.

StDoodle
11-16-2011, 01:29 AM
You're fired! :P

Bale
11-16-2011, 09:08 AM
Updated newLife to v1.8.4


Added more choice adventures
Fixed HCN ascension greeting



I changed a few of the choice adventures during aftercore farming at the pirate's cove. I was surprised to discover the hard way that this script didn't reset them for me! Fixed. Added choice adventures for a few other outfits also, just in case.

Bale
11-28-2011, 08:45 AM
Updated newLife to v1.8.6


Refactored some code so that I can easily add new challenge paths.
Added user_confirm() to abort and download a new version if the user's challenge path is unknown to this script.
Added one more choice adventure



I will thank myself for this update in 2.5 months when the next challenge path is released. Now all items are simply run through a be_good() check so that I can check for the new challenge path by simply adding rules for the new challenge path to the be_good() function. Some other stuff may need to be added to adjust choice adventures, but at least part of this is streamlined now.

Winterbay
11-29-2011, 08:38 AM
A small typo in the latest version:


Pork Elf stones are being autosold now to garner a stolen accordion, seal toothdetuned radio.


Seems to be missing either a comma or an "and a", or is there a new cool seal toothedetuned radio around that I was hitherto unaware of? :)

zarqon
11-29-2011, 09:00 AM
either a comma or an "and a"

I'd say both, but don't get me started on the Oxford comma. I was hoping to have a relaxing evening at home.

Also, I love this: "Reason: Add bad joke" :D

Bale
11-29-2011, 09:06 AM
Seems to be missing either a comma or an "and a", or is there a new cool seal toothedetuned radio around that I was hitherto unaware of?

Thanks. Fixed it.


Updated newLife to v1.8.6.1


Properly acquire "seal toothdetuned radio"

Winterbay
11-29-2011, 10:33 AM
I'd say both, but don't get me started on the Oxford comma. I was hoping to have a relaxing evening at home.

Also, I love this: "Reason: Add bad joke" :D

I won't then. I've never studied that much English writing so I have no sense on when to use what so I use the rules I would in Swedish which works most of the time, and the ones where it doesn't are often rather obvious :)

Bale
11-29-2011, 08:43 PM
I've never studied that much English writing so I have no sense on when to use what so I use the rules I would in Swedish which works most of the time, and the ones where it doesn't are often rather obvious :)

I've noticed that people for whom English is a second language frequently write (on the internet) with better English than those for whom English is their native tongue. And when their grasp of the language fails, their mistakes are less anoying. (playhavock excluded for I suspect he's actually a very good writer who does it on purpose -- he makes the wrong errors.)

stannius
11-30-2011, 04:10 PM
Four requests, in decreasing order of how useful I think non-stanniuses would find these features:

Open your pack of astral consumables.

Can we get a preference for check_breakfast()? Sometimes that starting MP is too precious to burn on summons.

I like to set sail for virgin booty manually (so I can hand in the volcano map if I've acquired it). In Fist one should probably never set sail, but that ship has sailed (groan).

Finally, I would love some support for 100% familiar checking. I would definitely prefer something that sets both the bcasc_100familiar preference and the is_100_run var. And what I would really like is to something that will somehow cause an abort (forcing me to fix it before continuing). Too many times I have run bumcheekascend or macguffin.ash or whatever, and had it change from my current 100% familiar to the one from a previous run that I never changed, turning my 100% run into a tour guide run.



void familiar100(string touristfamiliar)
{
if(touristfamiliar != "none")
{
string norm = normalized(touristfamiliar, "familiar");
if(norm == "none")
{
abort("do not understand familiar " + touristfamiliar);
}
touristfamiliar = norm;
use_familiar(to_familiar(touristfamiliar));
}

print("100% familiar will be " + touristfamiliar, "green");

// bcasc setting
set_property("bcasc_100familiar", touristfamiliar);

// zlib setting (shared across scripts)
setvar("is_100_run", touristfamiliar); // create var if it doesn't exist
cli_execute("zlib is_100_run = " + touristfamiliar); // set var no matter what
}

Theraze
11-30-2011, 07:43 PM
The is_100_run variable should get set as part of your preAscension script, not postAscension. Especially because newLife will equip your new is_100_run familiar, if it's set. My little preAscension script sets my current familiar as my new 100% run familiar automatically when I ascend, which works beautifully with newLife. Additionally as a problem... if touristfamiliar isn't set, it will leave your is_100_run set but not necessarily what you want it to be.

Basically, I think 100% run stuff, besides equipping familiar, is best outside the scope of this script.

Bale
11-30-2011, 09:12 PM
Four requests, in decreasing order of how useful I think non-stanniuses would find these features:

Open your pack of astral consumables.

I already do this. (Lines 329-331.) Do you have experience of it not happening?


I like to set sail for virgin booty manually (so I can hand in the volcano map if I've acquired it). In Fist one should probably never set sail, but that ship has sailed (groan).

I understand... I'll think about if I want to add a zlib var to allow this.



Finally, I would love some support for 100% familiar checking. I would definitely prefer something that sets both the bcasc_100familiar preference and the is_100_run var. And what I would really like is to something that will somehow cause an abort (forcing me to fix it before continuing). Too many times I have run bumcheekascend or macguffin.ash or whatever, and had it change from my current 100% familiar to the one from a previous run that I never changed, turning my 100% run into a tour guide run.

There has been some similar discussion in this thread. Nothing will be done because some people like to set their 100 variables before the ascending, some people set their 100 variables after ascending. Other people just don't like to be bothered by the whole thing. Please set up a preAscension script for that, just as Theraze suggests.

stannius
12-01-2011, 08:28 PM
My suggestions were not as helpful as I had intended.


I already do this. (Lines 329-331.) Do you have experience of it not happening?

I had commented out "handle_starting_items()" long ago because it failed in Fist runs. I was also wondering why newlife had stopped equipping starting items. Duh.




I understand... I'll think about if I want to add a zlib var to allow this.

Thanks. How about the breakfast request?


There has been some similar discussion in this thread. Nothing will be done because some people like to set their 100 variables before the ascending, some people set their 100 variables after ascending. Other people just don't like to be bothered by the whole thing. Please set up a preAscension script for that, just as Theraze suggests.

Sorry about that... I think I might have been part of that (or a similar) discussion. My mind is like a steel sieve.

Can a preAscension script have a required argument? e.g.


void main(string touristfamiliar)
{
...
}

Thus forcing me to set the proper familiar.

I don't use newLife as a post-ascension script. I just run it manually after ascending and when I switch between computers. That's why a pre-ascension script doesn't help me as much as having it in newlife. But, I recognize that I have unusual preferences and/or am doing it wrong, and that changing a public script for my unusual requirements is not good.

I think what I need to do is combine a preascension script and a post-login script. The latter can warn me if is_100 doesn't match my currently equipped familiar.

Not related to your script but, what's funny about is_100_run and bcasc_100familiar is that it seems they can actually subvert mafia's built in 100% familiar run protection.

Bale
12-01-2011, 08:56 PM
Thanks. How about the breakfast request?

What breakfast request?



Can a preAscension script have a required argument? e.g.

Probably. Give it a try and let us know for sure!

stannius
12-01-2011, 09:07 PM
What breakfast request?


Can we get a preference for check_breakfast()? Sometimes that starting MP is too precious to burn on summons.

I edited it into the post, which might conceivably caused the addition to not get cached or something. OTOH you did quote me as saying "Four requests..." which I edited in at the same time. Curious.


Probably. Give it a try and let us know for sure!

Will do!

stannius
12-01-2011, 09:40 PM
This script checks the two settings, and if they don't match your familiar, pops a dialogue. Since only two buttons are allowed, "yes" = "change the two settings to match the current familiar" and "no" = "fix it yourself, or ignore, but at least you were warned."



// set loginScript = check100familiar
import <zlib>;

void main()
{
if(
(get_property("bcasc_100familiar")!=my_familiar() || vars["is_100_run"] != my_familiar())
&& user_confirm( "is_100_run and/or bcasc_100familiar do not match your current familiar! change settings? (if you want to change familiar click no and fix manually)"))
{
// bcasc setting
set_property("bcasc_100familiar", my_familiar());

// zlib setting (shared across scripts)
vars["is_100_run"] = normalized(my_familiar(),"familiar");
updatevars();
}
}

Bale
12-01-2011, 10:00 PM
I edited it into the post, which might conceivably caused the addition to not get cached or something. OTOH you did quote me as saying "Four requests..." which I edited in at the same time. Curious.

I see it now. The probable reason for the disconect is that you edited it into the post after I read it, but before I clicked "reply with quote". Then I simply snipped out the part I wanted without bothering to read the stuff that I thought I had already read. I could simply have a preference to "do not automatically use resources" which will prevent breakfast and selling pork gems both. How does that sound?

This never troubles me since I have my hardcore breakfast set to NOT automatically cast anything that I might be short of MP for. I've got a breakfast script that checks if I have sufficient MP/meat before casting those summonings, like this snippet:



if(have_skill($skill[Summon Alice Army Cards]) && get_property("grimoire3Summons") == "0" && my_mp() > 30)
use_skill(1, $skill[Summon Alice Army Cards]);

if(have_skill($skill[Summon Crimbo Candy]) && get_property("_candySummons") == "0" && my_mp() > 25)
use_skill(1, $skill[Summon Crimbo Candy]);

(my_path() != "Way of the Surprising Fist" && my_meat() > 2000 && !in_bad_moon() && hermit(5, $item[ten-leaf clover]));

if(visit_url("main.php").contains_text("map7beach.gif"))
cli_execute("raffle 5 " + (can_interact() && my_meat() > 6000? "inventory": "storage"));

if(have_skill($skill[Lunch Break]) && get_property("_lunchBreak") == "false" && (my_mp() > 50 || can_interact())) {
matcher lunch = create_matcher("That jerk (.+?) stole your lunch again!",
visit_url("skills.php?pwd&action=Skillz&whichskill=60&skillform=Use+Skill&quantity=1"));
if(lunch.find())
print_html("<font color='olive'><b>"+lunch.group(1)+"</b> stole your lunch, but you got a sack lunch from the next guy!</font>");





Would a loginScript be a superior solution for you?

stannius
12-02-2011, 04:01 PM
I could simply have a preference to "do not automatically use resources" which will prevent breakfast and selling pork gems both. How does that sound?

Not very good since I want to sell my pork gems, buy a detuned radio, get a seal tooth, etc. :D

Bale
12-02-2011, 09:33 PM
Call me fussy, but I do want to keep extra options to a minimum. How does the loginScript solution sound? After all, if you have that stuff in your breakfast and you log out it will be executed the next time you log in even if you cannot afford it.

jwylot
12-13-2011, 11:12 PM
erm.......running v1.8.6.1 for an HCO ascension throws a warning box saying "Your current challenge path is unknown to this script!"

Bale
12-13-2011, 11:19 PM
Ha! Figures! It's been a long time since I used the dietary paths so I wasn't even thinking of them. Not hard to fix if I know the answer to one question: What does KoLmafia say when you copy/paste ash my_path() to the command line?

jwylot
12-14-2011, 12:28 PM
> ash my_path()

Returned: 3

slyz
12-14-2011, 03:21 PM
Hmm... According to AccountRequest.parseAccountOptions() the path string should be one of the following:

"Oxygenarian" :
"Boozetafarian"
"Teetotaler"
"Bees Hate You"
"Way of the Surprising Fist"
"Trendy"
"None"

But in AccountRequest.parseStatus(), the path is set to whatever is in the "path" field of api.php, with the exception of "4", "6" and "7", which are transformed into "Bees Hate You", "Way of the Surprising Fist" and "Trendy" respectively. It looks like api.php has "path=3" for Oxygenarian, but Mafia doesn't turn the "3" into "Oxygenarian". It looks like it should be done.

Jwylot: could you visit KoL's options -> account menu via the Relay Browser, then check if my_path() still returns "3"?