PDA

View Full Version : Newish Castle farming script



Xenthes
06-21-2010, 04:13 AM
I made this script a couple of weeks ago and since someone was asking about how to write one in this (http://kolmafia.us/showthread.php?4433-REQUEST-someone-to-tell-me-how-exactly-you-start-a-script.-documentation-unhelpful&p=31436#top) thread I thought I would post what I did.

This script does need zlib.ash (http://kolmafia.us/showthread.php?2072-ZLib-Zarqon-s-useful-function-library) and the updated version of EatDrink.ash (http://kolmafia.us/showthread.php?4202-The-Unofficial-Ascend.ash-support-thread.&p=30725&viewfull=1#post30725)
dobhh.ash (http://kolmafia.us/showthread.php?823-BHH-script-etc&p=4475&viewfull=1#post4475) needed for the bounty hunter section.


What is does:
* Eats and spleens up to your max fullness and your spleen
* Finds best outfit and familiar for item drop
* Does the the bounty hunter for the day using dobhh.ash
* Finds the best outfit and familiar for meat farming
* Farms the castle for however many adventures you have remaning
* Uses the warm subject gift certificates and autosells the rest
* Finds and equips the best rollover items in your inventory
* Drinks up to your max drunkness then overdrinks.
* Prints out how much you got from autoselling the items and how much you got from using the WSGCs in your inventory in the gCLI

Any suggestions for improvements are welcomed.

icon315
06-21-2010, 09:48 PM
I would make


eatdrink(15, 0, 15, false);
eatdrink(0, 19, 0, true);

Into


eatdrink(fullness_limit(), 0, spleen_limit(), false);
eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);


AND

cli_execute("maximize meat");


cli_execute("maximize meat -equip sns crossbow");
Just in case


Also add this

string bhh_page = visit_url("bhh.php");
boolean hunt_today() {
switch {
case bhh_page.contains_text("I can't assign you a new one"):
print("Bounty hunt already completed today.", "red");
return false;
case bhh_page.contains_text("I'm still waiting for you to bring me"):
print("You're already on a bounty hunt!", "green");
return false;
case bhh_page.contains_text("5 discarded pacifiers"):
print("Hunting for 5 discarded pacifiers!", "green");
visit_url("bhh.php?pwd&action=takebounty&whichitem=2415");
return true; }
print("Not asking for a good bounty today.", "red");
return false;
}
}

Also i added a script i made

oly0015
06-21-2010, 11:12 PM
Thanks icon, the bounty part will come in useful for the one i'm doing

Xenthes
06-22-2010, 02:40 AM
Is there a way to skip the BHH part if I add that in if I already have the outfit, sniffy tome, and hounddog? Two of the characters I might be using this with already has all of that.

icon315
06-22-2010, 02:43 AM
you could do something like


if (my_name() == "MyMain")

or


if ( ! have_outfit( "Bounty-Hunting Rig" ) && ! have_familiar ($familiar[Jumpsuited Hound Dog]) && ! have_skill($skill[Transcendent Olfaction]) )

Bale
06-22-2010, 02:51 AM
Is there a way to skip the BHH part if I add that in if I already have the outfit, sniffy tome, and hounddog? Two of the characters I might be using this with already has all of that.


if(available_amount($item[bounty-hunting helmet]) > 0)
&& available_amount($item[bounty-hunting pants]) > 0)
&& available_amount($item[bounty-hunting rifle]) > 0)
&& have_familiar($familiar[jumpsuited hound dog])
&& have_skill($skill[Transcendent Olfaction]))

heeheehee
06-22-2010, 03:14 AM
if(available_amount($item[filthy lucre]) < 15*(available_amount($item[bounty-hunting helmet])==0).to_int()
+ 15*(available_amount($item[bounty-hunting pants])==0).to_int() + 15*(available_amount($item[bounty-hunting rifle])==0).to_int()
+ 100*(available_amount($item[pompadour'd puppy])==0 || have_familiar($familiar[jumpsuited hound dog])).to_int()
+ 200*(available_amount($item[tome of transcendent olfaction])==0 || have_skill($skill[transcendent Olfaction])).to_int())

Overkill much?

Bale
06-22-2010, 03:40 AM
Overkill much?

Oooooh! It's so pretty! I love a pretty little overkill!

heeheehee
06-22-2010, 03:42 AM
Erm, yeah. Noticed that there were two item_amount()'s that should've been available_amount()'s. Fixed!

kain
06-22-2010, 03:45 AM
but you mean you don't want to collect lucres, just in case something new comes into the BHH? *dances on his pile of 125 'extra' lucre*

heeheehee
06-22-2010, 03:55 AM
Yeah, I dunno. If J&S introduced a new item, people* would complain so much more, man.

*Refers to those who either haven't bothered to lucre consistently as well as newbies who still haven't gotten all 345 lucre yet.

icon315
06-22-2010, 04:27 AM
Yeah i don't see the point in not taking the bounty, you can always use the foods/drinks

johnnyponny
06-26-2010, 11:01 AM
Maybe you should make an option not to autosell giant needle and wolf mask, considering they can be pulverized.

Bale
06-26-2010, 07:45 PM
Or you could just change/comment out those lines in the script. It's hardly a big project with hidden repercussions to any change. Just sayin'.

Xenthes
06-30-2010, 10:31 PM
Updated the script a bit. It now eats and spleens up to your characters max fullness and spleen, does the bounty hunter using the script listed in the first post and then drinks up to your max drunkness then over drinks.

Thanks to all who suggested changes.

fraed
07-19-2010, 03:19 AM
Love your script. works just like I wanted to do myself but I don't know scripting. I am having a problem with the eatdrink script it always runs in sim mode. I have edited the vars_mycharactername.txt file and it still runs in sim mode. I have tried finding info on eatdrink in the other form but didn't find anything there.

Again thanks for a great script.

icon315
07-19-2010, 04:05 AM
well not sure what is wrong, but here is a new version i cooked up. it will try to get more free buffs which will help your farming

fraed
07-20-2010, 01:49 AM
well not sure what is wrong, but here is a new version i cooked up. it will try to get more free buffs which will help your farming

Thank you. This one worked GREAT. One question I do have is why do the scripts do all the drinking after your done? Sorry I'm a real noob on this.

Xenthes
07-20-2010, 02:09 AM
Thank you for using it and the compliment on the script.


Thank you. This one worked GREAT. One question I do have is why do the scripts do all the drinking after your done? Sorry I'm a real noob on this.

So that you have more adventures to use the next day.

icon315
07-20-2010, 03:38 AM
i never got that either :P, but if you want to do that before just change

in line 83

eatdrink(fullness_limit(), 0, spleen_limit(), false);

to


eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);

Winterbay
07-20-2010, 06:48 AM
I think, at least in the case of dj_d's farming script that chooses from all available locations, that it might be due to the fact that you can end up getting drunker while you adventure and thus it is better to leave drinking until after the adventuring. That's the only reason I can come up with :)

slyz
07-20-2010, 07:19 AM
I think it's simply to give you some flexibility. If you ever decide you want to do something other than farming on the next day, at least you'll have adventures banked.

fronobulax
07-20-2010, 11:32 AM
Two reason to drink at the end of the day. First, you don't get hosed if you encounter an adventure that increases drunkenness (as was pointed out elsewhere). Second, it makes it easier to manage Ode To Booze efficiently. A good script casts Ode and drinks. A better one creates the drinks, because that could consume adventures, casts Ode and drinks. Either way, the script only has to worry about Ode once.

icon315
07-20-2010, 06:41 PM
Yeah i guess, but i when i farm i usually only do it in the castle, or he oasis, and there is no possible way to get more drunk there. also i'm not a fan of wasting time to get ode to booze.

fraed
07-21-2010, 01:06 AM
Thank you all for the info.

dinin991
08-07-2010, 11:17 PM
I can't seem to get eatdrink to NOT run in simulation mode via the script. I can run it in the CLI just fine but soon as it gets to:



eatdrink(fullness_limit(), 0, spleen_limit(), false);

or

eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);



It seems to only run in simulation mode both times.

Another question, how can I add to the script to use kolmafia's built in breakfast feature?

slyz
08-08-2010, 12:23 AM
type zlib eatdrink_simConsume = false in the gCLI.


Another question, how can I add to the script to use kolmafia's built in breakfast feature?

Just set Mafia to use Mafia's built-in breakfast feature.

icon315
08-08-2010, 02:28 PM
Another question, how can I add to the script to use kolmafia's built in breakfast feature?
cli_execute("breakfast")
should work



Here is a farming script i made for a friend.....for example purposes

Theraze
08-12-2010, 10:08 PM
Was looking through the farming script you (icon) made... one note, near the end, you check if smasbot is online, then send items to smashbot. :)

icon315
08-12-2010, 10:13 PM
heh, o well

Camber
08-13-2010, 03:23 PM
Was looking through the farming script you (icon) made... one note, near the end, you check if smasbot is online, then send items to smashbot. :)

And, one other minor (somewhat humorous) thing with the smash_today() function, you check if wadbot is online, and then send to smashbot anyway :-) We've all made the same copying errors; i know i have!

Bubba
09-12-2010, 08:47 PM
er i tried running the script but... it made sum random countdown thing that took like 5 whole minutes before i gave up

Theraze
09-13-2010, 12:00 AM
Most likely you're referring to the fact that it calls eatdrink twice (initially above, overdrink below) and eatdrink delays on a 3 second between steps, normally... That means that it can take several minutes to run properly, especially if you have a lot of items. Also, it overdrinks at the end... I've commented out both steps. Here's the version of castle_farming.ash I'm using now. It's based on Xenthes' original script, but with a few tweaks... mainly, it skips EatDrink (though it's still imported, if you choose to just remove the // commenting it out), doesn't sell any thin black candles (because they're fun for demon summoning), and keeps one of each of the sold items in inventory, so if you actually want to use a rave whistle as a moxie plinker, you won't find it suddenly disappearing on you.

You can see if this works for you... your problem bits (the EatDrink) shouldn't affect you with this copy. Or just comment out EatDrink, top and bottom...

redwulf25_ci
11-06-2010, 10:29 PM
Here is a farming script i made for a friend.....for example purposes

Why does it put on a Tuxedo Shirt then buy and drink booze that doesn't benefit from the shirt?