Script to auto-still on logon.

tripwood

New member
Hello. I almost always forget to use the still when I load up my character. I know you can put an "autologon" script in preferences, so making it improve 10 bottles of sewage schnapps automatically would be the best.

I tried cannibalizing from another script to make this work but I am completely lost. Could anyone help me out on how to so? Thank you!
 

Bale

Minion
Here's a snippet from my breakfast script. It checks prices to figure out the most profitable upgrade. It is often, but not always, sewage schnapps.

Code:
item improvement(item [item] upgrade){
	item best;
	int profit = 0;
	int test_profit;
	foreach key in upgrade {
		test_profit = mall_price(upgrade[key]) - mall_price(key);
		if(test_profit > profit) {
			best = key;
			profit = test_profit;
		}
	}
	return best;
}

boolean improve_spirits() {
	if(my_class() != $class[disco bandit] && my_class() != $class[accordion thief]) {
		print("You're not a moxie class, so no booze refinement for you.", "blue");
		return false;
	}
	if(stills_available() == 0) {
		print("you have no uses left at the still", "#FFA500");
		return false;
	}
	item [item] upgrade;
	upgrade[$item[bottle of gin]] = $item[bottle of Calcutta Emerald];
	upgrade[$item[bottle of rum]] = $item[bottle of Lieutenant Freeman];
	upgrade[$item[bottle of tequila]] = $item[bottle of Jorge Sinsonte];
	upgrade[$item[bottle of vodka]] = $item[bottle of Definit];
	upgrade[$item[bottle of whiskey]] = $item[bottle of Domesticated Turkey];
	upgrade[$item[boxed wine]] = $item[boxed champagne];
	upgrade[$item[grapefruit]] = $item[tangerine];
	upgrade[$item[lemon]] = $item[kiwi];
	upgrade[$item[olive]] = $item[cocktail onion];
	upgrade[$item[orange]] = $item[kumquat];
	upgrade[$item[soda water]] = $item[tonic water];
	upgrade[$item[strawberry]] = $item[raspberry];
	upgrade[$item[bottle of sewage schnapps]] = $item[bottle of Ooze-O];
	upgrade[$item[bottle of sake]] = $item[bottle of Pete's Sake];
	item still = improvement(upgrade);
	print("Creating " + stills_available()+ " " +upgrade[still]+ " to sell @ "+mall_price(upgrade[still]), "blue");
	retrieve_item(stills_available(), still);
	create(stills_available(), upgrade[still]);
	cli_execute("mallsell * "+ upgrade[still]+ " @ "+ mall_price(upgrade[still]));
	return true;
}
 

tripwood

New member
When I load it, it says Unable to evoke main. I copy pasted that code in a file called "still_logon.ash".
 

Bale

Minion
That's because this was just a snippet. Not a full script. If you want to use it as your entire breakfast script, just add these lines to the bottom

Code:
void main() {
improve_spirits();
}
 

dj_d

Member
That's really cool, Bale. If I spend time in aftercore as a mox class I'll definitely use it.

What other awesomeness do you have hiding in your bfast script? :)
 

Bale

Minion
Glad you like it. Feel free to enjoy. It actually checks if you're a moxie class so you can just use it by default.
 

dj_d

Member
By the way - why would you do this at logon? Why not at logoff, to allow for the possibility that you might want to use the still for something during your day's turns?
 

Bale

Minion
By the way - why would you do this at logon? Why not at logoff, to allow for the possibility that you might want to use the still for something during your day's turns?

I can't think of a good reason.
 

kain

Member
I'm with DJ_D ... I burn extra stills at the end of the day, on the off-chance I get involved in something where I need more turns than normal, or a clannie needs something.

I like checking for profitability ... I check to see what I have the fewest of.

But yes, scripting them on login or logout does prevent you from forgetting. I cringe to think about how many I just forgot, or was too lazy to do.
 
Top