View difference between Paste ID: V5uF9q6f and sr03HHbh
SHOW: | | - or go back to the newest paste.
1
script "Automatic 2-day Hardcore Community Service";
2
notify aabattery;
3
//courtesy of yojimboS_LAW's 2-day HC guide
4
//shoutouts to Cheesecookie and Ezandora for contributing a bit of code/advice
5
6
//woulda liked a #define or const here but hey I'll take what I can get
7
int HPTEST = 1;
8
int MUSTEST = 2;
9
int MYSTTEST = 3;
10
int MOXTEST = 4;
11
int FAMTEST = 5;
12
int WPNTEST = 6;
13
int SPELLTEST = 7;
14
int COMTEST = 8;
15
int ITEMTEST = 9;
16
int HOTTEST = 10;
17
int COILTEST = 11;
18
19
int [string] statemap;
20
21
boolean actuallyrun = true;
22
23
//////fix combat handling, shit don't work at all :/
24
////switch chateau to moxie for a rest or two if need to get to 35 for hot equip....or powerlevel before hot test?
25
////add puck-man logic maybe (unlocking the woods and stuff)
26
////allow running before ascending to check prereqs then
27
28
void loadSave() {
29
	file_to_map("AutoHCCSvars.txt", statemap);
30
}
31
32
void newSave() {
33
	statemap["questStage"] = 0;
34
	statemap["skippingIsland"] = 0;
35
	statemap["run"] = get_property("knownAscensions").to_int();
36
	map_to_file(statemap, "AutoHCCSvars.txt");
37
}
38
39
void saveProgress(int questStage) {
40
	statemap["questStage"] = questStage;
41
	map_to_file(statemap, "AutoHCCSvars.txt");
42
}
43
44
void skipIsland() {
45
	statemap["skippingIsland"] = 1;
46
	map_to_file(statemap, "AutoHCCSvars.txt");
47
}
48
49
boolean islandSkipped() {
50
	if (statemap["skippingIsland"] == 1) {
51
		return true;
52
	} else {
53
		return false;
54
	}
55
}
56
57
void unlockSkeletonStore() {
58
	visit_url("shop.php?whichshop=meatsmith&action=talk");
59
	visit_url("choice.php?pwd&whichchoice=1059&option=1&choiceform1=Sure%2C+I%27ll+go+check+it+out.");
60
}
61
62
boolean get_property_boolean(string property) {
63
	return get_property(property).to_boolean();
64
}
65
66
int get_property_int(string property) {
67
	return get_property(property).to_int();
68
}
69
70
void decorateShrub() {
71
	familiar current = my_familiar();
72
	if(have_familiar($familiar[Crimbo Shrub]) && !get_property_boolean("_shrubDecorated")) {
73
		use_familiar($familiar[Crimbo Shrub]);
74
		visit_url("inv_use.php?pwd=&which=3&whichitem=7958");
75
		visit_url("choice.php?pwd=&whichchoice=999&option=1&topper=1&lights=1&garland=1&gift=1");
76
	}
77
	use_familiar(current);
78
}
79
80
void setFamiliar() { //idk about this but something's better than nothing...I'd throw puck-man here but then I'd have to unlock the woods so meh
81
	if (my_familiar() == $familiar[none]) {
82
		if (have_familiar($familiar[Fist Turkey])) {
83
			use_familiar($familiar[Fist Turkey]);
84
		} else if (have_familiar($familiar[Golden Monkey])) {
85
			use_familiar($familiar[Golden Monkey]);
86
		} else if (have_familiar($familiar[Grim Brother])) {
87
			use_familiar($familiar[Grim Brother]);
88
		} else if (have_familiar($familiar[Unconscious Collective])) {
89
			use_familiar($familiar[Unconscious Collective]);
90
		} else if (have_familiar($familiar[Galloping Grill])) {
91
			use_familiar($familiar[Galloping Grill]);
92
		} else if (have_familiar($familiar[Crimbo Shrub])) {
93
			use_familiar($familiar[Crimbo Shrub]);
94
		} else if (have_familiar($familiar[Smiling Rat])) {
95
			use_familiar($familiar[Smiling Rat]);
96
		} 
97
	}
98
}
99
100
void checkPrereq() {
101
	if (!have_skill($skill[The Ode to Booze])) {
102
		abort("You need Ode to Booze first.");
103
	} else if (!have_skill($skill[Summon Smithsness])) {
104
		abort("You need Summon Smithsness first.");
105
	} else if (!have_skill($skill[Advanced Saucecrafting])) {
106
		abort("You need Advanced Saucecrafting first.");
107
	} else if (!get_property_boolean("chateauAvailable")) {
108
        abort("You need access to Chateau Mantegna first.");
109
    } else if ($item[Clan VIP Lounge key].available_amount() == 0) {
110
		abort("You need access to your clan's VIP lounge first.");
111
	} else if ($item[Deck of Every Card].available_amount() == 0) {
112
		abort("You need the Deck of Every Card first.");
113
	} else if (my_class() != $class[sauceror]) {
114
		abort("You're supposed to be a sauceror.");
115
	} else if (!knoll_available()) {
116
		abort("You're supposed to have access to the (friendly) Degrassi Knoll. You know, muscle sign.");
117
	}
118
}
119
120
void sellJewels() {
121
	print("Selling jewels...");	
122
	foreach stone in $items[hamethyst, baconstone, porquoise]
123
	autosell(item_amount(stone), stone);
124
}
125
126
int advCost(int whichtest) {
127
	buffer page = visit_url("council.php");
128
	string teststr = "name=option value="+ whichtest +">";
129
	if (contains_text(page, teststr)) {
130
		int chars = 140; //chars to look ahead
131
		string pagestr = substring(page, page.index_of(teststr)+length(teststr), page.index_of(teststr)+length(teststr)+chars);
132
		string advstr = substring(pagestr, pagestr.index_of("(")+1, pagestr.index_of("(")+3);
133
		advstr = replace_string(advstr, " ", ""); //removes whitespace, if the test is < 10 adv
134
		return to_int(advstr);
135
	} else {
136
		print("Didn't find specified test on the council page. Already done?");
137
		return 99999;
138
	}
139
}
140
141
int free_rests_left() {
142
	return total_free_rests() - get_property_int("timesRested");
143
}
144
145
boolean useIfHave(int howmany, item what) {
146
	if(what.available_amount() >= howmany) {
147
		use(howmany, what);
148
		return true;
149
	} else {
150
		return false;
151
	}
152
}
153
154
boolean free_rest() {
155
	if (free_rests_left() > 0) {
156
		visit_url("place.php?whichplace=chateau&action=chateau_restlabelfree");
157
		return true;
158
	} else {
159
		return false;
160
	}
161
}
162
163
void calderaMood() {
164
	cli_execute("mood CalderaMood");
165
	cli_execute("mood clear");
166
	if (have_skill($skill[Elemental Saucesphere])) {
167
		cli_execute("trigger lose_effect, Elemental Saucesphere, cast 1 Elemental Saucesphere");
168
	} else if (have_skill($skill[Astral Shell])) {
169
		cli_execute("trigger lose_effect, Astral Shell, cast 1 Astral Shell");
170
	} else if (have_skill($skill[Reptilian Fortitude])) {
171
		cli_execute("trigger lose_effect, Reptilian Fortitude, cast 1 Reptilian Fortitude");
172
	} else if (have_skill($skill[Springy Fusilli])) {
173
		cli_execute("trigger lose_effect, Springy Fusilli, cast 1 Springy Fusilli");
174
	} else if (have_skill($skill[The Power Ballad of the Arrowsmith])) {
175
		cli_execute("trigger lose_effect, The Power Ballad of the Arrowsmith, cast 1 The Power Ballad of the Arrowsmith");
176
	} else if (have_skill($skill[Suspicious Gaze])) {
177
		cli_execute("trigger lose_effect, Suspicious Gaze, cast 1 Suspicious Gaze");
178
	} else if (have_skill($skill[Cletus's Canticle of Celerity])) {
179
		cli_execute("trigger lose_effect, Cletus's Canticle of Celerity, cast 1 Cletus's Canticle of Celerity");
180
	} else if (have_skill($skill[Sauce Contemplation])) {
181
		cli_execute("trigger lose_effect, Sauce Contemplation, cast 1 Sauce Contemplation");
182
	} else if (have_skill($skill[Patience of the Tortoise])) {
183
		cli_execute("trigger lose_effect, Patience of the Tortoise, cast 1 Patience of the Tortoise");
184
	} else if (have_skill($skill[Moxie of the Mariachi])) {
185
		cli_execute("trigger lose_effect, Moxie of the Mariachi, cast 1 Moxie of the Mariachi");
186
	}
187
	cli_execute("mood execute");
188
}
189
190
void chateauCast(skill which) { //casts the skill as normal (if you have it), unless you don't have the MP, in which case it will use a free rest at the chateau first
191
	if (have_skill(which)) {
192
		if (my_mp() >= mp_cost(which)) {
193
			use_skill(which);
194
		} else if (free_rest()) {
195
			if (my_mp() >= mp_cost(which)) {
196
				use_skill(which);
197
			} else {
198
				abort("Failed to cast " + to_string(which) + " even after a Chateau rest...");
199
			}
200
		} else {
201
			restore_mp(mp_cost(which));
202
			print("Ran out of MP and free rests; had to restort to meat-MP instead", "red");
203
			if (my_mp() >= mp_cost(which)) {
204
				use_skill(which);
205
			} else {
206
				abort("Failed to cast " + to_string(which) + " even after restoring MP...");
207
			}
208
		}
209
	}
210
}
211
212
boolean doTest(int which) {
213
	if (my_adventures() >= advCost(which)) {
214
		visit_url("choice.php?whichchoice=1089&option="+which+"&pwd="+my_hash());
215
		return true;
216
	} else {
217
		abort("Failed to generate enough adventures to complete test " + which);
218
		return false;
219
	}
220
}
221
222
void combatAdv(location where, boolean fighting) {
223
	if (have_effect($effect[Springy Fusilli]) == 0) {
224
		chateauCast($skill[Springy Fusilli]);
225
	}
226
	if (fighting && have_skill($skill[Curse of Weaksauce]) && have_skill($skill[Saucegeyser]) && my_mp() < (mp_cost($skill[Curse of Weaksauce]) + mp_cost($skill[Saucegeyser]))) {
227
		if (!free_rest()) {
228
			restore_mp(mp_cost($skill[Curse of Weaksauce]) + mp_cost($skill[Saucegeyser]));
229
		}
230
	}
231
	if (my_hp() < my_maxhp()) {
232
		restore_hp(my_maxhp());
233
	}
234
	adventure(1, where, "combat");
235
}
236
237
void YRAdv(location where) { //sets crimbo shrub as active familiar first, then switches back...looks dumb if it takes multiple adv to get the YR target but whatever
238
	if(have_effect($effect[Everything Looks Yellow]) > 0) {
239
		abort("Yellow ray time, but you still have Everything Looks Yellow.");
240
	}
241
	familiar prevfam = my_familiar();
242
	if(have_familiar($familiar[Crimbo Shrub])) {
243
		use_familiar($familiar[Crimbo Shrub]);
244
	}
245
	combatAdv(where, false);
246
	if (prevfam != $familiar[Crimbo Shrub]) {
247
		use_familiar(prevfam);
248
	}
249
}
250
251
boolean YRsourceAvailable() {
252
	if(have_familiar($familiar[Crimbo Shrub]) || $item[Golden Light].available_amount() > 0) {
253
		return true;
254
	} else {
255
		return false;
256
	}
257
}
258
259
int hotdogStock(int which) { //returns how many of the item to 'unlock' a dog is currently stocked
260
	buffer page = visit_url("clan_viplounge.php?action=hotdogstand");
261
	string dogstr = substring(page, page.index_of(which.to_string()), page.index_of(which.to_string())+550);
262
	string stockstr = substring(dogstr, dogstr.index_of("in stock")-6, dogstr.index_of("in stock"));
263
	return substring(stockstr, stockstr.index_of("(")+1, stockstr.index_of(" ")).to_int();
264
}
265
266
boolean hotdogAvailable(int which) { //returns true if you don't have to restock to eat the specified hotdog
267
	buffer page = visit_url("clan_viplounge.php?action=hotdogstand");
268
	string dogstr = substring(page, page.index_of(which.to_string()), page.index_of(which.to_string())+10);
269
	if (contains_text(dogstr, "_food")) { //if _food is the first match, the hotdog is disabled.
270
		return false;
271
	} else {
272
		return true;
273
	}
274
}
275
276
void restockHotdog(int which) {
277
	int target;
278
	item restockitem;
279
	switch(which) {
280
		case -101: //sleeping dog
281
			target = 10;
282
			restockitem = $item[gauze hammock];
283
			break;
284
		case -100: //wet dog
285
			target = 25;
286
			restockitem = $item[sleaze wad];
287
			break;
288
		case -99: //junkyard dog
289
			target = 25;
290
			restockitem = $item[stench wad];
291
			break;
292
		default:
293
			abort("Unsupported hotdog");
294
			break;
295
	}
296
	int amtneeded = target - hotdogStock(which);
297
	if (amtneeded < 1) {
298
		abort("Got confused while trying to restock hotdog.");
299
	} else if (storage_amount(restockitem) < amtneeded) {
300
		buy_using_storage(amtneeded - storage_amount(restockitem), restockitem, -1);
301
	}
302
	visit_url("clan_viplounge.php?preaction=hotdogsupply&hagnks=1&whichdog="+which+"&quantity="+amtneeded);
303
}
304
305
void eatHotdog(int which) {
306
	if (!hotdogAvailable(which)) {
307
		restockHotdog(which);
308
	}
309
	visit_url("clan_viplounge.php?preaction=eathotdog&whichdog="+which);
310
}
311
312
void cast(skill which) { //just casts it if you have it.
313
	if (have_skill(which)) {
314
		use_skill(which);
315
	}
316
}
317
318
void summonDailyStuff() {
319
	use_skill(3, $skill[Summon Smithsness]);
320
	chateauCast($skill[Advanced Saucecrafting]);
321
	chateauCast($skill[Advanced Cocktailcrafting]);
322
	chateauCast($skill[Pastamastery]);
323
	chateauCast($skill[Grab a Cold One]);
324
	chateauCast($skill[Spaghetti Breakfast]);
325
	visit_url("campground.php?action=garden");
326
	visit_url("campground.php?action=workshed");
327
}
328
329
int advToSemirare() {
330
	for i from 0 to 30 { //this is ridiculous.
331
		if (get_counters("Fortune Cookie", i, i) != "") {
332
			return i; //if 0 then semirare is imminent
333
		}
334
	}
335
	return 99999;
336
}
337
338
string checkGarden() {
339
	buffer page = visit_url("campground.php");
340
	if (contains_text(page, "A Winter Garden")) {
341
		return "winter";
342
	} else if (contains_text(page, "A Beer Garden")) {
343
		return "beer";
344
	} else if (contains_text(page, "A Pumpkin Patch")) {
345
		return "pumpkin";
346
	} else if (contains_text(page, "A Peppermint Patch")) {
347
		return "peppermint";
348
	} else if (contains_text(page, "A Bone Garden")) {
349
		return "bone";
350
	} else {
351
		return "none";
352
	}
353
}
354
355
int g9val() { //useless in hindsight; we get g9 on day 1 and use it on day 2 so its values are irrelevant. maybe I'll move g9 farming to day 2 if you got the SR between shore trips
356
	buffer page = visit_url("desc_effect.php?whicheffect=af64d06351a3097af52def8ec6a83d9b");
357
	return substring(page, page.index_of("+")+1, page.index_of("%")).to_int();
358
}
359
360
boolean giantGrowth() {
361
	if(!have_skill($skill[Giant Growth]) || $item[Louder Than Bomb].available_amount() == 0 || $item[green mana].available_amount() == 0) {
362
		return false;
363
	} else {
364
		familiar curfam = my_familiar();
365
		use_familiar($familiar[none]);
366
		combatAdv($location[The Dire Warren], false);
367
		use_familiar(curfam);
368
		if(have_effect($effect[Giant Growth]) > 0) {
369
			return true;
370
		} else {
371
			return false;
372
		}
373
	}
374
}
375
376
string customCombat(int round) {
377
	if (round == 0 && (have_skill($skill[Curse of Weaksauce]) && my_mp() >= (mp_cost($skill[Curse of Weaksauce]) + mp_cost($skill[Saucegeyser])))) {
378
		return "skill Curse of Weaksauce";
379
	} else if (have_skill($skill[Saucegeyser]) && my_mp() >= mp_cost($skill[Saucegeyser])) {
380
		return "skill Saucegeyser";
381
	} else {
382
		print("Resorting to basic attack", "red");
383
		return "attack";
384
	}
385
}
386
387
string combatYR() {
388
	if (have_skill($skill[Open a Big Yellow Present])) {
389
		return "skill Open a Big Yellow Present";
390
	} else if ($item[Golden Light].available_amount() > 0) {
391
		return "use Golden Light";
392
	} else {
393
		abort("No yellow ray available when trying to use one");
394
		return "I really shouldn't have to specify a return value after an abort";
395
	}
396
}
397
398
string combat(int round, string opp, string text) { //always uses your own custom combat script after first doing whatever you're supposed to
399
	if ((opp == $monster[lavatory].to_string() || opp == $monster[garbage tourist].to_string() || opp == $monster[lava lamprey].to_string() || opp.contains_text("pirate")) && $item[DNA extraction syringe].available_amount() > 0) { //DNA
400
		if ($item[Gene Tonic: Elemental].available_amount() == 0) {
401
			if(round == 0) {
402
				return "use DNA extraction syringe";
403
			} else {
404
				return customCombat(round - 1);
405
			}
406
		} else {
407
			return customCombat(round);
408
		}
409
	} else if (opp == $monster[dairy goat].to_string()) { //beast DNA and milk of magnesium
410
		if(round == 0 && $item[DNA extraction syringe].available_amount() > 0 && $item[Gene Tonic: Beast].available_amount() == 0) {
411
			return "use DNA extraction syringe";
412
		} else if (YRsourceAvailable()) {
413
			return combatYR();
414
		} else {
415
			return customCombat(round - 1);
416
		}
417
	} else if (opp == $monster[super-sized Cola Wars soldier].to_string() || opp == $monster[lab monkey].to_string() || opp == $monster[creepy little girl].to_string()) {
418
		return "run away";
419
	} else if (opp == $monster[government scientist].to_string()) {
420
		if (have_effect($effect[On the Trail]) == 0) {
421
			return "skill Transcendent Olfaction";
422
		} else if (have_effect($effect[On the Trail]) == 40) { //used it this combat
423
			return customCombat(round - 1);
424
		} else {
425
			return customCombat(round);
426
		}
427
	} else if (opp.contains_text("hippy") || opp.contains_text("Frat Boy") || opp == $monster[novelty tropical skeleton].to_string() || opp == $monster[factory worker (female)].to_string() || opp == $monster[factory overseer (female)].to_string()) {
428
		return combatYR();
429
	} else if (opp == $monster[fluffy bunny].to_string()) {
430
		if (round == 1) {
431
			return "skill Giant Growth";
432
		} else {
433
			return "use Louder Than Bomb";
434
		}
435
	} else { //no special case, just use your CCS
436
		return customCombat(round);
437
	}
438
}
439
440
boolean getSRifCan() { //returns true if got it
441
	if (advToSemirare() == 0) {
442
		if (checkGarden() == "winter") {
443
			adventure(1, $location[The Limerick Dungeon], "combat");
444
		} else { 
445
			adventure(1, $location[The Outskirts of Cobb's Knob], "combat");
446
			use(1, $item[Knob Goblin lunchbox]);
447
		}
448
		return true;
449
	} else {
450
		return false;
451
	}
452
}
453
454
boolean pulverize(item which) {
455
	if (!have_skill($skill[Pulverize]) || which.available_amount() == 0) {
456
		return false;
457
	} else {
458
		cli_execute("pulverize " + which);
459
		return true;
460
	}
461
}
462
463
void getG9Serum() { //like 0-7 turns prolly
464
	if(statemap["questStage"] >= 8) {
465
		return;
466
	}
467
	if (get_property_boolean("spookyAirportAlways") && have_skill($skill[Transcendent Olfaction])) {
468
		if (my_mp() < mp_cost($skill[Transcendent Olfaction])) {
469
			if (!free_rest()) {
470
				restore_mp(mp_cost($skill[Transcendent Olfaction]));
471
				print("Had to restort to meat-MP instead of chateau rest", "red");
472
			}
473
		}
474
		while($item[experimental serum G-9].available_amount() < 2) {
475
			if (!getSRifCan()) {
476
				combatAdv($location[The Secret Government Laboratory], true);
477
			}
478
		}
479
	}
480
	saveProgress(8);
481
}
482
483
boolean hasScalingZone() {
484
	if (get_property_boolean("hotAirportAlways") || get_property_boolean("spookyAirportAlways") || get_property_boolean("sleazyAirportAlways") || get_property_boolean("sleazyAirportAlways") || $item[GameInformPowerDailyPro walkthru].available_amount() > 0 || $item[GameInformPowerDailyPro magazine].available_amount() > 0) {
485
		return true;
486
	} else {
487
		return false;
488
	}
489
}
490
491
void eatHotFood() {
492
	use(1, $item[milk of magnesium]);
493
	eat(1, $item[sausage without a cause]);
494
	if (hotdogAvailable(-99)) { //junkyard dog
495
		visit_url("clan_viplounge.php?preaction=eathotdog&whichdog=-99");
496
	} else if (hotdogAvailable(-100)) { //wet dog
497
		visit_url("clan_viplounge.php?preaction=eathotdog&whichdog=-100");
498
	} else {
499
		if (hotdogStock(-99) >= hotdogStock(-100)) {
500
			eatHotdog(-99);
501
		} else {
502
			eatHotdog(-100);
503
		}
504
	}
505
	if ($item[ice harvest].available_amount() > 0) {
506
		eat(1, $item[ice harvest]);
507
	}
508
	if ($item[snow crab].available_amount() > 0) {
509
		eat(1, $item[snow crab]);
510
	} else if ($item[snow berries].available_amount() >= 2) {
511
		create(1, $item[snow crab]);
512
		eat(1, $item[snow crab]);
513
	} 
514
	if (my_fullness() < 14) {
515
		if ($item[limp broccoli].available_amount() > 0) {
516
			eat(1, $item[limp broccoli]);
517
		} else if ($item[gooey lava globs].available_amount() > 0) {
518
			eat(1, $item[gooey lava globs]);
519
		} 
520
	}
521
	while (my_fullness() < 15) {
522
		if ($item[Knob pasty].available_amount() > 0) {
523
			eat(1, $item[Knob pasty]);
524
		} else if ($item[tasty tart].available_amount() > 0) {
525
			eat(1, $item[tasty tart]);
526
		} else {
527
			print("Resorting to eating a fortune cookie for remaining fullness.", "red");
528
			buy(1, $item[fortune cookie]);
529
			eat(1, $item[fortune cookie]);
530
		}
531
	}
532
}
533
534
void hotTest() {
535
	if(statemap["questStage"] == 21) {
536
		pulverize($item[dirty rigging rope]);
537
		pulverize($item[sewage-clogged pistol]);
538
		pulverize($item[dirty hobo gloves]);
539
		////chateau rest to 35 moxie
540
		if ($item[lava-proof pants].available_amount() > 0) {
541
			equip($item[lava-proof pants]);
542
		}
543
		if ($item[perfume-soaked bandana].available_amount() > 0) {
544
			equip($slot[acc1], $item[perfume-soaked bandana]);
545
		}
546
		if ($item[heat-resistant necktie].available_amount() > 0) {
547
			equip($slot[acc2], $item[heat-resistant necktie]);
548
		}
549
		if ($item[heat-resistant gloves].available_amount() > 0) {
550
			equip($slot[acc3], $item[heat-resistant gloves]);
551
		}
552
		if ($item[stench powder].available_amount() > 0 && $item[scrumptious reagent].available_amount() > 0) {
553
			create(1, $item[lotion of stench]);
554
			use(1, $item[lotion of stench]);
555
		}
556
		if ($item[sleaze powder].available_amount() > 0 && $item[scrumptious reagent].available_amount() > 0) { //not that I have any idea what I could pulverize for this.
557
			create(1, $item[lotion of sleaziness]);
558
			use(1, $item[lotion of sleaziness]);
559
		}
560
		useIfHave(1, $item[scroll of Protection from Bad Stuff]);
561
		useIfHave(1, $item[Gene Tonic: Elemental]);
562
		if (have_familiar($familiar[Exotic Parrot])) {
563
			use_familiar($familiar[Exotic Parrot]);
564
			chateauCast($skill[Leash of Linguini]);
565
			chateauCast($skill[Empathy of the Newt]);
566
		}
567
		saveProgress(22);
568
	} 
569
	
570
	if(statemap["questStage"] == 22) {
571
		eatHotFood();
572
		chateauCast($skill[Elemental Saucesphere]);
573
		chateauCast($skill[Astral Shell]);
574
		if (!hasScalingZone()) {
575
			if (have_effect($effect[Ode to Booze]) < 2) {
576
				chateauCast($skill[The Ode to Booze]);
577
			}
578
			visit_url("clan_viplounge.php?preaction=speakeasydrink&drink=7&pwd="+my_hash()); //ish kabibble
579
		}
580
		saveProgress(23);
581
	}
582
	
583
	if(statemap["questStage"] >= 24) {
584
		return;
585
	}
586
	maximize("hot res", false);
587
	doTest(HOTTEST);
588
	saveProgress(24);
589
}
590
591
void weaponTest() {
592
	if(statemap["questStage"] == 8) {
593
		//chataeau rest while buffing dmg
594
		chateauCast($skill[The Ode to Booze]);
595
		visit_url("clan_viplounge.php?preaction=speakeasydrink&drink=6&pwd="+my_hash()); //sockadollager
596
		chateauCast($skill[Rage of the Reindeer]);
597
		chateauCast($skill[Jackasses' Symphony of Destruction]);
598
		chateauCast($skill[Tenacity of the Snapper]);
599
		chateauCast($skill[Song of the North]);
600
		while (my_level() < 8 && free_rest()) {} //expends free rests until level 8 or running out
601
		if (my_level() < 8) {
602
			print("Failed to reach level 8 with chateau rests...oh well", "red");
603
		} else if (free_rests_left() > 0) {
604
			print("Reached level 8 with "+ free_rests_left() +" free rests left", "green");
605
		} else {
606
			print("Reaced level 8, but ran out of free rests", "blue");
607
		}
608
		saveProgress(9);
609
	}
610
	
611
	if(statemap["questStage"] == 9) {
612
		//consume astrals
613
		if ($item[astral energy drink].available_amount() > 0) {
614
			chew(1, $item[astral energy drink]);
615
		} else if ($item[astral pilsner].available_amount() > 0) {
616
			while (my_inebriety() < 14 && my_adventures() < advCost(WPNTEST)) {
617
				if (have_effect($effect[Ode to Booze]) == 0) {
618
					chateauCast($skill[The Ode to Booze]);
619
				}
620
				drink(1, $item[astral pilsner]);
621
			}
622
		}
623
		saveProgress(10);
624
	}
625
	
626
	if(statemap["questStage"] >= 11) {
627
		return;
628
	}
629
	maximize("weapon dmg", false);
630
	doTest(WPNTEST);
631
	saveProgress(11);
632
}
633
634
void itemTest() {
635
	if(statemap["questStage"] == 11) {
636
		//eat food
637
		use(1, $item[milk of magnesium]);
638
		eatHotdog(-101); //sleeping dog
639
		eat(1, $item[weird gazelle steak]);
640
		eat(1, $item[This Charming Flan]);
641
		if ($item[snow crab].available_amount() > 0) {
642
			eat(1, $item[snow crab]);
643
		} else if ($item[Knob pasty].available_amount() > 0) {
644
			eat(1, $item[Knob pasty]);
645
		} else {
646
			print("Resorting to eating a fortune cookie for last point of fullness.", "red");
647
			buy(1, $item[fortune cookie]);
648
			eat(1, $item[fortune cookie]);
649
		}
650
		saveProgress(12);
651
	}
652
	
653
	if(statemap["questStage"] == 12) {
654
		//buff item drop
655
		useIfHave(1, $item[Gene Tonic: Pirate]);
656
		useIfHave(1, $item[tin cup]);
657
		useIfHave($item[pulled yellow taffy].available_amount(), $item[pulled yellow taffy]);
658
		if ($item[Agitated Turkey].available_amount() > 0 && my_inebriety() < 14) {
659
			if (have_effect($effect[Ode to Booze]) == 0) {
660
				chateauCast($skill[The Ode to Booze]);
661
			}
662
			use(1, $item[Agitated Turkey]);
663
		}
664
		chateauCast($skill[Fat Leon's Phat Loot Lyric]);
665
		chateauCast($skill[Singer's Faithful Ocelot]);
666
		saveProgress(13);
667
	}
668
	if(statemap["questStage"] >= 14) {
669
		return;
670
	}
671
	maximize("item drop", false);
672
	doTest(ITEMTEST);
673
	saveProgress(14);
674
}
675
676
void allStatBuffs() {
677
	if (have_effect($effect[Song of Bravado]) == 0) {
678
		chateauCast($skill[Song of Bravado]);
679
	}
680
	if (have_effect($effect[Tomato Power]) == 0) {
681
		useIfHave(1, $item[tomato juice of powerful power]);
682
	}
683
	if (have_effect($effect[Experimental Effect G-9]) == 0) {
684
		useIfHave(1, $item[experimental serum G-9]);
685
	}
686
	if (have_effect($effect[Stevedave's Shanty of Superiority]) == 0) {
687
		chateauCast($skill[Stevedave's Shanty of Superiority]);
688
	} 
689
	if (have_effect($effect[Expert Oiliness]) == 0) {
690
		useIfHave(1, $item[oil of expertise]);
691
	}
692
	if (have_effect($effect[Smithsness Presence]) == 0) {
693
		useIfHave(1, $item[handful of Smithereens]);
694
	}
695
	if (get_property_int("_speakeasyDrinksDrunk") < 3 && have_effect($effect[On the Trolley]) == 0 && my_inebriety() <= 12) {
696
		if (have_effect($effect[Ode to Booze]) < 2) {
697
			chateauCast($skill[The Ode to Booze]);
698
		}
699
		visit_url("clan_viplounge.php?preaction=speakeasydrink&drink=5&pwd="+my_hash()); //bee's knees
700
	}
701
}
702
703
void hpTest() {
704
	if(statemap["questStage"] == 26) {
705
		cli_execute("cheat strength");
706
		use(1, $item[oil of expertise]);
707
		useIfHave(1, $item[scroll of Puddingskin]);
708
		useIfHave(1, $item[philter of phorce]);
709
		if (have_effect($effect[Tomato Power]) == 0) {
710
			useIfHave(1, $item[tomato juice of powerful power]);
711
		}
712
		if (have_effect($effect[Experimental Effect G-9]) == 0) {
713
			useIfHave(1, $item[experimental serum G-9]);
714
		}
715
		buy(2, $item[Ben-Gal&trade; Balm]);
716
		use(1, $item[Ben-Gal&trade; Balm]);
717
		chateauCast($skill[Song of Starch]);
718
		chateauCast($skill[Stevedave's Shanty of Superiority]);
719
		chateauCast($skill[Reptilian Fortitude]);
720
		chateauCast($skill[The Power Ballad of the Arrowsmith]);
721
		chateauCast($skill[Sauce Contemplation]);
722
		chateauCast($skill[Patience of the Tortoise]);
723
		chateauCast($skill[Moxie of the Mariachi]);
724
		chateauCast($skill[Rage of the Reindeer]);
725
		saveProgress(27);
726
	}
727
	
728
	if(statemap["questStage"] == 27) {
729
		maximize("hp", false);
730
		if(doTest(HPTEST)) {
731
			chew(1, $item[blood-drive sticker]);
732
		}
733
		saveProgress(28);
734
	}
735
}
736
737
void spellTest() { //buffing for this test is actually handled at the end of day 2 so there's not much here.
738
	if(statemap["questStage"] >= 19) {
739
		return;
740
	}
741
	if ($item[scrumptious reagent].available_amount() > 0)  {
742
		buy(1, $item[soda water]);
743
		create(1, $item[cordial of concentration]);
744
		use(1, $item[cordial of concentration]);
745
	}
746
	maximize("spell damage", false);
747
	doTest(SPELLTEST);
748
	saveProgress(19);
749
}
750
751
void coilTest() {
752
	if(statemap["questStage"] >= 4) {
753
		return;
754
	}
755
	if (my_adventures() >= 60) {
756
		doTest(COILTEST);
757
		use(1, $item[a ten-percent bonus]);
758
	} else {
759
		abort("Failed to generate enough adventures to coil wire.");
760
	}
761
	saveProgress(4);
762
}
763
764
void muscleTest() {
765
	if(statemap["questStage"] == 28) {
766
		if (have_effect($effect[Power Ballad of the Arrowsmith]) == 0) {
767
			chateauCast($skill[The Power Ballad of the Arrowsmith]);
768
		} 
769
		if (have_effect($effect[Rage of the Reindeer]) == 0) {
770
			chateauCast($skill[Rage of the Reindeer]);
771
		} 
772
		chateauCast($skill[Seal Clubbing Frenzy]);
773
		chateauCast($skill[Patience of the Tortoise]);
774
		useIfHave(1, $item[jar of &quot;Creole Lady&quot; marrrmalade]);
775
		useIfHave(1, $item[dollop of barbecue sauce]);
776
		if (have_effect($effect[Phorcefullness]) == 0) {
777
			useIfHave(1, $item[philter of phorce]);
778
		}
779
		allStatBuffs();
780
		giantGrowth();
781
		saveProgress(29);
782
	}
783
	if(statemap["questStage"] == 29) {
784
		maximize("muscle", false);
785
		doTest(MUSTEST);
786
		saveProgress(30);
787
	}
788
}
789
790
void mystTest() {
791
	if(statemap["questStage"] == 30) {
792
		chateauCast($skill[The Magical Mojomuscular Melody]);
793
		chateauCast($skill[Sauce Contemplation]);
794
		chateauCast($skill[Manicotti Meditation]);
795
		useIfHave(1, $item[ointment of the occult]);
796
		allStatBuffs();
797
		giantGrowth();
798
		useIfHave(1, $item[bag of grain]);
799
		saveProgress(31);
800
	}
801
	if(statemap["questStage"] == 31) {
802
		maximize("myst", false);
803
		doTest(MOXTEST);
804
		saveProgress(32);
805
	}
806
}
807
808
void moxieTest() {
809
	if(statemap["questStage"] == 32) {
810
		chateauCast($skill[The Moxious Madrigal]);
811
		chateauCast($skill[Disco Fever]);
812
		chateauCast($skill[Moxie of the Mariachi]);
813
		chateauCast($skill[Disco Aerobics]);
814
		useIfHave(1, $item[dollop of barbecue sauce]);
815
		useIfHave(1, $item[pressurized potion of pulchritude]);
816
		useIfHave(1, $item[serum of sarcasm]);
817
		allStatBuffs();
818
		giantGrowth();
819
		useIfHave(1, $item[pocket maze]);
820
		saveProgress(33);
821
	}
822
	if(statemap["questStage"] == 33) {
823
		maximize("moxie", false);
824
		doTest(MOXTEST);
825
		saveProgress(34);
826
	}
827
}
828
829
void famTest() {
830
	if(statemap["questStage"] == 34) {
831
		chateauCast($skill[Empathy of the Newt]);
832
		chateauCast($skill[Leash of Linguini]);
833
		if($item[vintage smart drink].available_amount() > 0) {
834
			chateauCast($skill[The Ode to Booze]);
835
			chateauCast($skill[The Ode to Booze]);
836
			use(1, $item[vintage smart drink]);
837
		}
838
		saveProgress(35);
839
	}
840
	if(statemap["questStage"] == 35) {
841
		maximize("familiar weight", false);
842
		doTest(FAMTEST);
843
		saveProgress(36);
844
	}
845
}
846
847
void noncombatTest() {
848
	if(statemap["questStage"] == 37) {
849
		chateauCast($skill[The Sonata of Sneakiness]);
850
		chateauCast($skill[Smooth Movement]);
851
		if ($item[snow berries].available_amount() > 0) {
852
			create(1, $item[snow cleats]);
853
			use(1, $item[snow cleats]);
854
		}
855
		useIfHave(1, $item[deodorant]);
856
		useIfHave(1, $item[shady shades]);
857
		useIfHave(1, $item[squeaky toy rose]);
858
		saveProgress(38);
859
	}
860
	if(statemap["questStage"] == 38) {
861
		maximize("-combat -tie", false);
862
		doTest(COMTEST); 
863
		saveProgress(39);
864
	}
865
	
866
}
867
868
void powerlevel() {
869
	if(statemap["questStage"] == 24 || statemap["questStage"] == 25) {
870
		if (!hasScalingZone()) {
871
			print("No scaling zone found...skipping powerleveling.", "red");
872
			saveProgress(26);
873
		} else {
874
			//powerlevel
875
			if(statemap["questStage"] == 24) {
876
				useIfHave(1, $item[ointment of the occult]);
877
				useIfHave(1, $item[experimental serum G-9]);
878
				if ($item[hot ashes].available_amount() > 1) {
879
					create(1, $item[ash soda]);
880
					use(1, $item[ash soda]);
881
				}
882
				chateauCast($skill[The Ode to Booze]);
883
				visit_url("clan_viplounge.php?preaction=speakeasydrink&drink=5&pwd="+my_hash()); //bee's knees
884
				chateauCast($skill[Ur-Kel's Aria of Annoyance]);
885
				chateauCast($skill[Ur-Kel's Aria of Annoyance]);
886
				chateauCast($skill[Pride of the Puffin]);
887
				chateauCast($skill[Drescher's Annoying Noise]);
888
				chateauCast($skill[Leash of Linguini]);
889
				chateauCast($skill[Empathy of the Newt]);
890
				chateauCast($skill[Empathy of the Newt]);
891
				chateauCast($skill[Wry Smile]);
892
				chateauCast($skill[Aloysius' Antiphon of Aptitude]);
893
				chateauCast($skill[Aloysius' Antiphon of Aptitude]);
894
				while (free_rests_left() > 1) {
895
					free_rest();
896
				}
897
				if (have_familiar($familiar[Hovering Sombrero])) {
898
					use_familiar($familiar[Hovering Sombrero]);
899
				} else if (have_familiar($familiar[Golden Monkey])) {
900
					use_familiar($familiar[Golden Monkey]);
901
				} else if (have_familiar($familiar[Grim Brother])) {
902
					use_familiar($familiar[Grim Brother]);
903
				} else if (have_familiar($familiar[Unconscious Collective])) {
904
					use_familiar($familiar[Unconscious Collective]);
905
				} else if (have_familiar($familiar[Galloping Grill])) {
906
					use_familiar($familiar[Galloping Grill]);
907
				} else if (have_familiar($familiar[Smiling Rat])) {
908
					use_familiar($familiar[Smiling Rat]);
909
				}
910
				maximize("myst", false);
911
				saveProgress(25);
912
			}
913
			if(statemap["questStage"] == 25) {
914
				location farmzone;
915
				if (get_property_boolean("stenchAirportAlways")) {
916
					farmzone = $location[Uncle Gator's Country Fun-Time Liquid Waste Sluice];
917
					calderaMood(); //same deal here
918
				} else if (get_property_boolean("spookyAirportAlways")) {
919
					farmzone = $location[The Deep Dark Jungle];
920
					if ($item[Coinspiracy].available_amount() > 0) {
921
						buy($coinmaster[The Canteen], 1, $item[Jungle Juice]);
922
						drink(1, $item[Jungle Juice]);
923
					}
924
				} else if (get_property_boolean("sleazyAirportAlways")) {
925
					farmzone = $location[Sloppy Seconds Diner];
926
				} else if (get_property_boolean("hotAirportAlways")) {
927
					farmzone = $location[The SMOOCH Army HQ];
928
				} else {
929
					farmzone = $location[Video Game Level 1];
930
				}
931
				int turnsfarmed = 0;
932
				while (my_level() < 9 && turnsfarmed < 10) {
933
					combatAdv(farmzone, true);
934
					if (have_effect($effect[beaten up]) > 0) {
935
						abort("Getting beaten up when trying to powerlevel. Consider changing custom combat script?");
936
					}
937
					restore_hp(my_maxhp());
938
					turnsfarmed += 1;
939
				}
940
				saveProgress(26);
941
			}
942
		}
943
	}
944
}
945
946
void getTurtleTotem() {
947
	while($item[turtle totem].available_amount() < 1) {
948
		buy(1, $item[chewing gum on a string]);
949
		use(1, $item[chewing gum on a string]);
950
	}
951
}
952
953
void getMilk() {
954
	chateauCast($skill[Springy Fusilli]);
955
	restore_hp(my_maxhp());
956
	if(statemap["questStage"] >= 3) {
957
		return;
958
	}
959
	if (get_property("chateauMonster") == "dairy goat") {
960
		visit_url("place.php?whichplace=chateau&action=chateau_painting");
961
		adventure(1, $location[Noob Cave], "combat"); //I'm told this works. 
962
		/*if ($item[DNA extraction syringe].available_amount() > 0 && $item[Gene Tonic: Beast].available_amount() == 0) {
963
			if (have_skill($skill[Ambidextrous Funkslinging])) {
964
				visit_url("fight.php?action=useitem&whichitem=7383&whichitem2=7013&useitem=Use+Item%28s%29"); //7383 = syringe, 7013 = golden light
965
			} else {
966
				visit_url("fight.php?action=useitem&whichitem=7383&whichitem2=0&useitem=Use+Item%28s%29");
967
				visit_url("fight.php?action=useitem&whichitem=7013&whichitem2=0&useitem=Use+Item%28s%29");
968
			}
969
		} else {
970
			visit_url("fight.php?action=useitem&whichitem=7013&whichitem2=0&useitem=Use+Item%28s%29"); 
971
		} */
972
	}
973
	if($item[glass of goat's milk].available_amount() == 0) {
974
		abort("Failed to retrieve milk.");
975
	}
976
	if ($item[Gene Tonic: Beast].available_amount() > 0) {
977
		visit_url("campground.php?action=dnapotion");
978
	}
979
	saveProgress(3);
980
}
981
982
void getPirateDNA() {
983
	if(statemap["questStage"] >= 5) {
984
		return;
985
	}
986
	if (get_property_boolean("stenchAirportAlways") && $item[DNA extraction syringe].available_amount() > 0) { 
987
		combatAdv($location[Pirates of the Garbage Barges], true);
988
		visit_url("campground.php?action=dnapotion");
989
	}
990
	saveProgress(5);
991
}
992
993
void getCalderaDNA() {
994
	if(statemap["questStage"] >= 6) {
995
		return;
996
	}
997
	if (get_property_boolean("hotAirportAlways") && $item[DNA extraction syringe].available_amount() > 0) {
998
		if (have_effect($effect[Song of Sauce]) == 0) {
999
			chateauCast($skill[Song of Sauce]);
1000
		}
1001
		calderaMood();
1002
		while(have_effect($effect[Human-Fish Hybrid]) == 0 && ($item[Gene Tonic: Elemental].available_amount() == 0 || get_property_boolean("stenchAirportAlways"))) { //if got fish DNA and either elemental DNA or have Dinsey open
1003
			combatAdv($location[The Bubblin' Caldera], true);
1004
			if (have_effect($effect[Beaten Up]) > 0) {
1005
				print("You got whupped...", "red");
1006
				visit_url("clan_viplounge.php?action=hottub");
1007
			}
1008
			buffer page = visit_url("campground.php?action=workshed");
1009
			if (contains_text(page, "Human-Elemental Hybrid") && $item[Gene Tonic: Elemental].available_amount() == 0) {
1010
				visit_url("campground.php?action=dnapotion");
1011
			} else if (contains_text(page, "Human-Fish Hybrid") && have_effect($effect[Human-Fish Hybrid]) != 2147483547) {
1012
				visit_url("campground.php?action=dnainject"); 
1013
			}
1014
		}
1015
		cli_execute("mood clear");
1016
		while ($item[Gene Tonic: Elemental].available_amount() == 0 && get_property_boolean("stenchAirportAlways")) {
1017
			combatAdv($location[Barf Mountain], true);
1018
		}
1019
	}
1020
	saveProgress(6);
1021
}
1022
1023
void getDeodorant() {
1024
	if(statemap["questStage"] >= 37) {
1025
		return;
1026
	}
1027
	if(!islandSkipped() && YRsourceAvailable()) {
1028
		chateauCast($skill[Musk of the Moose]);
1029
		chateauCast($skill[Carlweather's Cantata of Confrontation]);
1030
		useIfHave(1, $item[reodorant]);
1031
		while($item[deodorant].available_amount() > 0) {
1032
			YRAdv($location[Orcish Frat House]);
1033
		}
1034
		if(have_effect($effect[Carlweather's Cantata of Confrontation]) > 0) {
1035
			cli_execute("uneffect " + $effect[Carlweather's Cantata of Confrontation].to_string());
1036
		}
1037
	}
1038
	saveProgress(37);
1039
}
1040
1041
void maybeUnlockIsland() { //either unlocks island or decides to just do skeleton store instead later
1042
	if(statemap["questStage"] >= 7) {
1043
		return;
1044
	}
1045
	getSRifCan();
1046
	if ((advToSemirare() % 3 == 0 && advToSemirare() < 10) || (get_property_boolean("spookyAirportAlways") && advToSemirare() > 9)) { //if the SR is perfectly between shore trips OR it'll come up during G9 farming
1047
		while ($item[Shore Inc. Ship Trip Scrip].available_amount() < 3) {
1048
			visit_url("choice.php?"+my_hash()+"&whichchoice=793&option=2&choiceform2=Tropical+Paradise+Island+Getaway");
1049
			getSRifCan();
1050
		}
1051
	} else { //1, 2, 4, 5, 7, or 8 adv to semirare or no CI; skeleton store instead...loses tomato/olive but saves initial turns so whatever. Tomato can be found in the pantry anyway
1052
		skipIsland();
1053
	}
1054
	saveProgress(7);
1055
}
1056
1057
void getPotionIngredients() {
1058
	if(statemap["questStage"] >= 15) {
1059
		return;
1060
	}
1061
	if (islandSkipped()) {
1062
		while ($item[cherry].available_amount() == 0) {
1063
			YRAdv($location[The Skeleton Store]);
1064
		}
1065
	} else {
1066
		while ($item[filthy knitted dread sack].available_amount() == 0 || $item[filthy corduroys].available_amount() == 0) {
1067
			YRAdv($location[The Hippy Camp]);
1068
		}
1069
		item prevhat = equipped_item($slot[hat]);
1070
		item prevpants = equipped_item($slot[pants]);
1071
		equip($item[filthy knitted dread sack]);
1072
		equip($item[filthy corduroys]);
1073
		while ($item[cherry].available_amount() == 0) {
1074
			if ($item[disassembled clover].available_amount() > 0) {
1075
				use(1, $item[disassembled clover]);
1076
				adventure(1, $location[The Hippy Camp], "combat");
1077
				use(1, $item[fruit basket]);
1078
			} else {
1079
				abort("Failed to get cherry from fruit baskets before running out of clovers.");
1080
			}
1081
		}
1082
		equip(prevhat);
1083
		if (prevpants != $item[none]) {
1084
			equip(prevpants);
1085
		}
1086
	}
1087
	saveProgress(15);
1088
}
1089
1090
void getHotResistGear() {
1091
	if(statemap["questStage"] >= 20) {
1092
		return;
1093
	}
1094
	if ($item[Saucepanic].available_amount() > 0) {
1095
		equip($slot[weapon], $item[Saucepanic]);
1096
	}
1097
	if ($item[Staff of the Headmaster's Victuals].available_amount() > 0) {
1098
		pulverize($item[Staff of the Headmaster's Victuals]);
1099
	}
1100
	if (get_property_boolean("hotAirportAlways")) {
1101
		if (!have_familiar($familiar[Crimbo Shrub]) && $item[handful of Smithereens].available_amount() > 0 && $item[Golden Light].available_amount() < 1) {
1102
			create(1, $item[Golden Light]);
1103
		} 
1104
		while($item[lava-proof pants].available_amount() == 0) {
1105
			YRAdv($location[LavaCo&trade; Lamp Factory]);
1106
		}
1107
	}
1108
	saveProgress(20);
1109
}
1110
1111
void makePotionsDay1() {
1112
	if(statemap["questStage"] >= 16) {
1113
		return;
1114
	}
1115
	create(1, $item[oil of expertise]);
1116
	int crafts = 2;
1117
	if ($item[grapefruit].available_amount() > 0) {
1118
		create(1, $item[ointment of the occult]);
1119
		crafts += 1; //++ doesn't work? aw c'mon
1120
	}
1121
	if ($item[lemon].available_amount() > 0 && $item[scrumptious reagent].available_amount() > 0) { //you've run out of reagants by now without way of sauce
1122
		create(1, $item[philter of phorce]);
1123
		crafts += 1;
1124
	}
1125
	if ($item[tomato].available_amount() > 0 && $item[scrumptious reagent].available_amount() > 0) { //not available in skeleton store
1126
		create(1, $item[tomato juice of powerful power]);
1127
		crafts += 1;
1128
	}
1129
	if ($item[olive].available_amount() > 0 && $item[scrumptious reagent].available_amount() > 0 && crafts < 5) { //also not in skeleton store; if you had everything so far you've also run out of free crafts
1130
		create(1, $item[serum of sarcasm]);
1131
	}
1132
	saveProgress(16);
1133
}
1134
1135
void makePotionsDay2() {
1136
	if(statemap["questStage"] >= 21) {
1137
		return;
1138
	}
1139
	if ($item[olive].available_amount() > 0 && $item[serum of sarcasm].available_amount() == 0) { 
1140
		create(1, $item[serum of sarcasm]);
1141
	}
1142
	if ($item[lemon].available_amount() > 0 && $item[philter of phorce].available_amount() < 2) { 
1143
		create(1, $item[philter of phorce]);
1144
	}
1145
	if ($item[tomato].available_amount() > 0 && $item[tomato juice of powerful power].available_amount() < 4) {
1146
		create(1, $item[tomato juice of powerful power]);
1147
	}
1148
	saveProgress(21);
1149
}
1150
1151
void endDay1() { //final actions of day 1; spell test buffing goes here
1152
	if(statemap["questStage"] >= 17) {
1153
		return;
1154
	}
1155
	cast($skill[Simmer]);
1156
	chateauCast($skill[The Ode to Booze]);
1157
	chateauCast($skill[The Ode to Booze]);
1158
	chateauCast($skill[Jackasses' Symphony of Destruction]);
1159
	chateauCast($skill[Song of Sauce]);
1160
	while (free_rest()) {} //expends all free rests
1161
	drink(1, $item[emergency margarita]);
1162
	maximize("adv", false);
1163
	saveProgress(17);
1164
}
1165
1166
void day1setup() {
1167
	if(statemap["questStage"] >= 1) {
1168
		return;
1169
	}
1170
	setFamiliar();
1171
	visit_url("tutorial.php?action=toot"); //get letter
1172
	if ($item[Letter from King Ralph XI].available_amount() > 0) {
1173
		use(1, $item[Letter from King Ralph XI]); //get sack of jewels
1174
		use(1, $item[pork elf goodies sack]); //get jewels
1175
	} else if ($item[pork elf goodies sack].available_amount() > 0) {
1176
		use(1, $item[pork elf goodies sack]); //get jewels
1177
	}
1178
	sellJewels();
1179
	if ($item[astral six-pack].available_amount() == 1) {
1180
		use(1, $item[astral six-pack]);
1181
	}
1182
	unlockSkeletonStore();
1183
	cli_execute("cheat mickey");
1184
	autosell(1, $item[1952 Mickey Mantle card]);
1185
	cli_execute("cheat giant growth");
1186
	cli_execute("cheat empress");
1187
	summonDailyStuff();
1188
	create(1, $item[Hairpiece on Fire]);
1189
	equip($item[Hairpiece on Fire]);
1190
	create(1, $item[Saucepanic]);
1191
	equip($item[Saucepanic]);
1192
	create(1, $item[A Light That Never Goes Out]);
1193
	equip($item[A Light That Never Goes Out]);
1194
	use(3, $item[Flaskfull of Hollow]);
1195
	if (!have_familiar($familiar[Crimbo Shrub])) {
1196
		create(2, $item[Golden Light]);
1197
	} else {
1198
		create(1, $item[Golden Light]);  ////Change to 0 once I implement dairy goat crimbo shrub YR
1199
	}
1200
	create(1, $item[This Charming Flan]);
1201
	buy(1, $item[frilly skirt]);
1202
	if (equipped_item($slot[pants]) == $item[none]) {
1203
		if (my_basestat($stat[moxie]) > 1) {
1204
			equip($item[frilly skirt]);
1205
		} else {
1206
			equip($item[old sweatpants]);
1207
		}
1208
	}
1209
	cli_execute("breakfast"); 
1210
	if (have_skill($skill[Empathy of the Newt]) || have_skill($skill[Astral Shell])) {
1211
		getTurtleTotem();
1212
	}
1213
	if ($item[detuned radio].available_amount() == 0) {
1214
		buy(1, $item[detuned radio]);
1215
		change_mcd(11);
1216
	}
1217
	if($item[GameInformPowerDailyPro magazine].available_amount() > 0) {
1218
		use(1, $item[GameInformPowerDailyPro magazine]);
1219
		visit_url("place.php?whichplace=faqdungeon");
1220
		visit_url("adventure.php?snarfblat=319");
1221
		if ($item[dungeoneering kit].available_amount() > 0) {
1222
			use(1, $item[dungeoneering kit]);
1223
		} else {
1224
			print("Failed to get dungeoneering kit for some reason", "red");
1225
		}
1226
		
1227
	}
1228
	saveProgress(1);
1229
}
1230
1231
void day2setup() {
1232
	if(statemap["questStage"] >= 18) {
1233
		return;
1234
	}
1235
	summonDailyStuff();
1236
	cli_execute("breakfast"); 
1237
	cli_execute("cheat forest");
1238
	cli_execute("cheat giant growth");
1239
	use(1, $item[Flaskfull of Hollow]);
1240
	create(3, $item[Louder Than Bomb]);
1241
	create(1, $item[Saucepanic]);
1242
	if (!have_skill($skill[Double-Fisted Skull Smashing])) {
1243
		pulverize($item[Saucepanic]);
1244
	}
1245
	create(1, $item[Vicar's Tutu]);
1246
	equip($item[Vicar's Tutu]);
1247
	create(1, $item[Staff of the Headmaster's Victuals]);
1248
	if (!have_skill($skill[Spirit of Rigatoni])) {
1249
		pulverize($item[Staff of the Headmaster's Victuals]);
1250
	}
1251
	saveProgress(18);
1252
}
1253
1254
void initialDrinks() { //drinking after day 1 setup but before coiling wire
1255
	if(statemap["questStage"] >= 2) {
1256
		return;
1257
	}
1258
	chateauCast($skill[The Ode to Booze]);
1259
	if (checkGarden() == "winter") {
1260
		create(1, $item[Ice Island Long Tea]);
1261
		drink(1, $item[Ice Island Long Tea]);
1262
		create(1, $item[snow crab]);
1263
	} else if (checkGarden() == "beer") {
1264
		create(3, $item[Can of Drooling Monk]);
1265
		drink(3, $item[Can of Drooling Monk]);
1266
		create(1, $item[tin cup]);
1267
	}
1268
	visit_url("clan_viplounge.php?preaction=speakeasydrink&drink=4&pwd="+my_hash()); //lucky lindy
1269
	saveProgress(2);
1270
}
1271
1272
void doRun() { //main function
1273
	if (my_daycount() == 1 && actuallyrun) {
1274
		print("Running HCCS Day 1...");
1275
		if(get_property("knownAscensions").to_int() != statemap["run"]) {
1276
			newSave();
1277
		}
1278
		day1setup();
1279
		initialDrinks();
1280
		getMilk(); //of magnesium
1281
		coilTest();
1282
		getPirateDNA();
1283
		getCalderaDNA(); //elemental DNA tonic and fish hybrid
1284
		maybeUnlockIsland();
1285
		getG9Serum();
1286
		weaponTest();
1287
		itemTest();
1288
		getPotionIngredients();
1289
		makePotionsDay1();
1290
		endDay1();
1291
		print("Day 1 complete!!", "green");
1292
	} else if (my_daycount() == 2 && actuallyrun) {
1293
		print("Running HCCS Day 2...");
1294
		day2setup();
1295
		spellTest();
1296
		getHotResistGear();
1297
		makePotionsDay2();
1298
		hotTest();
1299
		powerlevel();
1300
		hpTest();
1301
		muscleTest();
1302
		mystTest();
1303
		moxieTest();
1304
		famTest();
1305
		getDeodorant();
1306
		noncombatTest();
1307
		print("Run complete!!!", "green");
1308
		newSave();
1309
	} else if (!actuallyrun) {
1310
		print("The \"actuallyrun\" variable is set to false. Turn it on.", "red");
1311
	} else {
1312
		print("You're too slow!");
1313
	}
1314
}
1315
1316
checkPrereq();
1317
loadSave();
1318
doRun();