Pages: [1] :: one page |
Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Dmitryilyin
Gallente Risky eXplosion Red Alliance
|
Posted - 2009.02.20 15:18:00 -
[1]
Edited by: Dmitryilyin on 20/02/2009 15:23:20 Here is some script I use to calculate production cost of T1 stuff. All calculators I found was GUI or Web based, so i decided to make CLI one. It is first version and doesn't support lots of usefull features jet.
file: eveprodcalc.sh #!/bin/sh
GetDefaults() { CONFIG="eveprodcalc.conf" }
SourceFile() { if [ -r "${1}" ]; then source "${1}" if [ ${?} -ne "0" ]; then echo "Error sourcing file ${1}!" exit 1 fi else echo "File ${1} not found!" exit 1 fi }
CheckVars() { if [ -z "${DAFAULT_WASTE}" ]; then echo "No default waste!"; exit 1; fi if [ -z "${ME}" ]; then echo "No ME!"; exit 1; fi if [ -z "${PRODUCTION_EFFICIENCY_LEVEL}" ]; then echo "No Production Efficiency Level!"; exit 1; fi if [ -z "${INDUSTRY_LEVEL}" ]; then echo "No Industry Level!"; exit 1; fi }
Calculation() { awk ' function CalculateAmount(orig_amount) { return orig_amount * (1 + PERSONAL_WASTE + BP_WASTE) } BEGIN { PERSONAL_WASTE=0.25-(0.05* '\""${PRODUCTION_EFFICIENCY_LEVEL}"\"') BP_WASTE='\""${DAFAULT_WASTE}"\"' / (1+'\""${ME}"\"') / 100
TRITANIUM_AMOUNT=CalculateAmount('\""${TRITANIUM}"\"') PYERITE_AMOUNT=CalculateAmount('\""${PYERITE}"\"') MEXALLON_AMOUNT=CalculateAmount('\""${MEXALLON}"\"') ISOGEN_AMOUNT=CalculateAmount('\""${ISOGEN}"\"') NOCXIUM_AMOUNT=CalculateAmount('\""${NOCXIUM}"\"') ZYDRINE_AMOUNT=CalculateAmount('\""${ZYDRINE}"\"') MEGACYTE_AMOUNT=CalculateAmount('\""${MEGACYTE}"\"')
TRITANIUM_COST=TRITANIUM_AMOUNT * '\""${TRITANIUM_PRICE}"\"' PYERITE_COST=PYERITE_AMOUNT * '\""${PYERITE_PRICE}"\"' MEXALLON_COST=MEXALLON_AMOUNT * '\""${MEXALLON_PRICE}"\"' ISOGEN_COST=ISOGEN_AMOUNT * '\""${ISOGEN_PRICE}"\"' NOCXIUM_COST=NOCXIUM_AMOUNT * '\""${NOCXIUM_PRICE}"\"' ZYDRINE_COST=ZYDRINE_AMOUNT * '\""${ZYDRINE_PRICE}"\"' MEGACYTE_COST=MEGACYTE_AMOUNT * '\""${MEGACYTE_PRICE}"\"'
printf("Blueprint: %s\n",'\""${NAME}"\"') printf("ME: %s\n",'\""${ME}"\"') #printf("PE: %s\n",'\""${PE}"\"') printf("BP waste: %0.5f%\n",BP_WASTE*100) if ( PERSONAL_WASTE != "0" ) { printf("Personal waste: %0.0f%\n",PERSONAL_WASTE*100) printf("Total waste: %0.5f%\n",(PERSONAL_WASTE+BP_WASTE)*100) } printf("\n") printf("Tritanium Amount: %0.0f\n",TRITANIUM_AMOUNT) printf("Pyerite Amount: %0.0f\n",PYERITE_AMOUNT) printf("Mexallon Amount: %0.0f\n",MEXALLON_AMOUNT) printf("Isogen Amount: %0.0f\n",ISOGEN_AMOUNT) printf("Nocxium Amount: %0.0f\n",NOCXIUM_AMOUNT) printf("Zydrine Amount: %0.0f\n",ZYDRINE_AMOUNT) printf("Megacyte Amount: %0.0f\n",MEGACYTE_AMOUNT) printf("\n") printf("Tritanium Cost: %0.2f ISK\n",TRITANIUM_COST) printf("Pyerite Cost: %0.2f ISK\n",PYERITE_COST) printf("Mexallon Cost: %0.2f ISK\n",MEXALLON_COST) printf("Isogen Cost: %0.2f ISK\n",ISOGEN_COST) printf("Nocxium Cost: %0.2f ISK\n",NOCXIUM_COST) printf("Zydrine Cost: %0.2f ISK\n",ZYDRINE_COST) printf("Megacyte Cost: %0.2f ISK\n",MEGACYTE_COST) printf("\n") printf("Total Cost: %0.2f ISK\n",TRITANIUM_COST+PYERITE_COST+MEXALLON_COST+ISOGEN_COST+NOCXIUM_COST+ZYDRINE_COST+MEGACYTE_COST) }' }
Main() { GetDefaults SourceFile "${CONFIG}" SourceFile "${1}" CheckVars Calculation }
Main "${@}"
And config file file: eveprodcalc.conf #SKILLS PRODUCTION_EFFICIENCY_LEVEL="5" INDUSTRY_LEVEL="5"
#PRICES TRITANIUM_PRICE="3.59" PYERITE_PRICE="3.45" MEXALLON_PRICE="21.04" ISOGEN_PRICE="47.56" NOCXIUM_PRICE="69.87" ZYDRINE_PRICE="1750.40" MEGACYTE_PRICE="2499.02" MORPHITE_PRICE="7356.21"
And example "bp" file file: drake.bp #BP NAME="Drake" DAFAULT_WASTE="10" #Percent ME="50" #RESOURCES TRITANIUM="2444312" PYERITE="612070" MEXALLON="168645" ISOGEN="17467" NOCXIUM="12364" ZYDRINE="3603" MEGACYTE="839"
Also here you can find skill monitor http://www.eveonline.com/ingameboard.asp?a=topic&threadID=929881
|

Dmitryilyin
Gallente Risky eXplosion Red Alliance
|
Posted - 2009.02.20 15:24:00 -
[2]
Output example:
Blueprint: Drake ME: 50 BP waste: 0.19608%
Tritanium Amount: 2449105 Pyerite Amount: 613270 Mexallon Amount: 168976 Isogen Amount: 17501 Nocxium Amount: 12388 Zydrine Amount: 3610 Megacyte Amount: 841
Tritanium Cost: 8792286.12 ISK Pyerite Cost: 2115781.97 ISK Mexallon Cost: 3555248.23 ISK Isogen Cost: 832359.40 ISK Nocxium Cost: 865566.55 ISK Zydrine Cost: 6319057.26 ISK Megacyte Cost: 2100788.91 ISK
Total Cost: 24581088.45 ISK
|

Gaius Aemilius
Wormhole-space Surveying and Exploitation
|
Posted - 2009.02.20 17:25:00 -
[3]
Love CLI stuff.
I'll have to look the code over later when I have more processing cycles.
Thanks though. Great idea.
|

vvizard NOR
|
Posted - 2009.02.20 23:01:00 -
[4]
Nice idea!
Not sure if there's an easy way to integrate xml processing with a shell script, but it would be cool if it, lets say used curl(1) to fetch xml-data from eve-central.com and parse it to get the actual mineral costs. Would probably be even more awsome if you supply the community with all those *.bp files as you make them :)
|

Dmitryilyin
Gallente Risky eXplosion Red Alliance
|
Posted - 2009.02.21 11:12:00 -
[5]
I guess this would be todo list: - Load material list from database - Load mineral prices from eve-central - Add support for t2 and capitals production - Add production time an runs calculation - Add BP price/profit calculation
|

Jay Dilla
|
Posted - 2009.02.21 11:20:00 -
[6]
hi, Could anyone elaborate abit on how to use this code? I'm just starting to get into production that would help a lot.
Regards
Jay D
|

Intakstor
|
Posted - 2009.02.21 19:01:00 -
[7]
Originally by: Jay Dilla hi, Could anyone elaborate abit on how to use this code? I'm just starting to get into production that would help a lot.
Regards
Jay D
|

Dmitryilyin
Gallente Risky eXplosion Red Alliance
|
Posted - 2009.02.26 11:18:00 -
[8]
Rewritten and moved to http://www.eveonline.com/ingameboard.asp?a=topic&threadID=1008844
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |