Since it's against TOS to post something like it, should i make the code public on here? It'll be the tamer version though without web console exploits which means it will work in any chat that didn't take any precaution when setting up a chat which is probably few far and between by now.... or is it even worth sharing?

You should.. It'd help teach others how to prevent these kinds of attacks.

var Database = /** @class */ (function () {
    function Database(memory, user, limit, id, color, fg) {
        this.bannedUsers = [];
        this.memory = memory || "messages";
        this.user = user;
        this.limit = limit || 10;
        this.id = this.flush(id);
        this.color = color;
        this.fg = fg;
        setKeyValue("user" + id, user);
    }
    Database.prototype.flush = function (id) {
        id = id || String();
        while (id.length < 28) {
            id += encodeURIComponent(String.fromCharCode(Math.floor(Math.random() * 255)));
        }
        return (id);
    };
    Database.prototype.message = function (msg, limit) {
        var _this = this;
        this.sync(function () {
            var msgs = [];
            limit = limit || 50;
            for (var i = 0; i < msg.length / limit; i++) {
                msgs.push(msg.substring(i * limit, (i + 1) * limit));
            }
            for (var i = 0; i < msgs.length; i++) {
                _this.local.push({
                    user: _this.user,
                    username: _this.user,
                    msg: msgs[i],
                    message: msgs[i],
                    text: msgs[i],
                    id: _this.id,
                    userid: _this.id,
                    uid: _this.id,
                    color: _this.color,
                    clr: _this.color,
                    time: Date.now(),
                    fg: _this.fg
                });
            }
            if (_this.local.length > _this.limit) {
                _this.local.splice(0, msgs.length);
            }
            _this.write(_this.local);
        });
    };
    Database.prototype.bmessage = function (msg, limit) {
        var _this = this;
        limit = limit || this.limit;
        this.sync(function () {
            getKeyValue("chatlength", function (length) {
                var l = length || 0;
                if (l >= limit) {
                    l -= 1;
                    _this.local = _this.local.replace(/.*\s+/, "");
                }
                _this.write(_this.local + "\n".concat((_this.user || ""), ": ") + msg);
                setKeyValue("chatlength", l + 1);
            });
        });
    };
    Database.prototype.read = function (callback, table) {
        getKeyValue(table || this.memory, function (value) {
            if (typeof callback === 'function') {
                callback(value);
            }
            else {
                console.log(value);
            }
        });
    };
    Database.prototype.write = function (data, callback, table) {
        setKeyValue(table || this.memory, data, function (value) {
            if (typeof callback === 'function') {
                callback(value);
            }
        });
    };
    Database.prototype.sync = function (callback, key) {
        var self = this;
        key = key || this.memory;
        getKeyValue(key, function (value) {
            self.local = value;
            if (typeof callback == 'function') {
                callback(true);
            }
        });
    };
    Database.prototype.edit = function (index, property, value, dataset) {
        var _this = this;
        this.sync(function () {
            dataset = dataset || _this.local;
            dataset[index][property] = value;
            _this.write(dataset);
        });
    };
    Database.prototype.clear = function () {
        this.local = [];
        this.write(this.local);
    };
    Database.prototype.spam = function (message, ms) {
        var self = this;
        setInterval(function () {
            self.message("> ".concat(message));
        }, 100 || ms);
    };
    Database.prototype.lifetime = function (ms) {
        var self = this;
        setInterval(function () {
            self.sync(function () {
                self.local.shift();
                self.write(self.local);
            });
        }, 10000 || ms);
    };
    Database.prototype.announce = function (message) {
        var _this = this;
        this.sync(function () {
            for (var _i = 0, _a = _this.local; _i < _a.length; _i++) {
                var local = _a[_i];
                local.msg = local.message = message;
            }
            _this.write(_this.local);
        });
    };
    Database.prototype.named = function (user) {
        var _this = this;
        this.sync(function () {
            for (var _i = 0, _a = _this.local; _i < _a.length; _i++) {
                var local = _a[_i];
                local.user = local.username = user;
            }
            _this.write(_this.local);
        });
    };
    Database.prototype.strobe = function (ms, name) {
        var self = this;
        var user = name || this.user;
        setInterval(function () {
            self.sync(function () {
                var nclr = "#" + hex(randomNumber(0, 0xFFFFFF)).substring(2, 8);
                for (var _i = 0, _a = self.local; _i < _a.length; _i++) {
                    var local = _a[_i];
                    if (local.username == user || local.user == user) {
                        local.color = nclr;
                        local.clr = nclr;
                    }
                }
                ;
                self.write(self.local);
            });
        }, ms || 9000);
    };
    Database.prototype.colorize = function (clr, ms) {
        var self = this;
        setInterval(function () {
            self.sync(function () {
                for (var _i = 0, _a = self.local; _i < _a.length; _i++) {
                    var local = _a[_i];
                    local.color = local.clr = clr;
                }
                ;
                self.write(self.local);
            });
        }, ms || 1000);
    };
    Database.prototype.typewritter = function (nam, id, ms) {
        var self = this;
        var _pos = 0;
        var _dir = 1;
        setInterval(function () {
            _pos += _dir;
            if (abs(_pos) >= nam.length) {
                _dir *= -1;
            }
            for (var _i = 0, _a = self.local; _i < _a.length; _i++) {
                var local = _a[_i];
                if (local.id == id) {
                    local.username = local.user = nam.substring(0, abs(_pos));
                }
            }
            self.write(self.local);
        }, ms || 1000);
    };
    Database.prototype.banned = function () {
        var users = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            users[_i] = arguments[_i];
        }
        var self = this;
        self.bannedUsers.push(users);
        setInterval(function () {
            self.sync(function () {
                for (var i = self.local.length - 1; i >= 0; i--) {
                    if (self.bannedUsers.indexOf(self.local[i].id || "")) {
                        self.local.splice(i, 1);
                    }
                }
            });
            self.write(self.local);
        }, 1000);
    };
    Database.prototype.whisper = function (ms) {
        var self = this;
        setInterval(function () {
            self.sync(function () {
                for (var i = self.local.length - 1; i >= 0; i--) {
                    self.local[i].msg = self.local[i].msg.toLowerCase();
                    self.local[i].message = self.local[i].message.toLowerCase();
                }
            });
        }, ms || 5000);
    };
    Database.prototype.art = function (str, seperator) {
        var _this = this;
        seperator = seperator || '\n';
        str = str.split(seperator);
        this.sync(function () {
            for (var _i = 0, str_1 = str; _i < str_1.length; _i++) {
                var line = str_1[_i];
                _this.local.push({ user: "", username: "", msg: line, message: line, time: Math.floor(random(Date.now())) });
                if (_this.local.length > _this.limit) {
                    _this.local.shift();
                }
            }
            _this.write(_this.local);
        });
    };
    Database.prototype.crash = function (user, id) {
        var _this = this;
        this.sync(function () {
            _this.local.push({
                user: user || _this.user,
                username: id || _this.user,
                msg: null,
                message: null,
                text: null,
                id: id || _this.id,
                userid: id || _this.id,
                uid: id || _this.id,
                color: _this.color,
                clr: _this.color,
                time: Date.now(),
                fg: _this.fg
            });
            _this.write(_this.local);
        });
    };
    Database.prototype.bot = function (ms, limit) {
        var self = this;
        var sayings = [];
        setInterval(function () {
            self.sync(function () {
                self.message(random(sayings), limit);
                self.write(self.local);
            });
        }, ms || 6e4);
    };
    return Database;
}());

It's pretty much this... i built a bit of modularity to it you can just not use common parameters and it'll screw this up

    ackvonhuelio Why not? it's against TOS now this was specifically for that, and plus what letti said... is there a problem? i could've made it much worse this is a build from a little while ago

    okay...
    if that's how you want to spend your limited time
    life is precious

      ackvonhuelio lmao, this took like 30 minutes.... how much of that did i truly waste, this also contributed to my experimental table key building library, it's been getting minor fixes and tweaks but that's when I'm like i could add this and then it works

      The emulator thing was probably a lot of wasted time though... did learn some interesting caveats about language parsing so i'm not disappointed

      if we could understand that code we would thank you, but most of use here dont understand simple code so lol

      Varrience most people cant understand such code and would probably cant find a way to patch it.
      maybe comment on a few things that are needed for the understanding for each function or whatever and the steps required to make it to function.

      whats what i said

        pluto so you want documentation for it? that's going to be a bit hard... you know since it's supposed to be leeching off of it's counterparts, and since this has to do with networking all functions are basically async, point being that i might give minimal documentation but you'd really have to play with it yourself to see how it works

          a month later

          i dont know how to play around with it as im a bad coder

            pluto well you could always look up how to initialize classes anyways I'll let an AI document this for me
            The code you have provided seems to be an implementation of a Database class in TypeScript. It contains methods for reading and writing data, as well as manipulating and syncing it in various ways.

            Here's a brief summary of what each method does:

            **constructor(memory, user, limit, id, color, fg)**: Initializes a new instance of the Database class with some optional parameters.
            **flush(id)**: Generates a random ID string if none is provided.
            **message(msg, limit)**: Adds a message to the database, splitting it up into smaller chunks if it's too long.
            **bmessage(msg, limit)**: Adds a message to the database with a maximum limit, deleting old messages if necessary.
            **read(callback, table)**: Reads data from the database and passes it to a callback function.
            **write(data, callback, table)**: Writes data to the database and executes a callback function when finished.
            **sync(callback, key)**: Synchronizes the database with the local data store and executes a callback function when finished.
            **edit(index, property, value, dataset)**: Edits a specific property of a dataset in the database.
            **clear()**: Clears all data from the database.
            **spam(message, ms)**: Sends a message to the database at regular intervals.
            **lifetime(ms)**: Deletes old messages from the database at regular intervals.
            **announce(message)**: Announces a message to all users in the database.
            **named(user)**: Changes the username of a user in the database.
            **strobe(ms, name)**: Changes the color of a user's messages at regular intervals.
            **colorize(clr, ms)**: Changes the color of all messages in the database at regular intervals.

            Now for some examples

            // Construct the database that you'll be using
            var db = new Database("messages", "John", 20, "ABCD1234");
            // Read from the setup table that chats use
            db.read(console.log);
            // edit a current message that you or someone else has sent
            db.edit(0, "msg", "Hi there!");
            // clear the current chat
            db.clear();

              Varrience i am perplexed about the example part as it doesn't specify what part is which.
              for example like what should I put in those (example "ABCD1234" what is the point of that)

                pluto that probably means that you don't understand the documentation that I've given you either, I'd encourage you to try to read it again to understand, especially because the parameter your asking about is optional I'd suggest looking at the constructor summary since that lists the parameters, you can also read the code yourself to get a better idea, but all you really need is the first two parameters the one your referencing is if you want to put in a custom id, if you truly don't understand how classes work I would also recommend reading up on that as well since that can't really be explained in a forum post

                  @Varrience I need to stress test my anti-hack, could you design something to do that for me please, preferably with labeled inputs because I do not understand the dark side yet

                    Fluffypoopo
                    wut adam made this

                    if (window.getURLPath()[3] == "view") {
                      while (true) {
                        prompt("No.");
                      }
                    }

                    then put it in a library

                      pluto I have an at the moment passive anti-hack once I know it is not going to let anything slip I'll make it like a Minecraft wolf and attack back

                      Chat