PDA

View Full Version : Harvest – A highly customisable farming script



Pages : [1] 2

Banana Lord
06-17-2011, 07:26 AM
Harvest
Prepare thy work without, and make it fit for thyself in the field; and afterwards build thine house - Proverbs 24:27



Features

Quick and easy to set up
Can be configured to farm for anything, anywhere, anyhow you like
Bountyhunts optimally
Collects and displays farming stats
Runs from login to logout, handling all your daily activities eg: buffbot buffs, prismatic wads, equipping optimal rollover gear etc.
Ties in with many of your favourite scripts eg: EatDrink, OCD, CounterChecker
See FAQs for more.



http://dl.dropbox.com/u/4990751/Harvest%20Screenshot.png


Setup
In addition to the three scripts attached to the bottom of this post you will need the scripts specified under Requirements
NB: All scripts should go in your /kolmafia/scripts folder, all scripts beginning with "relay_" should go in your /kolmafia/relay folder.

Run Harvset from the relay browser (use the dropdown menu in the upper menu pane).
Configure the script's settings to your liking and click Save (stay on the page until the green confirmation text appears).
Add this to the top of the Custom Combat Script you will be using with Harvest:


[default]
consult Harvest Combat.ashNB: You may forego this step if you do not intend to use Harvest Combat.ash to automate combat (but you will still need something to run your combats for you).


Requirements
Scripts Required
Zarqon's Zlib (http://kolmafia.us/showthread.php?2072-ZLib-Zarqon-s-useful-function-library)
dj_d's EatDrink (http://kolmafia.us/showthread.php?1519-EatDrink.ash-Optimize-your-daily-diet-%28and-see-how-your-old-diet-stacks-up%29.) NB: It is possible to specify a different consumption script for Harvest to use
jasonharper's htmlform (http://kolmafia.us/showthread.php?3842)
Bale's OCD Inventory Control (http://kolmafia.us/showthread.php?1818-OCD-Inventory-control)
NB: Harvest comes preloaded with default data for OCD (giant's castle farming only) so you do not have to categorise any of the items in your inventory yourself if you do not need the full functionality of the script. Simply downloading OCD to your /scripts directory and running relay_OCD_db_Manager.ash once is enough to set the script up to work with Harvest.

Scripts Recommended
NB: Harvest will run fine without these, but I suggest that you look at what they can do as they may well enhance your farming
Bale's CounterChecker (http://kolmafia.us/showthread.php?2519-CounterChecker-Wormwood-Semi-rares-Dance-Cards-and-more) (if you want to automatically get semirares while farming)
Bale's Universal Recovery (http://kolmafia.us/showthread.php?1780-Universal-Recovery-Script) (for optimal HP/MP recovery)
jasonharper's Pyromania (http://kolmafia.us/showthread.php?5610-Pyromania-mana-burning-fine-tuning) (allows you to fine tune your MP burning settings)
jasonharper's breakables.ash (http://kolmafia.us/showthread.php?3769-Breakable-equipment-fine-tuning) (for fine tuning Mafia's handling of breakable equipment, such as sugar items)


Acknowledgements
This script was based on flypapermonk's Neo-Cow Farming Script (http://kolmafia.us/showthread.php?2583-The-Neo-Cow-Farming-Script). While little remains of the original script, I took direction from his work and borrowed a number of ideas from it. Special mention goes to slyz and Winterbay, who have answered a metric bucketload of my questions and contributed immensely to Harvest. Finally, I would like to thank the entire KoLMafia community, without whose patient assistance this script would never have been produced.

Current Versions
Harvest 2.0.4
relay_Harvest 2.0.1
Harvest Combat 1.2.2
[requires revision 9879]

Banana Lord
06-17-2011, 07:26 AM
Changelog

Harvest.ash
2.0.4
*Fix for stupid mistake in previous update (thanks again eegee).
2.0.3
>Handling for the situation where mafia doesn't update item quantities after using a putty monster.
>If you leave the Farming Location field blank, bountyhunting will now work correctly.
*Capitalisation for Linux users.
*Improvement to avoid skipping ode if you only have a few turns active when filling organs/overdrinking. Thanks eegee!
*No longer counts all buffs as AT buffs.
2.0.2
+Can now call an "End-of-day" script during "Finishing up for day".
+Will now make use of The Legendary Beat if you have it.
>Now captures result of adventure() during Duck Hunting (should have listened to Bale in the first place).
2.0.1
+While farming under the sea, Harvest will now beat up dolphins if the value of a stolen item is greater than the cost of a whistle.
*No longer aborts if you have not specified a CCS.
*Now properly equips hats to your hatrack.
*Now fights the right number of ducks.
*Now properly gets ode from a buffbot if you cannot cast it yourself.
2.0
+Harvest's budget can now be set with the har_gen_budget setting in your vars file (cannot be accessed from the relay script). Choose -1 to keep all of your meat on hand (not recommended).
+It is now possible to choose a buff to get from the Hatter each day before farming.
+Harvest can now hunt ducks (note that farming-related buffs will be acquired after duck hunting).
+You can now specify a pre and a post consumption script for Harvest to call. You should ensure that these do not interfere with Harvest's activities.
+If Harvest cannot get enough turns of specified AT buff from a buffbot it is now possible to allow it to buy recordings from the mall to make up the difference.
+Will now get ode from a buffbot if you cannot cast it yourself. NB: If you CAN cast it yourself Harvest will make sure you have a slot free for ode, but it is left up to your consumption script to actually make use of the skill (EatDrink will do this automatically, but if you use a different script it is up to you to make sure it does this).
+Aborts if you are adventuring in the sea, have one adventure remaining and have no turns of fishy (prevents infinite loop).
>Harvest can now be directed to olfact monsters other than goth giants while you farm.
>Minor tweaks to improve the efficiency of the bountyhunting code.
>Bountyhunting takes place before consumption to avoid wasting turns of effects acquired from food, booze and/or spleen items.
>Harvest is now much more intelligent about leaving room for fortune cookies if you have enabled semi-rare collection.
*Harvest will now actually use the Still (I, Banana Lord, am an idiot).
*The structure of some data files has been changed. The names of the affected files have been modified to avoid collisions with the old versions (new names are: HAR_Bounty_Data.txt, HAR_Buffbot_Info.txt, HAR_Options.txt). It is safe to delete the old files once you have updated (old versions are: HAR_Bounty_Info.txt, HAR_Buffbot_Data.txt, HAR_Options_Data.txt)
*Fixed bug that was making Harvest think ED had failed to fill your organs completely.
1.1.6
>Now removes On the Trail before starting a bounty if you're not currently tracking your bounty monster, and before farming if you're not tracking a Goth Giant.
+Optimally makes use of the Still, buying ingredients as appropriate (thanks for the code Bale!)
1.1.5
*If you have completed a bounty today without Harvest (e.g.: manually), the script will now properly detect that you cannot do another.
1.1.4
>Harvest will no longer try to fold your origami into pastie form if you can't wear shirts.
1.1.3
>If there is a bountyhunt available in your farming location Harvest will now always choose it and proceed to farm as normal rather than wasting turns with sub-optimal gear/effects.
1.1.2
*Bug fix and adjustments to take advantage of Bale's update to OCD.
1.1.1
>Better handling for selecting a bounty when the airship is an option.
*Fix minor bug in equip_song_raiser.
1.1
+Harvest can now bountyhunt for you
*Numerous minor bug fixes and improvements
1.0.2
*Fixed rare bug which caused Harvest to abort if you finished farming before using the extra stomach space left for a fortune cookie.
1.0.1
*Fixed an oversight that meant that the script would not allow you to choose to use sugar shields.
1.0
Initial release

relay_Harvest.ash
2.0.1
*Can now access Hatter setting without a VIP key in inventory
2.0
>Complete rewrite. CSS prettiness prevails!
+Now displays even more stats.
1.0
Initial release

Harvest Combat.ash
1.2.2
*Disco combos now actually work!
>Changes to accomodation the SBIP.
1.2.1
*Now employs stasis while duck hunting.
1.2
+Performs disco and rave combos.
>Changes to accommodate updates to other scripts.
1.1.3
+Support for using stasis items other than the spectre scepter.
*Now aborts cleanly if a stasis item cannot be found.
1.1.2
+Added support for stasising with NPZR and cocoabo.
1.1.1
+Implemented jywlot's request for automatic stocking mimic stasising.
1.1
+Handling for bountyhunting.
1.0.1
*Fixed typo. Thanks peter50216!
1.0
Initial release.

Key
+ = New feature
> = Feature modified
* = Bug fix

Banana Lord
06-17-2011, 07:27 AM
FAQs

I just want to farm the Giant's Castle
That's not a question, but let's answer it anyway. Because this is the most common farming location, Harvest comes pre-configured with settings for farming the Castle, so when you go to set it up you'll find that some options have been set for you. On a related note, if you're farming the Castle, Harvest will pass default data for castle items on to OCD. This means that if all you want to do is farm the Castle (or test the script out) you don't have to sort through your entire inventory before you can get started.

Do I have to do anything before I run the script each day?
Nope. After you've completed the initial setup Harvest will take care of everything.

Can Harvest get buffs from a buffbot for me?
Open HAR_Buffbot_Buffs.txt (in your KoLmafia>Data folder) and enter the names of the effects you would like to get. Each effect must be on a separate line and must be followed by a tab.

Could you help me set EatDrink up?
Setting up EatDrink.ash for the first time can be a bit daunting, but if all you want to do is set it up to work with Harvest simply follow these instructions and you'll be sorted.
Put EatDrink.ash into you /kolmafia/scripts folder
Copy paste this into the gCLI and run it: ash set_property("autoSatisfyWithNPCs", true); set_property("autoSatisfyWithMall", true);

What does this option do?
If you're unsure of the function of an option that you've come across in the relay script you can simply mouse over its name for a more detailed description. If you're still not sure just post in this thread and I (or someone else) will be happy to help.

Is Harvest safe? Will it ever go crazy and set fire to my meat?
Very rarely updates are made to KoL which cause scripts or even Mafia itself to behave in unexpected ways. It is therefore possible, however unlikely it may be, that Harvest may one day go nuts and use all your meat. Fortunately Harvest has a built in safety feature: It will closet all of your meat (keeping 100K on hand for farming-related expenses) before doing anything, meaning that if something does go horribly wrong it can only ever burn through 100K of your meat. If you would like Harvest to keep more or less of your meat on hand you can adjust the script's budget by typing this into the gCLI: set har_gen_budget=100000 substituting whatever value you feel is appropriate. If you set this to -1 Harvest will keep all of your meat on hand and closet nothing (this is not recommended, use at your own risk).

I'd like to use some foldable equipment with Harvest, how do I fold it up each day?
Harvest will automatically fold your stinky cheese and origami into their most suitable forms depending on what you're doing (eg: eye for farming, diaper for rollover). Currently only cheese and origami are supported but I'll be happy to add more if someone posts a request.

Can Harvest automatically remove certain effects while farming?
Open HAR_Effects_to_Remove.txt (in your KoLmafia>Data folder) and enter the names of the effects you would like to avoid. Each effect must be on a separate line and must be followed by a tab.

How do I get Harvest to burn my mana on librarm summons?
This is actually built into mafia. To enable it, check "cast summoning skills during buff balancing" in Mafia's preferences (under the General tab) and then adjust your burning settings under the "HP/MP Usage" tab in the Adventure window.

How does Harvest handle sugar gear?
Again, Mafia will handle this for you if you know how to set it up. I suggest using jasonharper's breakables.ash (see "Scripts Recommended" in the first post).

What's the deal with the pre and post consumption scripts, and the End-of-day script?
As the names suggest, Harvest will run the specified pre-consumption script immediately before filling your organs, the specified post-consumption script immediately after, and the specified End-of-day script immediately after farming. This could be useful if you need to do something special during your daily farming routine that Harvest does not cater for. For example: You could use the pre-consumption script to drink sake and eat sushi before EatDrink gets a chance to fill up your stomach, and then use the post-consumption script to get enough turns of fishy for you to farm the sea.

How do I get the script to do this, that or the other thing?
Feel free to ask for help, suggest improvements, or request features in this thread.

The script doesn't work/I found a bug
Please post any problems you have in this thread along with any gCLI output you think is relevant (even better would be setting verbosity to 3 from the relay script, recreating the error and then posting the gCLI output). Describe what you were doing when the error occurred.

What does HAR stand for?
I'm glad you asked. Hardcore Automated Reaping.

What exactly does this script do?
Harvest is smart. It applies good judgement to all situations and does its best to figure out what it is that you want it to do. It also uses a lot of neat tricks to eke every last bit of meat out of your day. The list below details Harvest's capabilities in broad terms, and in roughly chronological order.


[LIST]
Remembers prerun settings like CCS, mood and autoattack so it can restore them when you're done for the day, or in the event of a call to abort().
Closets your meat as an added safeguard against the script malfunctioning.
Has the ability to get semirares for you as you adventure using CounterChecker.ash.
Can complete a bountyhunt for you each day before farming. Tick the appropriate option and Harvest will use your spooky putty to speed up bounty hunting.
If you cannot cast Ode yourself Harvest will get it from a buffbot before consuming.
Uses EatDrink.ash to optimally fill your stomach, liver and spleen (you may specify a different consumption script to use).
Can be configured to farm a monster trapped in your spooky putty each day.
Can hunt ducks at McMillicancuddy's Farm.
Makes sure you have buffing items such as the Rock and Roll Legend and the Mace of the Tortoise.
Gets any buffs you specify from a buffbot (note that, if you can, Harvest will cause you to cast the skill yourself, because you really shouldn't be mooching off a buffbot if you don't have to).
Can play pool, visit the friars, attend a concert on the Mysterious Island of Mystery, summon your demon and visit the hatter
Farms anywhere you choose using any outfit, familiar or familiar equipment you specify (folds up your stinky cheese and/or origami automatically before equipping your farming outfit).
You can specify a monster to olfact while you farm.
Can use putty on your trailed monster to speed up re-olfaction.
Allows you to specify any effects you want to avoid while farming and removes them as soon as they are detected.
Uses dolphin whistles (if profitable) while sea farming.
Casts Rainbow Gravitation if possible, buying wads as needed.
Makes optimal use of the Still if you can still use it at the end of the day.
Uses Bale's OCD Inventory Control to tidy up your inventory after farming (mallsells, autosells, pulverizes and carries out other inventory-related actions of your choice).
Uses EatDrink to overdrink when you've finished farming.
Equips the most optimal rollover gear you have in your inventory and updates your specified rollover outfit accordingly.
Prints a summary of the day's earnings (this, along with other farming statistics, can be viewed at any time with the relay script).

fronobulax
06-17-2011, 02:40 PM
Closets your meat as an added safeguard against the script malfunctioning.
Uses EatDrink.ash (or another consumption scrtipt that you specify) to optimally fill your stomach, liver and spleen.


Sounds awesome. Do those steps occur in that order? If so EatDrink might be challenged. I implemented a mafia preference that allowed you to set a daily budget for ED. It kept track of what you spent each day and closeted meat so you could not exceed the budget. The budget is only enforced when ED is called in a way that enforces the budget, certain abort conditions can get things confused and meat spent to restore MP (to cast Ode) or build boxen does come out of the budget. If this sounds useful maybe I should add it to the supported release of ED.

Banana Lord
06-17-2011, 09:13 PM
Yes, in that order. At the moment I have it set up to keep 100K on hand and closet the rest, so that if something does break (I'm thinking of the ghastly results of that chef/bartender change) there's only so much meat to be lost. But even so, I'm always happy to have extra safeguards. I won't have a chance to sit down and make changes to the script for about a week, but as long as any changes you make don't break how eatdrink is currently called I'd very much like to see you add that.

peter50216
06-18-2011, 04:41 AM
Have to set
zlib eatdrink_simConsume = false

or the script will fail.

Edit: And in Harvest Combat.ash, activity should be "har_current_activity", not "ncf_current_activity"...

Banana Lord
06-18-2011, 04:53 AM
Have to set
zlib eatdrink_simConsume = false

or the script will fail.
That's an EatDrink setting which you should have configured when you set up eatdrink. I don't want to modify people's settings for other scripts if I can avoid it. If it turns out that a lot of people get caught by this then I'll think about changing that.


Edit: And in Harvest Combat.ash, activity should be "har_current_activity", not "ncf_current_activity"...
Thanks! Well spotted. When I changed the script name I knew I was bound to miss one!

Alhifar
06-18-2011, 05:03 AM
You could always call it with the 9 parameter version of eatdrink(), so that it doesn't simulate, even if the setting is to simulate normally.

peter50216
06-18-2011, 05:11 AM
In shrug_an_at_buff():

if(cost < previous_cost)
buff_to_shrug = buff;
previous_cost = cost;

Should it be:
if(cost < previous_cost){
buff_to_shrug = buff;
previous_cost = cost;
}

?

Banana Lord
06-18-2011, 05:23 AM
@Alhifar: Yeah I considered that when I wrote that bit of the script. But in the end I decided that if a user hasn't run eatdrink before (ie: they haven't set simConsume to false) then there're a bunch of other settings that they might want to take a look at. In short, I wanted to encourage people to double check their eatdrink settings. What's your opinion?

@peter: Yes. Right again. I'm so glad you're checking through my code (especially the buffbot bit). It's amazing how easy it is to miss things like that, even after multiple revisions and re-reads.

EDIT: Script updated, but without a version number change. It's not a critical bug, and since I'm sure I'll need to roll another update soon people'll get the fix soon enough (besides which I only have three users so far :p).

EDIT2: Oh and do you know about the [CODE*][/CODE*] and [PHP*][/PHP*] tags (without the *, obviously)? They'll preserve indentation in any code you post. You may know already, but since you have quite a small post count I thought I'd mention it.

Theraze
06-18-2011, 05:28 AM
Don't have to actually call 9 variable EatDrink, just define "SIM_CONSUME=false;" before you call EatDrink and it should work great. It's what I do in my aliases...

Banana Lord
06-18-2011, 05:35 AM
So I take it you think it's a good idea to streamline the process rather than force users to check their eatdrink settings before running Harvest too Theraze? Hmm, I'll think about it.

Theraze
06-18-2011, 06:01 AM
Well, if you're going to call EatDrink, make it work. :) If calling EatDrink is the responsibility of the user, leave it the responsibility of the user.

Banana Lord
06-18-2011, 06:43 AM
Actually, would setting simConsume to false work? Let's assume a user of Harvest has never used ED before (because if they had then this wouldn't be a problem for them). Setting simConsume to false before calling the script won't do a thing because the zlib settings won't have been created yet. I could have Harvest run ED once filling to 0 of each fullstat before changing the setting, but that doesn't seem very elegant.

However, if I use the 9 parameter version with simConsume set to false and it's the first time a user has run ED it should work, yes?

Alhifar
06-18-2011, 06:46 AM
The SIM_CONSUME variable is set in the top level of ED. Therefore, by the time your script runs, the import will have set it (and set the default value of vars[simConsume], but that's another matter), so setting that will affect the rest of the script.

Banana Lord
06-18-2011, 06:49 AM
Oh I see. Sorry, I misunderstood you. OK, it's probably a good idea. I'll post an updated version.

Theraze
06-18-2011, 01:31 PM
Yeah... my 'regular' eatdrink alias is this:
eatdrink => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false); If someone else used it, regardless of what settings they have saved, that would actually (not simulated) eat and drink from empty to full using whatever they have set for VoA and the pricing limits and the rest of it. As a different example, my simulation alias is this:
seatdrink => ashq import <EatDrink.ash>; SIM_CONSUME=true; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false); As you can see, I redefine simfulness, siminebriety, and simspleen as well as the SIM_CONSUME... this way they are properly set, but since I'm defining them after I've imported the script, I'm overwriting the script's defaults. :)

fronobulax
06-18-2011, 03:15 PM
When Theraze is happy with the EatDrink additions I expect to add a couple of things that make it easier to import and call EatDrink without making the user fiddle with everything.

Theraze
06-18-2011, 05:47 PM
Yeah, still working on it... for example, found out yesterday that even though I have it auto-purchasing worthless items if you have the money for it and the painful penne pasta is a good choice, if you start with no worthless items, creatable_amount is 0 despite the NPC store setting, because it's not a 'standard' NPC store. Soon as you get a (or a bunch of) worthless item somehow, your creatable_amount is 1+, and you'll create the 3-5 you'd normally make. Somewhat bizarre. Anyways, the fix was to allow for people using EAT_ACCURATE (the default) to consider each item whether you have it officially creatable or not, and for people with EAT_ACCURATE off for speed to use creatable_amount, since that's what it'll use below to decide if it can make the item, similar to current EatDrink.

All that to say, working on it, I'll post a new version for people to test once I think we've got some actual improvements in there.

dangold
06-23-2011, 01:26 PM
Two things:

First, your call to eatdrink.ash fails on Linux. Author of that script calls it EatDrink.ash, and case is significant in Unices

Second, running the script yields an error message as follows:

Cannot store boolean in ocd_profit of type int (Harvest.ash, line 878)

Harvest.ash , line 878:

int ocd_profit = ocd_control(false);

Banana Lord
06-23-2011, 09:25 PM
First, your call to eatdrink.ash fails on Linux. Author of that script calls it EatDrink.ash, and case is significant in Unices
I'll change the default setting for that, but you can easily adjust the case yourself from the settings table in the relay script.


Second, running the script yields an error message as follows:
I've never seen that issue before, and no-one else seems to have run into it. Could you download a new version of Harvest.ash (just in case)? Are you using the latest version of OCD? Could it be another unexpected interaction with Linux (I have no experience with that OS I'm afraid)? Do you get that error every time you run the script? If so set Verbosity to 3 (from the relay script), run the script again and post the relevant CLI output here.

peter50216
06-24-2011, 06:00 AM
The script forgot to call load_at_buff_data(); in num_at_songs() ...
So num_at_songs() always return 0...

dangold
06-24-2011, 11:22 AM
Err, okay. I tried this morning to replicate the failure, and simply couldn't. Sorry about that, Banana Lord.

Banana Lord
06-24-2011, 11:36 AM
@Peter: If you give me some CLI output (with verbosity set to 3) I'll look into that when I get a chance.

@Dan: No problem, I'm just happy it's working :-) If it does happen again drop me a line.

morwen
06-26-2011, 03:01 PM
Is there a way to tell the script not to abort when the cookie counter runs out? I don't really care about it and I'd rather the script continue running than having to have me restart it every time the counter runs out. I thought telling it that I didn't want it to farm semirares would solve the problem but it didn't.

Theraze
06-26-2011, 03:33 PM
Options:
1) Don't eat cookies if you don't want it to abort when the cookie counter wears off.
2) Set a dummy counterScript that does nothing, at least for the Fortune Cookie counter.
3) Have your counterScript automatically farm semirares.
4) Manually wipe the Fortune Cookie counter.

lostcalpolydude
06-26-2011, 10:44 PM
Is there a way to tell the script not to abort when the cookie counter runs out? I don't really care about it and I'd rather the script continue running than having to have me restart it every time the counter runs out. I thought telling it that I didn't want it to farm semirares would solve the problem but it didn't.

That should prevent it from eating a cookie, but if a cookie was eaten then this script has nothing to do with stopping (or not) to get it. If you use CounterChecker (linked in the first post) then you can get semi-rares without any more effort than running this script.

Banana Lord
06-28-2011, 07:11 AM
Actually Morwen, I think there may be something else going on here. I keep getting abort errors around the SR counter, but I don't think it's anything to do with Harvest... I'll post back here if I discover anything.

EDIT: Oh, well that was easy. If your problem is anything like mine then updating CounterChecker.ash will fix it. The transfunctioner update broke CounterChecker's handling of the 8-bit realm semi-rare, but because CounterChecker doesn't get called until well after you run Harvest it's highly likely that you won't be looking at mafia when it prompts you to update the script.

Winterbay
06-28-2011, 07:12 AM
If you don't have a counterchecker I think Mafia aborts when your SR counters are up since you might want to do soemthing else then. So if that's the case here that is a probable cause at least...

morwen
06-28-2011, 10:11 PM
Hrm. I still have no idea why it's coming up. I updated counterchecker but that didn't seem to help and I can't for the life of me figure out how to get it to stop counting for semirares. I have everything set to NOT eat cookies, but I still get a message every 60-100 adventures or so saying that the counter stopped. I didn't know if there was an option in the harvest script for it, since there was for neocow (although there wasn't one in the vars file for harvest, so it was more of a double check kind of thing). Blahh. I'm just going to continue using neocow for now until I figure it out. I want it for the BHH anyway.

Banana Lord
06-29-2011, 05:53 AM
Could you post the CLI output from when it aborts? And can you tell if the script's eating a cookie or not? It should be in your session log just before EatDrink runs.

Banana Lord
07-02-2011, 12:16 PM
If anyone's interested, here's a stable beta version of Harvest updated with bountyhunting capabilities. Included are a few other minor tweaks and improvements I've been working on. As always comments are greatly appreciated (especially if they are of the "it works!!" variety :p). I'll release it properly in a couple of days if it continues to run smoothly.

dangold
07-05-2011, 09:39 AM
Been using a while now, great script.

One tiny item - would it be possible to specify an outfit to wear while eating&drinking? Just that mafia has me set up nicely with 100s of turns of 3 AT buffs, so extra AT song needs equipment equipping.

Banana Lord
07-05-2011, 10:43 AM
Glad you're finding it useful :)

By "mafia has me set up nicely with 100s of turns of 3 AT buffs" I take it you mean that you have a lot of turns of AT buffs that you'd rather not shrug just to run ode while you eat/drink/spleen, is that correct? How about I have the script check to see if you have any items that could raise your song cap (thus allowing you to run ode without shrugging anything) and equip one of those while consuming and then switch back to your farming outfit? There aren't many to keep track of so it wouldn't be terribly difficult to do.

EDIT: On the basis that that's a good idea even if that wasn't what you meant I have added such a feature. I don't have any AT song-cap-raising items so I can't test the code as thoroughly as I would like, but I'll give it a run through tomorrow and all going well will release the next update (yay bountyhunting!)

Bale
07-05-2011, 11:20 PM
Since you cannot test this yourself I'll offer a tip. I'm not sure how you implemented this, but there is a trick to it. I found that it didn't work right if I tried to maximize for "Four Songs, Additional Song" on the theory that I might have either or both of those. (Though I cannot remember at the moment exactly what caused the malfunction.) I ended up having to do them in sequence like this:


if(current_at() >= max_at()) {
if(!boolean_modifier("Four Songs"))
maximize("Four Songs -tie", false);
if(current_at() >= max_at() && !boolean_modifier("Additional Song"))
maximize("Additional Song -tie", false);
}

Banana Lord
07-06-2011, 01:38 AM
Thanks for the tip Bale. I didn't actually do it like that, instead I made use of some existing code (max_at_songs and num_at_songs) along with some additional logic to a) find an accessory slot that isn't occupied by an item that raises your song cap and then b) equip an item in that slot which does increase it.


void equip_song_raiser()
{
announce(2, "equip_song_raiser");

load_at_buff_data();
if(num_at_songs() == max_at_songs())
{
outfit(FARMING_OUTFIT);

string [item] song_raisers;
song_raisers [$item[plexiglass pendant]] = "";
song_raisers [$item[brimstone beret]] = "";
song_raisers [$item[super-sweet boom box]] = "";

slot the_slot;
foreach space in $slots[acc1, acc2, acc3] // Find a suitable slot to equip the song_raiser in
{
if(space == $slot[none]) // If the slot's empty we can just use that
the_slot = space;

if(the_slot == $slot[none]) // Make sure we haven't already found a suitable slot
{
if(song_raisers contains equipped_item(space)) // If the item is a song_raiser itself don't unequip it
announce(3, "That item ("+ equipped_item(space).to_string() +") is a song_raiser so it was not unequipped");
else
{
the_slot = space;
announce(3, "the_slot: "+ the_slot.to_string());
equip(the_slot, $item[none]);
}
}
}

item song_raiser;
foreach gear in song_raisers
{
if(!have_equipped(gear) && item_amount(gear) > 0)
song_raiser = gear; // We don't really care WHICH song_raiser we equip, as long as we equip one
}
announce(3, "song_raiser: "+ song_raiser);

if(my_class() == $class[accordion thief] && item_amount($item[La Hebilla del Cinturon de Lopez]) > 0)
song_raiser = $item[La Hebilla del Cinturon de Lopez];

if(song_raiser != $item[none])
equip(the_slot, song_raiser);
else
announce(3, "No item could be equipped to raise your AT song cap");
}
else
announce(3, "No item was equipped because you already have room for another AT song");

clear(at_buffs);
}

It's not a terribly elegant function, but I'm fairly sure it'll work reliably.

Bale
07-06-2011, 10:02 AM
My code is shorter and doesn't need to be updated when KoL adds more items to boost AT song capacity.

:P

Banana Lord
07-06-2011, 10:25 AM
Hehe, and I bet you didn't spend a good 20 minutes writing and checking it either xD I bow to your superiority :p

Bale
07-07-2011, 06:23 AM
That is the benefit of simplicity. Since KoLmafia has maximize() it seems like a waste of programmer's time to check for all possible equipment.

Banana Lord
07-07-2011, 10:08 AM
Harvest updated! Bountyhunting functionality added.

jwylot
07-15-2011, 12:55 AM
Hi, I've been pretty busy lately with other stuff and have just got round to looking at this. I'm really impressed Banana - nice job! I look forward to giving it a spin tomorrow.

I did notice that you have made a special case for the hobo monkey in your CCS and wonder if a similar case could be made for the stocking mimic which at full weight is a farmer best friend?

Banana Lord
07-15-2011, 02:24 AM
Thanks jwylot! Hope you find it useful :-)That's certainly something I could look at doing. I've never used a mimic, so what sort of things should I watch out for?

jwylot
07-15-2011, 08:21 AM
The mimic can produce extra meat in the first 10 rounds and can regen MP up to round 30 so I stasis for 25 rounds followed by a killing blow if it ever gets that far.

Banana Lord
07-16-2011, 07:27 AM
Harvest Combat has been updated as per jwylot's request! I don't have a mimic so if someone could confirm that it works as expected that'd be nice :)

Theraze
07-16-2011, 02:49 PM
Should be relatively easy to test... The stocking mimic is the IotM version of the Cocoabo (complete with same formula), which is a reduced version of the NZPR. If you could get your NZPR up to the same size as a mimic, the *6 instead of *4 on the meat would make it awesome... but it's not as easy to overcome a difference of 80 in the familiar weight, which makes Mimic>NZPR>Cocoabo. But if you have any of the 3, you can test the formulas... Just set a Cocoabo and see if your meat raises properly.

Sidenote... could/should add the other 2 similar familiars to the mimic-code. :)

Banana Lord
07-16-2011, 10:37 PM
I'm pretty confident that it'll work, it's only two lines of code (a conditional in ash followed by a 'while !pastround' loop in combat macro-speak). It's trivial to add those two but I don't like spamming people with updates so I'll wait a couple of days and release it with the next update to Harvest, which I'm currently testing.

Banana Lord
07-22-2011, 01:32 AM
Harvest and Harvest Combat updated! I've made the bountyhunting portion of the script a bit smarter to take advantage of days on which a bounty is available in your farming location and have added support for stasising with a cocoabo and NPZR.

apenny
07-22-2011, 02:14 AM
Really amazing script. A couple of comments -

1. I had all my specter sceptres in my DC and it choked on the CCS and I had no idea why at the time. jwylot helped me out with this, but maybe either include it as settable what it uses or at least fail gracefully with a message (You have your ... in your DC you idiot!)
2. My understanding is that it doesn't arrange for Ode if you don't have it for drinking. This seems like an unfortunate limitation, is there some way to include this?

Thanks again for working on this great script.

apenny

Banana Lord
07-22-2011, 02:56 AM
Thanks for your kind words, I'm glad you're enjoying it :)

Haha, I knew that scepter thing would come back to bite me. The ode problem is an odd oversight because I usually try to remember those sorts of things. I'll add both of those features when I get a chance, but that may not be for a few days.

PartyBasher
07-22-2011, 02:28 PM
Hey, thanks for the script.
Unfortunately, I don't have torso permed, so I just get a "you can't make a shirt" and stop. Any way to fix this? I have the latest version of the script, zlib and mafia.


Also- how do I use this with limited buffs? (thingfinder etc.) If I set the buff in the farming mood, and then it runs out, what will it do when it runs out of casts?

Thirdly- anyway to use a stinky cheese eye and a diaper?

(I think I can do the last two by intergrating harvest into a script which pre-buffs and prepares for rollover, just wondering if there's a way to do this in the script itself...)

Banana Lord
07-22-2011, 09:43 PM
Could you copy/paste some more of the CLI output the next time you get that error? Alternatively, you could find the relevant part of your session log (/mafia/sessions).

When I wrote the script I assumed that no-one would be using the limited hobo buffs with it (it's almost always more profitable to sell them in /trade or in the mall as a record). I haven't tried it, but if you set them in your mood I think mafia will handle it perfectly. Maybe give it a try, you've got nothing to loose :)

I'll have a think about how to handle using two of the same foldable. Maybe I could add a option for turning off auto-folding.

Banana Lord
07-23-2011, 02:17 AM
Actually PartyBasher, Could you clarify something for me? Why are you using an eye AND a diaper? If you're doing it for the faster charging then surely a second eye would be better? But even then I'm not sure I understand, there are cheaper and better things to wear than a second stinky cheese eye.

lostcalpolydude
07-23-2011, 02:38 AM
Actually PartyBasher, Could you clarify something for me? Why are you using an eye AND a diaper? If you're doing it for the faster charging then surely a second eye would be better? But even then I'm not sure I understand, there are cheaper and better things to wear than a second stinky cheese eye.
Two eyes charge at the same rate as 1 eye, you need unique pieces to charge it faster. But there's no need to charge with 2 at a time as long as you'll have 100 combats for the day. Either start with the diaper and switch to the eye once it's charged enough, or maybe start with 1 eye and equip a second once it's charged enough if it's what you want to wear for farming.

Banana Lord
07-23-2011, 02:43 AM
Oh snap, forgot about that. But I'm still not sure I understand. I thought charging one piece of cheese gear charged it all? Why not just farm with the eye and equip the diaper afterwards? Or better yet, sell the second piece, farm with the eye then let Harvest fold it into a diaper to wear for rollover.

PartyBasher
07-23-2011, 01:27 PM
Auto folding? What I ment was using the eye to farm, and equip the diaper afterwards, as part of the rollover outfit. Sorry for the confusion. Didn't know harvest can autofold. Nevermind that part then.

Regarding hobo-buffs- you're probably right. So nevermind that part also.

Now, about the shirt thing- this is from the CLI.


"battleAction => custom combat script
CCS set to default

Commencing bountyhunting

_har_bounty_expected_lucre => 47
har_bounty_item => sammich crust
har_bounty_num_needed => 5
Taking off stinky cheese eye...
Equipment changed.
You can't make a shirt"


and from the session log-

(
"
> Commencing bountyhunting

Visiting the Bounty Hunter Hunter

Visiting the Bounty Hunter Hunter

accept bounty assignment to collect 5 sammich crusts
unequip acc1"

Then stops. So yeah, weird.

jwylot
07-23-2011, 07:39 PM
I'm no expert but there seems to be a logic problem in Harvest Combat.ash

Lines 142 and 148 use "while !pastround 25;" for stasising but line 160 which should finish the battle with attacks says "mac.append('while !pastround 25; attack; endwhile;');" which will stall.

Shouldn't this simply be "mac.append( attack; );"?

Banana Lord
07-25-2011, 03:07 AM
@PartyBasher: That is strange. I'll need a little more information to debug this so would you mind setting Verbosity to 3 from the relay script and reposting the CLI output when you get the error again? It might also be handy if I knew exactly what was in your bountyhunting outfit.

@jwylot: No, that's intentional. If the macro gets to round 25 and still hasn't won then either something's gone wrong, or you're fighting something too tough for regular attacks to deal with (FoB and corpse monsters can be a pain at lower levels). The idea is that the user can add an emergency finisher to their CCS after the "consult Harvest Combat.ash" line (e.g.: "skill weapon of the pastalord").

jwylot
07-25-2011, 04:31 AM
Ah, that makes sense now. Thanks :)

PartyBasher
07-28-2011, 05:29 PM
with verbosity 3-

"bountyhunt
best_hunt
Abandonned current bounty
can_access_hunt
Can access Dungeons of Doom: true
Current best_hunt is Dungeons of Doom: 5.0099983 turns
can_access_hunt
Can access Hole in the Sky: true
Current best_hunt is Dungeons of Doom: 5.0099983 turns
can_access_hunt
Can access Sleazy Back Alley: true
Current best_hunt is Dungeons of Doom: 5.0099983 turns
Accepted bounty for worthless pieces of yellow glass, Dungeons of Doom
get_putty_sheet
have_foldable
get_foldable
equip_gear
equip_gear
have_foldable
get_foldable
have_foldable
get_foldable
You can't make a shirt"

My outfit includes: ice pick, octupus spade, bag o' tricks, GAPs, stinky cheese eye But I don't think a specific equipment is the issue because I tried using a custom outfit with no items at all and it gave the same error.

slyz
07-28-2011, 06:10 PM
You can't make a shirt
That message means the script is trying to fold something into a shirt. Since you don't have Torso, it's impossible, so Mafia stops and prints this warning.

Whatever line is causing this should be prefaced with

if ( have_skill( $skill[ Torso Awaregness ] ) )

Banana Lord
07-28-2011, 08:07 PM
You don't own the origami IotM do you PartyBasher?

Sorry I haven't been able to look into the handful of feature requests and bugs posted earlier, I've had a busy week. Hopefully I'll have some time this evening, or at least tomorrow.

PartyBasher
07-29-2011, 05:47 AM
Why yes, yes I do.
Put it in my display case, everything works now.

Thank you very much!

Banana Lord
07-29-2011, 10:43 AM
OK, cool. That's an easy fix. As Slyz says, I need to check for torso before trying to fold for the shirt. It's part of the autofolding. If Harvest detects that you have origami and you're farming the castle it assumes that you'll want to use it in pastie form.

Banana Lord
07-30-2011, 01:38 AM
Harvest and Harvest Combat updated for the pastie/shirt fix and better handling for stasising.

About apenny's request regarding getting ode to booze from a buffbot if you can't cast it yourself, I'm thinking that you might be better off using Rinn's excellent acquireBuff.ash (http://kolmafia.us/showthread.php?4048-acquireBuff-Get-a-buff-from-a-buffbot) as part of a login script to make sure you have ode before calling Harvest. If it was a simple change I'd be more inclined to implement it myself but as things stand it's decidedly non-trivial to do neatly. I've been planning to re-write the buffbot code in Harvest so when that happens I'll take another look at adding that feature.

kotinka
08-15-2011, 12:14 PM
Hi, I just started using this today. I'm very impressed, but also a little scared.

Can you tell me if there's a way to stop the bounty hunter from accepting Frat House & Hippy Camp quests & to choose something else instead?

Thanks!

Banana Lord
08-15-2011, 09:16 PM
Hey Kotinka! Glad you like it. Why would you rather it didn't do bounties there? Are you using the script on a character that hasn't broken the prism yet? I never gave any consideration to in-run characters when I wrote Harvest so I'd be surprised if that was your only problem, if that is what you're doing.

Alhifar
08-15-2011, 09:19 PM
If you've done a wossname, neither of those zones are available. For that matter, one or the other is unavailable whatever you do.

Banana Lord
08-16-2011, 12:33 AM
Hmm. I put some logic in the script to detect the availability of those locations. Maybe I didn't put in handling for the case when BOTH are unavailable. I'll look into it.

EDIT:

In theory Harvest SHOULD avoid choosing the camp/frat house if you can't access one or both of them (the relevant function is can_access_hunt at about line 928, depending on your version). I can't actually test for the Frat House being unavailable, or for both being unavailable though, but it definitely works for the case where the camp cannot be accessed. Can anyone confirm if the script is or is not working in the other two cases?

Anyway, if that was the problem to which kotinka was referring, then I'd expect the script to abort when it tried to adventure in what it considers to be the best bountyhunt location and is unable to. Could you clarify your problem for me kotinka? If I understand why you want to be able to tell Harvest not to choose to do a bounty at the camp/Frat house then I'll be better able to solve your problem.

kotinka
08-16-2011, 06:40 PM
Hmm. I put some logic in the script to detect the availability of those locations. Maybe I didn't put in handling for the case when BOTH are unavailable. I'll look into it.

EDIT:

In theory Harvest SHOULD avoid choosing the camp/frat house if you can't access one or both of them (the relevant function is can_access_hunt at about line 928, depending on your version). I can't actually test for the Frat House being unavailable, or for both being unavailable though, but it definitely works for the case where the camp cannot be accessed. Can anyone confirm if the script is or is not working in the other two cases?

Anyway, if that was the problem to which kotinka was referring, then I'd expect the script to abort when it tried to adventure in what it considers to be the best bountyhunt location and is unable to. Could you clarify your problem for me kotinka? If I understand why you want to be able to tell Harvest not to choose to do a bounty at the camp/Frat house then I'll be better able to solve your problem.

Hiya, thanks for not telling me to get stuffed!

I did the island war & did a fairly poor job of it, it's my first ascension. Since doing it, I can't get the dreads from the hippy camp or the other item from the frat house, but I can adventure there. I've only used your script once, but trust my luck, my first time, I get frat house from the bounty hunter. I shot through 60 turns I think, before I realised what was going on.

I did the island war before I started using KOLmafia, so perhaps this is why the program doesn't recognise that I can't bounty hunt in these areas?

Thanks again,

k

Banana Lord
08-16-2011, 10:24 PM
Not at all, I like it when people post about things that have confused them or that turn out to be bugs because then I can continue to improve the script! :) And no, doing the war before starting to use mafia shouldn't have an impact on Harvest's behaviour.

Something here isn't adding up. To (hopefully) avoid confusion please excuse me while I state some obvious facts (or more accurately, facts which seem obvious to me, but about which one or both of us may be unclear). When you finish the war the base of the side that lost is replaced by a 'bombed back to the stone age' version (or both sides are, if you got the Wossname). Harvest checks island.php to see which images are present on the island and if the image associated with the frat house bombed back to the stone age is present Harvest should ignore that bounty, with the same applying to the hippy camp. Are you saying that Harvest is trying to adventure in a 'bombed back to the stone age' area while bounty hunting? If you can't remember, or are unsure, try looking in your /kolmafia/sessions folder for the relevant log. Perhaps it would be simplest if you posted that here as an attachment?

One more thing while I think about it. Could you set Harvest's Verbosity setting to 3 (from the relay script), then copy paste the following code into the mafia gCLI and post the output?
ash import <harvest.ash>; can_access_hunt($location[hippy camp]); can_access_hunt($location[frat house]);

kotinka
08-17-2011, 05:43 PM
Hi Banana Lord,

Yup, frat house is accessible & hippy camp is bombed back to the stone age.

Now for an embarrassing admission - having looked through the session log for the relevant day, I can see I WAS actually picking up the empty aftershave bottles! I can see from the log too, that the script does check that locations are accessible before bounty hunting.

I've now gone an interesting shade of mauve. I hope my immense noobishness hasn't put you to too much trouble.

huggs,

k

Banana Lord
08-17-2011, 07:38 PM
Haha, that's OK. Glad it's something simple. Don't worry about it, a quick search of these forums would turn up a dozen (or more) similar 'bug' reports posted by me :P Luckily for us both the people around here aren't big on lynch mobs ;-)

cobalt60
08-30-2011, 08:47 PM
Hi, apologies if this is an easy question, but I can't get past this error:

apply_prerun_settings
battleAction => attack with weapon
CCS set to Harvest-CCS
(but battle action is currently set to attack with weapon)


The next line is always a red-text fail line - either about bounty, or eating if I'm not all full, but the real error seems to be tied to the CCS somehow. Any tips? The CCS titled "Harvest-CCS" is as follows:

[ default ]
consult harvest combat.ash
attack with weapon

Banana Lord
08-30-2011, 10:55 PM
Would you mind copy pasting the red text too? And it might be handy if you set Verbosity to 3 (from the relay script) and then copy pasted the output when the error occurs. I'll just go and re-familiarise myself with that part of the script :)

EDIT: OK, so the apply_prerun_settings function simply puts a handful of settings (like your CCS, mood, battle action etc.) back the way they were before you called Harvest - it's a bit of good housekeeping. It's called when the script is finishing up for the day after farming or when it needs to abort because something hasn't gone the way it expected it to. I'm almost certain that we're looking at the latter case, yes? After applying your pre-reun settings it'll spit out an error message in red text that it believes describes whatever went wrong. The fact that you're getting several different error messages is a little strange, but I'll hold off passing judgement until I know what they are :).

So in short, I need to see those red-text errors.

cobalt60
08-31-2011, 12:30 AM
I'll try posting tomorrow, sorry, away from computer. Basically, if I had full/drunk/spleen left, the red text acted like EatDrink failed. If, however, I filled up, the red text became about failing to choose a bounty.

I kept thinking I screwed up the CCS stuff, and I'm not sure I really know what I'm doing there -- could you post a quick note on what that should look like? Otherwise, I'll post the error text tomorrow after trying again, thanks!

Banana Lord
08-31-2011, 12:56 AM
KK, you can always look at your session logs in /kolmafia/sessions if you don't want to have to boot up mafia. I'm fairly sure I now know which error messages you're getting though.

Harvest is running EatDrink, then noticing that for some reason you're not as full as should be (that's odd, so we'll come back to that problem). As you noticed, manually filling your organs allows Harvest to pass that error as you're now as full as it expects you to be. When it gets on to bounty hunting one of the first things the script does is choose the bounty that will take the fewest turns to complete. Now, today's bounties are fernswathy's tower, the hippy camp, and the haunted wine cellar. The first of these you may well not have unlocked, the second of these may be unavailable depending on how you completed the war, and if you haven't completed the level 11 quest (which involves unlocking the haunted cellar) then you won't be able to do the third bounty either. I noticed that the in-game character cobalt60 is at level 12, so could you confirm if you are able to reach any of the locations I mentioned above? If you can't do any of the available bounties it's hardly surprising that Harvest is unable to find a bounty for you to do :). I should also point out that Harvest was written with aftercore characters in mind (ie: ones that have defeated the NS) so you may or may not have problems using the script in-run.

The error about not filling your organs is more interesting. How full are your organs when Harvest gives you that error? Do you have the option to do semi-rares ticked? When ED starts up it will give you some output about what it intends to do, I'd like to see the line that follow the form "Consuming up to X food, X booze, and X spleen" (it's the 4th or 5th line displayed after ED starts running).

EDIT: Regarding your concern about your CCS, I'd be surprised if that was the cause of your problem. The only reason it's even mentioned in the gCLI is that Harvest has what you might call a "clean abort" function in it (I borrowed that idea from the script that inspired me to write Harvest, NeoCowFarm.ash). Because there is the possibility that the script will encounter a situation that requires user intervention (e.g.: your organs aren't as full as they should be, or the script couldn't find a bounty for you to do) it needs to be able to abort to return control to the user so that they can fix the problem manually. Since the script knows it's going to abort it can tidy things up before it does so by putting some of the settings it changes back to the way they were before you ran Harvest (for example your mood and your CCS). The CCS that you posted looks fine to me, and as I said, the fact that it mentions your CCS before aborting is irrelevant.

Disclaimer: I've been wrong before and will be again, so if it turns out that your CCS was causing the problem after all I reserve the right to laugh at myself and make use of a comical emoticon ;-)

cobalt60
08-31-2011, 06:45 PM
Thanks, and yeah sorry my in-game-name is different -- I should have thought that out better.

I ran it again today, and here's the results (after eating to 14/15 full and drinking to 18/19, last line is the red text):

6: elven squeeze lev:4 gain:3.0 adv:0.0 musc:6.5 myst:25.0 mox:25.0 meat:190 own:0 value:41
Best find was none with a value of 0. That's no good, so not consuming and moving on.
spleen: At 0, consuming to 15.
Best find was yellow paisley oyster egg with a value of -19. That's no good, so not consuming and moving on.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate disco ball with a value of -1898. That's no good, so not consuming and moving on.
Finished.
Spent 3355 meat. Gained Fullness: 13. Inebriety: 18. Spleen: 0. Adventures: 66. Muscle: 139. Moxie: 138. Mysticality: 614.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).

apply_prerun_settings
CCS set to Harvest-CCS
(but battle action is currently set to attack with weapon)
EatDrink.ash failed to fill your organs completely





EDIT: to clarify your questions, this is a test account, lvl 30, NS killed.

Banana Lord
08-31-2011, 09:56 PM
Hmm. This is potentially partly my fault :) Where did you get your version of ED from? The first post in the ED thread (linked in the first post in this thread) isn't always up to date. I'm not sure how much you know about the development of that script, but the original author is on hiatus and so the most up to date version of the script is buried in the thread somewhere. Try using this version (http://kolmafia.us/showthread.php?1519-EatDrink.ash-Optimize-your-daily-diet-(and-see-how-your-old-diet-stacks-up).&p=58439&viewfull=1#post58439) of ED and see if you have more luck. I'll also ask the current developers of ED where I should link new users to.

EDIT: Regarding your claficiation, that's odd. So you can definitely access the wine cellar. Could you set Verbosity to 3 (relay script) and paste the following code into the gLCI and show me what the output is?

ash import<Harvest.ash>; best_hunt();
Then try this:

ash import<Harvest.ash>; can_access_hunt($location[haunted wine cellar (automatic)]);

Finally, could you confirm if you've already done a bounty hunt today or not?

cobalt60
08-31-2011, 10:57 PM
Awww man. I'm so sorry. Got the correct version of ED and everything seems to work fine. My apologies for crapping up your thread with errors that weren't even yours!

Thanks for making this -- now that I can test it, I'm looking forward to seeing if it works for me!

Banana Lord
09-01-2011, 03:13 AM
Not at all! If anything it was my fault for linking to an old version of ED. Your bounty hunting issue was a bug, I think. Even if it wasn't it led me to find one in the script, which I think I've fixed (we'll see when I run it after rollover :D).

Banana Lord
09-09-2011, 05:21 AM
Script updated. If you've completed a bounty today without Harvest the script will now detect this properly and not abort when it can't select one (thanks cobalt60, you put me on the right track! :)).

antifish
09-15-2011, 03:54 AM
My logs indicate that it's not using putty for my bounty, despite what I chose in my preferences. Any idea what's going on?

Banana Lord
09-16-2011, 01:30 AM
Apologies for not getting back to you sooner. Did you have any putty uses free when you started Harvest? Does your putty currently have a monster trapped in it? Do you see any relevant messages? Could you copy paste the output of a combat in which you believe Harvest should be using your putty but isn't? Could you set Verbosity to 3 (from the relay script), run the script and then attach the log to a post in this thread?

tday93
09-17-2011, 07:18 AM
Hey, i keep getting the error text "[¶-1] has no matches." and the script immediately aborts. This occurs right after changing my outfit, it gets through eatdrink.ash fine, but just dies after printing that message. Thanks

Winterbay
09-17-2011, 12:42 PM
I would say that Bananalord would probably want to have CLI-output for the time around the event, always a good start when troubleshooting.

Banana Lord
09-19-2011, 10:39 AM
Thanks for that Winterbay :-) CLI output would be nice. CLI output with Verbosity set to 3 (from the relay script) would be even nicer :-) My immediate reaction would be to say that something weird is happening with a data file, but no-one else has reported that problem, and I haven't changed the files on Zarqon's server recently. Did you open up any of the data files in a text editor? That includes the user configurable ones. If you didn't edit it in plaintext strange things could happen. I'm shooting in the dark here, I really need some more output.

iamacow
09-19-2011, 12:08 PM
I got the same error, here's the context with verbosity at 3. For what it's worth, i just downloaded this script.
I'm using r9832


> call scripts\Harvest.ash

Countdown: 1 second...
Waiting completed.
main

Preparing to bring in the harvest

set_default_settings
create_data_files
file_empty
true
file_empty
true
file_empty
true
set_puttyfarming_options
set_bountyhunting_options
have_foldable
set_general_options
set_farming_options
set_rollover_options
Initialisation complete
save_prerun_settings
finished_farming
false

Getting you ready for your day

prep_for_day
closet_meat
Filling organs
fill_organs
equip_song_raiser
load_at_buff_data
at_buffs contains:
Fat Leon's Phat Loot Lyric
num_at_songs
You have 1 AT songs active
max_at_songs
You can currently hold 3 AT songs in your head
Countdown: 1 second...
Waiting completed.
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
adding favorite: rockin' wagon
adding favorite: pr0n chow mein
adding favorite: twinkly wad
Starting EatDrink.ash (version 3.1.4).
Consuming up to 14 food, 19 booze, and 15 spleen
Considering food from inventory closet Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 25000.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 1000 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
Pass 1: food.
Skipping food.
Pass 2: drink.
Skipping drink.
Pass 3: spleen.
Skipping spleen.
Pass 4: drink.
Skipping drink.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate disco ball with a value of -450. That's no good, so not consuming and moving on.
Finished.
Spent 0 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0.
Adventures: 0. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.1.4).
Consuming up to 14 food, 19 booze, and 15 spleen
Considering food from inventory closet Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 25000.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 1000 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate disco ball with a value of -450. That's no good, so not consuming and moving on.
Finished.
Spent 0 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0.
Adventures: 0. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).

finished_bountyhunting
false

Commencing bountyhunting

bountyhunt
best_hunt
Abandonned current bounty
can_access_hunt
Can access Goatlet: true
Current best_hunt is Goatlet: 40.0 turns
can_access_hunt
Can access Outskirts of The Knob: true
Current best_hunt is Outskirts of The Knob: 14.1 turns
can_access_hunt
Can access Whitey's Grove: true
Current best_hunt is Outskirts of The Knob: 14.1 turns
Accepted bounty for bloodstained briquettes, Outskirts of The Knob
equip_gear
equip_gear
have_foldable
have_foldable

- No Change -
Birthday Suit
8-Bit Finery
Antique Arms and Armor
Arrrbor Day Apparrrrrel
Black Armaments
BRICKOfig Outfit
Bugbear Costume
Cloaca-Cola Uniform
Clockwork Apparatus
Cold Comforts
Dyspepsi-Cola Uniform
Encephalic Ensemble
eXtreme Cold-Weather Gear
Filthy Hippy Disguise
Frat Boy Ensemble
Frat Warrior Fatigues
Furry Suit
Glad Bag Glad Rags
Gnauga Hides
Grass Guise
Hot and Cold Running Ninja Suit
Knight's Armor
Knob Goblin Elite Guard Uniform
Knob Goblin Harem Girl Disguise
Mining Gear
Mutant Couture
OK Lumberjack Outfit
Palmist Paraphernalia
Paperclippery
Roy Orbison Disguise
Star Garb
Swashbuckling Getup
Tapered Threads
Terrifying Clown Suit
Terrycloth Tackle
Unblemished Uniform
Vestments of the Treeslayer
War Hippy Fatigues
Wumpus-Hair Wardrobe
Yendorian Finery
[¶-1] has no matches.


Also, I just noticed that right now that the relay says:


Turns spent 207
Meat gained -1208371
Meat per adventure -5837

despite not having spent any adventures. The meat weirdness probably has something to do with closeting my meat, as that was my on-hand meat at the time.
EDIT: this fixed itself after running.


and finally, i tried turning off bounty hunting, since that seemed to be where it broke. It is running (seemingly) fine now.

Banana Lord
09-19-2011, 09:18 PM
Yes, that error is occurring while the script tries to bountyhunt (just before it begins adventuring). The output at the end is to be expected, Harvest assumes that if it gets to that point everything went well and so tries to continue as normal, the bug upstream causes weirdness downstream, if that makes sense. From what I can see it's breaking in the equip_gear function, which is odd because there's nothing too tricky happening there. Just some obvious questions to rule out basic problems: Can you confirm whether or not you have the stinky cheese and origami foldables (that's not a condition of using the script, it'd just be handy to know)? What is the name of your bountyhunting outfit? How recent is your build of mafia?

EDIT: I'm fairly sure that that output (the bit that contains a large number of outfits) would mean something to someone who knows more about mafia/ash than I do. If no-one chimes in in this thread, and we don't happen upon a solution soon, I might post it in the support forum tomorrow or the day after.

Winterbay
09-19-2011, 09:33 PM
I think that error shows up if you try to enter a negative number to a to_item() or similar function. I seem to recall some similar thing when Theraze managed to add sushis to the internal database of Mafia.

Banana Lord
09-19-2011, 10:29 PM
Well it definitely makes it to line 651 ("have_foldable("origami")"). Assuming iamacow doesn't have the origami foldable it makes it past there and down to line 660 where it finds assignment statements (not much to go wrong there) and then on to 675 with a call to outfit(). Using "outfit" as a string variable isn't likely to cause problems is it?

Deathless Assassin
09-19-2011, 11:29 PM
I've been trying this out, very well done! My one wish so far is that the script would use eyedrops to remove "On the Trail" before bounty hunting, but otherwise the integration of Bale's inventory script makes this the premier farming script.

Banana Lord
09-19-2011, 11:38 PM
Thank you! It's always nice to hear that my script's useful :-) That's a good idea, and one that should be fairly easy to implement. I'll probably post an update tomorrow or the next day.

Theraze
09-20-2011, 01:45 AM
Yeah... I considered whether or not to say anything, but... :) I got those sorts of errors when I had an item with ID of -1. There were some other things that caused it, but I think it's possible that any 'bad' item... yeah.
> ash to_int(to_item("ahoy mateys"))

Returned: -1Any non-existent item shows up as a value of -1. So the most likely possibility for getting an ID of -1, when other people aren't, is that you haven't updated to the latest version of mafia.

Banana Lord
09-20-2011, 01:57 AM
Thanks Theraze :-) It'd be good if either or both of the people who reported that issue could confirm whether or not updating to the latest daily build ('http://builds.kolmafia.us/') fixed the issue.

Theraze
09-20-2011, 02:40 AM
Hmm... since iamacow was only 1 revision off main, that's somewhat less likely... but hey, try and see if running "update clear" in the gCLI and rebooting mafia fixes it. We're long past when that should still be needed, but it's always a possibility. I suppose.

Deathless Assassin
09-20-2011, 05:41 AM
One other nicety that might already be in the pipeline is faxbot support, it would be particularly nice for bounties.

And still usage, since it's not currently supported in mafia's breakfast options.

Banana Lord
09-20-2011, 05:51 AM
More good ideas. I've added them to my todo list (which I intend to start working through in about two months). Remind me, faxbot requires the bot to have a whitelist to your clan doesn't it? That could complicate matters, as would waiting for the bot to get around to processing your request, but I'll certainly look into it.

Theraze
09-20-2011, 06:00 AM
Mr Edge has support for the still, but the script won't check if you actually have the ingredients first and skip buying them. I posted a change somewhere in that script thread that makes it check ingredients on hand... allows you to run it against your current ingredients first, and then run it against best profit later if you aren't in a fist run and want to spend meat, etc. :)

Banana Lord
09-20-2011, 06:35 AM
I wonder if Bale would be interested in adding support for auto-Stilling on-hand ingredients. It feels more like an "inventory management" than an "incidental pre-farming" activity. Can't hurt to ask.

Deathless Assassin
09-20-2011, 07:08 AM
Well, the farming bit comes in when you have none on hand, and need to determine what's optimal to buy and refine. As mentioned by Theraze the work has already been done by others in the past, you just need to find it and politely ask to steal it.

Banana Lord
09-20-2011, 07:28 AM
KK, I've asked Bale for his opinion. It he wants it in OCD then there's no point in my adding it to Harvest, and if not I'm quite happy to (politely) steal the code :D

EDIT: Bale has (understandably) declined to add that to OCD and posted a complete and optimal auto-Stilling function. Even *I'm* not lazy enough to find a way to avoid doing something when it's spoon-fed to me from a silver platter like that (yes, because doing a quick search of the forum WAS too much work), so you can expect to see an update tomorrow, assuming no bugs crop up. Unfortunately I can't do much to test the new features because I don't have Olfaction yet (will soon though, thanks to Harvest :D) or access to the Still, but I'd be surprised if there were issues (though that's kind of the point of a bug isn't it?).

lostcalpolydude
09-20-2011, 09:47 AM
Remind me, faxbot requires the bot to have a whitelist to your clan doesn't it? That could complicate matters, as would waiting for the bot to get around to processing your request, but I'll certainly look into it.
You could have the script optionally switch to Bonus Adventures From Hell to cover the clan having a fax machine and faxbot having a whitelist. The problem is that mafia's only support for faxbot is the GUI, and I don't think mafia will let you send PMs to people (the first one would go through and then mafia would block all chat commands).

Bale
09-20-2011, 09:58 AM
EDIT: Bale has (understandably) declined to add that to OCD and posted a complete and optimal auto-Stilling function. Even *I'm* not lazy enough to find a way to avoid doing something when it's spoon-fed to me from a silver platter like that (yes, because doing a quick search of the forum WAS too much work).

LoL! You make it sound like you wanted this added to OCD just to make me be the one doing the work? Thank goodness I posted my improve_spirits() function or we would both be in trouble.

Banana Lord
09-20-2011, 10:58 AM
Haha! You fell for my trap! I've been manipulating you all along! Now... If I could only enslave more scripters my goal of COMPLETE WORLD DOMINATION would be complete!

Nah, I don't mind doing the work (in fact it's probably good practice for me). Still, it IS nice to copy/paste pre-written and pre-tested code :-) I've given you a shout-out in the script ;-) Thanks again Bale!

iamacow
09-20-2011, 11:41 AM
Bountyhunting is working now, but I'm sorry to say that i was being a terrible debugger for you, I had other stuff to do this morning and was trying not to spend too much time on kol but I updated to r9833 and filled out blank boxes under bounty hunting (Made an outfit, picked a familiar/equip).
also i have a towel, but not the Mr. A origami kit

Banana Lord
09-20-2011, 11:44 AM
Filling out the boxes would certainly help ;-) Thanks for letting me know that it's all working now.

iamacow
09-20-2011, 12:21 PM
Filling out the boxes would certainly help ;-) Thanks for letting me know that it's all working now.
Haha, it can be hard to tell if scripts will let me be lazy and default to what I'm wearing or if they will hate me for not filling stuff out. Thanks for the cool script :D

Banana Lord
09-20-2011, 12:37 PM
I'd actually like to hide the options for a given section in the relay script (eg: hide bounty hunting options if Bountyhunt is not selected), but that will require me to look into CSS. Anyway, enjoy! :-)

Banana Lord
09-23-2011, 05:30 AM
Script updated with both of Deathless Assassin's requests (clearing On the Trail before bounty hunting, and making use of the Still). Thanks again Bale!

Bale
09-23-2011, 06:31 AM
You're welcome, again.

sleightmind
10-03-2011, 04:47 PM
Hey all. So I setup this harvest script and it works great. There's one thing though. I want it to run my default CCS, which I have set to cast entangling noodles, then use drunken baby style. When the bounty script runs, it casts entangling noodles, but then tries to attack with weapon instead. This sucks as I am in fistcore and do no damage that way. Can anyone tell me how to get it to use drunken baby style? Thanks!

Banana Lord
10-03-2011, 08:28 PM
Do the restrictions of fistcore end when you free the king? Are you in-run or in aftercore (I have no experience with fistcore). Harvest wasn't written with non-aftercore characters in mind, and I'm not really interested in doing a huge amount to add that support. Having said that, does anyone know of an easy way of checking to see if a character is in fistcore? It wouldn't be too hard to modify Harvest Combat. In the meantime try adding "skill Drunken Baby Style" to the bottom of your CCS (after the "consult" line). Harvest will automatically turn control over to the CCS after too many rounds of combat have passed, so as long as you can kill any monster you encounter in the limited number of rounds remaining you should be fine.

slyz
10-03-2011, 08:43 PM
You can still use the fist skills after breaking the prism, but only if your hands are empty.

Banana Lord
10-03-2011, 09:14 PM
OK, good, that simplifies things. But are you able to attack with a weapon as normal after breaking the prism?

Bale
10-03-2011, 09:27 PM
After breaking the prism, restrictions are lifted for all paths including Oxygenarian and Bees Hate You. In other words, yes.

Banana Lord
10-03-2011, 09:37 PM
Cool. Just making sure that Harvest would at least be useful for people in aftercore who have just completed a fistcore run.

sleightmind
10-04-2011, 12:32 AM
Hey thanks for the reply. So, here's my default CCS:


[ default ]
skill entangling noodles
skill drunken baby style


And here's what the script says when it runs:

Applying pre-run settings
CCS set to default
(but battle action is currently set to attack with weapon)

And here's an example of one of the bounty adventures in the session log:


[466] Fun House
Encounter: lemon-in-the-box
Round 0: sleightmind wins initiative!
Round 1: Gronald rubs its soles together, then stomps in place restlessly. Clearly, the violence it's done so far is only making it ache for some quality stomping. (Use the &quot;Release the Boots&quot; skill to let it go nuts.)
Round 1: sleightmind executes a macro!
Round 1: sleightmind casts ENTANGLING NOODLES!
Round 2: Gronald pulls it into an impromptu mosh pit, stomping it for 15 damage.
Round 2: lemon-in-the-box takes 15 damage.
Round 2: sleightmind attacks!
Round 3: lemon-in-the-box takes 1 damage.
Round 3: sleightmind attacks!
Round 4: lemon-in-the-box takes 1 damage.
Round 4: sleightmind attacks!
Round 5: lemon-in-the-box takes 1 damage.
Round 5: Gronald attempts to kickstart it. It doesn't get fully funded, but does do 19 damage.
Round 5: lemon-in-the-box takes 19 damage.
Round 5: sleightmind wins the fight!
After Battle: Gronald assumes the pli&eacute; position and bends its calf-parts in and out a few times.
You acquire an item: lemon
You gain 1 Wizardliness
You gain 6 Chutzpah

Does that make any sense? So it's casting noodles, then just attacks for 1 damage. What am I doing wrong here? Also, on the main Adventure tab in Kolmafia, I set the Action dropdown to "skill drunken baby style" and Special to "Cast noodles before simple actions". Then, if I run Harvest.ash, it sets the Action back to "attack with weapon".
Thanks for the help!

Banana Lord
10-04-2011, 01:50 AM
If Harvest changes any of your settings (like your outfit, mood, CCS or battle action) it will remember your previous setting so that it can change it back to the way it was when it finishes. It does that so that you don't have to remember to change all your settings to non-farming related options when it's done, if that makes sense (so that's why it's changing Action to attack with weapon, though it should only do that after it finishes). Are you sure you've got the correct CCS set for bounty hunting in the relay script? Just an obvious thing to check :-) Next obvious thing: As you may have noticed while writing a CCS, if mafia doesn't understand a command or you make a spelling mistake, it replaces the 'broken' line with 'attack with weapon'. Could you make sure that that isn't what's happened? Just look at your CCS out of edit mode and see if it says 'skill drunken baby style' or 'attack with weapon'.

If none of that helps, set Verbosity to 3 from the relay script and run Harvest again (you can stop it after it's finished the first combat) and paste the results (start to finish) here. Some of the output may have vanished off the top of the gCLI, in which case go to your /kolmafia/sessions folder and find the relevant part of the relevant log (they're all dated).

sleightmind
10-04-2011, 01:58 AM
So.. I think I may have fixed it, albeit heavy-handedly. I just went into the Harvest.ash script and forced the set_property("battleAction") to skill drunken baby style. I'll let it run tonight and see if that works.

Banana Lord
10-04-2011, 02:19 AM
If you changed that in the apply_prerun_settings() function it won't help you. if you changed it in the prep_for_day() function then it would have been simpler to have set your CCS to nothing (i.e.: no text) in the relay script and set action to Drunken Baby Style in mafia itself (as you were attempting to do before). Harvest won't change "battleAction" to "custom combat script" if you haven't entered anything for that setting. Of course, this won't use entangling noodles. I'm a little perplexed though, if you set your CCS up correctly, and entered the right name into the relay script then there shouldn't be any problem with Harvest using that CCS. The output you posted suggests that Harvest is indeed using the correct CCS (it casts entangling noodles, which was your first command), but that for some reason mafia isn't using drunken baby style. Do you have an up-to-date version of mafia (i.e.: latest build ('http://builds.kolmafia.us'))?

The Great Tatro
10-05-2011, 07:33 PM
I know close to nothing about scripting and programming so when I tried installing this script to automate my meat farming boy was I in for a surprise. I can't even figure out where the settings are never mind how to change them. I guess I am asking for assistance into how to do this. A PM would do nicely for anyone who could help as I can tell that this forum is about the development of this script then helping noobs like me. I would greatly appreciate any help that anybody can give.

Thanks
- Tatro

Banana Lord
10-05-2011, 10:19 PM
This forum is as much about helping people use scripts as it is about developing them, in my experience :) I'll start with the basics so please excuse me if I cover some stuff you're already familiar with. There are three types of script: Custom combat scripts (CCS), ash scripts (all end with the file type .ash), and relay ash scripts (the script name always begins with 'relay').

CCS
You can make a custom combat script very easily by going to the Adventure tab and then to the Custom Combat tab. New makes a new script, and edit makes a script editable. You can select a preexisting CCS with the drop down menu. In the case of Harvest, all you need to do with your CCS is make a new script (I suggest calling it 'meatfarming') and copy pasting the CCS from the example in the first post (those two lines are all you need to get started).

ASH
To 'install' a regular ash script you simply place it in your /kolmafia/scripts folder. Your scripts can be in any number of sub folders within this folder, for example I have a folder for all the scripts I use in aftercore: /kolmafia/scripts/aftercore. To run a script you can either type its name into the gCLI in mafia (under the graphical CLI tab) or find it in the scripts menu in mafia.

Relay
Relay scripts go in your /kolmafia/relay folder. To run a relay script you need to open the relay browser (click the map icon at the top of mafia's main window) and then find the '-run script-' drop down menu at the top of the KoL browser window that mafia opens (it's just to the left of the chat pane). Simply choose the relay script you want to run from that menu.

I think the first post provides clear enough instructions for you to go from there, but here's a quick recap. All you need to do is follow the links provided to download the scripts Harvest needs to run (these are developed by other scripters, so if you are unsure of how to set up a script other than Harvest I suggest you post your question in the script's thread, all the authors on these forums will be happy to help), and then download the three scripts attached to the first post of this thread (Harvest.ash, relay_Harvest.ash and Harvest Combat.ash) and put them in the correct folders. As I say in the first post, to set up Harvest itself and gain access to the script's settings, you just need to run the relay script (relay_Harvest.ash) from the drop down menu in the relay browser.

A small note on setting up the scripts listed under 'Requirements' in the first post: Most of these don't actually require you to do anything special to set them up (you just have to put them in the right folder so that Harvest can use them). The two exceptions to this are OCD Inventory Control.ash and eatdrink.ash (and maybe CounterChecker.ash if you have special requirements, but we'll leave that for now). Because of the amount of time it takes to set OCD up for the first time, Harvest comes preloaded with all of the data OCD needs to run (assuming you're farming the castle). You should aim to properly set OCD when you get a chance, but it'll work quite happily as is (just make sure you run relay_OCD_db_Manager.ash once before running Harvest for the first time). You should have no trouble setting eatdrink up as long as you follow the instructions in the first post of that thread (linked in the first post) carefully.

If you're still unsure of anything (or everything) post here again saying so and I'll do my best to clarify :-)

EDIT: Once you've got Harvest working and you're configuring your settings, if you're not sure what a setting does you can simply mouse over it for a description.

The Great Tatro
10-06-2011, 01:14 AM
Now that I got everything going I must say this is the most amazing thing that has happened to me since I began playing KoL. Fantastic script you have going here, it is exactly what I have been looking for. Thank you so much for you help Banana.

Banana Lord
10-06-2011, 04:38 AM
No problem! Glad you like it :-) If you want even more awesomeness try setting up Bale's amazing OCD script to deal with items that aren't specified in Harvest's default data (run the OCD relay script). Your inventory will never look the same again!

igue
10-06-2011, 01:34 PM
Hi! Ive been using this script for quite a while now and all i can say is that it works great! However, is there a way to remove a specific buff after farming? For example i want to remove Cantata so i can Cast Ode before i overdrink?

Banana Lord
10-06-2011, 01:42 PM
Are you using EatDrink? If so Harvest and ED should do that automatically for you between them. If they're not then I'd very much like to see some gCLI output so I can fix the issue. Glad you're enjoying the script :-)

igue
10-06-2011, 02:14 PM
Yes, I use Eatdrink but it doesnt remove the buff, it just fails to cast ode and drinks. >.<

Sorry for this next line, I dont know how to put it in text box.

Overdrinking
Maximizing...
310 combinations checked, best score 0.0 (FAIL)
Maximizing...
310 combinations checked, best score 0.0 (FAIL)
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Skipping favorites.
Starting EatDrink.ash (version 3.1.5).
Consuming up to 15 food, 19 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 37500.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 500 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
Pass 1: food.
Skipping food.
Pass 2: drink.
Skipping drink.
Pass 3: spleen.
Skipping spleen.
Pass 4: drink.
At drunkenness of 19. Overdrinking with 5000 meat.
Searching for "ice-cold Sir Schlitz"...
Search complete.
Searching for "ice-cold Willer"...
Search complete.
Searching for "ice-cold fotie"...
Search complete.
Searching for "bottle of vodka"...
Search complete.
Searching for "bloody mary"...
Search complete.
.
.
.
.
.
Search complete.
Waiting to consume...
perpendicular hula lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1000 own:51 value:5350
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
0: Ode to Booze price: 0 value: 2000
Casting The Ode to Booze 1 times...
Selected target has the maximum number of AT buffs already.
Drinking 1 perpendicular hula...
You gain 11 Adventures
You gain 34 Sarcasm
You gain 4 Drunkenness
Finished drinking 1 perpendicular hula.
1: perpendicular hula lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1000 own:51 value:5350
choc: Checking non-filling crimbo chocolates - all 3 kinds
Searching for "fancy but probably evil chocolate"...
Search complete.
Searching for "vitachoconutriment capsule"...
Search complete.
Searching for "chocolate cigar"...
Search complete.
Best find was chocolate disco ball with a value of -1600. That's no good, so not consuming and moving on.
Finished.
Spent 0 meat. Gained Fullness: 0. Inebriety: 4. Spleen: 0.
Adventures: 11. Muscle: 0. Moxie: 34. Mysticality: 0.

Banana Lord
10-06-2011, 08:48 PM
That's odd, I thought I'd set Harvest up to shrug an AT buff (if necessary) before running ED. I'll look into it. As for the gigantic-wall-of-text-of-doom, try using code tags [code]stuff goes here[/code*], but don't put the * in obviously.

EDIT: Amazing the difference a missing equals sign will make isn't it? :-) Try the version attached below and let me know if it works. If you're using ED and Harvest thinks you're going to want ode it will shrug the least valuable of your AT buffs (the total MP cost of all the turns you currently have of it). If all's well I'll roll an update.

igue
10-07-2011, 02:42 PM
This is great! Thanks Banana Lord!

Ill post again if everything goes well. :)

Edit:

It still doesnt shrug off the Cantata so it can cast Ode. Heres what happens.



Overdrinking
Maximizing...
310 combinations checked, best score 0.0 (FAIL)
Maximizing...
310 combinations checked, best score 0.0 (FAIL)
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Skipping favorites.
Starting EatDrink.ash (version 3.1.5).
Consuming up to 15 food, 19 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 37500.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 500 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
Pass 1: food.
Skipping food.
Pass 2: drink.
Skipping drink.
Pass 3: spleen.
Skipping spleen.
Pass 4: drink.
At drunkenness of 19. Overdrinking with 281 meat.
Getting 1 a little sump'm sump'm in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
autoBuyPriceLimit => 1243.0
Searching for "fermenting powder"...
Search complete.
Searching for "juniper berries"...
Search complete.
Searching for "olive"...
Search complete.
Searching for "little paper umbrella"...
Search complete.
Verifying ingredients for a little sump'm sump'm (1)...
Searching for "martini"...
Search complete.
Purchasing martini (1 @ 130)...
You acquire an item: martini
Purchases complete.
Creating a little sump'm sump'm (1)...
You acquire an item: a little sump'm sump'm
Successfully created a little sump'm sump'm (1)
autoBuyPriceLimit => 20000
Waiting to consume...
a little sump'm sump'm lev:4 gain:4.0 adv:12.0 musc:0.0 myst:26.0 mox:9.0 meat:995 own:1 value:5147
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
0: Ode to Booze price: 0 value: 2000
Casting The Ode to Booze 1 times...
Selected target has the maximum number of AT buffs already.
Drinking 1 a little sump'm sump'm...
You gain 10 Adventures
You gain 27 Mysteriousness
You gain a Mysticality point!
You gain 8 Chutzpah
You gain 4 Drunkenness
Finished drinking 1 a little sump'm sump'm.
1: a little sump'm sump'm lev:4 gain:4.0 adv:12.0 musc:0.0 myst:26.0 mox:9.0 meat:995 own:1 value:5147
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate disco ball with a value of -1550. That's no good, so not consuming and moving on.
Finished.
Spent 130 meat. Gained Fullness: 0. Inebriety: 4. Spleen: 0.
Adventures: 10. Muscle: 0. Moxie: 8. Mysticality: 27.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.1.5).
Consuming up to 15 food, 19 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 37500.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 500 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
At drunkenness of 19. Overdrinking with 281 meat.
0: Ode to Booze price: 0 value: 2000
1: a little sump'm sump'm lev:4 gain:4.0 adv:12.0 musc:0.0 myst:26.0 mox:9.0 meat:995 own:1 value:5147
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate disco ball with a value of -1550. That's no good, so not consuming and moving on.
Finished.
Spent 130 meat. Gained Fullness: 0. Inebriety: 4. Spleen: 0.
Adventures: 10. Muscle: 0. Moxie: 8. Mysticality: 27.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).

What other information could i provide so the problem could be traced more easily?

Banana Lord
10-16-2011, 09:10 PM
Sorry for not noticing your edit. That's annoying. I haven't got time to do anything with Harvest at the moment, but I'm planning to start work on a proper update in 2-3 weeks. Hope you can hold on until then :)

igue
10-17-2011, 12:17 PM
Sure sure. No problem! I can wait. Thank you for your time! All other stuff are working fine except that so I'll live.

Tom Sawyer
10-23-2011, 01:26 PM
BananaLord great script

had a question. It was made mention that either this script or Bale's OCD makes use of the still? Is there a setting in your script or in OCD or Eat-Drink that will make supercock drinks?

When I test ran it it never used the still so I manually went back and made 10 tonic waters.

It would seem to me that drinking supercocks would grant more turns but maybe I am overlooking something.

Cheers!

Banana Lord
10-23-2011, 05:40 PM
It will use the Still after farming in the most optimal way possible (no setting, it'll do it automatically). Drinking super cocktails might give you more adventures but probably won't be optimal because they're more expensive per adventure. EatDrink is in charge of feeding you and it does a bunch of calculations to determine your most optimal diet based on your setting for value_of_adventure (that's a mafia setting not a Harvest one, but you can change it from the relay script). Make sense?

Tom Sawyer
10-23-2011, 06:23 PM
Thanks BL

I use a modified version of izchak's castle farming script and was comparing the two

I think I will run yours for a week or so and see how optimal and cost effective the difference between the 2 ranges

Yours is certainly more configurable with relay options. Mine you have to tell specifically what to eat and drink.

All fun in spading :)

Banana Lord
10-23-2011, 06:32 PM
Sure, hope you find something that works for you :-) There'll be a largish update to Harvest in a month or so, so you might like to check back in when I'm done with that and see if any of the new stuff is to your liking.

BladeLight
10-28-2011, 03:36 AM
umm... sorry but what does followed by a tab mean?


FAQ

Can Harvest get buffs from a buffbot for me?
Open HAR_Buffbot_Buffs.txt (in your KoLmafia>Data folder) and enter the names of the effects you would like to get. Each effect must be on a separate line and must be followed by a tab.

[/LIST]

Banana Lord
10-28-2011, 03:37 AM
Just that, followed by a tab. You enter the name of the effect then push the tab key, then hit return to go to a new line should you want to add another effect.

BladeLight
10-28-2011, 04:09 AM
oh thanks, feel so stupid now...:eek:

Banana Lord
10-28-2011, 04:11 AM
Don't, that's the most un-user-friendly and confusing part of Harvest. If I could think of a way of changing it I would.

ninereal
10-30-2011, 04:54 AM
Probably a dumb question - I've done everything in the OP, but I keep getting a message that says "No matching CCS found!" What gives?

Banana Lord
10-30-2011, 05:45 AM
Check the name of the CCS you're using to farm with (mafia>Adventure>Custom Combat) and make sure it's exactly the same as the name of the CCS you have set in the Harvest relay script (under General, right at the top). That error just means that you've told Harvest to use a CCS you don't have.

ninereal
10-31-2011, 10:51 PM
Ah, got it. I had it as Harvest Combat.ash instead of .ccs. Thanks.

Banana Lord
11-01-2011, 10:01 AM
Awesome, no problem.

hello
11-01-2011, 01:55 PM
Hey, uhm, sorry for being a noob but how do I run the script? I'm at the part where it says this:

'Initialisation complete
Script setup complete. You can now configure the script's options with the relay script
Remember to click the Save button (bottom left) when you're done'

Again, sorry for being a noob

Tom Sawyer
11-01-2011, 03:32 PM
Banana Lord: Really like the power and ease of your script. Having run both mine and yours it shows how polished yours has become. It even was making more meat doing tricks I had not thought of so kudos on a great script.

However it still does not seem to want make use of the still. I have accepted the regular drinks are more economical than supercocks but I thought it would auto use the still to make tonic water to sell or such.

I went poking around in yours and found where Bale had lent you the code which is very similar to the one Izchak used which I too "borrowed" :)

You said there was no choice button to allow or disallow use of the still so it is perplexing me. The script does great, runs Eat-Drink, slaps on my meat finding gear, runs the castle, then it completes and reports how much was made ect ect. But the still is never used. I figured it could at least make tonic water which I can squirrel away or sell.

Still a great script!

Banana Lord
11-01-2011, 05:42 PM
@hello: You're most of the way there. Have you put relay_Harvest.ash in your relay folder? If so, just open the relay browser from mafia (map icon at the top left, it'll open KoL in your browser) then choose "Harvest" from the drop down box at the top right, just to the left of the chat pane.

@Tom: I'm now officially on holiday so I'll look into that properly when I get a chance (today or tomorrow). It's almost time to start work on that update I've been promising too :) The reason I didn't put a setting on for the Still is that that code runs right at the end of your day, by which time I reason that if you have spare Still there's no situation in which you wouldn't want Harvest to make use of them. If that makes sense.

coderanger
11-01-2011, 11:40 PM
Two questions:

1. Is it possible to automate rotating familiars for daily drops and/or running Boots stomps?

2. Is it possible to run other ad-hoc daily tasks (first one that comes to mind is getting a Black Heart each day)?

It seems like the answer to both is probably not currently, but if that is correct would you be interested in the patches for inclusion?

Banana Lord
11-02-2011, 05:16 AM
As far as no. 2 goes, while I'm happy to support farming related daily activities that I think ~90% of users will use I don't want to go cluttering Harvest up with too many options and functions. You could always write a script to run on login that meets your specific needs, or one that completes your daily activities and then calls Harvest. But I could see myself adding a feature whereby you could specify a script for Harvest to call after consuming but before Bounty Hunting/Farming. What do you mean by a black heart? There are a couple of items you could be referring to ;-) So yeah, in short, I'm happy to make it easier to use user-made scripts with Harvest, and I'm happy to add daily activities that make sense for the majority, but I want to avoid bloat. The familiar switching thing seems like it would be tricky to implement in that there are a bunch of options that would need to be set and catered for, and a bunch of different familiars to track.

If you've got code that can achieve either of the things you stated I'd love to see it, even if I decide not to include it (and I'm not saying I'll reject it out of hand) others might find it useful :-)

hello
11-02-2011, 05:47 AM
Thank you!

Uhm, I'm having another problem...

EatDrink.ash failed to fill your organs completely

I guess EatDrink.ash deems the spleen items not worth the price? So, how could i get around this?

Winterbay
11-02-2011, 07:42 AM
The familiar switching thing seems like it would be tricky to implement in that there are a bunch of options that would need to be set and catered for, and a bunch of different familiars to track.

If you've got code that can achieve either of the things you stated I'd love to see it, even if I decide not to include it (and I'm not saying I'll reject it out of hand) others might find it useful :-)

There is code in BBB that switches between your item-dropping familiars. You could take a look at that I guess.

Banana Lord
11-02-2011, 09:15 AM
OK, good idea. But I'm still hesitant. I don't know if it's something I want to support into the future. I'll put it on the back burner for now, as I think it's of minimal gain compared to the other stuff I'm planning. If I have the time and energy I'll look at it again, but for now I'll focus on other things (unless, that is, someone provides me with a compelling reason to add it ;))

@hello: If you're having trouble with ED you're best to post in the thread for that script, but I've run into that myself. In my case it was because I'd set my budget too low and ED was hitting its cap before it'd finished filling me up. Have a look here ('http://kolmafia.us/showthread.php?1519-EatDrink.ash-Optimize-your-daily-diet-(and-see-how-your-old-diet-stacks-up)./page122'), starting at #1212.

Tom Sawyer
11-02-2011, 12:40 PM
Banana Lord

This is a copy of Izchak's code for the still:

# this tries to use the still, improving whatever you have that can be improved
# however, it will only improve a single item, basically.
# I coded this the way I did on the assumption that one would have multiples of ten
# of several base drinks/mixers, eg. 10 lemons, 30 olives, 10 wines, etc.
boolean utilize_still(){
if(my_primestat() != $stat[moxie]) {
print("youre not a moxie class, and hence cannot use the still");
return false;
}
if(stills_available() == 0) {
print("you have no uses left at the still");
return false;
}
item [item] spirits_n_mixers;
spirits_n_mixers[ $item[grapefruit] ] = $item[tangerine];
spirits_n_mixers[ $item[lemon] ] = $item[kiwi];
spirits_n_mixers[ $item[olive] ] = $item[cocktail onion];
spirits_n_mixers[ $item[orange] ] = $item[kumquat];
spirits_n_mixers[ $item[soda water] ] = $item[tonic water];
spirits_n_mixers[ $item[strawberry] ] = $item[raspberry];
spirits_n_mixers[ $item[bottle of gin] ] = $item[bottle of Calcutta Emerald];
spirits_n_mixers[ $item[bottle of rum] ] = $item[bottle of Lieutenant Freeman];
spirits_n_mixers[ $item[bottle of tequila] ] = $item[bottle of Jorge Sinsonte];
spirits_n_mixers[ $item[bottle of vodka] ] = $item[bottle of Definit];
spirits_n_mixers[ $item[bottle of whiskey] ] = $item[bottle of Domesticated Turkey];
spirits_n_mixers[ $item[boxed wine] ] = $item[boxed champagne];

print("checking spirits, mixers, and crosby nash's still...");
foreach key in spirits_n_mixers {
if( item_amount( key ) > 0 && stills_available() > 0 && item_amount(key) >= stills_available() ) {
print( "hey, you have " + item_amount(key) + " " + key );
print( "you have " + stills_available() + " uses left at the still");
print( "making " + stills_available() + " " + spirits_n_mixers[key]);
return create(stills_available(), spirits_n_mixers[key]);
}
}
print("hmm, you didnt have much, so I made " + stills_available() + " tonic waters");
buy (stills_available(), $item[soda water]);
return create(stills_available(), $item[tonic water]);
}


I am going to mash this into your script and see if it works. Cheers!


EDIT: heh, reviewing the code I see Bale already has this in place. Damn, back to square one. I will force this to use up the still and not waste it should I forget to do so :)

Edit Edit: Went into OCD and set it to craft soda water into tonic water. Not sure if this will fly, see tomorrow

Tom Sawyer
11-05-2011, 01:49 PM
Banana Lord I finally got a solution to the still. I ended up adding cli_execute( "call still test.ash" ); to the end of your script. The Still Test ash file contains a mash of my code and some of Bale's so that it checks the market and the uses the still to produce what is the highest value and then chucks it into the store. If anyone else is having still problems this may help.

Again thanks for a kick ass script!


Edit: Heh digging around found an even better code that Bale all ready wrote for still usage and auto-selling. One needs to use a time machine to get ahead of Bale and his scripting power :)

Banana Lord
11-06-2011, 01:44 AM
Finally started work on the update and ended up sending a whole day on it :D. Implemented a handful of simple features which I'll test out after rollover. Still got a couple of bugs to track down and the buffbot code to sort out (that's the only big job, to be honest). I'm going to leave FaxBot support out of this update because there seems to be some activity around adding CLI commands to interface with the bot, so I'll hold off until that's done. So to sum up progress is being made, and much more quickly than I thought it would.

Now, Tom, regarding your question about the Still. The reason for Harvest not using it is because I am an idiot. I added the code Bale provided and completely forgot to put a function call in. How do you even do that?! Actually, don't answer that. Anyway, you can either wait for the update, or simply add "improve_spirits();" on a new line in the "finish_up()" function. Or you could just replace the whole "finish_up()" function with this one, if that's easier:


void finish_up()
{
announce(2, "finish_up");
set_property("har_current_activity", "finish");

announce(1, "Applying pre-run settings");
apply_prerun_settings();

if(have_skill($skill[rainbow gravitation]))
cast_rainbow_gravitation();

improve_spirits();

if(get_property("_har_endmeat") == "")
{
// Take WSGC into account (OCD doesn't add these to its total)
set_property("_har_endmeat", my_meat() + my_closet_meat() + item_amount($item[warm subject gift certificate]) * 450);
announce(3, "_har_endmeat set");
}
if(get_property("_har_endadventures") == "")
{
set_property("_har_endadventures", my_adventures());
announce(3, "_har_endadventures set");
}

announce(1, "Tidying your inventory");
int ocd_profit = run_ocd();
if(get_property("_har_ocd_profit") == "")
{
set_property("_har_ocd_profit", ocd_profit);
announce(3, "_har_ocd_profit set");
}

if(finished_farming() && my_inebriety() <= inebriety_limit())
{
announce(1, "Overdrinking");
overdrink();
}

equip_rollover_gear();

take_closet(my_closet_meat());

print_summary();
}

Oh please let there be nothing wrong with that function

EDIT: Oh and thanks for your praise :-) As for auto-selling Still-upgraded drinks, if you let Harvest handle it everything will be handled by OCD and the profit made will be included in your daily total.

Tom Sawyer
11-06-2011, 11:07 AM
Banana Lord

Edit: I am going to mash your update in and give a it a go. I will let you know if I catch any bugs, cheers!

Xenthes
11-07-2011, 03:49 PM
Great script Banana Lord. I just finally getting around to using it.

One request though. for the rollover option could you also add a familiar option? as part of my rollover gear I use the disembodied hand with a time sword.

Banana Lord
11-07-2011, 06:57 PM
Now that's one of those features that should already be there. But since there's only one adventure giving familiar (I don't see the hare being used for farming) and only one item you'd ever want to equip it with I'll make Harvest do it all automatically and avoid adding another cluttery option. That'll be in the next release.

EDIT: Wait. Hold the phone. I thought it was odd that I hadn't already added that feature. I have already added that feature (or more accurately it was already in some code I borrowed from BCC et al.). It should equip your hand and time sword automatically. Is it not doing that?

slyz
11-07-2011, 06:58 PM
You can simply maximize for "adv, switch Disembodied Hand".

Banana Lord
11-07-2011, 07:04 PM
The code pretty much does that already. I have a hunch that the problem was the difference between item_amount() and available_amount(). If the time sword was equipped on the hand before Harvest ran it would assume you had none in inventory and so skip both. That should be fixed now. I'm still a little unfamiliar with the maximizer, but I think this should do what I want it to, yes?


if(can_equip($item[time sword]) && have_familiar($familiar[Disembodied Hand]))
{
familiar oldFam = my_familiar();
use_familiar($familiar[Disembodied Hand]);
if(valid("time sword"))
maximize("adv -tie", false);
else
{
use_familiar(oldFam);
maximize("adv -tie -familiar", false);
}
}

EDIT: Valid() just returns true if you have and can equip an item.

slyz
11-07-2011, 07:15 PM
I'm pretty sure you can replace all that code with


maximize("adv, switch Disembodied Hand", false);

Banana Lord
11-07-2011, 07:19 PM
Hmm, seems fairly awesome. I can't test it myself as I don't have a hand and I sold my time sword a while back, but it equips my stuff perfectly. And that'll equip a time sword as well? What if the character has a hand but no time sword? Will it still equip the hand or leave the old familiar? Not that it'll make much difference in terms of rollover adventures, and I doubt there are many people who have the hand and don't have a time sword to go with it, but I like to be tidy :).

slyz
11-07-2011, 08:16 PM
It won't equip the Hand if you don't have anything that gives you +adv to go in it.

Winterbay
11-08-2011, 06:25 AM
Yeah that works just fine. I've had it in my logout script for quite some time now.

Xenthes
11-08-2011, 06:56 AM
Now that's one of those features that should already be there. But since there's only one adventure giving familiar (I don't see the hare being used for farming) and only one item you'd ever want to equip it with I'll make Harvest do it all automatically and avoid adding another cluttery option. That'll be in the next release.

EDIT: Wait. Hold the phone. I thought it was odd that I hadn't already added that feature. I have already added that feature (or more accurately it was already in some code I borrowed from BCC et al.). It should equip your hand and time sword automatically. Is it not doing that?

Did tonight. no idea why it didn't before. shrug.

Banana Lord
11-08-2011, 07:51 AM
@Winterbay: Sweet, thanks for the confirmation.

@Xenthes: Was the sword equipped to the hand when the maximizer ran? I'd guess not. I'm pretty sure I fixed the bug. For now just make sure the sword's not equipped to your fam when you run Harvest and you should be fine. Fingers crossed the update should be out some time in the next week.

Xenthes
11-08-2011, 02:53 PM
@Xenthes: Was the sword equipped to the hand when the maximizer ran? I'd guess not. I'm pretty sure I fixed the bug. For now just make sure the sword's not equipped to your fam when you run Harvest and you should be fine. Fingers crossed the update should be out some time in the next week.

It was last night since I hadn't used the hand for anything else. If I remember I will unequip the sword before I run the script and see if that changes anything.
Thanks for the quick replies and fix though. :)

slyz
11-08-2011, 04:31 PM
if(can_equip($item[time sword]) && have_familiar($familiar[Disembodied Hand]))
{
familiar oldFam = my_familiar();
use_familiar($familiar[Disembodied Hand]);
if(valid("time sword"))
maximize("adv -tie", false);
else
{
use_familiar(oldFam);
maximize("adv -tie -familiar", false);
}
}
If you don't simply want to use the maximize bit, replace the above by:


if(can_equip($item[time sword]) && available_amount($item[time sword])>0 && have_familiar($familiar[Disembodied Hand]))
{
familiar oldFam = my_familiar();
use_familiar($familiar[Disembodied Hand]);
maximize("adv -tie", false);
}


Valid() will return false when the hand is already equipped on your Disembodied Hand, whether it is your current familiar or not. available_amount() will return the correct amount, however.

unwanted
11-09-2011, 12:56 PM
Thanks for the great script- it's saved me a lot of RL time.
One thing though- is it possible to move the bounty hunting so it happens before eating, drinking and spleening? Since the 40 advs from rollover should be enough, there's no need for it to happen after and this would allow for buffs from consumption (such as beastly, mmmelon, fishy, etc) to be used for farming.

Banana Lord
11-09-2011, 10:20 PM
@Xenthes: No problem :)

@Slyz: Shouldn't that be like this? Otherwise it won't maximise unless the if statement evaluates true, and we don't need to remember oldFam at all. Or have I misunderstood something?

if(can_equip($item[time sword]) && available_amount($item[time sword])>0 && have_familiar($familiar[Disembodied Hand]))
use_familiar($familiar[Disembodied Hand]);

maximize("adv -tie", false);

@unwanted: Glad you like it, it's saved me heaps of time as well! Well... Apart from the hours I've put into making it ;). Hmm, that's possible. I'll definitely think about it, but there are a few possibilities I want to work through before I say yes.

Bale
11-09-2011, 10:58 PM
The "switch" keyword tells the maximizer to check if there is an advantage to switching to a specified familiar. The maximizer will check if you actually have that familiar and can equip anything useful on that familiar to make it worth switching. If the answer is negative then it will not switch familiars. All your additional code is unnecessary. Just do this:



maximize("adv, switch Disembodied Hand", false);

Also, adv means "adventure -tie" so having "-tie" is redundant. Yeah, it is odd that adventure and adv are not the same.

Banana Lord
11-09-2011, 11:30 PM
Thanks Bale, that made it much clearer :).

Xenthes
11-10-2011, 04:22 AM
For the testing I unequiped the time sword and equiped hodgemans whackin' stick. ran harvest and let it do its thing. when done the hand was the familiar with the time sword equiped.
w00t!

Banana Lord
11-10-2011, 09:42 AM
Great, it's nice to know I was on the right track. Happily that bug has already been removed from the development version thanks to Slyz (and Bale).

I'm trying to add disco combos (including rave combos) to Harvest Combat and I'd quite like to take advantage of the CCS combo command, but because the script works by building up a string which is eventually submitted as a macro I can't think of a way of doing this. Does anyone have any ideas?

Winterbay
11-10-2011, 10:08 AM
Doesn't the raveCombo1-6 preferences keep the names of the skills so that you could use get_property() on those in the submitted macro string? (possibly with some string manipulation first though)

Banana Lord
11-10-2011, 10:12 AM
True true, I was just trying to cut corners ;). Do you know how they're stored? As a string? Separated by what? Or as an aggregate? I haven't done the nemesis quest and am not a DB at the moment so I can't test.

Winterbay
11-10-2011, 10:14 AM
raveCombo1=Break It On Down,Pop and Lock It,Run Like the Wind
raveCombo2=Run Like the Wind,Pop and Lock It,Break It On Down
raveCombo3=Pop and Lock It,Run Like the Wind,Break It On Down
raveCombo4=Break It On Down,Run Like the Wind,Pop and Lock It
raveCombo5=Run Like the Wind,Break It On Down,Pop and Lock It
raveCombo6=Pop and Lock It,Break It On Down,Run Like the Wind


Appears to be a comma separated list.

Banana Lord
11-10-2011, 10:33 AM
Sweet, thanks.

Bale
11-10-2011, 10:41 AM
raveCombo1 Rave Concentration
raveCombo2 Rave Nirvana
raveCombo3 Rave Knockout
raveCombo4 Rave Bleeding
raveCombo5 Rave Steal
raveCombo6 Rave Substats

slyz
11-10-2011, 10:42 AM
Doesn't mafia turn any "combo whatever" CCS line into a macro?

Banana Lord
11-11-2011, 08:07 AM
@Bale: Found that on the wiki, but thanks anyway.

@Slyz: Yep, but Harvest Combat writes the macro as a buffer, so it can't use any CCS lines at all. I was hoping there'd be a way to get access to the logic mafia uses internally to turn "combo <whatever>" into a meaningful macro. That way I could just write a function and append it to the macro buffer rather than having to process the strings stored in the mafia properties.

EDIT: Does rave steal have to be used immediately after pickpocket or can it be used on any round (the wiki isn't particularly clear on that point)? Please let it be the latter.

EDIT2: Here ('http://dl.dropbox.com/u/4990751/Harvest%20Combat.ash') is a copy of Harvest Combat.ash updated with the ability to use disco and rave combos. I can't test it myself for aforementioned reasons, but hopefully some wonderful person will test it for me so I know if it works or not.

Winterbay
11-11-2011, 08:58 AM
I think you can use it whenever, but earlier is probably better since you may finish the fight without getting the combo off otherwise...

lostcalpolydude
11-11-2011, 08:59 AM
You can use rave steal any time during the fight. It can even be worth not using pickpocket if the most valuable item has a low drop rate.

Banana Lord
11-11-2011, 09:05 AM
@winterbay: Oh good catch! I forgot that the skills themselves would hurt the monster. I'll leave the combos at the end of the macro since none of the actions before then are likely to do any real damage, but I'll put the more valuable combos first.

@lost: Ugh, don't tell me that, I might feel obliged to actually calculate it :p. I think that that would add too much additional complexity to the script to be worth the effort. If Zarqon ever gets Batman finished I'll probably drop support for Harvest Combat anyway, since it'll have all of the same functionality (and then some) with even more optimality.

Banana Lord
11-14-2011, 03:50 AM
Harvest has finally made it to version 2.0!

Most noticably, the relay script has had a complete rewrite. I hope you enjoy using it as much as I enjoyed designing and making it (please forgive the code, some of it is... messy, but it was my very first experience with CSS and JS, and my second with HTML). One downside of this change is that internet explorer is not supported, even if I had the time, I simply am not interested in working through IE's many quirks and bugs. On the bright side Safari, Chrome and Firefox all work beautifully. As a quick glance at the changelog will tell you, I've added a bunch of new features (many of them suggested by helpful users like yourself :)), made a few changes and squished a couple of bugs.

Faxbot support is now my top priority. It will happen, but only once I know what direction mafia's devs are taking with regards to the bot.

In order to provide some more interesting statistics, Harvest will now record the number of turns you spent farming each day. This is mildly problematic for current users as they will be missing data for all days up until now. Harvest 2.0 will automatically update the structure of your HAR_Daily_Profit.txt data file (after saving a backup copy as HAR_Old_Profit_Data.txt) the first time you run it and in the process it will insert an estimate of the number of turns you spend a day (this is simply <turns this ascension>/<days this ascension>). If you are unhappy with this estimate you can use a text editor (plain text only) to find and replace these estimated entries with a number you think is more accurate.

It's more important than usual to make sure that when you update, you update all three scripts before running anything. Nothing horrible will happen if you don't do this (touchwood), but it'll make for a smoother transition.

Ima Felyn
11-15-2011, 04:14 AM
What do we set the Custom combat script in Harvest too? it was defaulted to "None" but harvest wont run now.

Actually scratch that I just set it to default, but now there is this issue I'm having, in the kol options > combat > my Auto-Attack* is set to a custom combat macro that I like, but every time I let Harvest run it sets it to (disabled) and doesn't execute the macro, anyway to fix this? I'd like Harvest to run with the macro I set.

Banana Lord
11-15-2011, 04:47 AM
Hmm, I never considered the case where someone didn't want to run a CCS at all (hence the not running when you don't specify one, and the changing of your battle action). I'll upload a new version sometime in the next hour, hopefully.

EDIT: Actually, never mind, I've uploaded a new version already (didn't bother bumping the version number for something so minor). You can either download that or change line 621 as follows:

Change

failure("You have not specified a custom combat script, you must do this before you can run Harvest");
to

announce(3, "No CCS specified");

Tom Sawyer
11-15-2011, 11:11 AM
Banana Lord

Once more congrats on what continues to be a great script. I took 2.0 for a drive and it seemed to work well. If I spot anything odd will post, cheers!

Ima Felyn
11-15-2011, 01:27 PM
The new version fixed it. But now I'm noticing that Harvest dumps all my money into my closet leaving me with 0 and is unable to buy stuff instead of the normal all minus 100,000, I checked the vars file and "har_gen_budget 100000" is set correctly so I dunno.

Banana Lord
11-15-2011, 07:20 PM
@Tom: Thanks very much :). I spent quite a long time on v2, including a couple of days of testing, but there's some stuff I can't test so it's always encouraging to hear that nothing went wrong!

@Ima Felyn: That's odd, I don't have that issue at all. Just to double check, copy paste this into the gCLI and tell me what it prints out: ash import<zlib.ash>; print(vars["har_gen_budget"].to_int());

EDIT: There's only one function in Harvest that could possibly be putting your meat in your closet, and I can't see how that could be malfunctioning. Humour me and try running this as well:
ash import<harvest.ash>; closet_meat(); print("My meat: "+my_meat()); print("Closet: "+my_closet_meat()); take_closet(my_closet_meat());

jwylot
11-15-2011, 08:14 PM
I love the new look of the relay settings page.....nice job :)

Banana Lord
11-15-2011, 09:00 PM
Thanks! :D It was a bit of a steep learning curve but I got there in the end!

Ima Felyn
11-16-2011, 04:05 AM
@Ima Felyn: That's odd, I don't have that issue at all. Just to double check, copy paste this into the gCLI and tell me what it prints out: ash import<zlib.ash>; print(vars["har_gen_budget"].to_int());

EDIT: There's only one function in Harvest that could possibly be putting your meat in your closet, and I can't see how that could be malfunctioning. Humour me and try running this as well:
ash import<harvest.ash>; closet_meat(); print("My meat: "+my_meat()); print("Closet: "+my_closet_meat()); take_closet(my_closet_meat());

> ash import<zlib.ash>; print(vars["har_gen_budget"].to_int());

100000
Returned: void

> ash import<harvest.ash>; closet_meat(); print("My meat: "+my_meat()); print("Closet: "+my_closet_meat()); take_closet(my_closet_meat());

My meat: 94395
Closet: 88300085
Removing meat from closet...
Returned: true

Okay I swear this was borked before, I didn't change anything but now it's seems to be working?... knocks on wood. Maybe it was a restart that fixed it.

EDIT: Okay so scratch that above, something is still borked, it worked for the character above, but then I tried a new character, and am getting this...

> > ash import<zlib.ash>; print(vars["har_gen_budget"].to_int());

Unable to invoke >

> > ash import<harvest.ash>; closet_meat(); print("My meat: "+my_meat()); print("Closet: "+my_closet_meat()); take_closet(my_closet_meat());

Unable to invoke >

It was the first time on this character to load up Harvest 2.0, first thing i did was run Harvest in the relay and saved settings, then ran Harvest. Hope those steps can lead you to the bug, not sure what else to say.

Banana Lord
11-16-2011, 04:17 AM
You could have a look in your session logs to see if you can pin point the issue. But if it's working fine now maybe there's no need. Glad it's working anyway :).

slyz
11-16-2011, 11:24 AM
Unable to invoke >
Try without the extra ">".

Theraze
11-16-2011, 02:40 PM
Yeah... you ran the wrong thing. You ran the quoted version, which includes a > to tell you that it's a command. Skip the initial >, your line should start with the ash (or ashq), not > ash.

BlanketThief
11-16-2011, 05:51 PM
Not sure if this is known, but currently the script still breaks when trying to farm with a mad hatrack (Equips the hat onto the player)

Banana Lord
11-16-2011, 08:23 PM
Thanks for that Theraze and Slyz, be sure to let us know if removing the extra character fixed the problem Felyn.

@BlanketThief: It wasn't, but I should have thought of that. It's a pretty easy fix so I've uploaded a new version of Harvest.ash (again, I won't bump the version number, but I'll include the fix in the changelog for the next update).

Ima Felyn
11-17-2011, 03:46 AM
Derp me, Slyz and Theraze are right, that extra > was the issue there. With that said it seems to be working now for all my characters, my experience using Harvest 2.0 on a character for the first time seems to still bug out, as in all meat going to closet leaving you with 0, having to manually remove 100k to continue, but some magic happens the next day because everything ends up just working, I don't know if its just a restart of Mafia or computer reboot that fixes it, and now I'm all out of characters who haven't ran Harvest 2.0 now so I can't invoke this bug anymore.

Banana Lord
11-17-2011, 05:12 AM
I was reasonably thorough when I tested 2.0. I made a fresh account on my computer, installed mafia and all relevant scripts from scratch (I didn't even cheat and write a script to do the set up automatically) and then ran Harvest on a KoL account which I've never used Harvest with before. It goes without saying that I didn't see this issue. I also tested the upgrade process by running 2.0 on an account which had previously been using the old version of Harvest, again without seeing this issue. The setting that remembers your budget is only accessed twice in all three scripts. There is only one function that puts meat in your closet and it is called only once in Harvest (it's a pretty basic function too). Also it would seem that no-one else has run into this issue.

I'm not saying that you're wrong or that you're imagining the problem, I'm just saying that there are very few ways in which Harvest could stuff this up and I can't see how the issue you're reporting could occur. The main thing is that the script is working for you now. If someone else has a similar issue then we'll know for sure that there's something untoward going on.

Ioeth
11-17-2011, 01:59 PM
First of all, great script! I really appreciate the addition of duck hunting with version 2.0. I do have a question about it, though. I completed the farm subquest in hippy fatigues, so I can hunt 10 ducks a day now, but Harvest only does 5. Is there some way I can get it to hunt the correct number of ducks, or hunt ducks until it isn't allowed anymore? I also had a question about the automatic buffbot request for Ode...is there any configuration required to get that set up? Thanks again!

Banana Lord
11-17-2011, 07:17 PM
No problem, thanks for the compliment :).

Aha! It seems I misunderstood how mafia tracks side-quest completion. Just to make sure I've got it sorted, could you paste the following into the gCLI and tell me what it prints out? get sidequestFarmCompleted

As for auto-oding, Harvest will figure out if you need that and do it all for you (or at least it should ;)).

Ioeth
11-17-2011, 08:06 PM
> get sidequestFarmCompleted
none

This may be because when I completed the Farm sidequest I wasn't using KoLmafia, so it might not have the right value set.

Banana Lord
11-17-2011, 08:22 PM
Yep, that'll cause you some problems ;). Even if Harvest had been working properly it wouldn't have known that you could fight 10 ducks rather than 5.

I'm assuming that the correct value for that setting would be "hippy", could someone who knows confirm that?

Once I know for sure what the value should be I'll upload a fixed version of Harvest and give you something to paste into the gCLI to fix that setting.

Ioeth
11-17-2011, 08:42 PM
Heh, so I helped you find a bug by reporting something that ultimately would have been my own problem anyway? Nice. :D

Bale
11-17-2011, 09:47 PM
Yep, that'll cause you some problems ;). Even if Harvest had been working properly it wouldn't have known that you could fight 10 ducks rather than 5.

You could just always hunt 10 ducks. It won't hurt anything as long as you capture the return value from adventure() when it fails at the 6th.

Banana Lord
11-17-2011, 11:07 PM
True true, but I figured I might as well make use of mafia's properties. Mind you, it would make a difference in this situation. I'll think about it.

Ioeth
11-18-2011, 10:59 AM
If you do take Bale's suggestion, it'll actually need to try to hunt 15 ducks, since that's how many are at the farm if you finish it as a frat.

Ioeth
11-18-2011, 02:11 PM
I'm assuming that the correct value for that setting would be "hippy", could someone who knows confirm that?

"none", "hippy" and "fratboy" are the three values for that setting, which correspond to 5, 10 and 15 ducks per day, respectively.

Ioeth
11-18-2011, 02:35 PM
As for auto-oding, Harvest will figure out if you need that and do it all for you (or at least it should ;)).

Seems like there might be a problem with that, too. I just had this happen:


...
Overdrinking
Maximizing (1st time may take a while)...
64 combinations checked, best score 0.0 (FAIL)
Maximizing...
64 combinations checked, best score 0.0 (FAIL)
Shrugging off your buff...
Fat Leon's Phat Loot Lyric removed.
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Skipping favorites.
Starting EatDrink.ash (version 3.1.5).
Consuming up to 15 food, 19 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
...

Shrugs off Fat Leon's, but doesn't appear to make any attempt to Ode me before passing off to EatDrink.ash.

Theraze
11-18-2011, 05:38 PM
Actually, that's the way it should work... EatDrink should automatically cast ode after acquiring booze, so-as not to waste turns of ode crafting food/booze if you don't have free crafting...

Winterbay
11-18-2011, 05:41 PM
Actually, that's the way it should work... EatDrink should automatically cast ode after acquiring booze, so-as not to waste turns of ode crafting food/booze if you don't have free crafting...

But it does not try to acquire the buff from a buffbot which was the point here. If you don't have the skill permed then eatdrink makes no attempt to get the buff by alternate means.

Banana Lord
11-18-2011, 08:06 PM
OK, hopefully the version attached to this post will fix both those issues. I'd appreciate it if you could set Verbosity to 3 from the relay script before you test it out and then let me know how it runs. If it still doesn't work at least I'll have a better idea of what to fix.

Regarding duck hunting: You may already know, but you can set that setting manually by typing this into the gCLI set sidequestFarmCompleted=hippy After that you can do a quick check to make sure Harvest's worked out how many ducks it should be fighting by putting this in the gCLI: ash import<harvest.ash>; num_ducks();

Regarding Ode: I've moved a few things around and have hopefully fixed that bug. I haven't had time to do proper testing, but hopefully everything works as it should.

Theraze
11-18-2011, 08:07 PM
True, true... suppose that Harvest should check if the character has it permed (and at least 50 max mp) before handing control over.

Banana Lord
11-18-2011, 08:12 PM
It doesn't check if it has it permed, but it does check if you have the skill (fine distinction, but an important one). The issue was, I think, that Harvest would work out that a character needed to get ode from a buffbot, shrug a buff to make room accordingly then call request_buff(). But request_buff() was designed for getting buffs like polka of plenty (of which you ideally want a number of turns equal to your remaining adventures), not buffs like ode of which you only want a limited number of turns. Anyway, I've overloaded request_buff() to make it possible to define a number of turns to get rather than letting it figure it out on its own. There were a couple of other things, but they were of a similar nature. Now... Let's see if it actually works!

slyz
11-18-2011, 08:45 PM
You would have to check, but I think most buffbots give only 20 or 25 turns of Ode.

Ioeth
11-18-2011, 09:21 PM
> ash import<harvest.ash>; num_ducks()
Returned: 10

Looks like that's working well with that update above. I've set Harvest's verbosity to 3 and will not interfere at all with its operation tomorrow to see if everything works as expected.

Banana Lord
11-19-2011, 12:27 AM
Buffy's the first bot Harvest requests buffs from (because of the way the alphabet works ;)), and it'll give as many turns as you ask for (until you exceed your daily MP limit). But yeah, the other bots tend to give fewer turns, but that's not a problem as Harvest will just move on to another bot if it needs more turns. That said, I can't imagine anyone needing more than 20 turns of ode at a time.

EDIT: To clarify: The greatest number of turns of Ode Harvest will ever try to get is 19 (your inebriety_limit()).

Theraze
11-19-2011, 06:58 AM
But if you craft supercocks w/o Inigo or Bartenders, that's 2 turns of ode gone per cocktail. 4 of those will burn down 8 turns of ode... If you're using fancy cooking, each of those will decrement your ode as well... As such, if you're making your own fancy food and drinks w/o helpers and buying ode at the start, figure on needing 30 turns or more fairly often.

Banana Lord
11-21-2011, 10:41 PM
Hmm, I didn't think of that. So you'd recommend 30 turns for initial organ filling and how many for overdrinking?

Theraze
11-22-2011, 12:38 AM
I'd probably check if they have access to crafting fancy food or drinks and if so, increase turns of ode by 5 for each (pastamastery and advanced cocktailcrafting) if they don't have mall access on (or it isn't currently available). If they've allowed access to the mall, it will almost certainly be cheaper to buy something than anything that can be made, so it won't use up any turns. If they have a chef or bartender, or Inigo currently active at the time when you're requesting the buff, then you don't need to add the 5 or 10.

Or, if you want to do it fast... yeah, 30 should be good. It's overkill for 95% of people, since if you're actively farming in aftercore you'll probably allow at least a bit of mall access, but it will avoid the "WTF?! Why did you only get me 10 rounds of Ode? Don't you know I have 19 liver?!" confused people.

Ioeth
11-22-2011, 01:56 PM
OK, hopefully the version attached to this post will fix both those issues. I'd appreciate it if you could set Verbosity to 3 from the relay script before you test it out and then let me know how it runs. If it still doesn't work at least I'll have a better idea of what to fix.

Everything has been working great for me since this update above. Thanks, Banana Lord!

Banana Lord
11-23-2011, 01:09 AM
Harvest updated! Version 2.0.1 fixes a couple of bugs and introduces automatic dolphin whistling. If you are sea farming and your dolphin counter is up and the last item stolen was worth more than the price of a sand dollar or dolphin whistle (whichever is cheaper) Harvest will acquire and use a whistle. This feature is currently automatic (there's no option to turn it on or off) and will occur before Zarqon's Best Between Battle script is called, preempting its dolphin whistling feature. I don't use BBB, but if this behaviour annoys you please post here saying so and I'll look at adding an option for it.

@Theraze: I decided to just leave it at inebriety_limit() for now. If someone complains I'll think about changing it, but like you said, it's not going to be an issue for most people.

@Ioeth: Thanks for that, you've been a very helpful bug-reporter :).

EDIT: Heh, obviously not many people are farming with Olfaction, looks like I broke that feature when I updated to 2.0. I only just noticed because I made it to 200 lucre today and finally got to test that code out. I'll test the patched code for a couple of days then roll the update.

Galanodel
11-29-2011, 01:39 AM
Quick bug report: seems there is an error with disco combos. When I have them enabled, I get the following error:

Begin index 0 greater than end index -1 (Harvest Combat.ash, line 220)

Banana Lord
11-29-2011, 05:33 AM
Bugger. I was really hoping I wouldn't have to debug that >_<. But thanks for your report :). The first thing I'll get you to do is set Verbosity to 3 (relay script) and try out the version of Harvest Combat attached to this post.

EDIT: Actually... I think I know already. I've tweaked the version of Harvest Combat attached to this script. Fingers crossed it works (still run it with verbosity set to 3, just in case I need to do some more debugging). Thanks! :)

eegee
11-29-2011, 06:30 PM
I have some requests/suggestions:

Could you please lift the "Clan VIP Lounge key" requirement for getting a buff from the hatter?
When 'Finishing up for the day', is it possible to either include using free fights (such a clubbing seals) or to allow calling a script so can I automate that?
Would it be possible to include using other once-a-day actions (such as ballpit, buying chips, and Legendary Beat) before starting to farm?
Could you add duck hunting to the combat CSS so that it uses the hobo monkey's stealing macro?


p.s. Thanks for the awesome script. I just tried it out today.

Banana Lord
11-29-2011, 08:34 PM
Could you please lift the "Clan VIP Lounge key" requirement for getting a buff from the hatter?
Yes.

When 'Finishing up for the day', is it possible to either include using free fights (such a clubbing seals) or to allow calling a script so can I automate that?
I'll allow calling a script.

Would it be possible to include using other once-a-day actions (such as ballpit, buying chips, and Legendary Beat) before starting to farm?
What is the benefit of using the ball pit to farming? If you're too low level it might be more profitable to just level up first. What do you mean by "buying chips"? I'll add using the legendary beat.

Could you add duck hunting to the combat CSS so that it uses the hobo monkey's stealing macro?
Will do.

Thanks for your suggestions (and compliment)! :)

eegee
11-30-2011, 01:50 PM
What is the benefit of using the ball pit to farming? If you're too low level it might be more profitable to just level up first. What do you mean by "buying chips"? I'll add using the legendary beat.
Now that you mention it, I've just realised that the jumping in the ball pit and buying chips from Snack Machine in clan rumpus room wasn't actually useful for farming. I was needlessly calling them.


Thanks for your suggestions (and compliment)! :)
..and thank you for such a friendly response :D

Banana Lord
12-01-2011, 09:27 AM
Harvest updated! A few bug fixes and eegee's requests implemented. All three scripts have been updated. Since I can't test a lot of the stuff I've just done there'll probably be a couple of things to fix, so thanks for your help and patience :). Aside from minor fixes and modifications this'll probably be the last update to Harvest for a while, I'm back to being busy.


and thank you for such a friendly response :D
We could do this all day :D.

Galanodel
12-01-2011, 04:26 PM
So, Mr. Banana Lord, I tried both your updated combat script you posted just a few posts ago, and your newly updated one on the front page. While it doesn't not give off errors, it doesn't use the combos sadly. Also, it has stopped using my putty to putty bounty monsters as well :-(.

I will turn on verbosity level 3 when I farm tomorrow for you.

Edit: Also, how do I use the OCD inventory control part of your script? I don't see any data in the inventory control relay, and it isn't selling the farmed items everyday it seems.

Banana Lord
12-01-2011, 06:10 PM
OK, thanks for letting me know. I'll take a look at the script in a moment.

If you're farming the castle it should pass data for any items you come across on to OCD (won't show up in the relay script, but should still sell the items). Otherwise you'll have to set the data yourself. Do you have the "Use default OCD Data" setting checked?

EDIT: Just a couple of obvious questions for you Galanodel: Are you a DB? Do you have "Use disco combos" checked? Could you put this in the CLI and tell me what it prints out?
ashq import<zlib.ash>; print(vars["har_farming_disco_combos"]);

I'm not sure about the putty/bountyhunting thing. I didn't change any of the relevant code, or so I thought. Are you absolutely sure Harvest isn't behaving the way it should?

EDIT2: Here's another version of Harvest Combat to try. It's exactly the same as the one in the first post, I've just added a bunch of level 3 verbosity comments which might help.

EDIT3: Regarding OCD, does Harvest call OCD at all? What's the output after "Tidying your inventory"?

Galanodel
12-02-2011, 08:31 PM
So, I have a heap-load of bugs for you. Here is a section from my farming in the castle, with disco combos turned on and verbosity set to 3
Visit to Beanstalk: Giant's Castle in progress...

[47766] Giant's Castle
Encounter: Procrastination Giant
Strategy: attack with weapon
Round 0: Lilinmall wins initiative!
Round 1: Lilinmall executes a macro!
Round 1: Lilinmall tries to steal an item!
You acquire an item: procrastination potion
You gain 89 Meat.
Round 2: Lilinmall attacks!
Round 3: Lilinmall wins the fight!
You gain 1357 Meat
You gain 4 Muscleboundness
You gain 6 Enchantedness
You gain 24 Chutzpah

finished_farming
false
prep_for_adventure
file_empty
is_underwater

Visit to Beanstalk: Giant's Castle in progress...

[47767] Giant's Castle
Encounter: Raver Giant
Strategy: attack with weapon
Round 0: Lilinmall wins initiative!
Round 1: Lilinmall executes a macro!
Round 1: Lilinmall tries to steal an item!
You acquire an item: Mick's IcyVapoHotness Rub
Round 2: Lilinmall attacks!
You gain 58 Meat.
Round 3: Lilinmall wins the fight!
You gain 1389 Meat
You acquire an item: Angry Farmer candy
You gain 7 Strongness
You gain 11 Wizardliness
You gain 19 Cheek

It then errored out about here 30 combats later. Here is the last one:


Visit to Beanstalk: Giant's Castle in progress...

[47800] Giant's Castle
Encounter: Alphabet Giant
Strategy: C:\Users\Galanodel\Documents\KOL Mafia\ccs\default.ccs [default]
Round 0: Lilinmall wins initiative!
Checking for updates (running Harvest Combat ver. 1.2.1)...
Running Harvest Combat version: 1.2.1 (current)
_har_nemesis_completed => true
Beginning farming...
db combos
Beginning db combos...
can_dnirvana: true
can_dconcentration: true
can_rave: true
combo: concentration
first_comma: -1
last_comma: -1
the_skills: Pop and Lock It,Run Like the Wind,Break It On Down
Begin index 0 greater than end index -1 (Harvest Combat.ash, line 268)
Round 1: Lilinmall attacks!
Round 2: Lilinmall wins the fight!
You gain 895 Meat
You gain 13 Muscleboundness
You gain 8 Wizardliness
You gain 19 Cheek

I am going to try the updated harvest combat from the front page to see if it works.

Negatory, same bug :(

I've swapped over to using Smart Stasis for now, so I can finish the day and see if it is calling the OCD script.

Last, but not least, here is the dump from the OCD section:


All item information is corrupted or missing. Whoooah! I hope you didn't lose any data...
Putting on filthy knitted dread sack...
Equipment changed.
Wielding bottle-rocket crossbow...
Equipment changed.
Holding Bag o' Tricks...
Equipment changed.
Putting on duct tape shirt...
Equipment changed.
Putting on filthy corduroys...
Equipment changed.
Putting on Uncle Hobo's belt...
Equipment changed.
Putting on stinky cheese eye...
Equipment changed.
Putting on monster bait...
Equipment changed.

Looks like OCD wasn't able to sell anything. Make sure you've set up OCD properly
_har_ocd_profit => -1
_har_endmeat => 8591557
_har_endadventures => 47981
finished_farming

I can verify I have run the OCD manager from the relay, as instructed on the front page.

Banana Lord
12-03-2011, 12:55 AM
That's very odd. And it's strange that no-one else has posted with the same errors. If the script was as broken as it appears from your post I'd expect other people to have been affected too. Is "Use default OCD data" ticked? Hmm. Actually... One other thing. Go to /kolmafia/data/OCDdata_HAR_Default.txt and confirm that the file is a) there, and b) has data in it. I seem to remember someone mentioning that Zarqon's Map Manager was in need of fixing (and that it has since been fixed). I didn't pay much attention because I'm quite busy at the moment, but maybe that was part of the problem?

Have you specified a CCS? No typos in the name?

Paste this into the CLI and tell me what it prints out: ashq for p from 1 to 6 print(get_property("raveCombo"+p));

Would you mind uploading the log from that day here please (/kolmafia/sessions/)? I'll try and take a look at it.

One last thing, try using [CODE] tags instead of [QUOTE] ones when you're pasting large amounts of text, it keeps everything neat and tidy :).

Galanodel
12-03-2011, 01:45 AM
That file is indeed missing sadly.

Here is the pasta from the command you gave me:

> ashq for p from 1 to 6 print(get_property("raveCombo"+p))

Pop and Lock It,Run Like the Wind,Break It On Down

Break It On Down,Pop and Lock It,Run Like the Wind
Break It On Down,Run Like the Wind,Pop and Lock It
Pop and Lock It,Break It On Down,Run Like the Wind

Here is the log from that day as well.

Banana Lord
12-03-2011, 09:05 AM
Don't be sad! That's brilliant news! It means that Harvest (probably) isn't broken. You were just unfortunate that you tried to set Harvest up when you did. Go to /kolmafia/data/zversions.txt and delete any lines beginning with "map_har_" or "map_OCDdata_HAR_". The next time you run Harvest it should download a new version of the associated data files. After you've done that, including running Harvest (doesn't matter if you're out of adventures/drunk, just run it anyway), go into your data folder and give me the filenames of the Harvest data files you find there (they all begin with "HAR_", apart from "OCDdata_HAR_Default.txt").

Are you sure that that is the entire log for the correct day (and that on that day you had verbosity set to 3)? I don't see anything that suggests you ran Harvest at all on that day (in fact the word "Harvest" doesn't occur even once), nor do I see any post-farming activities taking place in that log. And could you confirm that in Mafia's Preferences>Session Logs window every option is ticked except for "Log adventures left instead of adventures used"?

I suspect that disco combos are still broken (though if anyone else can let me know if they're working for them or not I'd appreciate it), but the rest of the script should work a lot better once you have the data files you need :D.

Galanodel
12-03-2011, 06:27 PM
So, I followed your instructions, and deleted the lines. It downloaded the following data files:

HAR bounty data
HAR buffbot buffs
HAR Buffbot info
HAR daily profit
HAR Effects to remove
HAR old daily profit
HAR options

I don't have the OCD data har default file though :(

I may have attached the wrong day. I will attach todays, after it runs. I disabled disco combos for the moment.

and yeah, I attached the wrong day. I have today's right though!

Banana Lord
12-04-2011, 05:18 AM
Huh. Well that is odd. Looks like I accidentally deleted some code. You're quite right about the OCD data file not downloading.

You'll notice that during duck hunting Harvest Combat doesn't correctly stop statsising with your monkey and end the combat. That's because you're using the SBIP. I'm not sure why you're doing that, but I'll change the phrase to match in the combat macro to avoid that issue.

Hah. Made a stupid mistake in the disco combo section. Hopefully that's that problem sorted.

Attached is a new version of Harvest. Because I can't test this stuff I don't want to release it until I can confirm that it works. So tomorrow would you mind doing again what you did today? Verbosity 3, run Harvest, post the log?

Ioeth
12-04-2011, 02:43 PM
It seems that there might be a bug in the buffbot functionality. Harvest seems to consider everything in har_buffbot_buffs.txt to be an AT buff, even if they are not. For instance, when I put my 3 AT buffs plus empathy in the file, it complains that there are more AT buffs specified than I can currently fit in my head. Empathy, of course, is not an AT buff, though.

Banana Lord
12-04-2011, 06:43 PM
Yep, eegee already caught that one. It'll be in the next update, I'm just holding off releasing it until I know if the bugs Galanodel reported have been fixed. Perhaps as a temporary workaround you could get a large number of turns from buffy ('http://kol.obeliks.de/buffbot/') manually? Then you wouldn't have to worry about getting more each day. Sorry for the inconvenience, hopefully it'll all be back up and running smoothly in a few days.

Galanodel
12-04-2011, 10:33 PM
Here is the log from today. Had to solve a quick bug in my own choice advs, as I hadn't told it what to do in the spooky forest by default. I also got stuck in an infinite loop briefly while trying to use my spooky sheet, but I knew refreshing my items would solve that error. Also, I still couldn't turn on disco combos, I assume because you didn't put out the updated Harvest combat yet. Glad to help overall btw, let me know if I can do something else to make the script even better!

Banana Lord
12-04-2011, 10:46 PM
Oh, my mistake. I meant to include that in the post. I'll get you to try out the new version of Harvest Combat before I post it, but there's no need to post the log this time unless something doesn't work properly. Thanks!

Galanodel
12-05-2011, 03:05 AM
May I offer a suggestion Banna? Increment a counter on how many times the putty is used, instead of just relying on Mafia auto-updating. Mine isn't picking up that it has been used the last time, and gets stuck in a loop until I refresh the items manually.

Banana Lord
12-05-2011, 03:25 AM
Better yet I'll capture the return value of use() and attempt to refresh automatically if something goes wrong. What method are you using to refresh the items? Typing "refresh" in the gCLI? It sounds like a bug with mafia, might be worth filing a bug report (just be polite and precise and Veracity won't vaporise either of us :D).

slyz
12-05-2011, 11:03 AM
Mine isn't picking up that it has been used the last time, and gets stuck in a loop until I refresh the items manually.
Could you create a bug report explaining what happens and how you fix it?

Galanodel
12-05-2011, 06:15 PM
What happens is that when the item is used that last time, Mafia doesn't consume it properly, so it believes that it still has a spooky putty monster when in fact it doesn't. To fix it, I open up my items window, and hit the refresh button in the lower right hand corner. I'll file a bug report tomorrow, after I verify exactly where it occurs.

EDIT: So, today, the bounty was giants. Bug report will have to be tomorrow :D

bugmenot2
12-06-2011, 04:51 AM
Minor request:: could you capitalize the import of EatDrink.ash ? It is eatdrink.ash in the script, and as a linux user the script fails unless I edit that line or change the capitalization of EatDrink

Banana Lord
12-06-2011, 05:07 AM
Someone else reported that bug about ED's listing in Harvest's settings. I should have changed it for the import as well. It'll be in the next release (out soon, hopefully).

Arundel
12-07-2011, 11:51 AM
First off, I love your script. It is outstanding. I now have the patience for lucre.

I am having a problem on one of my multis though, it keeps telling me I have failed to select a bounty. It runs great on the other characters, but fails on this one everytime. This is my verbosity 3 log:


main
set_default_settings
create_data_files
file_empty
file_empty
set_general_options
hatter_hat
set_puttyfarming_options
set_bountyhunting_options
have_foldable
set_duckhunting_options
have_foldable
set_farming_options
have_foldable
set_rollover_options

Preparing to bring in the harvest

initialise
Initialising
har_current_activity => prefarm
update_profit_datafile
Profit file already updated
closet_meat
save_prerun_settings
set_ccs
No CCS specified
finished_farming
false
finished_bountyhunting
bountyhunt

Commencing bountyhunting

har_current_activity => bountyhunt
best_hunt
can_access_hunt
Can access Haunted Wine Cellar (automatic): true
can_access_hunt
Can access Sleazy Back Alley: true
can_access_hunt
Can access South of the Border: true
apply_prerun_settings
CCS set to Pastalord
(but battle action is currently set to attack with weapon)
You failed to select a bounty

What am I doing wrong? Thoughts?

Banana Lord
12-07-2011, 05:44 PM
No problem! I had the same problem, as it happens (not wanting to do lucre manually, and not being able to find a script that made it easy to do). I only just recently got olfaction - Thanks to Harvest :).

Have you set a farming location? Even if farming was disabled, leaving that field blank would probably stuff up the bounty hunting code (I really should fix that, in fact, I think I'll add it to my todo list). I hope that's the problem anyway, if not, I'm stumped for now.

EDIT: Oh and thanks for posting a log with Verbosity set to 3, makes it much easier to bug-hunt :).

EDIT2: Realised that I wasn't making any sense, probably from a combination lack of sleep and sickness. Post fixed.

EDIT3: Went ahead and made that change. Hopefully I didn't break something else... :D. The workaround for you would be to leave Farming disabled but enter a location (any location) in the Farming Location field (if that is indeed the problem, as I said, if not, I'm stumped). I'll roll the update as soon as I hear back from Galanodel about the disco combo functionality.

Galanodel
12-07-2011, 09:10 PM
I am so sorry! I thought I posted to let you know, The DB combos are working like a charm now. The script takes about an hour to run, but thats normal.

Banana Lord
12-07-2011, 09:23 PM
Harvest and Harvest Combat updated! Bug fixes abound!

No problem Galanodel! Thanks for being a good bug-tester :).


The script takes about an hour to run
Hehe, the place I'm staying at has a fibre 'net connection :D. SO FAST! Maybe where you live you have a fibre connection already, but I'm used to 200kB/s. I've hit 6MB/s here. Harvest burns though my adventures super fast ;).

EDIT: You could speed it up by changing your settings so that ED doesn't update consumable prices so often, but I'd recommend posting in the ED thread to find the best way to do that for your needs.

EDIT2: Hey, does the screenshot in the first post look slightly blurry to anyone else? The original image ('http://dl.dropbox.com/u/4990751/Harvest%20Screenshot.png') certainly isn't. Anyone know how I can fix it?