difys docs

difys docs

  • Quick Start
  • Github

›Introduction

Introduction

  • Quick Start
  • Installation
  • Configuration
  • Motivation
  • Our Partners
  • The Core
  • Plugins
  • Scripts

Scripting

  • Scripting API

Usage

  • Usage guide
  • Examples and tutorials

Web API

  • Introduction
  • Routes
  • Examples

FAQ

  • Frequently asked questions

Other

    Protocol

    • Socket messages
    • Game socket

Scripts

In order to use a script, you must specify the script file name in the account config file.

"script": "MyScriptName"

The script will execute once the account is fully connected and ready to move around.

You have two variable you can use inside every scripts.

  1. Account: It holds the account informations, visit the data example to have an overview of accessible data.

  2. Plugin: It's an object with every plugin instances.

MyScriptName.js

In this example, we use the default Map plugin to try and move our character.

Keep in mind that the method used in this example could change.

function* start() {
    console.log(`${Account.username} begins the route.`);
    yield Plugin.Map.goTo(0, -16);
    yield Plugin.Chat.privateMessage("Genesis", "Using %s.", ["Potion de Rappel"]);
    yield Plugin.Inventory.use("Potion de Rappel");
}

That's it. Yes it's not that much for scripts because there isn't a lot to talk about, you are just using plugins essentially.

← PluginsScripting API →
difys docs
Docs
Quick startThe CorePluginsScripting
Community
DiscordCadernis
More
GitHubStar
Copyright © 2020 Difys team