Feature - Rejected Make Adventure Again icon work in the Crowd of Adventurers section

plus4

New member
Not a huge problem, just a usability issue:

In the revamped Naughty Sorceress' Tower, after fighting an opponent in the Crowd of Adventurers, the game offers a "Fight Again (1)" link instead of the usual "Adventure Again (location)".

I have no idea why TPTB made the UI like this, there's really no reason for it from the user's point of view. Must have something to do internal workings of the game. I also assume this will eventually be fixed (improved) in-game. In the meanwhile, it would be great if Mafia could "fix" this issue. I play from the relay browser and after fights I just press "1" (which is where the Adventure Again icon is for me). But here it doesn't work. I'm hoping this could be done by adding some JS to the page or something similar.

I think the same issue applies to the Mist-Shrouded Peak. Perhaps both places can be "fixed" (improved) by the same code.
 

Veracity

Developer
Staff member
KoLmafia Stationary Buttons or CAB?

(although, actually, StationaryButtonDecorator.getAdventureAgainLocation is used in both cases, so it probably doesn't matter.)

I'll be there later this morning. I'll see what the page HTML looks like...
 

heeheehee

Developer
Staff member
Excerpt from scripts/actionbar.20140514.js:
Code:
		if (params["type"] == "action" && params["id"] == "repeat")
		{
			if (typeof timersfunc != 'undefined') {
				if (!timersfunc()) return;
			}
			var linx = document.getElementsByTagName("A");
			for (var i = 0; i < linx.length; i++)
			{
				var link = linx[i];
				if (link.innerHTML.match(/Adventure Again/) || (link.getAttribute && link.getAttribute('id')=='againlink'))
					location.href = link.href;
			}
		}

Anyone have the HTML in those particular cases? If the decorated link doesn't have id="againlink", I'm going to call that a KoL bug with fakeagainmenu.

Edit: The StationaryButtonDecorator method Veracity mentioned also uses againlink, so I'm inclined to believe that's a KoL bug.
 
Last edited:

heeheehee

Developer
Staff member
Interesting thing I noticed with the local variable againLinkExists in that method is that it checks for id=againlink, whereas the pattern checks for id="againlink".
 

Veracity

Developer
Staff member
So, in JavaScript, when it does link.getAttribute('id'), does the result differ, depending on whether the page HTML says id=againlink vs. id="againlink" vs. id='againlink' (all of which are valid HTML)?

I bet not.

This could be a case where KoL generates a different varient of that for the "Fight Again (1)" link than for normal "Adventure Again" links, in which case changing the pattenr to make the " optional will fix it.

I'll find out soon if there is an againlink on that page or not.
 

lostcalpolydude

Developer
Staff member
If I messed up againLinkExists, that code only exists to keep the wrong link from being used (added after links from the Crimbo Shrub were throwing it off), so it shouldn't really matter for this discussion. Ideally something should likely be changed, though.
 

heeheehee

Developer
Staff member
So, in JavaScript, when it does link.getAttribute('id'), does the result differ, depending on whether the page HTML says id=againlink vs. id="againlink" vs. id='againlink' (all of which are valid HTML)?

I bet not.
You would be correct.
If I messed up againLinkExists, that code only exists to keep the wrong link from being used (added after links from the Crimbo Shrub were throwing it off), so it shouldn't really matter for this discussion. Ideally something should likely be changed, though.
It would matter if the againlink doesn't use double-quotes.
 

heeheehee

Developer
Staff member
Turns out I have access to an account in a position to test this!
The man pulls out a stopwatch and a pair of calipers, looks at you for a few seconds, and says "According to my evaluation, you qualify to start at rank #11 in the Fastest Adventurer contest."
HTML:
<p><center>You win the fight!<!--WINWINWIN--><p><P>The coating of weaksauce explodes.  You draw as much of the energy as you can into yourself before it dissipates.<center><Table><tr><td><img src="/images/itemimages/mp.gif" height=30 width=30></td><td valign=center class=effect>You gain 50 Mana Points.</td></tr></table></center><!--familiarmessage--><center><table><tr><td align=center valign=center><img src="/images/itemimages/hat2.gif" width=30 height=30></td><td valign=center>Tonald bends its brim into an approximation of a smile. (<b>+9</b> Stats)</td></tr></table></center><p>You gain 12 Muscleboundness.<bR>You gain 39 Magicalness.<bR>You gain 14 Cheek.<bR><p><a name="end"></a><center></center><center><a href=place.php?whichplace=nstower&action=ns_01_crowd1>Fight Again (1)</a><p><a href=place.php?whichplace=nstower>Back to the Naughty Sorceress' Tower</a></center>

No againlink.

edit: reported KoL bug; hopefully that gets fixed soon.
 
Last edited:

Veracity

Developer
Staff member
and... I went through the three crowds like a hot knife through butter, completely forgetting I wanted to look at this.

Well, I can take heeheehee's code snippet above and splice it into another fight page and use that to debug the issue. I'm sure it's something easy.

If anyone can get the text for winning a fight on the Icy Peak before it's an adventure zone per se, I'll look at that, too. Thanks.
 

heeheehee

Developer
Staff member
HTML:
<p><center>You win the fight!<!--WINWINWIN--><p><center><table><tr><td align=center valign=center><img src="/images/itemimages/meat.gif" width=30 height=30></td><td valign=center>You gain 206 Meat</td></tr></table></center><!--familiarmessage--><center><table><tr><td align=center valign=center><img src="/images/itemimages/hat2.gif" width=30 height=30></td><td valign=center>No Name McGee bends its brim into an approximation of a smile. (<b>+4</b> Stats)</td></tr></table></center><p>You gain 19 Fortitude.<bR>You gain 4 Magicalness.<bR>You gain 13 Chutzpah.<bR><p><a name="end"></a></center><center><center><a href=place.php?whichplace=mclargehuge&action=cloudypeak2>Once more unto the Peak!</a><p><a href=place.php?whichplace=mclargehuge>Back to Mt. McLargeHuge</a></center></center>
 

Veracity

Developer
Staff member
> test load winwin.html

Read 10,638 bytes into a 10,638 character string

> test aagain

place.php?whichplace=nstower&action=ns_01_crowd1
Looking at the code, I every reason to think that the "again" stationary button will link to that and will be enabled.

But, when you say "I play from the relay browser and after fights I just press "1" (which is where the Adventure Again icon is for me). But here it doesn't work." and I see the word "icon", I think you must be talking about the CAB. I don't use the CAB. So, if this is a CAB issue, I'll leave it for somebody who DOES use it...
 

Veracity

Developer
Staff member
> test load winwin2.html

Read 10,546 bytes into a 10,546 character string

> test aagain

place.php?whichplace=mclargehuge&action=cloudypeak2
Thanks again, heeheehee. Looks like we successfully extract the Icy Peak location, too.

I will submit the "test aagain" command so that anybody can do this, at least.
 

Veracity

Developer
Staff member
I have confirmed that the "again" button works perfectly on the Icy Peak.
So, this report has to be about the CAB.
Deferring to a CAB-using developer.
 

heeheehee

Developer
Staff member
For whatever it's worth, I got a response from Gemelli that he'd ping CDM about adding againlink to those, which should make the CAB automatically work.
 

Bale

Minion
Using the CAB, my "adventure again" button in the CAB works just fine. Link is still this:
HTML:
<a href=place.php?whichplace=nstower&action=ns_01_crowd3>Fight Again (1)</a>

so I have no idea why it works for me, but not for plus. I'm just going to mark this feature as implemented even though we didn't do anything since there isn't anything to do. If plus4 insists that it doesn't work for him (and he's had nothing to say in response to our questions since the initial post), then he should make a bug report explaining in detail what is happening to him.
 

lostcalpolydude

Developer
Staff member
The "again" button that mafia provides works. The "(1)" icon that KoL provides (repeat your last action, or adventure again) does not work, but that isn't mafia's fault. The mafia-provided button isn't keyboard-accessible like the other one, so I can understand why this was requested, but it's not something I'm interested in figuring out.
 

Bale

Minion
OH! That optional icon which could be put on the CAB? That's what doesn't work?! I never used it because I always click on the button to the left of the CAB to adventure again and it works fine.

So KoL should make their own CAB work properly or else it should be a request to make the mafia addition to the CAB have a keyboard setting, which I'm not sure is even a good idea.

I guess this feature is rejected, not implemented.
 

PeKaJe

Member
or else it should be a request to make the mafia addition to the CAB have a keyboard setting, which I'm not sure is even a good idea.

I long ago patched my local build of mafia to add an access key to that button, because the alternative is more mouse movement/clicking than I want. So I certainly think it's a good idea, based on my own usage pattern.
 

Bale

Minion
I am curious what access key you use. Obviously you cannot use the ~ key because KoL uses that one. And you cannot use the number keys because KoL uses those also. Which key is it? I'm betting it is the "Q"!
 
Top