ABSOLUTELY AWESOME!!

I've managed to change the CS file to make it use fuel instead of scrap so it makes it feel more RP.

I was hoping to get it to use Diesel Barrels (to give them a use other than excavator) but to make that practical I have to set the "cost" to something like .00084 (1 barrel for 500w per day) -- but the system doesn't like going to such a low decimal.

 

Without hacking your base code apart is there any suggestion on what I can change to make that happen?

Awesome! Using fuel is a great idea!

As for the decimal issue, it is because the "Price per watt" setting is of a 'float' type which only allows for a certain amount of precision. An easy way to increase the precision would be to change it from 'float' to 'double', as double allows for a much more precise decimal. The rest of the calculations are already in double precision, so all you would need to do is change the definition of PricePerWatt from float to double. It should look like this after you make the change:

		private Configuration config;
		private class Configuration
		{
			[JsonProperty(PropertyName = "Price per watt (hourly)")]
			public double PricePerWatt = 0.1f;

			[JsonProperty(PropertyName = "Min power")]
			public float MinPower = 10;

			[JsonProperty(PropertyName = "Max power")]
			public float MaxPower = 1000;

			[JsonProperty(PropertyName = "Power increments")]
			public float PowerIncrements = 10;

			[JsonProperty(PropertyName = "Use economics balance (requires plugin)")]
			public bool UseEconomics = false;
		}

I think that should allow you to get as small as you would like. If it still doesn't look right, there may be some rounding in the UI you could tweak too, let me know if that helps!

Can we see this change officially in an update to the plugin?

If Nerdlancer is willing to share his code I wouldn't mind posting an official version, giving credit to his work.

Oh all I did was change the item ID's and some of the numbers used for the calculation.

So in the .CS file lines 200 and 225 just replace -932201673 with -946369541

Then in the JSON file I set it to this - roughly works out to be 2500 LGF for 500W for 24 hours (my server is somewhat easy-mode lol)

 

{
"Price per watt (hourly)": 0.21,
"Min power": 100.0,
"Max power": 1000.0,
"Power increments": 100.0,
"Use economics balance (requires plugin)": false
}

 

If you wanted to make that the official update by all means - I'm not gonna demand credit for like 3 lines :-P 

 

As I said I was originally trying to make it work with diesel but couldn't figure the math to get that to work properly but I'll give your suggestion a crack and see how that goes :)