
Pantload
Handsome Millionaire Playboys Flatline.
5
|
Posted - 2012.02.04 06:57:00 -
[1] - Quote
Consider the following snippet of code:
*********************************************************************************
from reverence import blue
EVE_PATH = "###### YOUR EVE PATH HERE ######"
eve = blue.EVE(EVE_PATH) loc = eve.cfg.evelocations.get it = eve.cfg.invtypes.get
f = blue.ResFile() f.Open("res:/UI/Shared/Maps/mapcache.dat") mapcache = blue.marshal.Load(f.Read()) print "mapcache.keys() = %s" % mapcache.keys(), '\n'
planets = mapcache['planets'] planets_by_system = {} for id, info in planets.iteritems(): ....system_name = loc(info[0]).locationName ....planet_type = str(it(info[1]).typeName) ....#highsec systems seem to always have lower case letters in their names ....if system_name != system_name.upper(): ........if not system_name in planets_by_system: ............planets_by_system[system_name] = [] ........planets_by_system[system_name].append((planet_type, id))
for n in sorted(planets_by_system.keys()): ....print n ....for p in sorted(planets_by_system[n]): ........print p
*********************************************************************************
Sample output looks like this:
Aakari ('Planet (Barren)', 40088910) ('Planet (Barren)', 40088913) ('Planet (Barren)', 40088982) ('Planet (Gas)', 40088917) ('Planet (Gas)', 40088932) ('Planet (Gas)', 40088956) ('Planet (Gas)', 40088986) ('Planet (Lava)', 40088912) ('Planet (Lava)', 40088915) ('Planet (Oceanic)', 40088922) ('Planet (Storm)', 40088925) ('Planet (Storm)', 40088998) Abagawa ('Planet (Barren)', 40009338) ('Planet (Gas)', 40009343) ('Planet (Gas)', 40009354) ('Planet (Gas)', 40009375) ('Planet (Ice)', 40009385) ('Planet (Lava)', 40009333) ('Planet (Lava)', 40009335) ('Planet (Storm)', 40009348) ('Planet (Temperate)', 40009340)
*********************************************************************************
Questions:
1) Where do I look up a conversion of the "id" into a planet name? 2) Can I look up attributes for a planet similar to show info in game? ( for example: planet radius )
Any help is greatly appreciated.
Cheers, PL |