Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EVEROOT = r"C:/Program Files (x86)/CCP/EVE"
- OUTPATH = r"C:/orderdump"
- import time
- import os
- from reverence import blue
- eve = blue.EVE(EVEROOT)
- cfg = eve.getconfigmgr()
- cachemgr = eve.getcachemgr()
- cmc = cachemgr.LoadCacheFolder("CachedMethodCalls")
- print "Deleting old records... \n"
- for root, dirs, files in os.walk(OUTPATH, topdown=False):
- for name in files:
- os.remove(os.path.join(root, name))
- for key, obj in cmc.iteritems():
- if key[1]=="GetOrders":
- item = cfg.invtypes.Get(key[3])
- region = cfg.evelocations.Get(key[2])
- print "Processing " + item.name + " [" + region.locationName +"]... \n"
- txtfile = open(os.path.join(OUTPATH, item.name+"-"+region.locationName+".csv"), 'w')
- txtfile.write("orderID,typeID,volumeEntered,volumeRemaining,price,minVolume,bid,duration,stationID,range,jumps,\n")
- for history_item in obj['lret']:
- for entry in history_item:
- line = "%(OrderID)i, %(TypeID)i, %(VolEnt)i, %(VolRem)i, %(Price).2f, %(MinVolume)i, \
- %(Duration)i, %(StationID)i, %(Range)i, %(Jumps)i," % \
- {'OrderID': entry['orderID'], \
- 'TypeID': entry['typeID'], \
- 'VolEnt': entry['volEntered'], \
- 'VolRem': entry['volRemaining'], \
- 'Price': entry['price'], \
- 'MinVolume': entry['minVolume'], \
- 'Duration': entry['duration'], \
- 'StationID': entry['stationID'], \
- 'Range': entry['range'], \
- 'Jumps': entry['jumps']}
- txtfile.write(line+"\n")
- txtfile.close()
Advertisement
Add Comment
Please, Sign In to add comment