Rinn's Quest Scripts

i was hoping someone could tell me what to write to get the Future script to remember to use an empty bottle every 10 turns, also where should i put it in the script?
 

slyz

Developer
I think Mafia does it automatically for you... did you try it out?
Remember to use SmartStasis.ash to deal with the combats (it automatically uses the rod for you).
 

Bale

Minion
You don't ever need to use an empty bottle. Just adventure in the location of your choice and KoL will simply use up bottles as you go without ever requiring you to click on a bottle. (You'll mostly notice this by the fact that if you're adventuring normally, the last adventure link will work even if you just used up a bottle.)
 

zarqon

Well-known member
When adventuring in agua de vida zones, you need to put goal-hunting calls to adventure() in while loops, because although mafia looks into another empty bottle if needed when you start adventuring, it will stop adventuring when a bottle runs out. If it helps, here's the Future section of my vidadeagua.ash:

This assumes SmartStasis for getting the elemental discs.

PHP:
import <canadv.ash>
string questlog = visit_url("questlog.php?which=2");

boolean go_future() {
   if (contains_text(questlog,"<b>Future</b>")) return vprint("You have already completed the Future quest.",2);
   if (!can_adv($location[megalopolis],true)) return false;
   set_property("choiceAdventure365","2");              // buy a multi-pass
   set_property("choiceAdventure364","2");              // Supreme Being glossary
   while (my_adventures() > 0 && have_item($item[ruby rod]) == 0)
      obtain(1,"ruby rod",$location[megalopolis]);
   equip($item[ruby rod]);
   while (my_adventures() > 0 && item_amount($item[essence of heat]) + item_amount($item[essence of kink]) +
          item_amount($item[essence of cold]) + item_amount($item[essence of stench])+item_amount($item[essence of fright]) < 5) {
      obtain(1,"essence of heat",$location[megalopolis]);
      obtain(1,"essence of kink",$location[megalopolis]);
      obtain(1,"essence of cold",$location[megalopolis]);
      obtain(1,"essence of stench",$location[megalopolis]);
      obtain(1,"essence of fright",$location[megalopolis]);
   }
   outfit(vars["defaultoutfit"]);
   while (my_adventures() > 0 && item_amount($item[essence of cute]) == 0)
      obtain(1,"essence of cute",$location[megalopolis]);
   while (my_adventures() > 0 && item_amount($item[ruby rod]) > 0)
      obtain(1,"choiceadv",$location[megalopolis]);
   return (item_amount($item[ruby rod]) == 0);
}
 

Bale

Minion
Thank you. That was interesting. I had no idea mafia autostopped on the expenditure of a bottle.
 
ok, but i'm still a bit stuck, am i supposed to use your script instead of Rinn's then?

i was kinda hoping to use the one i had, and just add like one line to gaze into another bottle

p.s. yeah i've been using the most up to date daily versions of zlib, FirthThingsFirst, SmartStasis etc. and the most recent daily build

p.p.s Kudos on the fabulous scripts since i've never said thanks to either you or Bale for his Recovery one. I use them everyday and think they're awesome :D
 
Last edited:

Bale

Minion
You're very welcome. :D

ok, but i'm still a bit stuck, am i supposed to use your script instead of Rinn's then?

Well you could use zarqon's script, but if you want to know what the problem was... According to zarqon the problem with Rinn's script is pretty straightforward. Just put the adventure() into a useful while loop that checks my_adventures() and if you've gotten the goal since it will autostop when you use up a bottle. The while loop will start it up again. You don't actually need to use a bottle. Like this:

PHP:
import <QuestLib.ash>;

void FutureQuest()
{
	if (!contains_text(visit_url("questlog.php?which=2"),"Hyboria? I don't even..."))
	{
		print("You must complete Hyboria? I don't even...before starting Future");
		return;
	}

	if (!contains_text(visit_url("questlog.php?which=2"),"Future"))
	{
		cli_execute("checkpoint");
		if (available_amount($item[ruby rod]) == 0)
		{
			equip($slot[acc1], $item[ring of conflict]);
			cli_execute("conditions clear");
			add_item_condition(1, $item[ruby rod]);
			while(my_adventures() > 0 && item_amount($item[ruby rod]) < 1)
				adventure(request_noncombat(my_adventures()), $location[Seaside Megalopolis]);

			if (available_amount($item[ruby rod]) == 0)
			{
				abort("Didn't acquire the ruby rod.");
			}
		}

		int heat = available_amount($item[essence of heat]);
        int kink = available_amount($item[essence of kink]);
        int cold = available_amount($item[essence of cold]);
        int stench = available_amount($item[essence of stench]);
        int fright = available_amount($item[essence of fright]);

		if (heat + kink + cold + stench + fright < 5)
		{
			cli_execute("conditions clear");

			if (heat == 0)
			{
				add_item_condition(1, $item[essence of heat]);				
			}
			if (kink == 0)
			{
				add_item_condition(1, $item[essence of kink]);				
			}
			if (cold == 0)
			{
				add_item_condition(1, $item[essence of cold]);				
			}
			if (stench == 0)
			{
				add_item_condition(1, $item[essence of stench]);				
			}
			if (fright == 0)
			{
				add_item_condition(1, $item[essence of fright]);				
			}
			equip($slot[weapon], $item[ruby rod]);
			equip($slot[acc1], $item[monster bait]);
			while(my_adventures() > 0 && (item_amount($item[essence of heat]) < 1 || item_amount($item[essence of kink]) < 1 ||
			  item_amount($item[essence of cold]) < 1 || item_amount($item[essence of stench]) < 1 || 
			  item_amount($item[essence of fright]) < 1))
				adventure(request_combat(my_adventures()), $location[Seaside Megalopolis]);	

			heat = available_amount($item[essence of heat]);
			kink = available_amount($item[essence of kink]);
			cold = available_amount($item[essence of cold]);
			stench = available_amount($item[essence of stench]);
			fright = available_amount($item[essence of fright]);
			if (heat + kink + cold + stench + fright < 5)
			{
				abort("Didn't get all the essences.");
			}
		}

		if (available_amount($item[essence of cute]) == 0)
		{
			equip($slot[acc1], $item[ring of conflict]);
			cli_execute("conditions clear");
			add_item_condition(1, $item[essence of cute]);
			while(my_adventures() > 0 && (item_amount($item[essence of cute]) < 1))
				adventure(request_noncombat(my_adventures()), $location[Seaside Megalopolis]);
			if (available_amount($item[essence of cute]) == 0)
			{
				abort("Didn't get the essence of cute.");
			}
		}

		equip($slot[acc1], $item[ring of conflict]);
		cli_execute("conditions clear");

		while (!contains_text(visit_url("questlog.php?which=2"),"Future"))
		{
			adventure(request_noncombat(1), $location[Seaside Megalopolis]);
		}

		outfit("checkpoint");
	}
	else
	{
		print("already done?");
	}
}

void main()
{
	FutureQuest();
}
 

zacius

New member
Fantastic script.

Seems a touch doptimal in the wine bottle logic; leaving the glasses on during combat gets things done with less switching but does remove an accessory space.

These scripts are keepers, thank you.
 

heeheehee

Developer
Staff member
Hmm. I thought that the only reason anyone would equip the glasses past ascension #1 would be to get the Spookyraven skill (it's not required after that).
 

Theraze

Active member
I've made a few changes to my copies of this script, specifically the changes listed above for Doc Galaktik.ash and Future.ash, but I also made some other changes to Levels 3, 4, 5, 7, 8, and 13. Specifically, Levels 3-7 check if the person has either no ascensions or is in bad moon before asking about MCD, since in BM it costs adventures to change ML and no-ascension new players don't have any MCD. As well, Level 8 sets chrome/asbestos/linoleum ore to 3 and uses That FN Ninja's miner.ash to get the ores. Haven't made it collect the cold outfit yet, but I'll probably try to do that this next ascension. Level 13 uses a slightly different check for the hedge maze that hasn't been quite as problematic for me as the default one. Basically, I removed the visit to lair3.php checking for hedgemaze.gif because it was going there even after done.

Does anyone want any/all of these modified files uploaded, or just the code changes?
 

Theraze

Active member
Okay, so here is the basic gist of the way that the ascension/BM checkers work (truncated so it doesn't go on forever, just make sure if you're doing it manually to add the proper } near the end):
Code:
            if (contains_text(visit_url("questlog.php?which=1"),"You've discovered the Boss Bat's chamber"))
			{
                                if (my_ascensions() > 0 && !in_bad_moon())
                                {
                                        request_monsterlevel(0);

                                        if (user_confirm("Try for the Boss Bat britches?"))

For Level 8 (and this will change as I update it with the cold outfit), the main difference is adding the
Code:
import <miner.ash>
at the top after the Questlib, and in the ore setting, modifying to the following:
Code:
				if (contains_text(visit_url("trapper.php"), "chrome ore"))
				{
					ore = $item[chrome ore];
                                        chrome = 3 - item_amount($item[chrome ore]);
				}
				else if (contains_text(visit_url("trapper.php"), "asbestos ore"))
				{
					ore = $item[asbestos ore];
                                        asbestos = 3 - item_amount($item[asbestos ore]);
				}
				else if (contains_text(visit_url("trapper.php"), "linoleum ore"))
				{
					ore = $item[linoleum ore];
                                        linoleum = 3 - item_amount($item[linoleum ore]);
				}
and then, when it hits the end during the "go mine yourself!" check, replace with this:
Code:
				if ((available_amount(ore) < 3) && (have_outfit("mining gear")))
				{
					cli_execute("checkpoint");
					outfit("mining gear");
                                        mine_stuff();
					cli_execute("outfit checkpoint");
				}

For Level 13, it was just turning
Code:
			if (visit_url("lair3.php").contains_text("hedgemaze.gif"))
			{
into
Code:
                        while (my_adventures() > 0 && !hedgemaze())
                        {
                                adventure(request_monsterlevel(1), $location[Sorceress' Hedge Maze]);
                        }
which still does fail sometimes... but much less often, and if it happens, it actually errors out instead of going into an infinite loop, an action I definitely prefer.

Files should follow, named quest-additions.zip, if I've figured this out. :)
 

Attachments

  • quest-additions.zip
    7.5 KB · Views: 52

sarikuya

New member
So how exactly do I get these to stop wanting the Baby Sandworm familiar? I can't use any of them and never have seen these types of files before.
 

Theraze

Active member
Easiest way to avoid that is to edit QuestLib.ash and set change_familiar to false up at the top...
 

Theraze

Active member
Okay... as I was poking around in the files, I considered a better way to make the Level 13 hedge check actually work consistently... basically, work the same way KoLmafia does internally, by looking at which picture/links it's loading up on the lair page. So, change:
Code:
if (visit_url("lair3.php").contains_text("hedgemaze.gif"))
{
while (my_adventures() > 0 && !hedgemaze())
{
adventure(request_monsterlevel(1), $location[Sorceress' Hedge Maze]);
}
}
into this:
Code:
if (!visit_url("lair.php").contains_text("#Map2") && !visit_url("lair.php").contains_text("#Map3") && !visit_url("lair.php").contains_text("#Map4"))
{
while (my_adventures() > 0 && !hedgemaze())
{
adventure(request_monsterlevel(1), $location[Sorceress' Hedge Maze]);
}
}

Basically, what it's doing is it looks at the main lair.php page, and verifies that it's still on #NoMap or #Map. Problem is, I can't match based on #Map, because that'll match up on #Map2-4 as well, so I'm eliminating those instead... worked great so far, skipped the infinite hedge loop today even though the cat is batting away items left and right...
 

Bale

Minion
My own hedge script just does:

PHP:
if(!contains_text(visit_url("lair3.php"), "lair4.php"))

Seems simpler. Though if you prefer your method, it would be better to save visit_url("lair.php") as a string before comparing since it is so wasteful to hit the server three separate times, or instead of comparing it three times just use:

PHP:
if (visit_url("lair.php").contains_text("#Map\""))

The back-slash escapes the quote so that you can match the character following #Map and thereby exclude #Map2, etc.
 
Last edited:
Top