Git Product home page Git Product logo

spice's Introduction

Spice (v0.2.0)

Developed by MalevolentJalapeno (Spenser Jones)

Download

You can download the most recent version of Spice (v0.1.1) by clicking here.

Usage

Start by initializing Spice() on any entity, array, or even without an argument. After that, start calling some functions on it, and watch in amazement as your script is cut in half (or more!)

Examples

Find and chop the closest living tree

Spice(Find({ tree: true })).Filter(function(tree) { return tree.durability > 0; }).Closest().Chop();

Find an axe in your inventory, and equip it

Spice(Me).Inventory().GetItemByType('axe').Equip();

Find and pick up any objects

Spice(Find({ isobject: true })).Closest().PickUp();

Find the best path to the closest Obelisk, and walk there

Repeat();
var obelisk = FindClosest({ isobelisk: true });
if (Spice(obelisk).IsNextTo(Me)) {
    Spice().Abort("I'm at the obelisk!");
} else {
    Spice(obelisk).MoveTowards();
}

Debugging and testing scripts

From time to time, you may run into a confusing variable or array, and say to yourself "I wish I could see what was in this, without writing for loops and calling Log repeatedly!"

Spice(GetItemByName('Stone')).InspectProperties();

Creating objects in the sandbox

Writing a big script, and tired of collecting resources before starting to test your logic? Sounds like it is time to spawn a few objects at your feet!

Spice().__CreateStone(5);  // Create 5 stones
Spice().__CreateBranch(3); // Create 3 branches
Spice().__CreateWood(1);    // Create 1 wood
Spice().__CreateObject({ icon: "stoneaxe", isobject: true, name: "Axe", itemtype: "axe" }, 8); // Create 8 defined objects

Thank You to:

  • skawesome - Assistance with the Class structure logic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.