session results

zekaonar

Member
I'm looking to tap into the data displayed in the overview>session results. This is the data that displays meat, item and substat gain for the session. Does anyone know the CLI/ash to get at this data?
 

fronobulax

Developer
Staff member
I'm pretty certain there isn't one.

That's what I was thinking too. But I see to recall a pretty slick alias or two floating around that did a before and after on inventory and the computed some kind of difference, which might suffice.
 

Veracity

Developer
Staff member
Perhaps the ASH session_logs function would be of use to you.

string[ int ] lines = session_logs( 1 );

will give you an array of the lines of today's session log. That is obviously not identical to what is in the gCLI - which has things in it that don't go in to the file, and vice versa, and which only has stuff from the current session - but, depending on what you need this for, it might fill the bill.
 

zekaonar

Member
To resurrect this past conversation, I'm looking to write some auto-spading code for droprates. In some preAdventure code I can record item drop, food drop, meat drop, etc and then in a post adventure script I'd like to analyze the last combat done for drops with enough info to determine pickpockets, disgorges, etc. I'm hoping to tap into some mafia data structures without having to parse things from scratch. Best places to get at this data?
 

Theraze

Active member
That's what I was thinking too. But I see to recall a pretty slick alias or two floating around that did a before and after on inventory and the computed some kind of difference, which might suffice.

Was that the trackitems alias?
Code:
trackitems => ashq int [item] currentinv = get_inventory(); int currentmeat = my_meat(); try{cli_execute("%%");}finally{ int [item] postinv = get_inventory(); int postmeat = my_meat(); foreach i2,c2 in postinv{if (postinv[i2] != currentinv[i2]) print(i2 + ": " + (postinv[i2].to_int() - currentinv[i2].to_int()));} foreach i1,c1 in currentinv{if (postinv[i1] == 0) print(i1 + ": " + (-c1));}if (postmeat != currentmeat) print("Meat: " + (postmeat - currentmeat));}
 
Top