Skip to content

Leesneaks/nodejs-botserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS BotServer

A modular and extensible BotServer server inspired by otcv8botserver, built with Node.js.


🧩 Features

  • 📡 WebSocket interface for real-time bot communication
  • 🌐 Optional HTTP web UI for monitoring
  • 🧱 Modular architecture (drop plugins in /modules)
  • 🪵 Auto file logging to logs/output.log
  • 🧠 Auto-install missing dependencies
  • 🔌 Built-in plugin hook system (WS + lifecycle)

📦 Requirements


🧩 Plugins

See Plugin Documentation for a list of available modules.

Plugins


🔗 Links


⚙️ Setup

  1. Download & Install Node.js

  2. Run the Server

    • Launch start-server.bat
    • Automatically installs dependencies on first run
  3. Logging

    • All console output (stdout & errors) is logged to logs/output.log
    • Colors are stripped from log files for clean reading

💡 Optional:
Don’t want a module/plugin?

  • Disable the web interface: rename modules/server/http.jsmodules/server/http.js.disabled
    or
  • Modify the meta data at the bottom of the module to enabled: true/false

🤖 vBot Integration

  1. Open _Loader.lua
  2. Add the following at the top:
    BotServer.url = "ws://localhost:8000/" -- add this line
    -- load all otui files, order doesn't matter

📤 Sending Character Info (Lua)

To allow the server to register your character data, you can send character information from your bot using a Lua script.

Add the following to your bot script (e.g., inside a Macro):

macro(10000, "Send Char Info", function()
  if not BotServer._websocket then return end

  BotServer.send("char_info", {
    name       = player:getName(),
    level      = player:getLevel(),
    vocation   = player:getVocation(),
    health     = player:getHealth(),
    maxHealth  = player:getMaxHealth(),
    mana       = player:getMana(),
    maxMana    = player:getMaxMana(),
    experience = player:getExperience(),
    expPercent = player:getLevelPercent(),
    location   = pos() and string.format("%d, %d, %d", pos().x, pos().y, pos().z)
  })
end)

Web UI

Web UI Preview

WebSocket Terminal View

WebSocket Terminal