Code Monkey home page Code Monkey logo

sparkscript's Introduction

DEPRECATED

I'm no longer maintaining this.

DiamondFire library

Simple to use DiamondFire library for Javascript.

Check out DiamondFire, its pretty cool.
Manual template manipulation guide by Owen here

gh-actions gh-actions
npm-sparkscript
Warning: No stable version yet.. everything might flop and/or change

Example: for current git build

// import the quick editor
// import df from "sparkscript";
const df = require("sparkscript").default;

const template = df("Test template", (e, s) => {
  // e short for "editor"
  // s short for "settings"
  e.defAction("giveItems", (/* args */) => {
    e.player.action("SetHotbar", e.mc("cod", "§b§l<-§c§o killer fish §b§l->"), e.mc("bow", "§b§l<-§c§o le bow §b§l->"))
    //* you can use & for other things. use § for color codes.
  });

  //* you can use .setTarget() to specify the player to target. you can also chain it amongst other functions
  //* ex:
  // const funnyAction = e.player.action("DoAFlip").setTarget("Default")
  // funnyAction.setInverted(true).setAction("NOTAFlip)

  e.player.event("Join");
  e.action.giveItems();

  e.player.event("Respawn");
  e.action.giveItems();

});

const code = template.export();
console.log(code.compressed);

Key features:
> Read from template data with .from( ) function.
> Read & compile from Spark file, buffer or string. till spkc v2 gets an official release.
> Easy to use template editor.

Actiondump

You might need to specify the actiondump using the setActionDump function that's in default export.
Or use the codeDump file that exports all actiondump related functions into a default object, simply import the file:
const codeDump = require("sparkscript/core/codeDump"); or import codeDump from "sparkscript/core/codeDump";

Build from source

You can use either npm or yarn for this.

mkdir sparkscript
cd sparkscript
git clone https://github.com/UserUNP/sparkscript .
npm install
npm run build

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.