New Content - Implemented Olympic-Sized Swimming Pool

slyz

Developer
I'll have the first few items and effects committed soon, and I'll get started on adding support in ClanLoungeRequest.java.
 

GValko

Member
There are two once-a-day activities you can do with the pool.

You can swim and look under for a random item, or you can get a buff.

The former should probably be a breakfast thing, but I don't know if it's totally random as to what you receive.
 

slyz

Developer
I'm almost done with implementing the "working out" part.

I'm not sure what to do with the screwing around part yet, but it's easier to test and debug since it's basically a choice adventure you can get as much as you want (until you find an item, apparently).
 

slyz

Developer
r10946 Adds support for everything except the "Screwing Around" choice adventure obtained when using the "Cannonball" button.
 

slyz

Developer
I think the item-finding will get its own command (and daily preference). It will simply enter the choice adv, choose to handstand, choose to look for an item if available, find an item, and exit.

That's about all the support I'm willing to add, since being able to move around and talk sounds like the arcade games: I don't see any reason to automate or track anything except the item acquisition.
 

Fluxxdog

Active member
Now that we've had a roll over, if you are in the pool during rollover (and possibly when logging in), mafia (r10949) gets confuzzled. Naturally, it stopped because I had a choice adventure, but afterward none of the chat would load up properly. The only thing from my session log that seemed to help was the url needed to leave the pool.
Code:
Took choice 585/1: unknown
choice.php?whichchoice=585&pwd&option=1&action=leave
And then I had to restart mafia to get it to load properly.
 
I think the item-finding will get its own command (and daily preference). It will simply enter the choice adv, choose to handstand, choose to look for an item if available, find an item, and exit.

That's about all the support I'm willing to add, since being able to move around and talk sounds like the arcade games: I don't see any reason to automate or track anything except the item acquisition.

I'm thinking it should just go in as one of the automatic breakfast events.

Possibly needs a flag to know if it's been done or not to catch the error case of the VERY rare times that the pool will be completely full.
 

Kirkpatrick

New member
Currently mafia adds its Non-Combat Action Bar* to the swimming page. Unless there is functionality I'm not aware of with that, I think it would be nice to not do this, leaving more vertical space for that Olympic sized pool!

Also: if this would be better suited in a separate feature request, I will provide one instead.

*Relevant, I think
 
Last edited:

Fluxxdog

Active member
Naturally, it stopped because I had a choice adventure, but afterward none of the chat would load up properly.
Does that happen only with the swimming pool, or with any choice adventure?
From what I've seen, it happens with any choice that isn't defined in mafia setting or IIRC if the choice setting is 0 (abort for manual choice). Unfortunately I forgot to let myself get all pruny (prunish?) this time.
Come to think of it, are there any other choice.phps that also require an action= like this?

Edit: Actually, come think of it, no. Even beerpong had its own .php. All the choice adventures to date had choice.php?whichchoice=xx&option=y with nothing extra.
(of course, I may have overlooked something)
 
Last edited:

Donavin69

Member
This is a quick script just to dive for treasure, I added it to my 'dinner' script.
 

Attachments

  • DiveForTreasure.ash
    356 bytes · Views: 145

Bale

Minion
Thank you. I just added that to my loginScript. (I have a check to make sure that certain parts of my loginScript are only executed once a day.)
 

Bale

Minion
That part of it works like this:

PHP:
switch(get_property("_loginScript")) {
case "0": case "":
	// Hitting main.php gets my penpal item as well as checking for the beach.
	if(visit_url("main.php").contains_text("map7beach.gif"))
		cli_execute("raffle 5 " + (can_interact() && my_meat() > 6000? "inventory": "storage"));
case "1":
	set_property("_loginScript", "1");
	if(item_amount($item[creepy voodoo doll]) > 0)
		use(1, $item[creepy voodoo doll]);
case "2":
	set_property("_loginScript", "2");
	if(equipped_item($slot[familiar]) == $item[time sword])
		equip($slot[familiar], $item[none]);
	if(equipped_amount($item[time halo]) > 0)
		cli_execute("unequip time halo");  // Can't equip backup if it also has a halo. KoL sucks.
	fold($item[stinky cheese eye]);
	equip_outfit(get_property("baleOutfit"));  // Yesterday's outfit pre-rollover gear
	set_property("baleOutfit", "");
case "3":
	set_property("_loginScript", "3");
	if(can_interact()) {
		switch(random(3)) {
		case 0: cli_execute("chips radium, radium, radium"); break;
		case 1: cli_execute("chips ennui, ennui, ennui"); break;
		case 2: cli_execute("chips wintergreen, wintergreen, wintergreen"); break;
		default:
			cli_execute("chips radium, ennui, wintergreen");
		}
	} else {
		// In aftercore, getting clovers is part of breakfast. I'm pickier about during ascension.
		(my_path() != "Way of the Surprising Fist" && my_meat() > 2000 && !in_bad_moon() && hermit(5, $item[ten-leaf clover]));
	}
case "4":
	set_property("_loginScript", "4");
	// If in aftercore and wake up in clan Hardcore State, switch to waking clan
	if(can_interact() && origin_clan() == 84118 && get_property("baleClan") != "") {
		get_property("baleClan").to_int().goto_clan();
		print("Leaving Hardcore State to find company.", "blue");
	}
	set_property("baleClan", "");
case "5":
	set_property("_loginScript", "5");
	// Always harvest garden, regardless of type, whenever there is anything growing
	if(visit_url("campground.php").contains_text("action=garden"))
		cli_execute("garden pick");
case "6":
	set_property("_loginScript", "6");
	if(item_amount($item[Clan VIP Lounge key]) > 0)
		DiveForTreasure();
case "7":
case "90":
	set_property("_loginScript", "90");
	cli_execute("refresh inv"); // To ensure Pen Pal item is recognized.
case "99":
	set_property("_loginScript", "99");
case "999": break;
}

I set it up like that since there is so much to do in case I interrupt it part way through or there is a problem, so it can always be resumed from the point of interruption.
 
Last edited:

Donavin69

Member
I set it up like that since there is so much to do in case I interrupt it part way through or there is a problem, so it can always be resumed from the point of interruption.

If it is interrupted in the midst of a step (after setting the property, but before running the 'step') it will mark the step as complete, but would not have done it, correct? Is there any way to capture that? (I had the problem where I interrupted Omnivore after I had it set the autoBuyPriceLimit, and didn't set it back)

(BTW, I am going to 'steal' your idea for your breakfast steps, Thanks!)
 

Theraze

Active member
If interrupted during a step, it will go back to that step... because he doesn't use breaks, it just goes on to the next step when it's done, but because he sets the current step as the one to go back to, it might re-run one item... but only one.

The only exception, obviously, is the inventory refresh. If that one is aborted, it will dive for treasure again, then refresh inventory again.
 

Bale

Minion
If it is interrupted in the midst of a step (after setting the property, but before running the 'step') it will mark the step as complete, but would not have done it, correct?

Nope. You got that backwards. If a step is interrupted in the middle, it will go back to the beginning of that step.


The only exception, obviously, is the inventory refresh. If that one is aborted, it will dive for treasure again, then refresh inventory again.

You're right. I'm gonna edit in the fix for that.


(BTW, I am going to 'steal' your idea for your breakfast steps, Thanks!)

Don't overuse it. I only use it for things that mafia will not track. When mafia tracks something, it is better to use mafia's awareness. For instance... stills_available() will tell you if I can improve spirits, get_property("tomeSummons") will tell me if I can still summon from my Tomes and get_property("_candySummons") will tell me if I have summoned Crimbo Candy today. For example...


PHP:
// I want to know who stole my lunch!
if(have_skill($skill[Lunch Break]) && get_property("_lunchBreak") == "false" && (my_mp() > 50 || can_interact())) {
   matcher lunch = create_matcher("That jerk (.+?) stole your lunch again!", 
     visit_url("skills.php?pwd&action=Skillz&whichskill=60&skillform=Use+Skill&quantity=1"));
   if(lunch.find())
      print_html("<font color='olive'><b>"+lunch.group(1)+"</b> stole your lunch, but you got a sack lunch from the next guy!</font>");
   }
 
Last edited:

fronobulax

Developer
Staff member
It seems to me that when I Dive For Treasure and find something, the result does not appear in the Session/Recent results. Since there are items that do appear even if they are not the result of an adventure, it would be nice if these did too.
 
It seems to not recognize that the pool item exists until I cause a refresh, it's very odd.

Perhaps the script that gets the pool item automatically, can include the reuired refresh to force it to see the item, or is that in there and I'm just not reading it right (I probably am not)?
 
Top