anonymous guest stat tracking

you'll be logged in right before you die and logged out once the stat data is saved

当前为 2022-12-30 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         anonymous guest stat tracking
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  you'll be logged in right before you die and logged out once the stat data is saved
// @author       Marliskilla
// @match        https://takepoint.io/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=takepoint.io
// @license      MIT
// ==/UserScript==

// userdata; if not changed, you'll track stats for the user "temp"
let user = "temp"; // change temp to your username
let password = "tempPassword"; // change tempPassword to your password

(function() {
    'use strict';
    var loadLoop = setInterval(() => {
        if(sockets && sockets[0]) {
            sockets[0].onmessage = function(e) {
                let data = new TextDecoder().decode(e.data).split('|');
                data.forEach((elem) => {
                    if(elem.startsWith('r,')){ // event data
                        let subArr = elem.split(',');
                        if(parseInt(subArr[1]) == "6"){ // "killed by ..."
                            sockets[0].send(new TextEncoder().encode("al," + user + "," + password + ",0")); //logs you in
                        }
                    }
                    if(elem.startsWith('sta,')){ //stat data
                        sockets[0].send(new TextEncoder().encode("ao")); //logs you out again
                    }
                });
                //internal takepoint stuff, just pasted from the original code
                var uint8Array = new Uint8Array(e.data);
                var buffer = Module._malloc(uint8Array.length);
                writeArrayToMemory(uint8Array, buffer);
                sockets[0].events.push([buffer, uint8Array.length, Module.getClientTime()]);
            };
        }
    }, 20)
})();