New Content - Implemented Crackpot (Bug?)

Lxndr

Member
Verifying ingredients for digital key (1)...
Verifying ingredients for white pixel (11)...
Creating 11 white pixel...
Creation failed, no results detected.

---

Looks like the mystic change broke mafia's ability to make pixel items.
 

Veracity

Developer
Staff member
"The mystic change". I have no idea what you are talking about.

Explain, please?

Thanks.
 

lostcalpolydude

Developer
Staff member
January 08, 2013 - Made some backend changes to the way the Crackpot Mystic works.
The URL changed, and in this case the old URL no longer works (plains.php still works for some reason).
 

jwylot

Member
using 11774
Code:
Unknown item found:
white pixel (459, 603807622)
--------------------
459 white pixel 603807622 pixel1.gif none t,d 25 white pixels
# white pixel
--------------------
Unknown item found: red pixel potion (464, 968682404)
--------------------
464 red pixel potion 968682404 ppotion.gif usable, combat t,d 50 red pixel potions
# red pixel potion
--------------------
Unknown item found: blue pixel potion (465, 619523877)
--------------------
465 blue pixel potion 619523877 ppotion.gif usable, combat t,d 50 blue pixel potions
# blue pixel potion
--------------------
Unknown item found: green pixel potion (466, 809354660)
--------------------
466 green pixel potion 809354660 ppotion.gif usable, combat t,d 50 green pixel potions
# green pixel potion
--------------------
Unknown item found: purple pixel pie (467, 334196995)
--------------------
467 purple pixel pie 334196995 pie.gif food t,d 50 purple pixel pies
# purple pixel pie
--------------------
Unexpected error, debug log printed.
You acquire white pixel (7)
Unknown item found: digital key (691, 503819853)
--------------------
691 digital key 503819853 pixelkey.gif none q 0 digital keys
# digital key
--------------------
Unexpected error, debug log printed.
Unexpected error, debug log printed.
You acquire an item: digital key
Unexpected error, debug log printed.
You acquire an item: red pixel potion
Unexpected error, debug log printed.
You acquire an item: red pixel potion
Unexpected error, debug log printed.
You acquire an item:
 

Lxndr

Member
"The mystic change". I have no idea what you are talking about.

Explain, please?

Thanks.

Apologies for the lack of explanation - I made the (unwarranted) presumption that the trivial changes were more-or-less common knowledge. I'll try to be clearer in the future.

thanks for the fix!
 

roippi

Developer
From when the new content was pushed today, buying new things in relay:

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
             KoLmafia v15.8, Windows 7, Java 1.6.0_32
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Mon Jan 14 20:02:44 EST 2013
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at net.sourceforge.kolmafia.request.PixelRequest.registerRequest(PixelRequest.java:129)
	at net.sourceforge.kolmafia.request.CreateItemRequest.registerRequest(CreateItemRequest.java:1234)
	at net.sourceforge.kolmafia.RequestLogger.doRegister(RequestLogger.java:672)
	at net.sourceforge.kolmafia.RequestLogger.registerRequest(RequestLogger.java:479)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1404)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1346)
	at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:2055)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:222)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:185)
	at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:519)
	at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:158)
	at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:131)
 

Catch-22

Active member
From when the new content was pushed today, buying new things in relay

CreateItemRequest.getInstance will return null when the item doesn't exist in the concoctions database, getQuantityPossible will return null when the instance of the item request is null and Java will throw an exception if you try to compare an integer to null as in if ( 1 < null ).

Fixing this NPE with the least amount of work would just be adding the new items to the item and concoctions database.
 

roippi

Developer
The point is that we have historically taken a lot of steps to make mafia play well with unknown content. We should not throw an NPE at all.
 

Catch-22

Active member
The point is that we have historically taken a lot of steps to make mafia play well with unknown content. We should not throw an NPE at all.

Agreed, I was just pointing out how to fix it with the least amount of work/effort ;)

2nd easiest way would be simply adding an assertion. Mafia would still error out, it just wouldn't be an NPE, it would error out earlier. I'm guessing that you're suggesting KoLmafia discovers the items/concoctions as it parses the crackpot mystic page?

I guess it's up to you how much coding you want to do for something which, historically, hasn't changed in many years.
 
Last edited:

Veracity

Developer
Staff member
The point is that we have historically taken a lot of steps to make mafia play well with unknown content. We should not throw an NPE at all.
Correct.

That understanding is (part of) why you are a KoLmafia dev.


Catch-22;86276I said:
I'm guessing that you're suggesting KoLmafia discovers the items/concoctions as it parses the crackpot mystic page?
We do that for quite a few other places which have never changed. The seal recipes, for example.

If we had thought to do that here, there would have been no problem.

Too bad we didn't.

I mean, it's not like it's difficult, considering all the example code we have which does it elsewhere...
 
Last edited:

Catch-22

Active member
Yeah, I know. I was asking for clarification, I wasn't saying it's a bad idea. I was also noting the areas that would need to be fixed if you wanted to fix it completely (where the nulls were actually being generated) and I only noted the simplest form of a fix.

I just wasn't sure if Roippi was aware of what was causing the NPE (all he did was post a debug log). The issue has gone by unnoticed before, when the pixel whip was added.
 

lostcalpolydude

Developer
Staff member
The NPE is fixed now. New recipes aren't discovered, and ingredients aren't removed for new items that are made though.
 
Top