a node package for calculating rust crafting costs
This repository has been archived on 2026-09-29. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2014-06-08 01:40:22 -05:00
node_modules init 2014-03-26 03:53:07 -05:00
calculator.js cleanup 2014-03-26 04:11:01 -05:00
items.js init 2014-03-26 03:53:07 -05:00
items.json update 2014-06-08 01:40:22 -05:00
main.js update 2014-06-08 01:40:22 -05:00
models.js init 2014-03-26 03:53:07 -05:00
package.json init 2014-03-26 03:53:07 -05:00
README.md fix typo 2014-03-26 04:11:50 -05:00
rustcalculator.sublime-project init 2014-03-26 03:53:07 -05:00
rustcalculator.sublime-workspace update 2014-06-08 01:40:22 -05:00

Examples

Basic Usage

// Define a set of objects
var raid = {
  F1_grenade: 32,
  wood_barricade: 6
};

// Print a nice human readable output
jprint(Calculator.calculate(raid));

Output: {"wood":1204,"sulfur_ore":1707,"metal_ore":320}

Another Basic example

var grief_package = {
  wood_ceiling: 2,
  wood_stairs: 2,
  wood_pillar: 2,
  wood_foundation: 1,
  metal_door: 2
};

jprint(Calculator.calculate(grief_package));

Output: {"wood":340,"metal_ore":100}

Add Multiple Items

var floor1 = {
  wood_foundation: 1,
  wood_wall: 3,
  wood_door: 1,
  wood_pillar: 4,
  wood_stairs: 1,
};

var floor2 = {
  wood_wall: 4,
  wood_pillar: 4,
  wood_stairs: 1,
};

var floor3 = {
  wood_pillar: 4,
  wood_wall: 4,
  wood_ceiling: 1,
};

jprint(Calculator.calculate([floor1, floor2, floor3]));

Output: {"wood":950}