What's in your login/logout scripts?

[*]Whitelists, sends a message to, then boots any inactive members, so that they are not wasting clan resources for clan buffs.

I suppose I might just be reading this wrong, but you are aware that when you boot a member from your clan, KoL takes them off the whitelist, right?
 
My clan does have a bot that buffs everyone -- but it only buffs players active within the last week, so that's fine. It's the (expensive) clan training that inactive members squander (considering that clan buffs basically only apply to aftercore, we typically do only the +meat buff).

@bordemstirs: Is that a recent change? It tested just fine when I wrote it a while back.
 
That's nice actually -- if I reorder it to whitelist after booting, I don't need to check if they are already whitelisted.
 
A new addition. To punch out my Advent calendar during the month of December...
PHP:
if(substring(today_to_string(), 4, 6) == "12") {
	string advent = visit_url("campground.php?action=advent");
	while(advent.contains_text("left to punch out right now"))
		 advent = visit_url("campground.php?preaction=openadvent");
}

  • clanhops to my main clan in case I spend the night in a clan with +advs furniture - thanks Bale

On top of this, I use Bale's clanhop to switch to a clan with +adv furniture when loging out.

This was a good idea so I added it to my login/logout scripts also!

logout:
PHP:
import "clanhop.ash";

set_property("libramSkillsSoftcore", "none");
set_property("libramSkillsHardcore", "none");

if(my_inebriety() > inebriety_limit()) {
	// If in aftercore and currently in clan Hardcore Nation, spend the night in Hardcore State
	if(can_interact() && origin_clan() == 41543)
		goto_clan(84118);
	// Swap in rollover gear
	if(available_amount($item[stinky cheese diaper]) < 1 && available_amount($item[stinky cheese eye]) > 0)
		cli_execute("fold stinky cheese diaper");
	cli_execute("maximize adv, switch disembodied hand");
}

part of my login

PHP:
import "clanhop.ash";
// If in aftercore and wake up in clan Hardcore State, switch to Hardcore Nation
if(origin_clan() == 84118)
	goto_clan(41543);
 
Last edited:
My Inigo crafting bit announced it would be "casting 5 Inigo's to craft 10 gatorskin umbrella for a -1000 meat profit" yesterday (crafting gatorskin umbrella was hardcoded a long time ago). I modified it to be slightly more... profitable. Simply add:
PHP:
if ( profit < 0 ) return false;
in inigo_craft().
 
I'd like to thank Bale for having posted this thread so that when I lost my USB-stick with all my mafia data on I had at least the basis of my login and logout scripts available as a post here :)
 
One thing I do that I did not yet see, if I am in BM or HC and short on meat and have the outfits and am low enough level (so that value of adventure is 400 meat gain or less), is to visit the treasury once in each of the Harem and Elite Guard outfits - 2 non-combat adv for 800 meat.
 
That's... kinda interesting. Definitely non-optimal, but for a relaxed BM run I can see it. Please post that code snippet because I'm curious about what you consider low enough level, etc.
 
Low enough level - Basically, if I can safely farm the castle, I would go there instead of doing both of the treasury adv's. (Note that the Harem outfit Treasury adventure is worth 500 meat, and KGE is worth 300.)

I ran 57 adventures in Kittycore (King not free) just to check my math. My sample average meat gain in KittyCore adventuring in the castle with maximizer 2.0 Item drop, 1.0 meat drop was 352.28 (autoselling or using everything dropped - there was some restoring/healing involved but no semi-rares). In KC, it would seem that the Harem outfit adventure in the Treasury is more profitable than castle farming thanks to the Black Cat.
 
Last edited:
Here's my hardcore logout script with bits shamelessly stolen from others.
PHP:
void main()
{
	if ( in_hardcore() && !in_bad_moon() && user_confirm("Have you finished for today?"))
	{
	set_property( "logoutScript" , "HC_logout.ash" );//this script
	foreach familiar in $familiars [ Baby Bugged Bugbear, Stocking Mimic, Mini-Hipster] {
	use_familiar (familiar);
	equip($slot[familiar], $item[none]);
	}
	foreach item in $items[ fixed-gear bicycle, ironic moustache, bag of many confections, bugged balaclava]
	autosell(item_amount(item), item);//get meat
	outfit( "Birthday Suit");//dress down for pvp
	use_familiar($familiar[None]);
	chat_clan("/whitelist taut");//off to my PVP furnished clan
	foreach thing in $items[chrome crossbow, chrome sword, chrome staff, dead guy's watch, Sage's, stainless steel solitaire] {
		if (available_amount(thing) > 0) {
		equip(thing);
		}
		}
	if (item_amount ($item [ Fennel's ]) > 0 && item_amount ($item [ Sage's]) <= 0)
	equip ($item [ Fennel's]);
	}
}
My login script obtains the bugged balaclava and equips it.
 
PHP:
user_confirm("Have you finished for today?"))

Just thought that I'd mention I simulate that with this:

PHP:
if(my_inebriety() > inebriety_limit())

They're not identical, but I prefer not to have the user_confirm so I use this approximation.
 
I tried that Bale but it fails in HCT/Oxy and I don't want it doing stuff if I log out before finishing the day so user confirmation seemed the only way.
 
Question... is there a reason not to use
Code:
maximize("rollover", false);
instead of the
Code:
[FONT=Courier New][COLOR=#ff8000]    [/COLOR][COLOR=#007700]foreach [/COLOR][COLOR=#0000BB]thing in $items[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000BB]chrome crossbow[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]chrome sword[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]chrome staff[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]dead guy[/COLOR][COLOR=#DD0000]'s watch, Sage'[/COLOR][COLOR=#0000BB]s[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000BB]stainless steel solitaire[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]] {
        if ([/COLOR][COLOR=#0000BB]available_amount[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]thing[/COLOR][COLOR=#007700]) > [/COLOR][COLOR=#0000BB]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]) {
        [/COLOR][COLOR=#0000BB]equip[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]thing[/COLOR][/FONT][COLOR=#007700][FONT=Courier New]);
        }
        }[/FONT]
[/COLOR]
now?
 
Yes, I want to lose to PVP attacks so prefer to wear nothing unless it increases rollover adventures or PVP fights. This is also why I unequip my familiar.
 
I suggest that a better way to do that is this:

PHP:
maximize("Adventures", false);
foreach s in $slots[]
	if(numeric_modifier(equipped_item(s), "Adventures") == 0)
		equip(s, $item[none]);

That way if you get depleted grimacite stuff or things change otherwise, your script will know when to use it.
 
Or alternatively...
Code:
outfit( "Birthday Suit");//dress down for pvp
use_familiar($familiar[None]);
maximize("Adventures, -tie", false);
 
Sorry Thereze, but that does not work. -tie will refuse to leave a slot empty even if it won't help. You have to actually remove stuff that doesn't help after maximize puts it on.
 
Bale's suggestion looks future-proof. I guess it's time I tried to understand maximizer better but will "adventures" also equip Sage's jacket if I'm lucky enough to get one as I thought the keyword for that was "pvp fights". Would this do the job?
PHP:
maximize("Adventures, pvp fights", false);
foreach s in $slots[]
    if(numeric_modifier(equipped_item(s), "Adventures") == 0 && numeric_modifier(equipped_item(s), "PVP fights" == 0)
        equip(s, $item[none]);
 
Back
Top