Bug - Fixed Not detecting use of jar of psychoses (The Crackpot Mystic)

Bale

Minion
For some reason mafia has failed to detect using "jar of psychoses (The Crackpot Mystic)" for me. (This has happened at least twice.)

I go to the Crackpot Mystic in the relay browser and click his button. I get a jar of psychoses (The Crackpot Mystic) and mafia adds a [use] link. I click that link and it is properly installed in my campground.

Unfortunately the property _psychoJarUsed is not set to true and get_campground() does not contain the jar.

Code:
[COLOR="#808000"]> get _psychoJarUsed[/COLOR]

false

[COLOR="#808000"]> ash get_campground()[/COLOR]

Returned: aggregate int [item]
Certificate of Participation => 1
Dramatic™ range => 1
Frobozz Real-Estate Company Instant House (TM) => 1
ice harvest => 0
Little Geneticist DNA-Splicing Lab => 1
My First Shaker™ => 1

[COLOR="#808000"]> refresh all[/COLOR]

Refreshing session data...
Synchronizing moon data...
Loading character status...
Retrieving character data...
Updating inventory...
Examining Meat in closet...
Updating closet...
Retrieving quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving campground data...
Examining Meat and pulls in storage...
Updating storage...
You are currently a member of Hardcore Nation
Visiting Hot Dog Stand in clan VIP lounge
Visiting Speakeasy in clan VIP lounge
Session data refreshed.

[COLOR="#808000"]> ash get_campground()[/COLOR]

Returned: aggregate int [item]
Certificate of Participation => 1
Dramatic™ range => 1
Frobozz Real-Estate Company Instant House (TM) => 1
ice harvest => 0
jar of psychoses (The Crackpot Mystic) => 1
Little Geneticist DNA-Splicing Lab => 1
My First Shaker™ => 1

[COLOR="#808000"]> get _psychoJarUsed[/COLOR]

false

Refreshing the session caused mafia to recognize that it is in the campground.
 

Veracity

Developer
Staff member
I see the following code in UseItemRequest:

Code:
		case ItemPool.SUSPICIOUS_JAR:
		case ItemPool.GOURD_JAR:
		case ItemPool.MYSTIC_JAR:
		case ItemPool.OLD_MAN_JAR:
		case ItemPool.ARTIST_JAR:
		case ItemPool.MEATSMITH_JAR:
		case ItemPool.JICK_JAR:
			// You may have been successful
			if ( responseText.contains( "You open the jar and peer inside." ) )
			{
				CampgroundRequest.setCampgroundItem( itemId, 1 );
				Preferences.setBoolean( "_psychoJarUsed", true );
			}
			else
			{
				// If not, don't remove it
				ResultProcessor.processResult( item );
			}
			return;
Has the message changed when you use it, or does it now redirect differently, or has this never worked?
 

Bale

Minion
It definitely used to work. I noticed this because a previously functional script started to fail. (ChIT modifies the uneffect link to use the jar to uneffect the various bad effects there instead of a SGEEA if the jar is available. It stopped doing that.)

I'll have to check the response text next time I do this!
 

Veracity

Developer
Staff member
I did this today and completely forgot about this report.
I'll try to remember to get a DEBUG log next time - unless you do it first.
 

Bale

Minion
Ah! I'm so glad you just bumped this. Right now is a great time for me to do this.

I put it on pastebin for you: DEBUG
 

Veracity

Developer
Staff member
OK, so this is a KoL change.

Requesting: http://www.kingdomofloathing.com/inv_use.php?which=3&whichitem=5900&pwd&ajax=1
Retrieved: http://www.kingdomofloathing.com/inv_use.php?which=3&whichitem=5900&pwd&ajax=1
Field: Location = [place.php?whichplace=junggate_3]
(that is a new redirect)
Requesting: http://www.kingdomofloathing.com/place.php?whichplace=junggate_3
Retrieved: http://www.kingdomofloathing.com/place.php?whichplace=junggate_3
responseText has:

You open the jar and peer inside. The swirling subconscious-extract makes you dizzy, so you lie on the couch (couch?) as you feel your mind projecting itself into the jar.

That's the same as before, but it's not in a response to inv_use.php any more.

KoL changes are "New Content", so I will change the tag. I'll implement the fix, by and by.
 

Veracity

Developer
Staff member
Actually, this is not a change; it was a bug I introduced.
If only Sourceforge would let me commit code...
 

Ezandora

Member
r15343, daily build release.

Not sure if this is fixed. _psychoJarUsed hasn't been updating for me for a few days. I've been opening the crackpot mystic jar from a mafia script, via use(). Here's an independent test on a multi:

Code:
> ash use(1, $item[jar of psychoses (crackpot mystic)])

Changing "jar of psychoses (crackpot mystic)" to "jar of psychoses (The Crackpot Mystic)" would get rid of this message ()
Using 1 jar of psychoses (The Crackpot Mystic)...
Finished using 1 jar of psychoses (The Crackpot Mystic).
Returned: true

> get _psychoJarUsed

false

> ash get_campground()

Returned: aggregate int [item]
Certificate of Participation => 1
Newbiesport™ tent => 1

Debug log attached.
 

Attachments

  • DEBUG_20150204.txt
    10.8 KB · Views: 124

lostcalpolydude

Developer
Staff member
There's a redirect to whichplace=junggate_3, which mafia follows, and it has the String we are checking for in the response. Maybe UseItemRequest.lastItemUsed is being set to null before UseItemRequest.parseJungGate() is called.
 

Veracity

Developer
Staff member
Can't forget that that KoL requests redirect without ajax (as Bale found) and don't do that with ajax (as Ezandora found)...

Revision 15345
 
Top