Introduction

The Novoline Scripting API provides easy-to-use APIs to add additional functionality to the client. It is based on ES6 and tries to match MCP 1.8.8 in terms of code.

Your first Script

Start by creating a .js file in the scripts folder, in the Novoline working directory (C:\Novoline\game\Novoline). You can use any editor of your choice.

Parser Variables

Each script should start with a header, describing it. It looks like this:

///script_info={name=Script name, description=Script description, author=Me, version=1.0.0 }

The aforementioned line defines a variable used by the parser. Some variables are mandatory, script_info is one of them, it's used to display script information in the GUI, others are optional.

Note that there are no version conventions, you can use whatever versioning you prefer.

Creating a Feature

Creating a feature is as easy as calling client.features.register. The resulting feature will be placed in the Scripts category in the ClickGui, and its settings will also be saved in the config files.

You can create multiple features in a single script.

Now that we know this, let's put it all into action.

const feature = client.feature.register(
    'TestFeature',      // feature name, may not contain spaces
    'Test description'  // feature description
);

Adding Settings

You can add multiple Settings to Features by using the addSetting method in the Feature object.

feature.addSetting(
    'checkbox',          // Setting type, one of: checkbox, combobox, slider, multi_combo, color
    'Enable something',  // Setting name
    false                // Setting value, different for every type
);

For a more comprehensive guide on Settings, please visit the Feature Settings section.

Managing Scripts

If you've followed the steps carefully, you should now see your script in-game, in the Script modules tab of the ClickGUI, and in the Dashboard menu.

Should there be an error, you will be able to view the details of it as well, by loading the script again. Be sure to note, that if the Script header is written incorrectly, the script won't show up in the UI!

If you haven't already noticed, you can unload Scripts. Doing so will revert any changes made by them, including created modules, settings, etc. You can reload a script at any time by clicking the Load button.

When the Script contents are modified, it will be reloaded automatically

Analyzing Errors

When a script cannot be loaded, or there's a run-time error, you will see this message in the chat:

To understand what's wrong with your Script, you'll need to know the following:

  1. Exception shows the error that happened during Script execution.

  2. Message is the Exception's message.

  3. Traceback indicates the calls that lead to the error. As the description suggests, the last call is what caused the error.

The Traceback also contains a lot of useful information. Let's break it down:

  1. Method is the method/function name that was executed. If it starts with an L:, it leads to an inline function.

  2. File is the file name that contains this function. If it's an internal script, it will be prefixed with classpath:, or file: if it's an import.

  3. Line is the line number.

Last updated