Scripting the birth of a new life.

Bale

Minion
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

Well-known member
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

Minion
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

Minion
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

Member
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

Minion
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

Member
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
Code:
> call scripts/newLife.ash

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


best regards
Dave
 

morgad

Member
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)

Code:
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

Minion
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.
 

Bale

Minion
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.
 
Last edited:

Bale

Minion
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

Active member
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

Minion
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.
 

Attachments

  • newLife.ash
    16.7 KB · Views: 37
Last edited:

Theraze

Active member
Code:
  if((knoll_available() && available_amount($item[detuned radio]) > 0) || in_mysticality_sign())
   change_mcd(10 + canadia_available().to_int());
Should be:
Code:
  if((knoll_available() && available_amount($item[detuned radio]) > 0) || canadia_available())
   change_mcd(10 + canadia_available().to_int());
 

Bale

Minion
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!

Beware of Bees.
 
Last edited:
Problem with the astral pet sweater.

Code:
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.
 
Top