macguffin.ash (a script in progress)

izchak

Member
Yup, thats right, a complete (mostly) macguffin script. Mostly, in that it doesnt fight Ed, and it doesnt handle the new pirate content. It doesn't fight Ed because he's still one of my favourite new NS13 monsters :p

First off, this script was primarily written to work for me, and I'm doing casual runs. As such, a lot of this script is biased towards that. It appears to work for softcore folk, and I've heard from people using it in hardcore successfully. I haven't actually checked if anyone in bad moon has used this script, but its been pretty thoroughly used by quite a few people now, and it seems to work well enough. I've fixed all the major problems I know about, anyway.

Also, portions of this script could be useful for others writing their own macguffin related scripts. In particular, if I could have borrowed someone else's code to pour the correct wines into the goblet, I would have! Getting it right was a pain in the ass.

Also, a nameless someone PM'd me asking for an updated hidden city script, and as you can't PM a script, I can just attach it here!
The hidden city script can be used independently of the main macguffin script, btw.

This script will almost definitely be updated, as I think of and find improvements that are necessary.

Finally, this script uses my outfit_change script, which has its own thread detailing how to use it.

EDIT (09 Nov 2007) both the hidden city and the macguffin scripts have been updated. It is now considerably easier to control combat options in the hidden city. Note that I haven't tested these combat options, as I use a custom combat script instead.

EDIT (17 Nov 2007) : fixed a combat bug against the Protector Spectre.

EDIT (22 Nov 2007) : added some code to autofetch missing wines for the spookyraven cellar.

EDIT (5 Dec 2007) : Pirate revamp broke snakehead charrrm fetching. Script will now refuse to get the snakehead charrrms, instead of hunting for them at the old pirate cove location. Expect a proper fix 'real soon' :p

EDIT (25 Jan 2008) : Checked in a fix for outfit_change.ash, so it can now properly deal with moving an 'equip one only' accessory to a different slot

EDIT (6 Jan 2008) : Checked in a minor fix for the hidden city, I think hola changed the internal name for one of the stone spheres, from 'plants' to 'nature'. EG: Mossy stone sphere of nature. The script should properly insert spheres now.
 

Attachments

  • custom_outfits.txt
    6.7 KB · Views: 925
  • macguffin.ash
    26.9 KB · Views: 1,014
  • outfit_change.ash
    9.4 KB · Views: 734

SeiferTim

New member
I'm waiting until I get the Level 30 trophy as a Seal Clubber before I ascend again.
(I'm almost there... 4 more levels lol)
I'm looking forward to giving this a try when I get back up to that quest again.
 

kain

Member
wow ... and I thought my scripts were complicated (well, not that complicated) ... I'm really going to enjoy reading through and learning some new things!

thanks for sharing
 
I'm having a problem.

I ran out of adventures on the first day, after I finished the beach portion.
Today, I reran the script to find out it wasted 30 adventures looking for a drum machine I already got and used!
What's up with that?

Anyway, my problem is that it's redoing parts of the quest it's already done.
Is there a way to get it to check if it's done a portion of the quest?

Thanks,
Duffkiligan (A newbie to KoLMafia, but not to kingdom)
 

izchak

Member
Huh.

First off, yes, the script does attempt to figure out where you were, in order to avoid doing something that has already been done. It does this through the quest log, by scanning for certains lines of text which then tell us what still needs doing. That, and a few inventory checks. The questlog checking gets a little complex around the beach, because the beach subquest is part of the 'A Pyramid Scheme' subquest, which ALSO includes the pyramid, naturally.
Can you tell me where exactly you finished on the first day, with regards to the macguffin quest? Had you completed the entire beach quest, right up until equipping the worm-riding hooks and using the drum machine?

If anything like this comes up again (the script doing something quest related that has already been done), I'd like to request a copy of your questlog (the first page) along with general information about the problem, that way I can figure out what caused the problem, and make a fix. Trying to figure out what exactly caused this is a little tricky without that information, as I already have some code in the script to prevent exactly the behaviour you encountered.
 
"For your worm-riding training, you need to find a 'thumper', something that produces a rhythmic vibration to summon sandworms.
It's unlikely that we're talking about bunny rabbits here. "

Is the thing in my quest log.
So it already got the "Thumper"
But the condition it set was for the drum machine. D:
It isn't adventuring in the desert to turn this part in.
I have 4 drum machines.


I'll do it manually this run, I hope there's a fix.
=]

----------------------------------
Oh yes, and is there a way to get the script to use bottles of alcohol, non-physical combat items, or skills against the spirits?
I got beaten-up a couple times before I realized what happened.

Thanks. =]
~Duff
----------------------------------
Another problem!
I'm at the middle chamber, and it keeps wanting tomb ratchets.
Can't I make it so it uses the wheel?
Softcore + 10 ratchet pulls = Too many. D:
I use the wheel.
Thanks again.
 

izchak

Member
Ah. I've fixed this error. Basically, in the code to fetch a drum machine, it wasn't checking to see if you already HAVE a drum machine. A silly error on my part. I have uploaded a fixed version.

Whoops!
 
Thank you very much!
Now just to get the script to make it not-auto attack on the spirits.

Or, maybe make mafia go to the "You're on your own" when fighting them.


Also, the altars is broken.
It put one in the right place, then broke and said "Something went wrong"
It did everything else except place them.
 

izchak

Member
(The hidden city script has been updated, btw.)

As for doing the protector spirits, I suppose I should have explained how that works. I'll use this post to do so.
Basically, you can either use the hidden city script to control your combats in the hidden city, or you can ask mafia to do it using whatever mafias current battle strategy is (including custom combat scripts).
This is the line which decides who controls the battles, the script or mafia:
Code:
boolean use_ccs = false;
That line is right at the top of the hidden city script, along with a few other variables you can modify.
Set it to true to ask mafia to handle your combats, set it to false to let the script handle your combats.
Please note, if you ask mafia to handle your combats, you NEED to get mafia to identify the spheres for you. I basically built this option in because I have outsourced these combats to my own custom combat script.

If you want to use skills to defeat the spirits, I've updated the script to make it considerably easier to use combat skills against the spirits. At the top of the script, you should find these lines:
Code:
# if you want to use your mad skillz to defeat spirits, set this to true
boolean useSkill = false;
# select your weapon!
skill useThisSkill = $skill[stream of sauce];

If you set useSkill to true, it will attempt to use the skill listed below it to defeat the protector spirits. It will use that skill instead of combat items, btw.
As for the rest of the monsters in the hidden city, it will try to shieldbutt them if you have a pilgrim shield, otherwise it will try to attack them. If you want some other combat strategy there, just ask.

If you want to get a bit more flexible with your items and combat, feel free to hack in your own combat options to the script. Pm me if you need help adding an item there. I might add in an easily editable list of combat items. Would anyone find that useful?

Duff: I have now added bottles of alcohol to the list of used combat items. I hope that helps!

As for the ratchets, the current default is set to use ratchets, pulling or buying them as necessary. This is toggle-able. I have updated the macguffin script to move that toggle to the top of the script, in order to make it easier to find and change. Look for this line:
Code:
boolean RATCHET = true;

Set it to false, and it will turn the wheel instead of using ratchets.
Duff: You say it failed to insert the triangles into the altars?
Did you use the script to defeat the protector spirits, or did you do it manually?
I'm guessing you did it manually. The script uses the protector spirit combats to identify the various spheres, as there are 4 spheres, and 5 spirits. Its a way of guaranteeing that at least three spheres get identified, which is necessary. If you went and defeated the spirits manually, you will still have several unidentified spheres. You need to identify them (at least three of the four) before the script can put the correct sphere into the correct altars.
 
Thank you so much for this script!
It's perfect now!
(Or as far as I can see, I had no other problems with it)

This will literally save hours of my life.


And as for the spirits; Yeah, I did 3/5 manually.
2/5 got beaten up by my pumpkin bucket xD

So it got two spheres and found what one was.
I get it now.
Thank you so much!

(I will use this script until it is out-dated)
Keep 'em coming!
I'd like to see a FULL War script.
Customizable side.
It does the side quests the right way (Guy made of bees, +items, +meat, Fence/Lanturn/Drum for the ducks, ect.)
That would save even more of my life!
 

izchak

Member
Thanks, Duff. I appreciate you finding bugs that I wouldn't have. I've used this script dozens of times already, so any remaining bugs are things I won't find on my character.

As for an islandwar script, I actually already have a script like that!
Except it only handles the war as a frat warrior, and I've only tested it doing the 'optimal' route of arena, gremlins, beach, orchard and farm. I've written it such that it can, one day, do the entire islandwar, whether you choose to do it as a hippy, or a frat, and with whatever quests you desire!

Currently, thats on the backburner though, while I build up my impressive collection of Iron Beta's of Industry :p

That, and I have another script I'm working on...
 

kain

Member
off I go to see how the updated hidden_city.ash script looks now ... I messed mine all kinds of up (in a good way)
 

izchak

Member
Most of the change happened in the handle_combat() function, kain. If you have made significant mods to your copy, knowing that might help in merging the two versions back together.

P.S. if you've made some kind of cool improvement/mod for you, tell me about it please! Even if you think not many other people would use it how you use it, it still gives me insight into different ways of doing ... stuff.
Modifications, improvements and suggestions are always welcome, even encouraged!
 

kain

Member
I finally got around to looking at the differences (stupid work getting in the way of my KoL time). The only major differences were that I had statically modified the combat routines (I don't usually open the citadel, I hard-coded cans of hair spray as a last resort and wave of sauce)

I also added a finish_city(); to main() so I could just run hidden_city.ash

superb superb script, many many kudos

(edit -- I don't speel guud) (and also to add...)

I did run into some difficulties killing the boss. It kept trying to funksling the mossy sphere and nothing. So I tweaked the boss battle to let my CCS take care of it.

I would be interested in seeing your ccs ;)
 

izchak

Member
Whoops. I did introduce a small bug into the last fix for hidden_city.ash which would result in the script continually trying to throw a sphere that it no longer has at the Protector Spectre.
This is because the script identifies 3 spheres beforehand (by using them in combat against the protector spirits), guesses what the fourth one is, inserts them into the altars (using them up). It then comes to the protector spectre combat, which is handled by the same function that handles ancient protector spirits. The script thinks it still has an unidentified sphere, and tries to identify it by using it in combat. Of course, it no longer has that sphere, so KoL would return a null round, and the script would do the same thing next round...

Fixed, and first post updated!
 

Orinks

New member
Hi,

Is it possible for you to make the Mcguffan.ash script perform the wine seller function automatticly? I can't seem to get it right; the links in my browser aren't labled for a screen reader to reckognise them.

Thanks.
 

izchak

Member
I presume he's asking about the wine cellar. Currently, the script will automatically figure out which wines are needed, and place them, BUT: it will not farm the cellar to find the wines. This is a reflection of how the script is intended for casualcore ascensions, where you just have the wines, or you can mallbuy them.

Are you requesting an automatic 'farm the cellar until you have the right wines' feature?

I haven't done it yet because its a little hairy, code-wise, switching between the different corners, and figuring out which corner drops which wine...
That, and its a feature that I personally have no use for. If someone has some cunning wine farming code to share, I'd love to see it! :p
 

hippymon

Member
Well, personally to farm the wine cellar I would do a simple:
Code:
cliE("conditions clear");
if(!got_item(firstwine){
  add_item_condition(1, firstwine);
  adventure(more_combats(), $location[haunted wine cellar]);
}
if(!got_item(secondwine){
  add_item_condition(1, secondwine);
  adventure(more_combats(), $location[haunted wine cellar]);
}
if(!got_item(thirdwine){
  add_item_condition(1, thirdwine);
  adventure(more_combats(), $location[haunted wine cellar]);
}
Sense mafia automatically does each corner (or at least it did last time I used it... Along time ago).
Or to simply obtain the items:
Code:
if(can_interact()){
  retrieve_item(1, firstwine);
  retrieve_item(1, secondwine);
  retrieve_item(1, thirdwine);
}
 

izchak

Member
Huh. Thanks, hippymon.
I've added this little function to the script, in order to autofetch missing wines. I have yet to test it myself, but it *should* work.

Code:
void get_wines(item firstwine, item secondwine, item thirdwine) {
	if(can_interact()){
		retrieve_item(1, firstwine);
		retrieve_item(1, secondwine);
		retrieve_item(1, thirdwine);
	}
	if(!got_item(firstwine){
		cliE("conditions clear");
		add_item_condition(1, firstwine);
		pump_ML();
		adventure(my_adventures(), $location[haunted wine cellar]);
	}
	if(!got_item(secondwine){
		cliE("conditions clear");
		add_item_condition(1, secondwine);
		pump_ML();
		adventure(my_adventures(), $location[haunted wine cellar]);
	}
	if(!got_item(thirdwine){
		cliE("conditions clear");
		add_item_condition(1, thirdwine);
		pump_ML();
		adventure(my_adventures(), $location[haunted wine cellar]);
	}
	if(!got_item(firstwine) || !got_item(secondwine) || !got_item(thirdwine))
	abort("failed to find enough wine!");
}
 
Top