Repository navigation
Expand file tree
/
Copy pathGoogleSheetAppScripts.js
More file actions
565 lines (423 loc) · 25.6 KB
/
Copy pathGoogleSheetAppScripts.js
File metadata and controls
565 lines (423 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
//Automation.gs -------------------------------------------------------------------------------------------------------------------------------
/*
*/
function createIntervalTrigger() {
// Delete existing triggers for safety
deleteTriggers_();
// Create a new trigger
ScriptApp.newTrigger("fullUpdate")
.timeBased()
.everyMinutes(15) // Options: everyMinutes(n), everyHours(n), everyDays(n)
.create();
}
function fullUpdate() {
console.log("Running full update...");
importGameStats();
copyOldSave();
getSums();
getPlayerInv();
getPowerStats();
calcEfficiency();
console.log("Finished full update.");
}
function deleteTriggers_() {
const triggers = ScriptApp.getProjectTriggers();
for (let i = 0; i < triggers.length; i++) {
if (triggers[i].getHandlerFunction() === "fullUpdate") {
ScriptApp.deleteTrigger(triggers[i]);
}
}
}
//Master Sheet.gs -------------------------------------------------------------------------------------------------------------------------------
/*
*/
let spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
let dataImports = spreadsheet.getSheetByName("ImportData"); //RAW data
let dataOutputs = spreadsheet.getSheetByName("Template"); //FINALIZED data
let oldData = spreadsheet.getSheetByName("Factory History");
let powerSheet = spreadsheet.getSheetByName("Power Grids");
let calculatorSheet = spreadsheet.getSheetByName("Calculator");
const lastRow = dataImports.getLastRow();
function generalGameStats() {
let saveTime = dataImports.getRange("A2").getValue();
let session = dataImports.getRange("B2").getValue();
let saveFile = dataImports.getRange("C2").getValue();
dataOutputs.getRange("B2").setValue(saveTime);
dataOutputs.getRange("B3").setValue(session);
dataOutputs.getRange("B4").setValue(saveFile);
console.log("Game data loaded...");
}
/*
Gets Sum of all resources in MACHINES + VEHICLES
& creates table in TEMPLATE SHEET
*/
function getWorldSums() {
// Get G (Container Owner) and J (qty)
const data = dataImports.getRange(2, 7, lastRow - 1, 4).getValues();
let totals = {}; // <-- key = material, value = total qty
//BUILD TOTALS MAP
for (let i = 0; i < data.length; i++) {
let containerType = data[i][0]; // Column G
let name = data[i][1]; // Column H
let qty = data[i][3]; // Column J
if (!name) continue; // skip empty rows
if (!totals[name]) {
totals[name] = 0;
}
if (containerType !== "player") {
totals[name] += qty;
}
}
//OUTPUT TO TEMPLATE
const outputMaterials = dataOutputs.getRange("E3:E").getValues();
for (let i = 0; i < outputMaterials.length; i++) {
let materialName = outputMaterials[i][0];
if (!materialName) continue;
let total = totals[materialName] || 0;
dataOutputs.getRange(i + 3, 10).setValue(total); // Column J
}
console.log("All material sums updated.");
}
function getPowerStats() {
const lastRow = dataImports.getLastRow();
const data = dataImports.getRange(2, 20, lastRow - 1, 4).getValues();
const prevNums = [];
const filtered = data.filter(row => {
if (row[0] === "" || row[0] === null) return false;
if (prevNums.includes(row[0])) return false;
prevNums.push(row[0]); // track as we go through each row
return true;
});
console.log(filtered);
if (filtered.length > 0) {
powerSheet.getRange(4, 2, filtered.length, filtered[0].length).setValues(filtered);
}
powerSheet.getRange(1, 1).setValue(20);
}
function getPlayerInv() {
const lastRow = dataImports.getLastRow();
const data = dataImports.getRange(2, 7, lastRow - 1, 4).getValues();
let totals = {};
// BUILD TOTALS MAP
for (let i = 0; i < data.length; i++) {
let containerType = data[i][0]; // G
let name = data[i][1]; // H
let qty = data[i][3]; // J
if (!name || containerType !== "player") continue;
totals[name] = (totals[name] || 0) + qty;
}
// CONVERT MAP → ARRAY
let output = [];
for (let material in totals) {
output.push([material, totals[material]]);
}
// OPTIONAL: sort alphabetically
output.sort((a, b) => a[0].localeCompare(b[0]));
//output.sort((a, b) => a[1] - b[1]);
// CLEAR OLD OUTPUT
dataOutputs.getRange("A17:B130").clearContent();
// WRITE NEW DATA
if (output.length > 0) {
dataOutputs.getRange(17, 1, output.length, 2).setValues(output);
}
console.log("Dynamic player inventory updated.");
}
//Calculate Efficiency.gs -------------------------------------------------------------------------------------------------------------------------------
/*
*/
const props = PropertiesService.getScriptProperties();
let tableIncrement = Number(props.getProperty("tableIncrement")) || 0;
function resetFactoryHistory() {
const lastRow = oldData.getLastRow();
const lastCol = oldData.getLastColumn();
const rangeToClear = oldData.getRange(29, 1, lastRow, lastCol);
rangeToClear.clearContent();
rangeToClear.clearFormat();
tableIncrement = 0;
props.setProperty("tableIncrement", tableIncrement);
}
function copyOldSave() {
let saveDate = dataImports.getRange("A2").getValue();
let saveTime = dataImports.getRange("O2").getValue();
const lastRow = dataOutputs.getLastRow();
const lastCol = dataOutputs.getLastColumn();
// Copy table starting at row 1, column = tableIncrement + 1
const start = dataOutputs.getRange(2, 5, lastRow, lastCol);
const finish = oldData.getRange(30, 1 + tableIncrement);
start.copyTo(finish);
oldData.getRange(29, 1 + tableIncrement).setValue(saveDate);
oldData.getRange(29, 2 + tableIncrement).setValue(saveTime);
// Move 6 columns to the right for next copy, |||||wrap after 30 columns
tableIncrement = ((tableIncrement + 6) /*% 30*/);
props.setProperty("tableIncrement", tableIncrement);
console.log("Increment (column): " + tableIncrement);
}
/*
Calculates Production/Cosumption, Net and Efficency
Inputs: Comes from
- 'InportData' for filtering
- 'Factory History' for Timing, and AMT snapshots
Outputs: On 'Template'
- # of machines
- Production/consumption rate
- net
- efficency
*NOTE: if the # of machines is 0 that can mean the material is just not in the output of that machine
**Testing: It looks bad when timeDif = 0 (obv) || storageDif = net 0 even if there are machines
*/
function calcEfficiency() {
console.log((tableIncrement-6) +" | " + (tableIncrement-12));
if (tableIncrement < 12) {
console.log("Need More Data, Increment is too low");
} else {
let last = oldData.getLastRow();
let timeDif = (((oldData.getRange(29, 2 + tableIncrement - 6).getValue() - oldData.getRange(29, 2 + tableIncrement - 12).getValue()) / 1000) / 60);
let data = dataImports.getRange(2, 8, lastRow - 1, 17).getValues();
//goes through material list in 'FACTORY HISTORY'
for (let r = 31; r <= last - 2; r++) {
//reset prev. outputs in 'TEMPLATE'
dataOutputs.getRange(r - 28, 6).clearContent();
dataOutputs.getRange(r - 28, 7).clearContent();
dataOutputs.getRange(r - 28, 8).clearContent();
dataOutputs.getRange(r - 28, 9).clearContent();
//get current resource
let resource = oldData.getRange(r, 1).getValue();
if (!resource) continue;
//get past and current AMTs
let preStorage = oldData.getRange(r, tableIncrement - 6).getValue();
let postStorage = oldData.getRange(r, tableIncrement).getValue();
//get # of machines by going through 'IMPORTDATA' checking columns H/X
let amtMachines = 0;
for (let i = 0; i < data.length; i++) {
let name = data[i][0]; //Column H
let output = data[i][16];//Column X
// console.log(`row: "${i}" | name: "${data[i][0]}" | output col: "${data[i][16]}"`);
if (!name) continue;
if (name == resource && output == "output") amtMachines++;
}
//get output rate from RECIPE object
let outputRate = RECIPES[resource] ? RECIPES[resource].output : 0;
let net = (postStorage - preStorage) / timeDif;
let prodCons = -1* (outputRate * amtMachines - net);
// console.log(`${resource} | machines: ${amtMachines} | net: ${net} | prodCons: ${prodCons}`);
//output onto 'TEMPLATE'
dataOutputs.getRange(r - 28, 6).setValue(amtMachines).setNumberFormat("0");
if (amtMachines > 0) {
dataOutputs.getRange(r - 28, 7).setValue(prodCons).setNumberFormat("0.0");
}
dataOutputs.getRange(r - 28, 8).setValue(net).setNumberFormat("0.0");
dataOutputs.getRange(r - 28, 9).setValue(postStorage - preStorage).setNumberFormat("0");
}
console.log("Finished Data Inputs!")
}
}
//Calculator.gs -------------------------------------------------------------------------------------------------------------------------------
/*
*/
let totals = {};
let calculatorIncrement = 2;
function clearCalculator(){
calculatorSheet.getRange("A2:F60").clearContent();
calculatorSheet.getRange("A3:F60").clearFormat();
}
function onEdit(e) {
const range = e.range;
const sheet = range.getSheet();
if (sheet.getName() !== "Calculator") return;
const editedCell = range.getA1Notation();
if (editedCell !== "B2" && editedCell !== "C2") return;
const item = sheet.getRange("B2").getValue();
const rate = sheet.getRange("C2").getValue();
if (item !== "" && rate !== "") {
totals = {};
calculatorIncrement = 2;
recipeFlow = 0;
sheet.getRange("A2:E30").clearContent();
calculator(item, rate, sheet);
}
}
function calculator(item, targetRate, sheet, depth = 0) {
let recipe = RECIPES[item];
// Track ALL items
totals[item] = (totals[item] || 0) + targetRate;
// Raw resource (Base Case)
if (!recipe || Object.keys(recipe.inputs).length === 0) {
totals[item] = (totals[item] || 0) + targetRate;
return;
}
// Output rows
sheet.getRange(calculatorIncrement, 1).setValue(recipe.machine);
sheet.getRange(calculatorIncrement, 2).setValue(item);
sheet.getRange(calculatorIncrement, 3).setValue(targetRate);
sheet.getRange(calculatorIncrement, 6).setValue(depth);
calculatorIncrement++;
// Recurse
for (let input in recipe.inputs) {
let required = (targetRate / recipe.output) * recipe.inputs[input];
calculator(input, required, sheet, depth+1);
}
}
// BFT method, gives order of materials based on flow level *will not give totals
// function calculatorBFS(startItem, startRate, sheet) {
// let queue = [{ item: startItem, rate: startRate, depth: 0 }];
// totals = {};
// calculatorIncrement = 2;
// while (queue.length > 0) {
// let current = queue.shift();
// let item = current.item;
// let rate = current.rate;
// let depth = current.depth;
// let recipe = RECIPES[item];
// // ✅ Track totals
// totals[item] = (totals[item] || 0) + rate;
// // 🎨 Color by depth
// let colors = ["#ffffff", "#d9ead3", "#cfe2f3", "#fce5cd", "#ead1dc"];
// let color = colors[depth % colors.length];
// // ✅ Output row
// sheet.getRange(calculatorIncrement, 1).setValue(recipe?.machine || "Raw");
// sheet.getRange(calculatorIncrement, 2).setValue(" ".repeat(depth) + item);
// sheet.getRange(calculatorIncrement, 3).setValue(rate);
// sheet.getRange(calculatorIncrement, 6).setValue(depth);
// sheet.getRange(calculatorIncrement+1, 1, 1, 5).setBackground(color);
// calculatorIncrement++;
// // 🔴 Stop at raw resources
// if (!recipe || Object.keys(recipe.inputs).length === 0) continue;
// // 🔁 Add inputs to queue (this is the BFS magic)
// for (let input in recipe.inputs) {
// let required = (rate / recipe.output) * recipe.inputs[input];
// queue.push({
// item: input,
// rate: required,
// depth: depth + 1
// });
// }
// }
// }
//Recipes.gs -------------------------------------------------------------------------------------------------------------------------------
/*
*/
const RECIPES = {
// ==== Raw Materials (Extracted, not crafted) ====
"Iron Ore" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Copper Ore" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Limestone" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Coal" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Caterium Ore" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Raw Quartz" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Sulfur" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Bauxite" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Uranium" : { output: 30, inputs: {}, machine: "MinerMk1" },
"Nitrogen Gas" : { output: 30, inputs: {}, machine: "Resource Well Extractor" },
"Water" : { output: 30, inputs: {}, machine: "Water Extractor" },
// ==== Ingots & Refined Materials ====
"Iron Ingot" : { output: 30, inputs: { "Iron Ore": 30 }, machine: "Smelter" },
"Copper Ingot" : { output: 30, inputs: { "Copper Ore": 30 }, machine: "Smelter" },
"Caterium Ingot" : { output: 30, inputs: { "Caterium Ore": 30 }, machine: "Smelter" },
"Steel Ingot" : { output: 45, inputs: { "Iron Ore": 45, "Coal": 45 }, machine: "Foundry" },
"Aluminum Ingot" : { output: 60, inputs: { "Alumina Solution": 60, "Coal": 30 }, machine: "Refinery" },
"Aluminum Scrap" : { output: 30, inputs: { "Bauxite": 60, "Water": 30 }, machine: "Refinery" },
"Copper Powder" : { output: 5, inputs: { "Copper Ingot": 30 }, machine: "Constructor" },
// ==== Processed Materials ====
"Concrete" : { output: 15, inputs: { "Limestone": 45 }, machine: "Constructor" },
"Quartz Crystal" : { output: 22.5, inputs: { "Raw Quartz": 45 }, machine: "Constructor" },
"Silica" : { output: 25, inputs: { "Raw Quartz": 45 }, machine: "Constructor" },
"Petroleum Coke" : { output: 30, inputs: { "Heavy Oil Residue": 60 }, machine: "Refinery" },
// ==== Fuels & Liquids ====
"Fuel" : { output: 40, inputs: { "Crude Oil": 60 }, machine: "Refinery" },
"Liquid Biofuel" : { output: 50, inputs: { "Solid Biofuel": 50, "Water": 25 }, machine: "Refinery" },
"Turbofuel" : { output: 40, inputs: { "Fuel": 40, "Compacted Coal": 15 }, machine: "Refinery" },
"Alumina Solution" : { output: 30, inputs: { "Bauxite": 30, "Water": 22.5 }, machine: "Refinery" },
"Sulfuric Acid" : { output: 10, inputs: { "Sulfur": 10, "Water": 5 }, machine: "Refinery" },
"Nitric Acid" : { output: 4, inputs: { "Nitrogen Gas": 4, "Water": 1, "Iron Plate": 1 }, machine: "Refinery" },
// ==== Components ====
"Iron Rod" : { output: 15, inputs: { "Iron Ingot": 15 }, machine: "Constructor" },
"Screw" : { output: 40, inputs: { "Iron Rod": 10 }, machine: "Constructor" },
"Iron Plate" : { output: 20, inputs: { "Iron Ingot": 30 }, machine: "Constructor" },
"Reinforced Iron Plate" : { output: 10, inputs: { "Iron Plate": 30, "Screw": 60 }, machine: "Assembler" },
"Copper Sheet" : { output: 20, inputs: { "Copper Ingot": 30 }, machine: "Constructor" },
"Wire" : { output: 30, inputs: { "Copper Ingot": 15 }, machine: "Constructor" },
"Cable" : { output: 30, inputs: { "Wire": 60 }, machine: "Constructor" },
"Alclad Aluminum Sheet" : { output: 10, inputs: { "Aluminum Scrap": 10, "Aluminum Ingot": 3 }, machine: "Assembler" },
"Aluminum Casing" : { output: 45, inputs: { "Aluminum Ingot": 75 }, machine: "Constructor" },
"Steel Pipe" : { output: 20, inputs: { "Steel Ingot": 30 }, machine: "Constructor" },
"Steel Beam" : { output: 15, inputs: { "Steel Ingot": 60 }, machine: "Constructor" },
"Encased Industrial Beam" : { output: 10, inputs: { "Steel Beam": 40, "Concrete": 60 }, machine: "Assembler" },
"Modular Frame" : { output: 5, inputs: { "Reinforced Iron Plate": 20, "Iron Rod": 10 }, machine: "Assembler" },
"Heavy Modular Frame" : { output: 2, inputs: { "Modular Frame": 10, "Steel Pipe": 20, "Encased Industrial Beam": 10, "Screw": 50 }, machine: "Manufacturer" },
"Fused Modular Frame" : { output: 2, inputs: { "Heavy Modular Frame": 2, "Aluminum Casing": 2, "Radio Control Unit": 1, "Cooling System": 0.75 }, machine: "Manufacturer" },
"Rotor" : { output: 5, inputs: { "Iron Rod": 25, "Screw": 125 }, machine: "Assembler" },
"Stator" : { output: 5, inputs: { "Steel Pipe": 25, "Wire": 50 }, machine: "Assembler" },
"Motor" : { output: 5, inputs: { "Rotor": 10, "Stator": 10 }, machine: "Assembler" },
"Turbo Motor" : { output: 1, inputs: { "Motor": 2, "Cooling System": 2, "Radio Control Unit": 1, "Rubber": 2 }, machine: "Manufacturer" },
"Cooling System" : { output: 2.5, inputs: { "Heat Sink": 2.5, "Motor": 1.25, "Rubber": 2.5 }, machine: "Assembler" },
"Heat Sink" : { output: 2.5, inputs: { "Aluminum Casing": 2.5, "Rubber": 2 }, machine: "Assembler" },
"Battery" : { output: 4, inputs: { "Sulfuric Acid": 5, "Aluminum Casing": 4, "Plastic": 5, "Wire": 2 }, machine: "Refinery" },
// ==== Electronics ====
"Quickwire" : { output: 60, inputs: { "Caterium Ingot": 15 }, machine: "Constructor" },
"Circuit Board" : { output: 10, inputs: { "Quickwire": 25, "Plastic": 10 }, machine: "Assembler" },
"AI Limiter" : { output: 5, inputs: { "Circuit Board": 25, "Steel Pipe": 10 }, machine: "Assembler" },
"High-Speed Connector" : { output: 2.5, inputs: { "Circuit Board": 12.5, "Quickwire": 25, "Cable": 2.5 }, machine: "Assembler" },
"Computer" : { output: 2.5, inputs: { "Circuit Board": 12.5, "AI Limiter": 5, "Plastic": 5, "Cable": 2.5 }, machine: "Manufacturer" },
"Supercomputer" : { output: 1.25, inputs: { "Computer": 3.75, "High-Speed Connector": 3.75, "Radio Control Unit": 1.875, "Crystal Oscillator": 1.25 }, machine: "Manufacturer" },
"Radio Control Unit" : { output: 2.5, inputs: { "Circuit Board": 10, "Crystal Oscillator": 2.5, "Aluminum Casing": 6.25, "Rubber": 3.75 }, machine: "Manufacturer" },
"Crystal Oscillator" : { output: 1.25, inputs: { "Quartz Crystal": 18.75, "Quickwire": 18.75, "Reinforced Iron Plate": 3.75 }, machine: "Assembler" },
// ==== Containers & Packaged Fluids ====
"Empty Canister" : { output: 60, inputs: { "Plastic": 30 }, machine: "Constructor" },
"Empty Fluid Tank" : { output: 20, inputs: { "Steel Ingot": 20 }, machine: "Constructor" },
"Packaged Water" : { output: 60, inputs: { "Water": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Alumina Solution" : { output: 60, inputs: { "Alumina Solution": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Sulfuric Acid" : { output: 60, inputs: { "Sulfuric Acid": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Nitric Acid" : { output: 60, inputs: { "Nitric Acid": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Nitrogen Gas" : { output: 60, inputs: { "Nitrogen Gas": 60, "Empty Fluid Tank": 60 }, machine: "Packager" },
"Packaged Oil" : { output: 60, inputs: { "Crude Oil": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Heavy Oil Residue" : { output: 60, inputs: { "Heavy Oil Residue": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Fuel" : { output: 60, inputs: { "Fuel": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Liquid Biofuel" : { output: 60, inputs: { "Liquid Biofuel": 60, "Empty Canister": 60 }, machine: "Packager" },
"Packaged Turbofuel" : { output: 60, inputs: { "Turbofuel": 60, "Empty Canister": 60 }, machine: "Packager" },
// ==== Bio Materials & Derivatives ====
"Biomass" : { output: 45, inputs: { "Leaves": 30, "Wood": 15, "Mycelia": 7.5 }, machine: "Constructor" },
"Solid Biofuel" : { output: 30, inputs: { "Biomass": 90 }, machine: "Constructor" },
"Plastic" : { output: 20, inputs: { "Crude Oil": 30 }, machine: "Refinery" },
"Rubber" : { output: 20, inputs: { "Crude Oil": 30 }, machine: "Refinery" },
"Compacted Coal" : { output: 10, inputs: { "Coal": 20, "Sulfur": 10 }, machine: "Assembler" },
// ==== Nuclear Materials ====
"Electromagnetic Control Rod" : { output: 2.5, inputs: { "Stator": 6.25, "High-Speed Connector": 1.25 }, machine: "Assembler" },
"Encased Uranium Cell" : { output: 5, inputs: { "Uranium": 10, "Concrete": 5, "Sulfuric Acid": 5 }, machine: "Refinery" },
"Uranium Fuel Rod" : { output: 1.25, inputs: { "Encased Uranium Cell": 6.25, "Electromagnetic Control Rod": 1.25 }, machine: "Manufacturer" },
"Non-fissile Uranium" : { output: 10, inputs: { "Uranium Waste": 10, "Water": 10, "Silica": 5 }, machine: "Refinery" },
"Plutonium Pellet" : { output: 5, inputs: { "Non-fissile Uranium": 10, "Sulfuric Acid": 5, "Aluminum Casing": 2.5 }, machine: "Refinery" },
"Encased Plutonium Cell" : { output: 2.5, inputs: { "Plutonium Pellet": 5, "Concrete": 2.5, "Steel Pipe": 2.5 }, machine: "Assembler" },
"Plutonium Fuel Rod" : { output: 0.625, inputs: { "Encased Plutonium Cell": 3.125, "Electromagnetic Control Rod": 0.625 }, machine: "Manufacturer" },
"Uranium Waste" : { output: 0, inputs: {}, machine: "Nuclear Power Plant" },
"Plutonium Waste" : { output: 0, inputs: {}, machine: "Nuclear Power Plant" },
// ==== Ammo & Equipment ====
"Black Powder" : { output: 30, inputs: { "Sulfur": 15, "Coal": 15 }, machine: "Assembler" },
"Smokeless Powder" : { output: 30, inputs: { "Black Powder": 15, "Heavy Oil Residue": 7.5, "Water": 7.5 }, machine: "Refinery" },
"Nobelisk" : { output: 5, inputs: { "Smokeless Powder": 7.5, "Steel Pipe": 5, "Cable": 2.5 }, machine: "Assembler" },
"Gas Nobelisk" : { output: 2.5, inputs: { "Nobelisk": 2.5, "Nitrogen Gas": 2.5 }, machine: "Assembler" },
"Pulse Nobelisk" : { output: 2.5, inputs: { "Nobelisk": 2.5, "Crystal Oscillator": 0.625 }, machine: "Assembler" },
"Cluster Nobelisk" : { output: 2.5, inputs: { "Nobelisk": 5, "Smokeless Powder": 3.75 }, machine: "Assembler" },
"Nuke Nobelisk" : { output: 1.25, inputs: { "Cluster Nobelisk": 1.25, "Encased Uranium Cell": 1.25 }, machine: "Assembler" },
"Rifle Ammo" : { output: 25, inputs: { "Black Powder": 2.5, "Steel Pipe": 1.25, "Iron Rod": 1.25 }, machine: "Assembler" },
"Homing Rifle Ammo" : { output: 12.5, inputs: { "Rifle Ammo": 12.5, "AI Limiter": 1.25 }, machine: "Assembler" },
"Turbo Rifle Ammo" : { output: 12.5, inputs: { "Homing Rifle Ammo": 12.5, "Turbofuel": 5 }, machine: "Assembler" },
// ==== Structural / Project Parts ====
"Iron Rebar" : { output: 10, inputs: { "Iron Rod": 20 }, machine: "Constructor" },
"Stun Rebar" : { output: 5, inputs: { "Iron Rebar": 10, "Electromagnetic Control Rod": 1 }, machine: "Assembler" },
"Shatter Rebar" : { output: 5, inputs: { "Iron Rebar": 10, "Crystal Oscillator": 0.5 }, machine: "Assembler" },
"Explosive Rebar" : { output: 5, inputs: { "Iron Rebar": 10, "Nobelisk": 0.5 }, machine: "Assembler" },
"Fabric" : { output: 15, inputs: { "Mycelia": 15, "Biomass": 45 }, machine: "Constructor" },
"Gas Filter" : { output: 5, inputs: { "Fabric": 5, "Coal": 5 }, machine: "Assembler" },
"Iodine Infused Filter" : { output: 2.5, inputs: { "Gas Filter": 2.5, "Quickwire": 12.5, "Aluminum Casing": 2.5 }, machine: "Assembler" },
"Color Cartridge" : { output: 20, inputs: { "Leaves": 10, "Water": 5, "Biomass": 5 }, machine: "Assembler" },
"Beacon" : { output: 5, inputs: { "Iron Plate": 10, "Iron Rod": 10, "Cable": 7.5 }, machine: "Assembler" },
"Smart Plating" : { output: 5, inputs: { "Reinforced Iron Plate": 10, "Rotor": 10 }, machine: "Assembler" },
"Versatile Framework" : { output: 5, inputs: { "Modular Frame": 5, "Steel Beam": 10 }, machine: "Assembler" },
"Automated Wiring" : { output: 5, inputs: { "Stator": 10, "Cable": 25, "Quickwire": 25 }, machine: "Assembler" },
"Modular Engine" : { output: 5, inputs: { "Motor": 10, "Rubber": 5, "Versatile Framework": 5 }, machine: "Assembler" },
"Adaptive Control Unit" : { output: 1.25, inputs: { "Automated Wiring": 1.25, "Circuit Board": 1.25, "Heavy Modular Frame": 1.25, "Computer": 1.25 }, machine: "Manufacturer" },
"Assembly Director System" : { output: 1.25, inputs: { "Adaptive Control Unit": 1.25, "Supercomputer": 1.25, "Cable": 12.5, "Quickwire": 25 }, machine: "Manufacturer" },
"Magnetic Field Generator" : { output: 1.25, inputs: { "Versatile Framework": 2.5, "Electromagnetic Control Rod": 1.25, "Battery": 2.5 }, machine: "Assembler" },
"Thermal Propulsion Rocket" : { output: 1.25, inputs: { "Modular Engine": 2.5, "Turbo Motor": 1.25, "Cooling System": 1.25, "Fused Modular Frame": 1.25 }, machine: "Manufacturer" },
"Nuclear Pasta" : { output: 0.5, inputs: { "Copper Powder": 5, "Pressure Conversion Cube": 0.5 }, machine: "Particle Accelerator" }
};