Bug - Waiting for Info Discard Karma link on Astral Gash doesn't discard Karma

Veracity

Developer
Staff member
Now checking r11313 ... works just as well, using Java 6.0.310 and Firefox 12.0, updated to FF 14.0.1 and still discards properly
That's the current version.

Nothing was changed in KoLmafia between your initial report and this report that had anything to do with discarding.
 

Darzil

Developer
Ok, Boris 30 done, so time for testing :

Running KoLmafia v15.3 r11323, Windows 7, Java 1.6.0_33, IE 9.0.8112.

Switched on debug log, clicked on discard link, switched off debug log.

The debug log was :
<!--lastseen:0000002764-->
<!--lastseen:0000002765-->

I then compared the two URL's on the discard links.

URL on ascend page (not working for me) : javascript:if(confirm('Are you sure you want to discard your Instant Karma?')) singleUse('inventory.php?which=1&action=discard&pwd=[PWD]&whichitem=4448&ajax=1');void(0);
URL on equipment page (working for me) : http://127.0.0.1:60080/inventory.php?which=1&action=discard&pwd=[PWD]&whichitem=4448

I guess that narrows it down to either the lack of host/port at the front, or the presence of ajax=1, or javascript confirm is appearing but then not firing when Ok clicked. It seems interesting that the two options handle are you sure differently, with the first doing it in javascript, and the second presumably in kolmafia code (as it's not in the URL).
 

lostcalpolydude

Developer
Staff member
Code:
<a href="inventory.php?which=1&action=discard&pwd=&whichitem=4448" onclick='return discardconf("Instant Karma");'>[discard]</a>
That is KoL's code. That function is
Code:
function discardconf(item)
{
	return autodiscard || confirm("Are you sure you want to discard your " + item + "?");
}
singleUse is a javascript function in a mafia file (basics.js) that ultimately executes some mafia code.

Looking more closely, singleUse() apparently wants 2 parameters, and it is only given 1 parameter there. It is done in other places (I probably copied it from one of them). I don't know enough about javascript to understand why that works for anyone, or if that could be the cause of something working for some people but not everyone.
 
Last edited:

Ruby Eyes

Member
Don't you want to edit out your pwd?

Besides that ... if singleUse is a javascript function, you can usually blame different execution methods on different browsers on different computers with different security settings; sometimes even firewalls are interfering with those.
 
Last edited:
Top