The Unofficial Ascend.ash support thread.

Thanks for the quick response.



1) Level 20
2) It ate to 9 and stopped, I had room for more
3) I have mall access, and to my knowledge I give Mafia mall access (it did put the flange in the mall)
4) I ate some food and ran the simulation. The summary is:
Best location is Thugnderdome with the command line 'maximize item drop;familiar Jumpsuited Hound Dog;{Peeled Eyeballs};'. Expected value is 835. The best monster there is Gnasty Gnome, who is worth 2334 meat.
Average meat from combats is 835
Average meat from noncombats (hardcoded) is 0
Combat rate is 100
Total of 6 monsters; meat per adventure is 835
Best monster is Gnasty Gnome, worth 2334.

Hmm... Mine usually have the dooks quite high up (and currently since I've modified mine a bit the Sea), but I guess you might have skipped that side quest and if I remove the sea entries it generally goes to the castle after the dooks.

If it just ate to nine there is something odd with the call to eatdrink.ash which farm.ash calls to eat and drink. It should max out eating before moving on to farming and spleen and drink when it has run out of turns.

I guess you have the version of farm.ash from this thread and not the one that came with the originial zip? (I'm guessing this since that one won't run due to "map modified within foreach" errors)
 
Hmm... Mine usually have the dooks quite high up (and currently since I've modified mine a bit the Sea), but I guess you might have skipped that side quest and if I remove the sea entries it generally goes to the castle after the dooks.

If it just ate to nine there is something odd with the call to eatdrink.ash which farm.ash calls to eat and drink. It should max out eating before moving on to farming and spleen and drink when it has run out of turns.

I guess you have the version of farm.ash from this thread and not the one that came with the originial zip? (I'm guessing this since that one won't run due to "map modified within foreach" errors)

Yeah I have the farm.ash from this thread. I'll just tell it to ignore the Thugnderdome and proceed from there. At least I know I'm not doing anything terribly stupid in the way I use the script, which I assumed was the case.

Thanks for the feedback. I'll try some tinkering and see where it takes me. As for the eatdrink thing, it seems to just reference my max fullness to I don't know why it stopped at 9. I guess I could override that with the actual fullness value.
 
I hate EatDrink. This script was created with an aesthetic that is anathema to my soul. If I had created this script it would look very different indeed, so I find it frustrating to work with this code and frequently do clumsy things midway between dj_d's style and my own. If this script did not work so damn well I'd throw it away and start from scratch.

Anyway, I've been working on fixing get_choc() so that it will work with every chocolate in the game, not just the few that were around when dj_d was still working on this script himself. I think I've succeeded, so here is the fruit of my labor. Feel free to adapt this to the main branch of EatDrink if you see value here.

PHP:
class [item] class_choco;
	class_choco [$item[chocolate seal-clubbing club]] = $class[Seal Clubber];
	class_choco [$item[chocolate turtle totem]] = $class[Turtle Tamer];
	class_choco [$item[chocolate pasta spoon]] = $class[Pastamancer];
	class_choco [$item[chocolate saucepan]] = $class[Sauceror];
	class_choco [$item[chocolate disco ball]] = $class[Disco Bandit];
	class_choco [$item[chocolate stolen accordion]] = $class[Accordion Thief];

item reducechoc(item it) {
	if(it == $item[vitachoconutriment capsule])
		return $item[vitachoconutriment capsule];
	return $item[fancy chocolate];   // all other chocos track together
}

string choc_prop(item it) {
	return "eatdrink_ate_"+ substring(it.reducechoc(), 0, 5);
}
setvar(choc_prop($item[vitachoconutriment capsule]),gameday_to_string() + ":0"); 
setvar(choc_prop($item[fancy chocolate]),gameday_to_string() + ":0"); 

int chocval(item it) {
	int choc_adv;
	switch(simchoc[it.reducechoc()]) {
	case 0:
		if(class_choco contains it)
			choc_adv = 3;
		else choc_adv = 5;
		break;
	case 1:
		if(class_choco contains it)
			choc_adv = 2;
		else choc_adv = 3;
		break;
	case 2:
		choc_adv = 1;
		break;
	default:
		choc_adv = 0;
	}
	if(choc_adv > 0 && class_choco contains it)
		if(class_choco[it] != my_class())
			choc_adv = choc_adv - 1;
	return choc_adv;
}

boolean get_choc() {
	//this is cheap, but I'm going to abuse simchoc to iterate over for the main loop here (irrespective of whether I'm simulating).
	simchoc[$item[vitachoconutriment capsule]] = 0;
	simchoc[$item[fancy chocolate]] = 0; //note this encompasses all other chocos too
	string choc_prop;
	foreach key in simchoc {
		choc_prop = choc_prop(key);
		int mark = index_of(vars[choc_prop], ":");
		if(index_of(vars[choc_prop], ":") != -1 && substring(vars[choc_prop], 0, mark) == gameday_to_string())
			simchoc[key] = substring(vars[choc_prop], mark+1).to_int();
		else {
			vars[choc_prop] = gameday_to_string() + ":0";
			updatevars();
			simchoc[key] = 0;
		}
	}
			
	clear(grub);
	int choco_counter = 1;
	foreach key in $items[chocolate disco ball, chocolate pasta spoon, chocolate saucepan, 
	  chocolate seal-clubbing club, chocolate stolen accordion, chocolate turtle totem, fancy chocolate,
	  fancy but probably evil chocolate, fancy chocolate car] {
		grub[choco_counter].it = key;
		grub[choco_counter].consumptionGain.max = 1;
		grub[choco_counter].consumptionGain.min = 1;
		grub[choco_counter].type = "choc";
		grub[choco_counter] = availability(grub[choco_counter]);
		grub[choco_counter].price = effective_price(grub[choco_counter]);
		choco_counter += 1;
	}
	con_rec vita;
		vita.it = $item[vitachoconutriment capsule];
		vita.consumptionGain.max = 1;
		vita.consumptionGain.min = 1;
		vita.type = "choc";
		vita = availability(vita);
		vita.price = effective_price(vita);
	con_rec choc;
	int to_consume;
	foreach it in simchoc {  //will run twice
		if(it == $item[vitachoconutriment capsule])
			choc = vita;
		boolean giveup = false;
		while(!giveup && simchoc[it] < 3) {
#		for i from 1 upto 3 {  // Chocolates can only be consumed thrice
			if(it == $item[fancy chocolate]) {
				foreach i in grub {
					grub[i].adv.max = chocval(grub[i].it); 
					grub[i].adv.min = grub[i].adv.max;
					grub[i].value = value(grub[i], false);
				}
				to_consume = best();
				if(to_consume == 0) {
					choc.it = $item[none];
					choc.value = 0;
				} else
					choc = grub[to_consume];
			} else {
				choc.adv.max = chocval(choc.it);
				choc.adv.min = choc.adv.max;
				choc.value = value(choc, false);
			}
			if(choc.value > 0) {
				verbose2("Attempting to consume a "+choc.it);
				string consume_entry = format_entry(choc);
				logprint(consume_entry);
				if(pause > 0 && !SIM_CONSUME) {
					verbose("Waiting to consume...");
					print_html(consume_entry);
					wait(pause);
				}
				if(consumeone(choc, "choc")) {
					summarize(ConsumptionReportIndex+": "+consume_entry);
					ConsumptionReportIndex = ConsumptionReportIndex + 1;
					simchoc[reducechoc(choc.it)] += 1;
					if(!SIM_CONSUME) {
						vars[choc_prop(choc.it)] = gameday_to_string() + ":" + simchoc[reducechoc(choc.it)];
						updatevars();
					}
				} else {
					//Update the price, since your purchase may have failed
					int oldprice = grub[to_consume].price;
					grub[to_consume].price = effective_price(grub[to_consume]);
					verbose(grub[to_consume].it+" price updated from "+oldprice+" to "+ grub[to_consume].price+".");
					print_html("FAIL: "+consume_entry);
					logprint("FAIL: "+consume_entry);
				}
			} else {
				verbose2("For "+choc.it+" value "+to_int(choc.value)+" is less than or equal to zero.");
				giveup = true;
			}
		}
	}
}

My fiddling with EatDrink is nearly at an end. I've finally got it working the way I want.
 
Last edited:
Made some more improvements to my main() to fix a few problems and add features.

PHP:
void main(string parameters) {
	SIM_CONSUME = false;
	int foodMax = fullness_limit();
	int drinkMax = inebriety_limit();
	int spleenMax = spleen_limit();
	boolean overdrink = false;
	matcher option = create_matcher("(?i)(?:(no) +)?([A-Za-z0-9_]+) *(= *([A-Za-z0-9\\.]+))? *,?", parameters);
	string var, val;
	while(option.find()) {
		if(option.group(1) == "no")
			val = "false";
		else if(option.group(3) == "0")
			val = "true";
		else val = option.group(4);

		var = option.group(2);
		if(var.is_integer()) {
			val = var;
			var = "value_of_adventure";
		}
		#print("'"+ var +"' = '"+ val + "'");
		
		switch(var.to_lower_case()) {
		case "use_inv":
		case "inventory":
		case "inv":
			USE_INV = val.to_boolean(); 
			break;
		case "use_closet":
		case "closet":
			USE_CLOSET = val.to_boolean(); 
			break;
		case "use_storage":
		case "storage":
			USE_STORAGE = val.to_boolean(); 
			break;
		case "sim_consume":
		case "sim":
			SIM_CONSUME = val.to_boolean();
			break;
		case "supress_overdrink":
			SUPRESS_OVERDRINK = val.to_boolean();
			break;
		case "shop":
		case "buy":
			SHOP = val.to_boolean();
			break;
		case "budget":
			BUDGET = val.norm_int();
			break;
		case "price_flexibility":
		case "flexibility":
			PRICE_FLEXIBILITY = val.norm_float();
			break;
		case "consider_cost_when_owned":
			CONSIDER_COST_WHEN_OWNED = val.to_boolean();
			break;
		case "cost_of_pull":
		case "pull":
			COST_OF_PULL = val.norm_int();
			break;
		case "value_of_adventure":
		case "adventure":
		case "voa":
			VALUE_OF_ADVENTURE = val.norm_int(); 
			break;
		case "value_of_prime_stat":
		case "prime_stat":
		case "prime":
			VALUE_OF_PRIME_STAT = val.norm_float(); 
			break;
		case "value_of_nonprime_stat":
		case "nonprime_stat":
		case "nonprime":
			VALUE_OF_NONPRIME_STAT = val.norm_float();
			break;
		case "stat":
		case "stats":
			VALUE_OF_PRIME_STAT = val.norm_float();
			VALUE_OF_NONPRIME_STAT = val.norm_float()/5;
			break;
		case "pie_priority":
		case "pies":
		case "pie":
			PIE_PRIORITY = val.to_boolean(); 
			break;
		case "price_of_nontradeables":
		case "nontradeables":
		case "nontradeable":
			PRICE_OF_NONTRADEABLES = val.norm_int();
			break;
		case "price_of_unknowns":
		case "unknowns":
		case "unknown":
			PRICE_OF_UNKNOWNS = val.norm_int(); 
			break;
		case "sim_ronin":
		case "ronin":
			SIM_RONIN = val.to_boolean(); 
			break;
		case "sim_level":
		case "level":
			SIM_LEVEL = val.norm_int();
			break;
		case "pause":
			if(val == "true") {
				if(pause < 1) pause = 3;
			} else pause = val.norm_int();
			break;
		case "foodmax":
		case "food":
			if(val == "true") break;
			foodMax = val.norm_int();
			break;
		case "drinkmax":
		case "drink":
			if(val == "true") break;
			drinkMax = val.norm_int();
			break;
		case "spleenmax":
		case "spleen":
			if(val == "true") break;
			spleenMax = val.norm_int();
			break;
		case "overdrink":
			overdrink = val.to_boolean();
			break;
		case "cookie":
			if(val == "false") cookie = false;
			else cookie = true;
			cookie_size = val.norm_int();
			break;
		case "price_age":
			price_age = val.norm_float();
			break;
		}
	}
	eatdrink(foodMax - cookie_size, drinkMax, spleenMax, overdrink);
}

Now I can do this:

> eatdrink 6000 sim, no food, no drink, no spleen

Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
adding favorite: rockin' wagon
adding favorite: pr0n chow mein
adding favorite: twinkly wad
Starting EatDrink.ash (version 3.0, Bale Edition).
Consuming up to 0 food, 0 booze, and 0 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 24000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 6000 meat. Mysticality subpoint is 10.0. Nonprime stat subpoint is 2.0. Hagnk pulls are limited and their 'cost' is incorporated.
Simulating only; no purchases or food/drink/spleen consumption.
Pass 1: food.
Skipping food.
Pass 2: drink.
Skipping drink.
Pass 3: spleen.
Skipping spleen.
Pass 4: drink.
Skipping drink.
choc: Checking non-filling chocolates - all kinds
If there are favorites still in consideration, they'll be here:
simulating consumption of one fancy chocolate car.
1: fancy chocolate car lev:0 gain:1.0 adv:5.0 musc:0.0 myst:0.0 mox:0.0 meat:13400 own:0 value:16600
If there are favorites still in consideration, they'll be here:
simulating consumption of one chocolate pasta spoon.
2: chocolate pasta spoon lev:0 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:1795 own:0 value:10205
If there are favorites still in consideration, they'll be here:
simulating consumption of one chocolate pasta spoon.
3: chocolate pasta spoon lev:0 gain:1.0 adv:1.0 musc:0.0 myst:0.0 mox:0.0 meat:1795 own:0 value:4205
simulating consumption of one vitachoconutriment capsule.
4: vitachoconutriment capsule lev:0 gain:1.0 adv:5.0 musc:0.0 myst:0.0 mox:0.0 meat:24000 own:0 value:6000
Finished.
Spent 40990 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0. Adventures: 13. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.0, Bale Edition).
Consuming up to 0 food, 0 booze, and 0 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 24000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 6000 meat. Mysticality subpoint is 10.0. Nonprime stat subpoint is 2.0. Hagnk pulls are limited and their 'cost' is incorporated.
Simulating only; no purchases or food/drink/spleen consumption.
choc: Checking non-filling chocolates - all kinds
1: fancy chocolate car lev:0 gain:1.0 adv:5.0 musc:0.0 myst:0.0 mox:0.0 meat:13400 own:0 value:16600
2: chocolate pasta spoon lev:0 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:1795 own:0 value:10205
3: chocolate pasta spoon lev:0 gain:1.0 adv:1.0 musc:0.0 myst:0.0 mox:0.0 meat:1795 own:0 value:4205
4: vitachoconutriment capsule lev:0 gain:1.0 adv:5.0 musc:0.0 myst:0.0 mox:0.0 meat:24000 own:0 value:6000
Finished.
Spent 40990 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0. Adventures: 13. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
Last edited:
Now I want a copy of your eatdrink. ;)

I really hesitate to post it since I change a lot of things that users of EatDrink rely on. For instance, rather than create a zlib setting for each variable I hardcode default values into the script and have them changed from the command line call, not editing vars_username. That's why I went all out in creating a command line parameter parser. If I want to change any varaibles I use cli_execute("EatDrink 1200, no sim, cookie = 2, budget = 20000, no pull, no stats, pies, no pause, price_age = .1"); It makes scripted control of EatDrink easier, but all those zlib settings people have honed for use with EatDrink are ignored by my version.

Another reason for no wanting to show it is that it is a horrible Frankenstein's monster of patchwork parts. It's quite ugly.

My main reason for modifying my EatDrink so much and putting in the command line parameter parsing is that when I was importing it, I found some of its many global variables were conflicting with my script's variables. This caused run errors and kept the calling script from modifying the EatDrink variables with ease. Now I use cli_execute() to call EatDrink and it's golden!

If you're curious: The cookie thing is to inform EatDrink how much fullness to leave unused for fortune cookie eating later on, after getting semi-rare adventures. (If I set the cookie value, it will even decide to eat a cookie as part of EatDrink if I don't currently have any semi-rare counters.) I like using fortune cookies, but the original EatDrink didn't support them.

Oh, and my EatDrink uses coffee pixie sticks, but it would be tough to show the code since it is spread out in several places and I've lost track of it. Somewhat ugly stuff.

> eatdrink 1000, sim, no drink, no food

Checking for updates (running ZLib ver. : 21)...
_version_zlib => : 21
You have a current version of ZLib.
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
adding favorite: rockin' wagon
adding favorite: pr0n chow mein
adding favorite: twinkly wad
Starting EatDrink.ash (version 3.0, Bale Edition).
Consuming up to 0 food, 0 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 24000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 1000 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0.
Simulating only; no purchases or food/drink/spleen consumption.
Pass 1: food.
Skipping food.
Pass 2: drink.
Skipping drink.
Pass 3: spleen.
spleen: At 0, consuming to 15.
Loading spleen map from Mafia's datafiles
Filtering by type
Filtering by level
Finding prices
Setting values
Choosing spleen to consume.
If there are favorites still in consideration, they'll be here:
Fav: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:324 own:8696 value:802
simulating consumption of one coffee pixie stick.
1: coffee pixie stick lev:4 gain:4.0 adv:7.5 musc:0.0 myst:0.0 mox:0.0 meat:3640 own:0 value:965
Choosing spleen to consume.
If there are favorites still in consideration, they'll be here:
Fav: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:324 own:8696 value:802
simulating consumption of one coffee pixie stick.
2: coffee pixie stick lev:4 gain:4.0 adv:7.5 musc:0.0 myst:0.0 mox:0.0 meat:3640 own:0 value:965
Spleen value is 965; mojo filter to get it costs 2675
Choosing spleen to consume.
If there are favorites still in consideration, they'll be here:
Fav: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:324 own:8696 value:802
simulating consumption of one coffee pixie stick.
3: coffee pixie stick lev:4 gain:4.0 adv:7.5 musc:0.0 myst:0.0 mox:0.0 meat:3640 own:0 value:965
Choosing spleen to consume.
If there are favorites still in consideration, they'll be here:
Fav: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:324 own:8696 value:802
simulating consumption of one hot wad.
4: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:420 own:559 value:904
Choosing spleen to consume.
If there are favorites still in consideration, they'll be here:
Fav: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:324 own:8696 value:802
simulating consumption of one hot wad.
5: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:420 own:559 value:904
Choosing spleen to consume.
If there are favorites still in consideration, they'll be here:
Fav: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:324 own:8696 value:802
simulating consumption of one hot wad.
6: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:420 own:559 value:904
Pass 4: drink.
Skipping drink.
choc: Checking non-filling chocolates - all kinds
If there are favorites still in consideration, they'll be here:
simulating consumption of one chocolate seal-clubbing club.
1: chocolate seal-clubbing club lev:0 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:0.0 meat:2450 own:0 value:550
If there are favorites still in consideration, they'll be here:
Best find was chocolate seal-clubbing club with a value of -450. That's no good, so not consuming and moving on.
Finished. You had -Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 14630 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 15. Adventures: 28. Muscle: 81. Moxie: 54. Mysticality: 27.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.0, Bale Edition).
Consuming up to 0 food, 0 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 24000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 1000 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0.
Simulating only; no purchases or food/drink/spleen consumption.
spleen: At 0, consuming to 15.
1: coffee pixie stick lev:4 gain:4.0 adv:7.5 musc:0.0 myst:0.0 mox:0.0 meat:3640 own:0 value:965
2: coffee pixie stick lev:4 gain:4.0 adv:7.5 musc:0.0 myst:0.0 mox:0.0 meat:3640 own:0 value:965
3: coffee pixie stick lev:4 gain:4.0 adv:7.5 musc:0.0 myst:0.0 mox:0.0 meat:3640 own:0 value:965
4: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:420 own:559 value:904
5: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:420 own:559 value:904
6: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:420 own:559 value:904
choc: Checking non-filling chocolates - all kinds
1: chocolate seal-clubbing club lev:0 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:0.0 meat:2450 own:0 value:550
Best find was chocolate seal-clubbing club with a value of -450. That's no good, so not consuming and moving on.
Finished. You had -Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 14630 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 15. Adventures: 28. Muscle: 81. Moxie: 54. Mysticality: 27.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).

(This is a different character from the earlier example that was consuming chocolate pasta spoons. The code I posted accounts for my_class() when deciding which chocolate to consume.)
 
Last edited:
1) I'm testing Bale's chocolates now and will post an Unofficial EatDrink "soon".
2) I personally don't find Bale's changes to main to be an improvement, so if only Bale and I care, I won't incorporate them, but if someone else likes them, then please let me know and I'll roll them in.
3) I consider the zLibs variable issue to be resolved provided users run r8775 or greater. I highly recommend a text editor be applied to the vars file to undo the hiccup.
 
1) Awesome.
2) As long as cookie_size is defined inside the script as 0, and you can override it, I think the changes would be a good thing. Being able to have it automatically adjust for cookies if you want to, as well as having additional keywords, both make the script more friendly imho. Being able to use "closet" as well as "use_closet" would make less "wrong" parameter inclusion, etc.
3) Awesome, again. :)
 
EatDrink has one other serious problem: no coffee pixie sticks. Currently EatDrink will not consider consuming them even though they are the cheapest value of adv/spleen. I'm going to try to dig out my pixie stick code and present it for fronobulax to include if he wants. This gets a little complicated, so bear with me.

First of all, I have replaced every single instance of mall_price() with check_price()

PHP:
float price_age = 0.5;
int check_price(item it) {
	if(it == $item[coffee pixie stick]) {
		if(historical_age($item[game grid ticket]) < price_age)
			return 10 * historical_price($item[game grid ticket]);
		return 10 * mall_price($item[game grid ticket]);
	}
	if(historical_age(it) < price_age)
		return historical_price(it);
	return mall_price(it);
}

My version of get_on_budget() contains these lines:

PHP:
	if (startmeat > budget)
	{
		verbose("Looks like you have enough meat to buy it");
		int got = item_amount(it);
		verbose("You have "+got+" right now");
		int temp;
		if(it != $item[coffee pixie stick])
			temp = buy(quantity, it, budget);
		else {
			temp = buy(10 * quantity, $item[game grid ticket], budget / 10);
			if(item_amount($item[game grid ticket])/ 10 > 0)
				retrieve_item(item_amount($item[game grid ticket])/ 10, $item[coffee pixie stick]);
		}

In effective_price() I have these lines:

PHP:
int effective_price(con_rec con)
{
	item it = con.it;
	int price = 0;
	if ((con.have > 0) && !CONSIDER_COST_WHEN_OWNED)
		return 0; //If you have it & you don't care about price
	if ((con.have == 0) && !SHOP)
		return 0; //If you don't have any but you can't shop
	if (!is_tradeable(it) && it != $item[coffee pixie stick])
	{
		verbose2("NONTRADEABLE: "+it);
		return PRICE_OF_NONTRADEABLES;
	}

I think that is all the code involved with coffee pixie sticks. I suspect there may have been an easier way to handle this, but I do have some trouble with dj_d's code. I look forward to seeing if you can improve it.


2) As long as cookie_size is defined inside the script as 0, and you can override it, I think the changes would be a good thing. Being able to have it automatically adjust for cookies if you want to

I don't think that is an issue involving the changes to main and fronobulax wasn't really considering it. If you want to leave room for later cookie eating you can always just lower the value of foodMax from 15 to 13. The only reason that you'd want to have a cookie_size variable is if EatDrink had code to decide if you currently need to eat a cookie. In that instance it becomes relevant. Since EatDrink doesn't do that, its better not to include cookies as a parameter.

The issue about my main() changes regards the ability to call EatDrink from the command line without needing an alias.
 
Last edited:
Well, I'm thinking of cookiesize in terms of that I can check counters, decide if I need to leave room for a cookie, and then run my normal eatdrink (or maybe, eatdrinkfc if cookies are considered) script. zarqon's BBB and your CC will both eat cookies for me... but they need room to do it. :)

And I suppose that I already implemented those changes earlier when you posted them, which is why my version looked so similar to yours. :p The dangers of not grabbing the base/original file when doing comparisons. Heh.
 
Well, I thought I had the chocolate stuff tested and was looking at a release but it seems as if I should try and add the coffee pixie sticks so I shall. It was amusing trying to see if the choco worked because my value of an adventure was so low that they were not viable and it took me a couple minutes to realize what to change. Still waiting for other comments on Bale's main but if I stop waiting now, I would put it in.

I am unlikely to totally revamp EatDrink. I am a steward of dj_d's work.

I am considering, however, a complete rewrite because that's what we do when we don't understand code. My thinking, though, is that this is a data driven optimization problem and that I need to have a design for something that will not change as new food (for example) is added to the game. I'm not far enough along to share those thoughts and I may never move from thought to a script.
 
I'm fairly decent at working through uncommented code... if you have a specific request, such as updating it to properly account for Ode or something like that, just let me know. The float ode_adjust should have two tweaks, for example... it should just changed to take in two numbers instead of one, like:
PHP:
ode_adjust(float adj_adv, float adj_con)
and down below,
PHP:
    else if (ode)
    { advscore = (ode_adjust(averange(con.adv), averange(con.consumptionGain)) 
    * VALUE_OF_ADVENTURE) / full; }
and
PHP:
 simadventures = simadventures + ode_adjust(averange(con.adv), averange(con.consumptionGain));
below that. Same goes for milk... consumptionGain, despite allowing for a range, is only ever used as a single, and is never actually used as a range. I'm guessing this is made to support future items where the fullness amount varies, but...

In the actual function:
PHP:
return adj_adv + Math.min(have_effect($effect["ode to booze"]), adj_con);
If you have no ode, add 0. If 3 rounds of ode and it'll use up 2 appetite, add an extra 2. If 3 rounds and 4 appetite, add 3...

Milk is a bit more complicated... possible, but complicated. Anyways, here's a sim_consume summary for BM glutton/pride (16 max food) at level 15.
Finished.
Spent 13653 meat. Gained Fullness: 16. Inebriety: 19. Spleen: 15. Adventures: 149. Muscle: 719. Moxie: 330. Mysticality: 217.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
And with simmilk, which should add a total of 16 adventures...
Finished.
Spent 12675 meat. Gained Fullness: 16. Inebriety: 19. Spleen: 15. Adventures: 149. Muscle: 719. Moxie: 330. Mysticality: 217.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
Eh, guess simmilk just means that it always considers milk to be on, instead of actually checking. Makes it kind of useless. Ah well. Here's one that combines simmilk (don't buy milk) with an override on the milk_adjust value, to give the non-milked amount:
Finished.
Spent 12675 meat. Gained Fullness: 16. Inebriety: 19. Spleen: 15. Adventures: 133. Muscle: 719. Moxie: 330. Mysticality: 217.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
Last edited:
I'm fairly decent at working through uncommented code... if you have a specific request, such as updating it to properly account for Ode or something like that, just let me know.

My solution was to have it use mom/ode before eating/drinking until it had a number of turns equal to the amount it is about to consume. That was pretty simple really. Of course I just threw away dj_d's ode and milk code to replace them with my own already written functions since it was the easiest way for me to understand it.
 
Of course I just threw away dj_d's ode and milk code to replace them with my own already written functions since it was the easiest way for me to understand it.
You have a great future ahead of you as a software developer :-)
 
The latest version of Mafia breaks farm.ash since the designation for unkown drops have been changed to s instead of 0. Thus: make a search and replace
Code:
case "0":
with
Code:
case "s":
and it should stop malfunctioning when getting to monsters with unkown drop rates.
 
Hello I purchased ascend.ash quite a while ago andkind of lost interest in KOL, I've started playing again. However, I forgot all of the casing for the password and any messages I had in my KOL account are long gone. I do remember what the password should be any assistance would be greatly apreciated.
 
Contact dj_d in-game and he might be able to help you out. He is the one who has the details of the transactions.
 
OH man, I guess I should have just googled the spelling instead of trusting myself, I remembered it, thanks for the timely reply!
 
Hey guys, sorry if this has been asked before, but is there a way to change how Ascend.ash handles EatDrink in terms of when it performs it? Right now, Ascend.ash will only eat the max when the script is first run, play through all the turns, and then use spleen, drink, and overdrink.. I'd prefer eat, drink, spleen, spend all turns, and then drink a nightcap.
 
That is not, as far as I can tell, configurable. You could edit the script. The argument against it is that you have to cast Ode twice as much as is optimal. Personally, I don't have Ode so it doesn't make a difference to me. I manually run EatDrink once to drink to fullness and then run Ascend.
 
Back
Top