@agmajs/script

Agmajs is an easy to use library to create scripts for any kind of .io game.

Usage no npm install needed!

<script type="module">
  import agmajsScript from 'https://cdn.skypack.dev/@agmajs/script';
</script>

README

@agmajs/script

Easy to use library to create scripts for any kind of .io game.

Installation

Using NPM:

$ npm install @agmajs/script

Using Yarn:

$ yarn add @agmajs/script

Usage

Creating a Script

// index.js
const { createScript } = require("@agmajs/script");

const script = createScript({
  info: {
    name: 'basic-script',
    version: 1,
    description: 'A really cool script!',
    author: 'Nuke'
  }
});

Single File Commands

// commands/index.js
module.exports = [
  require('./test')
]
// commands/test.js
const { defineCommand } = require("@agmajs/script");

module.exports = defineCommand({
  name: "test",
  run: (script, chatCtx, args) => {
    chatCtx.value = 'Test';
  }
});