Feature - Implemented Saving 100% Runs

Flanders

New member
Okay, so this is a request for two "Protect me from my own stupidity" features.

1) I have now blown every 100% run I attempted because I did not re-equip my familiar after ascending. Yep, every one. I'm so used to ascending with my familiar that I never remember to equip one when I come out the other side of Valhalla. Is it possible to implement some sort of one-time-only "Are you SURE you want to do that?" feature for the first adventure after ascension, if you don't have a familiar equipped (and aren't in BM)?

2) Just got burned by forgetting to double-check my settings at the Barr before adventuring, and wound up with 140 adventures and too much drunkenness to do anything. Maybe a "Gee, you're awfully drunk. Are you SURE you want to adventure with these settings?" message? I'd find it helpful.

I recognize these features are needed only because I have a tendency to be a bit too fast with the clicky finger, but still. Any chance you can protect me from my own stupidity?

Thanks!
 

Theraze

Active member
Regarding the first, if you're trying to do a 100% run, I'd suggest using zarqon's BBB script and its lovely is_100_run variable. That will automatically equip the familiar you're trying to do a 100% run with anytime you do automated adventuring. Including the first adventure. Just remember that it won't protect you while using the relay browser. Regarding the second... I'll check. Thought there was some sort of drunkenness warning...

Edit: Nope. That's a script thing. If you find yourself screwing up at the Barr often, you might want to make a script that validates you're not doing it overdrunk. Alternatively, could make an adventure script that just runs 'adventure' in the location you want if you're not too drunk...
 
Last edited:

fronobulax

Developer
Staff member
Doesn't Bale's NewLife reset the choice adventures so that drunkeness does not happen in the Barr? If not, it probably could. Unless the goal is to get partially drunk at the Barr NewLife might suffice.

The idea of implementing and enforcing a 100% run in mafia is intriguing although I'm not yet sure it could or should be done.
 

matt.chugg

Moderator
If you are adventuring in the relay browser, you can use something like this to prevent adventuring under certain conditions, this is a script that was never finished, but functionally will still work. (it also displays pagename and field names for page requests for ash developers)

PHP:
// showpageinfo (boolean) 
// If true will add the page name and a list of submitted fields to the top of the page.
// ignores charpane, topmenu and chat. useful for scripters to see what post data is involved.
// fails with ajax.
boolean showpageinfo = true;



void main() {
	// get page name and postdata/querystring
	string pagename = get_path();
	string [string] fields = form_fields();
	
	// completly ignore pages and let them do their own thing
	if ((pagename=="charpane.php") || (pagename=="lchat.php") || (pagename=="chatlaunch.php")) {
		exit;
	}
	
	// abort variables
	boolean abortload=false;
	buffer abortpage;


	// do stuff before page is loaded (lets you abort a page load!!!!!)
	if ((pagename=="lair6.php") && (fields["place"]==5)) {
		if (item_amount($item[Wand of Nagamar])==0) {
			abortpage.append("You should really get a Wand first...<br />");
			abortload=true;
		}
	}

	if((my_familiar() == $familiar[none]) && (pagename == "adventure.php")) {
		abortpage.append("You shouldn't be adventureing without a familiar...<br />");
		abortload=true;
	}
	
	if ((my_inebriety() > inebriety_limit()) && (pagename=="adventure.php")){
		abortpage.append("You Shouldn't be adventuring while drunk...<br />");
		abortload=true;
	}
	

	// write abort message
	if (abortload==true) {
		write("<span style='color:#FF0000; display:block; padding:5px; border:1px solid red; font-size:16px; font-weight:normal; font-family:arial;'><b>Page load aborted by safety.ash!</b><br />" + abortpage + "</span>");
		exit;
	}
	
	
	// NOT ABORTED! LETS DO STUFF!!!
	buffer page;
	
	// get the page
	page.append(visit_url());


	// do stuff to the page!
	// do stuff here	

		
	// append header info;
	if (showpageinfo==true) {
		if ((pagename=="topmenu.php") || (pagename=="charpane.php") ||(pagename=="lchat.php") || (pagename=="chatlaunch.php")) {
			// don't want to add header to these pages, should use not somewhere
		} else {
			string querystring="";
			if (count(form_fields()) > 0) {
				querystring = "<span style='color:#33AAAA;'>";
				foreach field in fields {
					querystring += " | " + field + "=" + fields[field];
				}
				querystring += "</span>";
			}
			page.replace_string("<body>","<body><span style='font-family:arial; font-size:10px; margin-left:30px; display:block;'><span style='color:#0000FF;'>" + pagename + "</span><span style='color:#FF0000;'> (" + count(form_fields())+ " fields)</span> " + querystring + "</span>" );
		}	
	}
	page.write();

}
 

Bale

Minion
Doesn't Bale's NewLife reset the choice adventures so that drunkeness does not happen in the Barr? If not, it probably could. Unless the goal is to get partially drunk at the Barr NewLife might suffice.

Yes, it does: newLife.

Fortunately mafia has the ability to automatically run a script after ascending. I made use of that ability to write a script that will take care of all the little things I want to do whenever I ascend. It will set those niggling choice adventures at the Barrr to keep you from getting drunk. It will ensure the castle wheel is turned in the direction of your mainstat if you're moxie or mysticality. It even ensures you get your mainstat at Whitey's Grove from the one choice adventure that helps your mainstat while the others give an item. There are many more such choice adventures and I think I found them all.

This script will also reset a few other choice adventures that might get changed in aftercore and are important to ascension like your song choice in the ballroom. It will set automatic recovery to a level appropriate for level 1. It will get the free hat for your Bugged Baby Bugbear from the Arena and it even pulls your VIP Lounge Key to save you the trouble. (It's a free pull!) Finally it visits the Toot Oriole, since that is just annoying to click through.
 

lostcalpolydude

Developer
Staff member
So, leave this open for the first part, reject the second part (because it belongs in a script that already exists), and edit the thread title accordingly? That's what I'm going with.

In the future, I would suggest two separate threads when you have two unrelated feature requests.
 
I suppose a simple solution for part 1 is for mafia to automatically re-equip the familiar you had upon entering the gash, provided you can actually do so (Beecore could make it impossible to do so, for example). I imagine there might be a few people who would dislike this, though: "This feature just ruined my 100% no familiar run!" Adjustable setting, perhaps that defaults to nothing (normal kol behavior)?
 

Theraze

Active member
I'm still failing to see why this can't just be done with a relay script or a between battle script? Both are easy solutions that provide this functionality for people without cluttering preferences more than they have to...
 

shazbot

Member
I just put in a feature request for Bale's New Life regarding a prompt for the BBB is_100_run variable, but I'm sure a generic request could be put in for a familiar prompt upon ascension for the same purposes (I myself just got messed up a day into a new ascension because I forgot to change is_100_run).
 

Theraze

Active member
I'd suggest a relay override script on the ascension page, that sets your familiar choice there to overwrite your is_100_run variable.
 

Theraze

Active member
Double-post sadness I know, but... eh.

I'd suggest actually replacing this with a preAscension script. If one exists, add in, otherwise, create/use something like:
Code:
import <zlib.ash>
vars["is_100_run"] = normalized(my_familiar(),"familiar");
updatevars();
That, on preAscension, should set whatever familiar you've set as your choice there as your next 100% run familiar. Easy. I may actually start using this one myself... Heh.

Edit: Tested and it worked. Set my is_100_run to the Animated Macaroni Duck I'd decided would be a good choice for a Pastamancer automatically when I ascended...
 
Last edited:

stannius

Member
I just put in a feature request for Bale's New Life regarding a prompt for the BBB is_100_run variable, but I'm sure a generic request could be put in for a familiar prompt upon ascension for the same purposes (I myself just got messed up a day into a new ascension because I forgot to change is_100_run).

Maybe we can get Bale to put "cli_execute lib is_100_run = TOBEDETERMINED" in newlife.
 

Theraze

Active member
Meh... just set your preAscension script with something like what I suggested in post 11 and you don't need to worry about it. Whatever you ascend with becomes your new 100% run familiar. Easy.
 
Top