The PI API - some issues im having with more advanced stuff

Remember, the API is terrible. I know, /u/ccp_foxfour is doing his best, but EVE is terrible and hence the API will be too.

So! The following pin attributes belong to each pin type (silo/launchpad, factory, extractor):

Everything: pinID="1016985113514" longitude="-4.22189173051" latitude="1.38254500766" typeID="2484" - the type of the pin, same below. typeName="Storm Advanced Industry Facility"

Factory:

schematicID="67" - Which schematic is installed, 0 if empty IIRC.
lastLaunchTime="2015-03-04 08:11:26" (also command centers) - for factories, this is the last time it started a cycle.

Extractor:

cycleTime="0"
quantityPerCycle="0"
installTime="0001-01-01 00:00:00"
expiryTime="0001-01-01 00:00:00"

Anything with an inventory:

contentTypeID="2390"
contentTypeName="Electrolytes"
contentQuantity="40"

To determine the factory cycle time, you need to look up the schematic in the SDE. There are no assumptions involved.

In the debug output, you're seeing "Starting new (something) cycle based on API assumptions (LLt: 2015-03-07 10:01:40)." - this is an attempt to fix one annoying issue, namely that the API does not let you know whether said factory is doing things or not, just the last time it started a cycle. My code assumes a cycle is under way if the lastLaunchTime is within 1.1cycleTime of the planet's lastUpdate time. This isn't strictly speaking correct, but it's correct more often than not - and the alternative is worse, as it'd lose a factory cycle on *all factories. This is, by the way, the only assumption I make; the rest is as close to EVE as possible, with the potential for small discrepancies based on order of execution - no easy way to predict that, so I don't.

And yes, your assumption is correct - the factories just update the inventory of whatever thing they're hooked up to. The extractors extract realistically; you might've seen the code to calculate it on evelopedia (which I happened to write).

/r/evetech Thread