Scripting the birth of a new life.

Theraze

Active member
Also if you feel bored you can look at my preAscension script in my SVN. It auto sets my current familiar to be my new 100% familiar if the is_100_run parameter is set. Only for the variable, not bcasc_100familiar, since I wasn't using BCA at the time I did that, but... eh, that would make sense to update. Guess that'll be in the next version. :)

After rollover, due to that fiddly SVN bug where if you update the svn\theraze-preascension\scripts\preAscension.ash script file, commit the changes, and log into mafia... it doesn't copy your changes over. It decides that the folder is already synced, and leaves your updated files orphaned in the svn folder. Only way to avoid it is to svn sync before you commit, or svn dec/inc until the files are proper. *sniffs* Oh well. I'll just try to remember to commit after rollover.
 

lostcalpolydude

Developer
Staff member
Perhaps the solution is to create a KoLmafia equivalent of is_100_run and have scripts convert to using it, in much the same way valueOfAdventure is "global"?
Mafia actually uses valueOfAdventure to compare costs. I don't think mafia would use a is_100_run setting anywhere.

After rollover, due to that fiddly SVN bug where if you update the svn\theraze-preascension\scripts\preAscension.ash script file, commit the changes, and log into mafia... it doesn't copy your changes over. It decides that the folder is already synced, and leaves your updated files orphaned in the svn folder. Only way to avoid it is to svn sync before you commit, or svn dec/inc until the files are proper. *sniffs* Oh well. I'll just try to remember to commit after rollover.

You can manually copy a file from /svn to the place it gets run from, if nothing else is working.
 

Theraze

Active member
Well, it does have some sanity checking for 100% runs currently that was added by... hola, I think? It just doesn't know if your 100% run is on purpose or just due to not shifting yet.
 

Lxndr

Member
Okay, I clearly misread something, because when I set this one:

zlib newLife_SellPorkForStuff = false

It still USED my pork elf goodies sack to GET the pork stuff. Is there a way to stop that?
 

Theraze

Active member
Code:
	switch(my_path()) {
	case "Way of the Surprising Fist":
		// Don't autosell in Way of the Surprising Fist
		if($strings[pork elf goodies sack, baconstone, hamethyst, porquoise, chewing gum on a string] contains it) return false;
		break;
Code:
	if(item_amount($item[pork elf goodies sack]) > 0 && good($item[pork elf goodies sack]))
		use(1, $item[pork elf goodies sack]);
	if(item_amount($item[baconstone]) + item_amount($item[hamethyst]) + item_amount($item[porquoise]) > 0 && vars["newLife_SellPorkForStuff"].to_boolean())
		buy_stuff();
Do a LOT of surprising fist runs? Or merge in your own change to make it not break up the sack.

Or I suppose you could ask Bale to change that so if you aren't going to auto-sell the gems, you don't auto-open the sack either. Eh. :)
 

Bale

Minion
Theraze, that sholdn't even matter. The relevant line is this:

PHP:
	if(item_amount($item[baconstone]) + item_amount($item[hamethyst]) + item_amount($item[porquoise]) > 0 && vars["newLife_SellPorkForStuff"].to_boolean())
		buy_stuff();

The function buy_stuff() is where all the purchasing happens. It seems rather hard to understand why that would fail.


Okay, I clearly misread something, because when I set this one:

zlib newLife_SellPorkForStuff = false

It still USED my pork elf goodies sack to GET the pork stuff. Is there a way to stop that?

Could you please post the relevant section of your session log? Also, please do a zlib newlife to check the current value of my zlib variables. Just to be 100% sure that it stayed false.
 

Theraze

Active member
Unless I badly misunderstand, the request is for this:
Code:
	if(item_amount($item[pork elf goodies sack]) > 0 && good($item[pork elf goodies sack]))
		use(1, $item[pork elf goodies sack]);
	if(item_amount($item[baconstone]) + item_amount($item[hamethyst]) + item_amount($item[porquoise]) > 0 && vars["newLife_SellPorkForStuff"].to_boolean())
		buy_stuff();
to change to this:
Code:
if (vars["newLife_SellPorkForStuff"].to_boolean()) {
  	if(item_amount($item[pork elf goodies sack]) > 0 && good($item[pork elf goodies sack]))
		use(1, $item[pork elf goodies sack]);
	if(item_amount($item[baconstone]) + item_amount($item[hamethyst]) + item_amount($item[porquoise]) > 0)
		buy_stuff();
}
I was merely presenting both the one current exception to breaking the sack, being in fistcore, as well as the current breaking/variable checking where the sack is always broken and the gems only sold if the variable is set to true.
 

Bale

Minion
OH! His vague phrase "get the pork stuff" was interpreted by me as get the stuff that is purchased with pork gems. People need to use their words

Sure, that's quite reasonable. Added in r4

svn update
 

fronobulax

Developer
Staff member
Mafia actually uses valueOfAdventure to compare costs. I don't think mafia would use a is_100_run setting anywhere.

I remember things that didn't happen. I thought I remembered KoL popping up some kind of "are you sure?". If it wasn't a 100% run then maybe it was just for Black Cat or maybe I am really confused and it was upon equipping a weapon when Surprising Fist benefits were potentially lost.
 

lostcalpolydude

Developer
Staff member
singleFamiliarRun does exist, apparently. The point of that setting is to not have to think about it ahead of time, based on how it's implemented. It starts out as maybe it's a 100% run (value of 0), switches to a specific familiar once you start a combat (that familiar's ID, I believe), then finally indicates that it isn't a 100% run with a value of -1. That's not so useful for a postAscensionScript, probably.
 

Theraze

Active member
Could set it as the familiar ID through nL using the is_100_run value if we wanted to make things a bit more, but... eh. It won't save automated breakage anyways, so it doesn't really help us.
 

Darzil

Developer
Am having some problems with NewLife. I suspect the issue is actually with the Mafia visit to the Friars not being exited correctly, but as this script is involved I think the process is to report here first.

If I ascend with NewLife installed, I see the following on ascension, repeated endlessly :

Code:
Refreshing session data...
Synchronizing moon data...
Loading character status...
Retrieving character data...
Refreshing closet...
Examining consumables in closet...
Examining equipment in closet...
Examining miscellaneous items in closet...
Updating inventory...
Retrieving quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving campground data...
Refreshing storage...
Examining meat in storage...
Examining consumables in storage...
Examining equipment in storage...
Examining miscellaneous items in storage...
Session data refreshed.
Encounter: The Florist Friar's Cottage
Encounter: The Florist Friar's Cottage
choiceAdventure182 => 4
choiceAdventure182 => 1
(usable quantity of Newbiesport™ tent is limited to 0 by choice adventure in progress)
(usable quantity of bugged beanie is limited to 0 by choice adventure in progress)
You need 1 more bugged balaclava to continue.
Visiting Doc Galaktik...

Visiting Doc Galaktik
Quest accepted.
Refreshing session data...
Synchronizing moon data...
Loading character status...
Retrieving character data...
Refreshing closet...
Examining consumables in closet...
Examining equipment in closet...
Examining miscellaneous items in closet...
Updating inventory...
Retrieving quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving campground data...
Refreshing storage...
Examining meat in storage...
Examining consumables in storage...
Examining equipment in storage...
Examining miscellaneous items in storage...
Session data refreshed.
Encounter: The Florist Friar's Cottage
Encounter: The Florist Friar's Cottage
choiceAdventure182 => 4
choiceAdventure182 => 1
(usable quantity of Newbiesport™ tent is limited to 0 by choice adventure in progress)
(usable quantity of bugged beanie is limited to 0 by choice adventure in progress)
You need 1 more bugged balaclava to continue.
Visiting Doc Galaktik...

Visiting Doc Galaktik
Quest accepted.

However, if I hit escape to exit, and run Newlife again, I see :

Code:
choiceAdventure182 => 4
choiceAdventure182 => 1
Using 1 Newbiesport™ tent...
Finished using 1 Newbiesport™ tent.
Using 1 bugged beanie...
You acquire an item: bugged balaclava
Finished using 1 bugged beanie.
Putting on bugged balaclava...
Equipment changed.
You acquire an item: letter from King Ralph XI
Using 1 letter from King Ralph XI...
You acquire an item: pork elf goodies sack
You acquire an item: disassembled clover
Finished using 1 letter from King Ralph XI.
Using 1 pork elf goodies sack...
You acquire an item: porquoise
You acquire an item: baconstone
You acquire an item: hamethyst
You acquire an item: porquoise
You acquire an item: baconstone
Finished using 1 pork elf goodies sack.
Autoselling items to NPCs...
You gain 500 Meat
Items sold.
Purchasing detuned radio (1 @ 300)...
You acquire an item: detuned radio
You spent 300 Meat
Purchases complete.
Purchasing chewing gum on a string (1 @ 50)...
You acquire an item: chewing gum on a string
You spent 50 Meat
Purchases complete.
Using 1 chewing gum on a string...
You acquire an item: turtle totem
Finished using 1 chewing gum on a string.
Purchasing chewing gum on a string (1 @ 50)...
You acquire an item: chewing gum on a string
You spent 50 Meat
Purchases complete.
Using 1 chewing gum on a string...
You acquire an item: saucepan
Finished using 1 chewing gum on a string.
Purchasing chewing gum on a string (1 @ 50)...
You acquire an item: chewing gum on a string
You spent 50 Meat
Purchases complete.
Using 1 chewing gum on a string...
You acquire an item: worthless trinket
Finished using 1 chewing gum on a string.
Autoselling items to NPCs...
You gain 500 Meat
Items sold.
Visiting the Hermit...
Visiting the Hermit...
Purchasing hermit permit (1 @ 100)...
You acquire an item: hermit permit
You spent 100 Meat
Purchases complete.
Visiting the Hermit...
You acquire an item: seal tooth
Hermit successfully looted!
Hermit successfully looted!
hpAutoRecovery => 0.25
manaBurningThreshold => 0.80
mpAutoRecovery => 0.0
Using 1 astral six-pack...
You acquire astral pilsner (6)
Finished using 1 astral six-pack.
Putting Bugsy the Baby Bugged Bugbear back into terrarium...
Taking Gonald the He-Boulder out of terrarium...
Maximizing...
17 combinations checked, best score 312.10
Putting on mariachi hat...
Equipment changed.
Putting on big pants...
Equipment changed.
Putting on astral mask...
Equipment changed.
Putting on sticky gloves...
Equipment changed.
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
Visiting Mr. Klaw "Skill" Crane Game in clan rumpus room
You acquire an item: stuffed stinky gravy fairy
Visiting Deluxe Mr. Klaw "Skill" Crane Game in clan VIP lounge
Visiting Deluxe Mr. Klaw "Skill" Crane Game in clan VIP lounge
Visiting Deluxe Mr. Klaw "Skill" Crane Game in clan VIP lounge
Visiting Looking Glass in clan VIP lounge
You acquire an item: "DRINK ME" potion
Let's cannonball in the swimming pool.
Encounter: Screwing Around!
You start screwing around in the swimming pool.
In the pool, flipping over.

Doing handstand in clan VIP swimming pool
Encounter: Screwing Around!
In the pool, diving for treasure.

Diving for treasure in clan VIP swimming pool
Encounter: Screwing Around!
You found a lost key in the VIP pool!
Getting out of the pool.

Getting out of clan VIP swimming pool

Harvesting your garden
You acquire skeleton (5)
Saving outfit: Backup
Outfit saved
Welcome to your new life as a Accordion Thief!

The key difference appears to be :

Encounter: The Florist Friar's Cottage
Encounter: The Florist Friar's Cottage
choiceAdventure182 => 4
choiceAdventure182 => 1
(usable quantity of Newbiesport™ tent is limited to 0 by choice adventure in progress)
(usable quantity of bugged beanie is limited to 0 by choice adventure in progress)

I suspect the choice adventure in progress is the Friar's Cottage, from the initial check of what is planted.

Edit : Also got a debug log I notice : View attachment DEBUG_20130628.txt
 
Last edited:

Magus_Prime

Well-known member
I experienced the same behavior earlier in the week but I ascribed it to clicking on the link to update newlife after it was already running.
 

Darzil

Developer
I experienced the same behavior earlier in the week but I ascribed it to clicking on the link to update newlife after it was already running.

I assumed the same last ascension (two days ago), as I also got the update needed bit, but it happened again this time.
 

Veracity

Developer
Staff member
Oh, this is funny. I ascended into BIG! today and noticed the same thing - the infinite recursion by KoLmafia, not newLife, since I don't use it. So, I opened a bug report and just submitted a fix - Revision 12251 - and, having done that, now I see these comments.

Untested, by me, since I won't ascend again until at least Monday.
 

Bale

Minion
No setting. You'd have to personalize the script for that. If you are willing to do so, please follow the instructions that follow. If not... I apologize for speaking in tongues.


How to Modify newLife so that the changes will stick, even if the script is updated:

  1. All changes must be made in the correct directory of your KoLmafia installation: /svn/mafiachit/relay/charpane.ash
    If you attempt to modify any other version the changes will not remain after the script is updated.
  2. Use a text editor that does not format, like Window's Notepad or notepad++
  3. Change line 338 to: boolean radio = false;
  4. In KoLmafia's CLI type: svn sync

That will keep newLife from ever buying a radio.

In case line numbers are tricky for your choice of editor, you can search for the current text for line 338:
Code:
		boolean radio = item_amount($item[detuned radio]) == 0 && knoll_available() && good($item[detuned radio]);
 

Bale

Minion
Oh dear. I should have linked to this page. Sorry for assuming too much. It's just that since every OS has its own location for the mafia directory...
 
Top