New Content - Implemented Sneaky wrapping paper

lostcalpolydude

Developer
Staff member
In case it's worth logging something more than the item received from these adventures, here's the HTML, collected outside of mafia.
Code:
<body>
<centeR><!--faaaaaaart--><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>A hidden surprise!</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center>You find a gift from <A href=showplayer.php?who=1253868 class=nounder><b>ElementalSSE</b></a> hidden next to a discarded sausage!<center><table class="item" style="float: none" rel="id=2593&s=15&q=0&d=1&g=0&t=1&n=4&m=0&p=0&u=e"><tr><td><img src="http://images.kingdomofloathing.com/itemimages/pasty.gif" alt="Knob pasty" title="Knob pasty" class=hand onClick='descitem(554994778)'></td><td valign=center class=effect>You acquire <b>4 Knob pasties</b> (stored in Hagnk's Ancestral Mini-Storage)</td></tr></table></center>There's a note attached:<p><table cellpadding=10><tr><td style='border: 1px solid black;'>Happy knobmas!</td></tr></table><p><p><a href="adventure.php?snarfblat=114">Adventure Again (The Outskirts of Cobb's Knob)</a><p><a href="plains.php">Go back to The Nearby Plains</a></center></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table><!--faaaaaaart--></centeR></body>
 

Bale

Minion
It would be nice to log the name of the gifter and any message they send.

Also, when I send a gift, mafia doesn't know yet to remove the wrapping paper and the gift from my inventory.
 
Not sure if this makes sense - are there any plans to support automation of the choice adventure that comes from using the wrapping paper? Thinking along the lines of automated gift giving of some sort. Or is this more appropriate for a post-adventure script?
 

Bale

Minion
Or is this more appropriate for a post-adventure script?

Considering the broad number of customizable options available, it would be a much better idea for this to be a script than a standard mafia feature.

I'm expecting someone to write up a script for this. Currently, I am simply waiting for it to happen, since it is quicker for me to modify someone else's script for my needs than to do it from scratch. That and I am unsure of the best way to do this so I want to see what the provided script offers as its default settings. If it takes too long though, then I'll write my own.

Hopefully mafia will support this content so that a script will work properly. There's a chance that someone has already written the basics of a script, but is resisting putting it up here until mafia supports the feature.
 

Crowther

Active member
Ha! Yes, Bale is exactly right. And someone has written a script. Based on my past experience, I fully expect to see an improved function from Bale shortly.

EDIT: And yes, it doesn't work quite right because mafia still needs a little more support.
 

lostcalpolydude

Developer
Staff member
Using secret wrapping paper properly removes items from mafia's inventory now (15006). I didn't add it to the NPC store .
 

lostcalpolydude

Developer
Staff member
15013 adds logging of the gift sender and their message. Took me longer than it should have to add this because I wanted to use a single regex instead of two, but since the note is optional I couldn't figure out how to do that.

People in-run that receive items get them (stored in Hagnk's Ancestral Mini-Storage) like buying from the mall. Mafia doesn't currently handle that.
 

Winterbay

Active member
Well, it should handle not adding the thing you get to your inventory so as to not get the inventory out of sync I guess.
 

lostcalpolydude

Developer
Staff member
That's probably something that should be handled more generally for item processing, rather than on a case by case basis.
 

Veracity

Developer
Staff member
Does it say something like "Item goes to Hagnk's storage"?
I fixed the Use Link decorator to not make a use link for things like that - the PVP rewards in kmail, for example.
But if that is the general sort of message, ResultProcessor should be made to recognize it.
 

lostcalpolydude

Developer
Staff member
It's the same as the message for mall purchases, which are handled in MallPurchaseRequest. Kmail doesn't have that issue because we don't add those items to inventory.
 

Veracity

Developer
Staff member
Perhaps the code in MallPurchaseRequest could be used in ResultProcessor, as well, to put the items into inventory or storage as appropriate.
 

lostcalpolydude

Developer
Staff member
15015 puts things into storage instead of inventory when that happens. It won't apply to some pages that do their own parsing (which doesn't matter for now at least), but I'm pretty sure I handled it properly.
 

Crowther

Active member
Something between 15012 and 15017 causes mafia to dump debug logs and abort when Best Anapests is running during combat. Since it happens when WHAM is parsing combat drops, I'm guessing it's 15015.

My suggestion is to force Jick to remove that idiotic effect from the game. Yes, I need to redo my moods.
 

Attachments

  • DEBUG_20141207.txt
    70.3 KB · Views: 30

lostcalpolydude

Developer
Staff member
That should be a simple fix, but sourceforge seems to have an issue at the moment, so I can't commit it yet. In ResultProcessor, line 183 should be
Code:
boolean hagnk = items != null && boldMatcher.group(2) != null;
 

Crowther

Active member
That should be a simple fix, but sourceforge seems to have an issue at the moment, so I can't commit it yet. In ResultProcessor, line 183 should be
Code:
boolean hagnk = items != null && boldMatcher.group(2) != null;

I'm very glad to hear it was simple.
 
Top