Posted April 4Apr 4 comment_9 Tutorial: Creating and Testing Mods with the aiostool CLIThe aiostool CLI is a command-line tool that makes it easy to create and test mods for the aiostool integration with aiosbot. This guide will walk you through the full process—from installation to running your first mod.PrerequisitesBefore you begin, make sure you have Node.js installed on your system.📥 Download Node.js: https://nodejs.orgTo verify that it's installed, run these commands in your terminal:node -v npm -v Installing the aiostool CLIThe CLI is available as an official package on npm:npm install -g @aiostool/cli This will install the aiostool command globally so you can use it anywhere on your system.Creating a New ModTo create a new mod, use the create command:aiostool create my-first-mod This will generate a folder my-first-mod with the following structure:my-first-mod/ ├── aiostool-mod.d.ts # Type definitions for mod development ├── main.js # Your mod's entry script └── mod.json # Mod configuration Inside main.js, you'll find a basic starter template:/// <reference path="./aiostool-mod.d.ts" /> registerFunction("main", () => { console.log("Hello from my-first-mod!"); return resolve("Hello from my-first-mod!"); }); Running and Testing Your ModTo test your mod, open the mod directory:cd my-first-mod Then run:aiostool run This will:Load the mod.json configExecute the main function automaticallyLaunch an interactive mode where you can trigger any other registered functionsExample:> main main returned: Hello from my-first-mod! > exit If there's an error in your mod code, the CLI will stop immediately and print the error message.Tips for DevelopmentYou can register multiple functions using registerFunction("name", fn), not just main.Use alert("Title", "Message") in your mod for alerts (prints to console in CLI; shows as popup in aiostool).Want to use npm modules like axios? Just install them and require() as usual. Currently you must pack the node_modules into the zip.More Info🔗 CLI on npm: @aiostool/cli Edited April 5Apr 5 by BlackRider Uploading node_modules has become obsolete @BlackRider Founder · Lead Developer · System AdministratorDevelopment · Infrastructure · Feature Design · Community & Project Management🔗 My links & socials
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.