Add "Manage Plants" link to end of adventures (Florist Friar)

Lilac

Member
These scripts are incredibly basic; they don't care whether you have the Friar "installed", whether you can actually plant in that zone, or whether you have any relevant plants left. They simply generate a [manage plants] link at the end of an adventure.

To install: Download all files to your /relay directory (NOT /scripts). If you have any conflicting relay scripts, these should be simple to roll into them with a little text editing.

TODO: Did I miss any .php results that are valid targets for plants? (currently looking at combats, choice adventures, and regular noncombats)
 

Attachments

  • choice.ash
    463 bytes · Views: 76
  • fight.ash
    357 bytes · Views: 66
  • adventure.ash
    359 bytes · Views: 68

Bale

Minion
I just added a link to the friar to my topmenu override.

:D My topmenu override does that also. In case anyone is curious about such things, here's my topmenu.ash

Code:
void main() {
	buffer results;
	results.append(visit_url());

	string alt = '<span style="font-weight:normal;color:#1975FF">';
	
	// inventory page option
	results.replace_string('inventory.php">inventory</a>',
	  'inventory.php?which=1">inv</a><a target=mainpane href="inventory.php?which=2">'+alt+'ent</span></a><a target=mainpane href="inventory.php?which=3">ory</a> <a target=mainpane href="inventory.php?which=f0">fav</a>');
	
	// crafting page option
	results.replace_string('craft.php">crafting</a>',
	  'craft.php">craft</a><a target=mainpane href="craft.php?mode=discoveries">'+alt+'ing</span></a>');
	
	// quests page option
	results.replace_string('questlog.php">quests</a>',
	  'questlog.php?which=1">qu</a><a target=mainpane href="questlog.php?which=4">'+alt+'es</span></a><a target=mainpane href="questlog.php?which=6">ts</a>');
	
	// messages page option
	results.replace_string('messages.php">messages</a>',
	  'messages.php?box=Inbox">mes</a><a target=mainpane href="messages.php?box=Outbox">'+alt+'sag</span></a><a target=mainpane href="sendmessage.php">es</a>');
	
	// reduce clutter
	results.replace_string("campground</a>","camp</a>");
	
	// Cosmic Kitchen
	if(my_path() == "Avatar of Jarlsberg")
		results.replace_string('camp</a>','camp</a> <a target=mainpane href="shop.php?whichshop=jarl">kitchen</a>');
	
	// Go straight to bookshelf from campground.
	boolean have_bookshelf() {
		if(in_bad_moon() || my_path() == "Avatar of Boris") return false;
		foreach s in $skills[Summon Alice's Army Cards, Summon BRICKOs, Summon Candy Hearts, Summon Love Song,
		  Summon Party Favor, Summon Stickers, Summon Sugar Sheets, Summon Tasteful Items]
			if(have_skill(s)) return true;
		return false;
	}
	if(have_bookshelf())
		results.replace_string("campground.php","campground.php?action=bookshelf");
	
	// add either VIP or sofa link, depending
	if(item_amount($item[VIP lounge key]) > 0)
		  results.replace_string("clan_hall.php\">clan</a>",
		    "clan_hall.php\">clan</a> <a target=mainpane href=\"clan_viplounge.php\">VIP</a>");
	else results.replace_string("clan_hall.php\">clan</a>",
	  "clan_hall.php\">clan</a> <a target=mainpane href=\"clan_rumpus.php?action=click&spot=5&furni=3\">sofa</a>");
	
	// add beanstalk, knob, manor, sea
	if (my_level() > 9) results.replace_string("plains</a>","plains</a> <a target=mainpane href=\"beanstalk.php\">bean</a>");
	if (my_level() > 4) results.replace_string("plains</a>","plains</a> <a target=mainpane href=\"cobbsknob.php\">knob</a>");
	if(get_property("lastManorUnlock") == my_ascensions())
		results.replace_string("town</a>","town</a> <a target=mainpane href=\"manor.php\">manor</a>");
	else results.replace_string("town</a>","town</a> <a target=mainpane href=\""+to_url($location[haunted pantry])+"\">pantry</a>");
	
	// add guild
	string guild = "guild.php?guild=";
	if(my_path() == "Avatar of Boris") guild = "da.php?place=gate1";
	else if(my_path() == "Avatar of Jarlsberg") guild = "da.php?place=gate2";
	else if(my_path() == "Avatar of Sneaky Pete") guild = "da.php?place=gate3";
	else if(my_path() == "Zombie Slayer") guild = "campground.php?action=grave";
	else if(my_primestat() == $stat[muscle]) guild += "f";
	else if(my_primestat() == $stat[mysticality]) guild += "m";
	else if(my_primestat() == $stat[moxie]) guild += "t";
	results.replace_string("<a href=\"#\" onClick='javascript:window.open(\"doc.php?",
	  "<a target=mainpane href=\""+guild+"\">guild</a> <a href=\"#\" onClick='javascript:window.open(\"doc.php?");
	// sea
	if(available_amount($item[makeshift SCUBA gear]) > 0)
		results.replace_string("<br><a href=\"#\" onClick",
		  "<br><a target=mainpane href=\"oldman.php\">sea</a> <a href=\"#\" onClick");
	
	// image links to public charsheet
	results.replace_string("valign=center><img src=\"http://images.kingdomofloathing.com/otherimages/",
	  "valign=center><a target=mainpane href=\"showplayer.php?who="+my_id()+"\"><img title=\"View Public Charsheet\" src=\"http://images.kingdomofloathing.com/otherimages/");
	results.replace_string("smallleftswordguy.gif\" width=33 height=40>",
	  "smallleftswordguy.gif\" width=33 height=40></a>");
 	
	// adds link to basement logs
	#int lastTr = last_index_of( results , "</tr>" );
	#results.replace( lastTr , lastTr , 
	 # "<td><a href=\"clan_raidlogs.php\" target=\"mainpane\"><img src=\"http://images.kingdomofloathing.com/adventureimages/hobofort.gif\" height=50 width=50 style=\"align: right; border: 0\" /></a></td>" );
	int lastTr = last_index_of( results , "</table>" ) +length("</table>");
	string divright = "<div style='position: absolute; right: 130px; bottom: 0px;'>";
	results.replace( lastTr , lastTr , divright +
	  "<a href=\"clan_raidlogs.php\" target=\"mainpane\"><img src=\"http://images.kingdomofloathing.com/adventureimages/hobofort.gif\" height=50 width=50 style=\"align: right; border: 0\" /></a></div>" );
	
	// Add link to the Florist
	lastTr = last_index_of( results , divright ) +length( divright );
	results.replace( lastTr , lastTr , 
	  "<a href=\"forestvillage.php?action=floristfriar\" target=\"mainpane\"><img src=\"http://images.kingdomofloathing.com/otherimages/forestvillage/friarcottage.gif\" height=68 width=68 style=\"margin:0 0 0 0; overflow:hidden; align: right; border: 0\" /></a>" );
	
	// Change pvp to PvP
	results.replace_string(">pvp<", ">PvP<");
	
	// Fix link to bugbear mothership
	if(my_path() == "Bugbear Invasion")
		results.replace_string("whichplace=bugbearship_outside", "whichplace=bugbearship");
	
	results.write();
}

Towards the bottom of that is the code to add an image of the florist's hut on the right side of my topmenu.
 
Last edited:

Tarko

Member
Top menu override?

I didnt see the option in Mafia and if this is a script you made, it's not linked in your signature.

Where should I go to do that?
 

Erich

Member
Top menu override?

I didnt see the option in Mafia and if this is a script you made, it's not linked in your signature.

Where should I go to do that?

copy and paste Bales code into a txt file. Save it as topmenu.ash into your /relay directory.
 
Top