Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --table information is taken from the new_economic_arcade.html attachment attached on Borisych's post explaining the economy changes at 1.29, accessible at http://forum.warthunder.com/index.php?/topic/22413-economy-v129/page-0
- --is the improvement actually paying off for the increase in airplane research and training costs?
- --feel free to run it at lua.org/demo.html
- US={-655,-707,-678,2124,1072,1522,4145,2118,3138,3202,1347,738,2070,2245,6240,1750,1050,-1867,-638,-54,1147,3526,1802,70,752,-1178,-370,-344,64,142,-158,1031,1420,175,1049,631,-276,-1098}
- Germany={-717,-715,-795,-800,-811,-473,522,862,869,1354,926,772,1424,-696,-722,-700,-722,-779,-566,115,776,1198,1833,632,-1478,751,-1855,730,-680,4694,4320,-1131,2601,-2133,-422,193,1542,103,784,1811,152,4306,-654,-689,-388,305,-105,-164,1000,-59,710,1983,1805,-1620,-430,767,5411,2624,5867}
- USSR={15,101,3148,2146,-729,-739,-738,-705,-879,-691,3545,1488,4286,314,3550,-856,-829,-728,-365,311,856,-704,-800,-241,355,387,199,850,1377,1604,898,2599,2130,234,3345,3193,3508,-759,-452,-81,488,775,807,1349,1784,-13,1114,1992,-40,503,1537,750,1656}
- --the original britain table had japanese planes too, but i removed them from here.
- Britain={-678,-685,-707,-690,52,59,-39,2283,2825,-758,402,3909,1908,4240,1392,2089,-2001,-4234,-13930,-13930,-465,-138,247,2822,3459,757,458,1534,1244,1687,2005,9837,-1177,-593,710,1156,523,116,5592,3131}
- --Japan's table is actually US table again originally. instead i'm picking the data from the rest of the Britain table.
- Japan={-167,1232,2002,2177,5439,-309,2535,7112,-748,-761,-758,-771,87,1143,1489,1836,1350,-487,-687,4880,-333,1244,2032,3244,5293,5681,502,11,3100,-75}
- --now for the code part.
- NationTable={US,Germany,USSR,Britain,Japan}
- --loops through all the tables.
- for Nation,Table in pairs(NationTable) do--lame variable naming, i know
- --loops through each nation's table to get the average
- PlanesInNation=0
- TotalImprovement=0--might be anedoctal. or not.
- for _,v in pairs(Table)do
- PlanesInNation=PlanesInNation+1
- TotalImprovement=TotalImprovement+v
- end
- --averages it out and outputs the result for a nation
- local AverageImprovement=TotalImprovement/PlanesInNation
- print(PlanesInNation.." Planes, Average Profit Improvement = "..AverageImprovement)
- --i would print out the nation name, but lua stores it as a memory address:-/
- --anyway, the order is US-Germany-USSR-Britain-Japan for those too lazy to check or unable to read lua scripts.
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement