New Content - Implemented cursed microwave, cursed pony keg

Bale

Minion
loginScript! Look at main() function, case "3":
(I deleted private sections so it may not work as is, but it shouldn't be hard to adapt whatever parts you like.)

Code:
void improve_spirits() {
	if(stills_available() < 1) return;
	item [item] upgrade;
	upgrade[$item[bottle of gin]] = $item[bottle of Calcutta Emerald];
	upgrade[$item[bottle of rum]] = $item[bottle of Lieutenant Freeman];
	upgrade[$item[bottle of tequila]] = $item[bottle of Jorge Sinsonte];
	upgrade[$item[bottle of vodka]] = $item[bottle of Definit];
	upgrade[$item[bottle of whiskey]] = $item[bottle of Domesticated Turkey];
	upgrade[$item[boxed wine]] = $item[boxed champagne];
	upgrade[$item[grapefruit]] = $item[tangerine];
	upgrade[$item[lemon]] = $item[kiwi];
	upgrade[$item[olive]] = $item[cocktail onion];
	upgrade[$item[orange]] = $item[kumquat];
	upgrade[$item[soda water]] = $item[tonic water];
	upgrade[$item[strawberry]] = $item[raspberry];
	upgrade[$item[bottle of sewage schnapps]] = $item[bottle of Ooze-O];
	upgrade[$item[bottle of sake]] = $item[bottle of Pete's Sake];

	item best;
	int profit = 0;
	int test_profit;
	int price(item it) {
		if(historical_age(it)>.75)
			return mall_price(it);
		return historical_price(it);
	}
	foreach key in upgrade {
		test_profit = price(upgrade[key]) - price(key);
		if(test_profit > profit) {
			best = key;
			profit = test_profit;
		}
	}

	print("Creating " + stills_available()+ " " +upgrade[best]+ " to sell @ "+historical_price(upgrade[best]), "blue");
	retrieve_item(stills_available(), best);
	create(stills_available(), upgrade[best]);
	put_shop(historical_price(upgrade[best]), 0,  upgrade[best]);
	#cli_execute("mallsell * "+ upgrade[best]+ " @ "+ historical_price(upgrade[best]));
}

void gravitate() {
	if(!have_skill($skill[Rainbow Gravitation])) return;
	int rainbowLeft = 3 - get_property("prismaticSummons").to_int();
	if(rainbowLeft < 1) {
		print("Already created 3 Rainbow Wads today!", "#FFA500");
		return;
	}
	foreach wad in $items[twinkly wad, hot wad, cold wad, spooky wad, stench wad, sleaze wad]
		retrieve_item(rainbowLeft, wad);
	use_skill(rainbowLeft, $skill[rainbow gravitation]);
}

boolean clip_mall() {
	int tomeLeft = 3- get_property("tomeSummons").to_int();
	if(tomeLeft < 1 || !can_interact()) return false;
	item [int] clip;
	for i from 5224 to 5283
		clip[count(clip)] = to_item(i);
	sort clip by -(historical_age(value) > .125? mall_price(value): historical_price(value));
	create(tomeLeft, clip[0]);
	print("Sell "+tomeLeft+" "+(tomeLeft > 1? to_plural(clip[0]):clip[0])+" @ "+historical_price(clip[0]), "blue");
	return put_shop(historical_price(clip[0]), 0, tomeLeft,  clip[0]);
}

boolean cast_tome() {
	boolean summon(int x, skill s) {
		if(s == $skill[Summon Clip Art]) {
			if(can_interact()) return clip_mall();
			// if I have skills summon clip art and ode, am not drunk, and have no bucket of wine then create one
			else if(have_skill($skill[The Ode to Booze]) && my_mp() > 2&& my_level() < 12 && my_level() >= 5 
			  && inebriety_limit() >= my_inebriety() && item_amount($item[bucket of wine]) == 0)
				return create(1, $item[bucket of wine]);
			return false;
		}
		return use_skill(x, s);
	}
	if(!can_interact()) return false;
	int tomeLeft = 3- get_property("tomeSummons").to_int();
	if(tomeLeft < 1) return false;
	foreach s in $skills[Summon Rad Libs, Summon Clip Art, Summon Snowcones, Summon Sugar Sheets, Summon Stickers]
		if(have_skill(s)) return summon(tomeLeft, s);
	return false;
}

string libram() {
	// Prefer to burn mana with librams in the following order of precedence
	foreach s in $skills[Summon Dice, Summon Party Favor, Summon Resolutions, Summon BRICKOs, Summon Candy Hearts, Summon Love Song]
		if(have_skill(s)) return to_string(s);
	return "";
}

// These are normally controlled by "once a day items" preference: useCrimboToysHardcore & useCrimboToysSoftcore
// Created this function so that I can control how the CSA fire-starting kit is used
void useToys() {
	set_property("useCrimboToysSoftcore", "false");
	set_property("useCrimboToysHardcore", "false");
	boolean get(item toy) {
		return item_amount(toy) > 0 
			|| (closet_amount(toy) > 0 && take_closet(1, toy))
			|| (can_interact() && storage_amount(toy) > 0 && take_storage(1, toy));
	}
	boolean playwith(item toy, string prop) {
		if(get(toy) && get_property(prop) == "false")
			return use(1, toy);
		return false;
	}
	playwith($item[handmade hobby horse], "_hobbyHorseUsed");
	playwith($item[ball-in-a-cup], "_ballInACupUsed");
	playwith($item[set of jacks], "_setOfJacksUsed");
	playwith($item[Chester's bag of candy], "_bagOfCandyUsed");
	playwith($item[Emblem of Ak'gyxoth], "_akgyxothUsed");
	playwith($item[Idol of Ak'gyxoth], "_akgyxothUsed");
	playwith($item[burrowgrub hive], "burrowgrubHiveUsed");
	playwith($item[glass gnoll eye], "_gnollEyeUsed");
	playwith($item[KoL Con Six Pack], "_kolConSixPackUsed");
	playwith($item[Trivial Avocations board game], "_trivialAvocationsGame");
	playwith($item[creepy voodoo doll], "_creepyVoodooDollUsed");
	
	if(get($item[CSA fire-starting kit]) && get_property("_fireStartingKitUsed") == "false") {
		if(in_hardcore() && my_path() != "Zombie Slayer") {
			set_property("choiceAdventure595", "2");
			use(1, $item[CSA fire-starting kit]);
		} else if(hippy_stone_broken()) {
			set_property("choiceAdventure595", "1");
			use(1, $item[CSA fire-starting kit]);
		}
	}
}

int gnome() {
	// Ensure that you have body parts with the following priority. Otherwise snag the kgnee
	foreach i in $items[gnomish housemaid's kgnee, gnomish coal miner's lung, gnomish athlete's foot, gnomish swimmer's ears, gnomish tennis elbow]
		if(available_amount(i) < 1) return (to_int(i) - 5767);
	return 4;
}

void main() {
	switch(get_property("_loginScript")) {
	case "0": case "":  // Buy a raffle ticket every day
		// Hitting main.php gets my penpal item as well as checking for the beach.
		if(my_name() != "zad" && visit_url("main.php").contains_text("map7beach.gif"))
			cli_execute("raffle 1 " + (can_interact() && my_meat() > 6000? "inventory": "storage"));
	case "3":  // Once per day items without use properties
		set_property("_loginScript", "3");
		if(can_interact()) {
			switch(random(3)) {
			case 0: cli_execute("chips radium, radium, radium"); break;
			case 1: cli_execute("chips ennui, ennui, ennui"); break;
			case 2: cli_execute("chips wintergreen, wintergreen, wintergreen"); break;
			default:
				cli_execute("chips radium, ennui, wintergreen");
			}
		}
		foreach it in $items[cursed microwave, cursed pony keg]
			if(item_amount(it) > 0) use(1, it);
	case "4":  // Get clovers
		set_property("_loginScript", "4");
		// In aftercore, getting clovers is part of breakfast. I'm pickier about during ascension.
		if(my_path() == "Zombie Slayer")
			visit_url("hermit.php");
		else 
			(my_path() != "Way of the Surprising Fist" && my_meat() > 2000 && !in_bad_moon() && hermit(5, $item[ten-leaf clover]));
	case "6":  // Always harvest garden, whenever there is anything growing for Peppermints, Pumpkins
		set_property("_loginScript", "6");
		string campground = visit_url("campground.php");
		if(campground.contains_text("action=garden") && (campground.contains_text("pumpkinpatch_") || campground.contains_text("pepperpatch_")))
			cli_execute("garden pick");
	case "7":  // Get body part for Reagnimated Gnome every day
		set_property("_loginScript", "7");
		if(have_familiar($familiar[Reagnimated Gnome])) {
			familiar f = my_familiar();
			use_familiar($familiar[Reagnimated Gnome]);
			visit_url("arena.php");
			visit_url("choice.php?pwd&whichchoice=597&option="+gnome());
			#choice.php?pwd&whichchoice=597&option=3&choiceform3=Take+the+elbow
			if(equipped_item($slot[familiar]) == $item[none])
				equip($item[gnomish housemaid's kgnee]);
			use_familiar(f); // Restore original familiar
		}
	case "90":  // Recheck Inventory
		set_property("_loginScript", "90");
		cli_execute("refresh inv"); // To ensure Pen Pal item is recognized.
	case "99":
		set_property("_loginScript", "99");
	case "999": break;
	}

	if(can_interact()) {
		improve_spirits();
		gravitate();
		if(my_adventures() < 200 && !to_boolean(get_property("_BaleTimeArrow")) && mall_price($item[time's arrow]) < 6000) {
			string bot = "";
			if(is_online("arrowbot")) bot = "arrowbot";
			else if(is_online("kBay")) bot = "kBay";
			if(bot != "") {
				retrieve_item(1, $item[time's arrow]);
				cli_execute("send time's arrow to " +bot);
				set_property("_BaleTimeArrow", "true");
			}
		}
	}

	if(can_interact()) set_property("libramSkillsSoftcore", libram());
	#else set_property("libramSkillsHardcore", libram);

	if(have_equipped($item[sword behind inappropriate prepositions])) {
		print("Removing the pesky sword to save your prepositions.", "blue");
		equip($slot[weapon], $item[none]);
	}

	cast_tome();

	useToys();
	
	if(have_skill($skill[Canticle of Carboloading]) && get_property("_carboLoaded") == "false" && my_mp() > 10)
		use_skill(1, $skill[Canticle of Carboloading]);
	
	if(have_skill($skill[Summon Alice's Army Cards]) && get_property("grimoire3Summons") == "0" && my_mp() > 30)
		use_skill(1, $skill[Summon Alice's Army Cards]);
	
	if(have_skill($skill[Summon Crimbo Candy]) && get_property("_candySummons") == "0" && my_mp() > 25)
		use_skill(1, $skill[Summon Crimbo Candy]);
		
	// Spend an adventure to get Interview With You (a Vampire) because it is worth a lot of meat
	if(can_interact() && available_amount($item[plastic vampire fangs]) > 0 && get_property("_interviewMasquerade") == "false" 
	  && my_adventures() > 0 && mall_price($item[Interview With You (a Vampire)]) > 2000) {
		cli_execute("checkpoint");
		if(equipped_amount($item[plastic vampire fangs]) < 1 && retrieve_item(1, $item[plastic vampire fangs]))
			equip($item[plastic vampire fangs]);
		set_property("choiceAdventure546", "12"); 
		visit_url("town.php?action=vampout");
		cli_execute("choice-goal");
		cli_execute("outfit checkpoint");
	}

	// I want to know who stole my lunch!
	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>");
	}
}
 
Last edited:

Bale

Minion
They're a free pull? Huh. I missed that. They'd also need preferences to indicate if they are used.
 

slyz

Developer
I'm very far from getting either one of those, so it's hard to implement and test.

Could someone post debug logs of using those two items?
 

slyz

Developer
We can deduce that from the item number, but we need the html text from a successful use.
 

rickerscott

New member
You give the keg a few good pumps and draw forth as much of the foul liquid within as you can stomach the sight of.
You acquire 5 beery bloods
 
Was there anything else besides the game text holding this back from being implemented? Just curious to see if I can help, I've got the microwave
 

Bale

Minion
It is likely that slyz is still willing, so if you are able to post the html of the game text, then please do this. rickerscott's answer was not what slyz asked for. That was not the html. (Frame -> Source)
 

lostcalpolydude

Developer
Staff member
11619 will pull them when you ascend and adds them to the list of reusable items to use during breakfast. There's no need to check the response text in this case; if it's something besides a success message, then it's a message saying you already used it today, and either way you can't meaningfully use it again today.
 
Top