Kolbot to iDB Integration


After kolbot finishes a mule character, its expiration date, items, gold, socket quest and imbue quest get published to iDB. This removes the need to log all your mules manually via iDB or iDB-Web.


If kolbot fails to send to iDB, it will write details into file: \d2bs\kolbot\iDB-Failed-[database name].txt in format: [realm]/[account]/[password]/[character name].

How To


Make sure you are loading iDB.js on bot initialization:
var D2Bot = {
    handle: 0,
    init: function() {
        var handle = DataFile.getStats().handle;
        if (handle) {
            this.handle = handle;
        var s = getScript("tools/iDB.js");
        if (!s || !s.running) {
        return this.handle;
Or if you already have a script like AutoPerm:
var D2Bot = {
    handle: 0,
    init: function() {
        var handle = DataFile.getStats().handle;
        if (handle) {
            this.handle = handle;
        var s = getScript("tools/AutoPerm.js");
        if (!s || !s.running) {
            if (FileTools.exists("tools/AutoPerm.js")) {
        s = getScript("tools/iDB.js");
        if (!s || !s.running) {
        return this.handle;


Add LogToiDB flag:
LogToiDB: true,
LogToShop: false,
SendToSite: false,
LogGame: ["", ""],
LogNames: false,
LogItemLevel: true,
LogEquipped: false,
LogMerc: false,
SaveScreenShot: false,
IngameTime: rand(10, 20),
getItemDesc: function (unit, logIlvl) {
Near the very bottom, add the code to trigger logging:
if (this.LogToiDB) {
    var iDBDoneLogging, tick = getTickCount();
    addEventListener("scriptmsg", function (msg) {
        if (msg && typeof msg === "string" && msg === "iDBDoneLogging") {
            iDBDoneLogging = true;
    while (!iDBDoneLogging && getTickCount() ‐ tick < 10000) {
FileTools.writeText("mules/" + realm + "/" + me.account + "/" + me.name + …
print("Item logging done.");
If you want to save Horadric Cube data, comment or remove this line:
trash = [
    547, //Golden Bird
    548, //Lamesen's Tome
//    549, //Horadric Cube
    550, //Horadric Scroll
    551, //Mephisto's Soulstone


Search for "randomString", if you don't have it, add it into the Misc definition:
var Misc = {
    randomString: function (len, num) {
        let possible = 'abcdefghijklmnopqrstuvwxyz';
        if (num) {
            possible += '0123456789';
        let text = '';
        for (let i = 0; i < len; i += 1) {
            text += possible.charAt(Math.floor(Math.random() * possible.length));
        return text;


Extract and place iDB.js into tools folder then configure the top section.
iDBdatabaseName Name of the database in iDB that you want to publish to (if it doesn't exist, the database will be created automatically)
iDBaddress localhost or to point at the local machine
Otherwise, use the target's IP or host name
Don't forget to open the firewall & setup port forwarding on the target server!
iDBport Typically 7337 unless the TCP-Port has been changed on iDB
iDBloginName Leave blank
iDBloginPass Leave blank
defPass Default password to use in case password lookup fails (it's a good idea to use fail or something similar so you know when the script is having trouble looking up the correct password from your mule config)
profiles List of all the profiles that should publish to iDB (automules, muleloggers, droppers, etc.)
profiles: [


2020-02-03: v1.8

  • ADD Added support for gold, imbue, socket

2019-12-28: v1.7

  • ADD Added character name to the failure logging

2019-12-16: v1.6

  • FIX Wait for all incoming packets to process before publishing to iDB

2019-12-16: v1.5

  • ADD Added logging on failure

2019-05-30: v1.0

  • ADD Initial