Modern castlefarming script

I was just nosing around the new version looking for new ideas for my own scripts when I noticed the ode to booze part. When self casting ode the script tests for 50MP, then fails gracefully if you don't have enough MP. I think that was what my outdated icy peak farming script did too, but now I have learned that most of the time if you have access to the mysticality guild, then using boolean restore_mp( 50 ) is worth the meat it costs to cast ode. restore_mp uses kolmafia's internal logic to restore mp regardless of the user defined settings. Casting of ode was one of the reasons I requested the function be added, and work regardless (I don't like turning MP auto-restore).

Alternately the buffbot requesting code could execute if the self cast fails if the function were re-written in this way:

Code:
boolean get_ode(int count) {
	int iterations;
	# if you got the skill, cast it, damnit!
	if(have_skill($skill[The Ode To Booze])) {
		if(have_effect($effect[Ode To Booze]) < 1) {
			# must add MP testing here
			if(my_mp() < 50) {
				print("not enough MP to cast Ode!");
				//return false; don't return false, let the buffbot code pick it up.
			}
			use_skill(1, $skill[The Ode To Booze]);
			return true;
		}
	}
        //else  //remove else and let the buffbot code run if we get to it
        //{
	# lets try get it from a buffbot
	if (get_ode_from_buffbot("Testudinata", count) ) return true; 
	if (get_ode_from_buffbot("The Professor", count) ) return true; 
	if (get_ode_from_buffbot("Iocainebot", count) ) return true;
        //} 
	# if we get here, something has gone wrong
	return false;
}

Just an idea for improvement which I thought you might like. I have 5 more level 30 runs to complete before returning to the castle, and by then I might be so addicted to the gallery that I may not return to the castle.
 

izchak

Member
Ooh, thanks, elfi!

I'll incorporate those changes ASAP, and post up a new version of the script. I've also tweaked the clover getting process to be more efficient (by stealing someones kiss_clovers_in_stock function), so its due for a minor update anyway.

As for the gallery farming, you might be excited to know I have a level 30 (on the cheap!) script that I am currently using. Its unsuitable for public consumption right now, as its biased towards muscle classes, eating herb brownies, and drinking white canadians, but its definitely possible to tweak it out for more general use. I'm almost done with one L30 run, so I'll start modding it for public use when I start my next level 30 run. If you want, I can PM you a private copy of it, and you can fiddle with it now ;)
 
Certainly sounds interesting, and definitely something I would want to look at. I can see that you have put a lot of thought into the castle farming script, and thought of a lot of things I wouldn't have.
 

Le Canard

New member
it tells me "request rejected: use 'csend' to make a buff request"

how does one fix this error?

on another note, would it be possible to tweak it so that if you run into an error and need to restart the script, it starts from where it left off, not from the beginning? not only is it a waste of meat to buy drinks/drink ingredients more then once, its also time consuming.
 

izchak

Member
Yeah, mafia now requires us to use csend for philanthropic buff requests. When the change was released, I encountered the error, fixed it in my personal scripts, and continued oblivious. I did, however, recently release a new updated version of my script, which uses csend instead, so it works.
However, if you're bent on sticking with the old version, I can tell you which bits you will need to alter. I dont have the exact linenumber, but I know which function it is in.
Its under the get_ode_from_buffbot() function, the lines should be something similar to this:
Code:
		if (count == 1)
			cli_execute("send " + first_hit  + " meat to " + buffbot);
		if (count == 2)
			cli_execute("send " + second_hit + " meat to " + buffbot);
It may not be identical to this, but it should be roughly similar. I dont have the old version anymore, and I'm not exactly using subversion for this ;) (Maybe I should move to that new subversion-y version of ext3 file system I read about)
Anyways, just change the 'send' bits to 'csend', like so:
Code:
		if (count == 1)
			cli_execute("csend " + first_hit  + " meat to " + buffbot);
		if (count == 2)
			cli_execute("csend " + second_hit + " meat to " + buffbot);
Pretty simple, eh?

As for better error control, I guess I should implement that. When that happens to me, I just kinda comment out the unappropriate bits in 'void main'...
 

hippymon

Member
Not sure if it has been said, but about the "collectors.txt" You might want to remove that...

plot hole 974990 175 <<<--- Nothing wrong with that.
chaos butterfly 652201 200 <<<--- "No longer paying 200 meat each for Chaos Butterflies.. msg me before you send trade plz.."
angry farmer candy 676679 140 <<<---Rubiel (#676679), the Level 35 Disco Bandit (Disabled)
awful poetry journal 676679 150 \/
disturbing fanfic 676679 150 \/
furry fur 676679 135 \/
Original G 676679 150 \/
procrastination potion 676679 150 \/
thin black candle 676679 145 <<<<--- \/
 

izchak

Member
He's been disabled? Wow, no wonder he hasn't replied to my trade offers...
I'm beginning to wonder if this whole 'saving stuff for collectors, for increased profits' malarkey is worth it!
I think I just need to be a bit more stringent with finding collectors. Like, only use collectors who appear to be 'lifelong' collectors of said item. Like how Hellion is a lifelong collector of hellion cubes, and thePlotHole is a lifelong collector of plot holes.
 
[quote author=izchak link=topic=801.msg4596#msg4596 date=1179567409]
He's been disabled? Wow, no wonder he hasn't replied to my trade offers...
I'm beginning to wonder if this whole 'saving stuff for collectors, for increased profits' malarkey is worth it!
I think I just need to be a bit more stringent with finding collectors. Like, only use collectors who appear to be 'lifelong' collectors of said item. Like how Hellion is a lifelong collector of hellion cubes, and thePlotHole is a lifelong collector of plot holes.
[/quote]

Don't forget I am a lifelong collector of those lovely sewer items!!! Since I started collecting I have not stopped. What would I do with all that otherwise useless meat?
 

hippymon

Member
[quote author=efilnikufecin link=topic=801.msg4603#msg4603 date=1179607860]


Don't forget I am a lifelong collector of those lovely sewer items!!! Since I started collecting I have not stopped. What would I do with all that otherwise useless meat?
[/quote]

Hehe, I love your collecting... make me some meatzies. :p
 

Seraphim

New member
[quote author=hippymon link=topic=801.msg4594#msg4594 date=1179530386]
Not sure if it has been said, but about the "collectors.txt" You might want to remove that...

plot hole 974990 175 <<<--- Nothing wrong with that.
chaos butterfly 652201 200 <<<--- "No longer paying 200 meat each for Chaos Butterflies.. msg me before you send trade plz.."
angry farmer candy 676679 140 <<<---Rubiel (#676679), the Level 35 Disco Bandit (Disabled)
awful poetry journal 676679 150              \/
disturbing fanfic 676679 150                \/
furry fur 676679 135                           \/
Original G 676679 150                           \/
procrastination potion 676679 150              \/
thin black candle 676679 145  <<<<---  \/

[/quote]

Holy crap! Surprised to see a portion of a script with me in it!

Er but yes... account was disabled. Send your crap to Seraphim863 (#647287) from now on. I'll accept everything here.

Impressive script by the way!
 

dangerpin

Member
Dangerpin, lifelong collector of Tiny Plastic Grues
Will buy for 400 each when not in HC

Code:
tiny plastic grue   283311 400
 

izchak

Member
The thing is, I want *lifelong* collectors of items, so that I can rest assured that they will still want to buy an item a month later, when I finally set up the tradeoffer. Your having gotten disabled once already leads one to worry that you might not be accepting trade offers in a months time...

On a related note, I am interested in finding other 'lifelong' collectors of items, these are generally people with decent funds who are collecting some given item, as compared to /trade resellers, who typically buy everything, and resell to others.

EDIT: Like dangerpin, who posted that 30 seconds before me! Thank you, dangerpin!
 

bismuth

New member
I (bismuth, #273752) am collecting disco balls, have been for more than 2 years (which is pretty lifelong by KoL standards :p I spend all my time in hardcore though, so direct disco ball offers to my trading multi Astaat (#521047) I pay 222 meat each!

Brilliant script by the way, I'm going to give it a spin, and maybe coming weekend I'll have time to add / update, in which case I'll post it.
 
I get this message when I try to load the script in kolmafia:

Undefined reference 'trade_hermit' (izchak_castlefarm(2).ash, line 205)

If I delete the hermit part I get an undefined reference to current_equipment.
 

fewyn

Administrator
Staff member
[quote author=MajorMajorMajorMajor link=topic=801.msg5441#msg5441 date=1186625072]
I get this message when I try to load the script in kolmafia:

Undefined reference 'trade_hermit' (izchak_castlefarm(2).ash, line 205)

If I delete the hermit part I get an undefined reference to current_equipment.
[/quote]

You'll have to remove the parts about plexiglass (search for current_equipment and you should easily see the lines which need to be removed)
 

hippymon

Member
Actually, I attempted to update this script, but that isn't the only problem with it.. Oh, and change The whol current_equipment line to " if(have_equipped($item[plexiglass pith helmet])) {" That will fix that part, but there is more to fix.. I have been working on it some and will continue to try and fix the kicks.
 

DemonicPenguin1

New member
uhh, i get some random stuff happening to my script...

This is the le_canard.izchak_castlefarm script, but it also messes up for the updated script in the first page...

I get an error with the trade_hermit thing on line 214. I dont know much about coding or programming so please dont just dismiss me as a helpless noob and move on.
 

hippymon

Member
[quote author=DemonicPenguin1 link=topic=801.msg5806#msg5806 date=1190571657]
uhh, i get some random stuff happening to my script...

This is the le_canard.izchak_castlefarm script, but it also messes up for the updated script in the first page...

I get an error with the trade_hermit thing on line 214. I dont know much about coding or programming so please dont just dismiss me as a helpless noob and move on.
[/quote]

As it says above someone has run in to this problem.. It is a simple fix. Simply find line 179 to line 216 and delete that section
Code:
int worthless_items() { 
    int total = 0;
    total = total + item_amount($item[worthless trinket]);
    total = total + item_amount($item[worthless knick-knack]);
    total = total + item_amount($item[worthless gewgaw]);
    print("you have " + total + " worthless items");
    return total;
}

boolean loot_hermit() {
	if(! hermitLooting) return true;
	boolean haxored = contains_text(visit_url("questlog.php?which=3"), "You have summoned the UB3r 31337 HaX0R");
	boolean cloverday = false;
	int clovers_from_hermit = 0;
	if(! haxored) {
		print("you still need to haxor the hermit");
		return false;
	}
	# 5 is the maximum number of clovers the hermit can have
	# so make sure we have at LEAST five worthless items
	if(worthless_items() < 5) {
		cli_execute("buy 3 668 scroll");
		cli_execute("buy 3 30669 scroll");
		create(3, $item[31337 scroll]);
		use(3, $item[31337 scroll]);
	}
	while(trade_hermit(1, $item[ten-leaf clover])) {
		print("got another clover");
		clovers_from_hermit = (clovers_from_hermit + 1);
		cloverday = true;
	}
	cli_execute("use * ten-leaf clover");
	if(cloverday) {
		print("you got " + clovers_from_hermit + " clovers from the hermit");
	} else {
		print("the hermit has no clovers today");
	}
	return true;
}

Then go to line 728 and delete it
Code:
 	if(! loot_hermit() )	print("failed to loot the hermit!");

After those fixes you will need to find line 614 to line 620 and change it to this:
Code:
	if(have_equipped($item[plexiglass pith helmet])) {
		# plexi farm farms for a set amount of adventures, burns off the MP
		# and repeats, until out of adventures
		plexi_farm(my_adventures(), $location[Giant's Castle]);
	} else {
		adventure(my_adventures(), $location[Giant's Castle]);
	}
 
Top