Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendMsg(msg) {
- if (msg.startsWith('/img ')) {
- setTimeout(() => {
- socket.emit("command", { list: ["img", msg.substring(5)] });
- });
- } else if (msg.startsWith('/name ')) {
- socket.emit("command", { list: ["name", msg.substring(6)] });
- } else {
- socket.emit("talk", { text: msg });
- }
- }
- var menu = document.createElement("div");
- menu.setAttribute("draggable", "true");
- document.getElementById("content").appendChild(menu);
- setTimeout(() => {
- alert("Tool has loaded!");
- menu.style.backgroundColor = "white";
- menu.style.position = "absolute";
- menu.style.left = "80%";
- menu.style.top = "20%";
- menu.style.color = "black";
- menu.style.padding = "10px";
- menu.style.cursor = "move";
- menu.style.border = "1px solid black";
- menu.style.width = "300px";
- menu.style.height = "600px";
- menu.style.overflow = "auto";
- menu.innerHTML = `
- <h2>nono's Bonziworld Swiss Knife</h2>
- <ol>
- <li>Enter messages, image commands, or name changes in the text area below. Separate each item with a comma.</li>
- <li>Text messages: Just type the message.</li>
- <li>Image command: <code>/img [image URL]</code></li>
- <li>Name change: <code>/name [new name]</code></li>
- <li>Set spam rate in seconds (can be decimal).</li>
- <li>Click "Run" to start spamming.</li>
- <li>Click "Run Donut" to display an animated donut in chat.</li>
- <li>Use the web browser to load pages and send their content to chat.</li>
- </ol>
- <img src="https://files.catbox.moe/f3rzuw.png" alt="Uploaded by catbox.moe" width="200"><br><br>
- <textarea id='in' placeholder='Enter commands here, separated by commas...' rows='4' cols='30'></textarea><br>
- <button id='run'>Run</button>
- <button id='stop'>Stop</button>
- <button id='donut'>Run Donut</button><br><br>
- <input type='number' id='rate' min='0.01' max='10' step='0.01' value='1'></input><br>
- <h4>Rate of spam (in seconds)</h4><br>
- Bot Name: <input type="text" id="botName" value="bot"><br>
- Bot Message: <textarea id="botMessage" rows="2" cols="30">bot message</textarea><br>
- <h4>Set Bot Join Interval (in seconds)</h4>
- <input type='number' id='joinRate' min='0.001' step='0.001' value='3'><br>
- <h4>Set Bot Message Interval (in seconds)</h4>
- <input type='number' id='messageRate' min='0.001' step='0.001' value='3'><br>
- <button id="startBots">Start Bots</button>
- <button id="stopBots">Stop Bots</button><br><br>
- <button id='webBrowser'>Toggle Web Browser</button>
- <div id='browserContainer' style='display:none;'>
- <input type='text' id='urlInput' placeholder='Enter URL'>
- <button id='loadUrl'>Go</button>
- <button id='sendToChat'>Send to Chat</button>
- <iframe id='browserFrame' style='width:100%;height:300px;'></iframe>
- </div>
- <div id="resizeHandle" style="position:absolute;bottom:0;right:0;width:10px;height:10px;background:gray;cursor:se-resize;"></div>
- `;
- let offsetX = 0, offsetY = 0, isDragging = false;
- let isResizing = false;
- let startX, startY, startWidth, startHeight;
- let botsJoinInterval;
- let botsMessageInterval;
- function startBots() {
- const roomIdElement = document.querySelector('.room_id');
- const roomId = roomIdElement ? roomIdElement.textContent : null;
- if (roomId) {
- const botName = document.getElementById("botName").value;
- const botMessage = document.getElementById("botMessage").value;
- const joinRate = parseFloat(document.getElementById("joinRate").value) * 1000;
- const messageRate = parseFloat(document.getElementById("messageRate").value) * 1000;
- botsJoinInterval = setInterval(() => {
- const bot = io(window.location.origin);
- bot.emit("client", "MAIN");
- bot.emit("login", { passcode: "", name: botName, room: roomId });
- botsMessageInterval = setInterval(() => {
- if (botMessage.startsWith('/img ')) {
- bot.emit("command", { list: ["img", botMessage.substring(5)] });
- } else {
- bot.emit("talk", { text: botMessage });
- }
- }, messageRate);
- bot.on('disconnect', () => {
- console.error("Bot disconnected. Attempting to reconnect...");
- startBots();
- });
- }, joinRate);
- console.log("Bots started!");
- } else {
- console.error("Room ID not found!");
- }
- }
- function stopBots() {
- clearInterval(botsJoinInterval);
- clearInterval(botsMessageInterval);
- console.log("Bots stopped!");
- }
- document.getElementById("startBots").onclick = startBots;
- document.getElementById("stopBots").onclick = stopBots;
- menu.addEventListener("mousedown", (e) => {
- if (e.target.id === "resizeHandle") {
- isResizing = true;
- startX = e.clientX;
- startY = e.clientY;
- startWidth = parseInt(document.defaultView.getComputedStyle(menu).width, 10);
- startHeight = parseInt(document.defaultView.getComputedStyle(menu).height, 10);
- } else {
- isDragging = true;
- offsetX = e.clientX - menu.offsetLeft;
- offsetY = e.clientY - menu.offsetTop;
- }
- document.addEventListener("mousemove", moveElement);
- document.addEventListener("mouseup", stopMoving);
- });
- function moveElement(e) {
- if (isDragging) {
- menu.style.left = (e.clientX - offsetX) + "px";
- menu.style.top = (e.clientY - offsetY) + "px";
- } else if (isResizing) {
- const width = startWidth + (e.clientX - startX);
- const height = startHeight + (e.clientY - startY);
- menu.style.width = width + "px";
- menu.style.height = height + "px";
- }
- }
- function stopMoving() {
- isDragging = false;
- isResizing = false;
- document.removeEventListener("mousemove", moveElement);
- document.removeEventListener("mouseup", stopMoving);
- }
- let spamInterval;
- document.getElementById("run").onclick = () => {
- let inputText = document.getElementById("in").value;
- let commands = inputText.split(',').map(cmd => cmd.trim());
- let rate = parseFloat(document.getElementById("rate").value);
- let interval = Math.max(rate * 1000, 10);
- let index = 0;
- function spamMessage() {
- if (commands.length === 0) return;
- let command = commands[index];
- sendMsg(command);
- index = (index + 1) % commands.length;
- }
- clearInterval(spamInterval);
- spamInterval = setInterval(spamMessage, interval);
- };
- document.getElementById("stop").onclick = () => {
- clearInterval(spamInterval);
- };
- document.getElementById("donut").onclick = () => {
- let A = 0, B = 0;
- const R1 = 1, R2 = 2, K2 = 5;
- const SCREEN_WIDTH = 80, SCREEN_HEIGHT = 22;
- const K1 = SCREEN_WIDTH * K2 * 3 / (8 * (R1 + R2));
- function renderFrame() {
- const output = [];
- const zbuffer = new Array(SCREEN_WIDTH * SCREEN_HEIGHT).fill(0);
- const buffer = new Array(SCREEN_WIDTH * SCREEN_HEIGHT).fill(' ');
- for (let j = 0; j < Math.PI * 2; j += Math.PI / SCREEN_WIDTH) {
- for (let i = 0; i < Math.PI * 2; i += Math.PI / SCREEN_HEIGHT) {
- const c = Math.sin(i), d = Math.cos(j), e = Math.sin(A), f = Math.sin(j), g = Math.cos(A), h = d + 2;
- const D = 1 / (c * h * e + f * g + 5);
- const l = Math.cos(i), m = Math.cos(B), n = Math.sin(B);
- const t = c * h * g - f * e;
- const x = Math.floor(40 + 30 * D * (l * h * m - t * n));
- const y = Math.floor(12 + 15 * D * (l * h * n + t * m));
- const o = Math.floor(x + SCREEN_WIDTH * y);
- const N = Math.floor(8 * ((f * e - c * d * g) * m - c * d * e - f * g - l * d * n));
- if (y < SCREEN_HEIGHT && y >= 0 && x >= 0 && x < SCREEN_WIDTH && D > zbuffer[o]) {
- zbuffer[o] = D;
- buffer[o] = ".,-~:;=!*#$@"[N > 0 ? N : 0];
- }
- }
- }
- for (let k = 0; k < SCREEN_WIDTH * SCREEN_HEIGHT; k++) {
- output.push(k % SCREEN_WIDTH ? buffer[k] : '\n');
- }
- sendMsg(output.join(''));
- A += 0.08;
- B += 0.06;
- }
- clearInterval(spamInterval);
- spamInterval = setInterval(renderFrame, 100);
- };
- document.getElementById("webBrowser").onclick = () => {
- const container = document.getElementById("browserContainer");
- container.style.display = container.style.display === "none" ? "block" : "none";
- };
- document.getElementById("loadUrl").onclick = () => {
- const url = document.getElementById("urlInput").value;
- document.getElementById("browserFrame").src = url;
- };
- document.getElementById("sendToChat").onclick = () => {
- const url = document.getElementById("urlInput").value;
- const proxyUrl = `https://api.allorigins.win/raw?url=${encodeURIComponent(url)}`;
- fetch(proxyUrl)
- .then(response => response.text())
- .then(html => {
- const parser = new DOMParser();
- const doc = parser.parseFromString(html, 'text/html');
- const content = doc.body.innerText;
- const chunks = content.match(/.{1,200}/g) || [];
- chunks.forEach((chunk, index) => {
- setTimeout(() => sendMsg(chunk), index * 1000);
- });
- })
- .catch(error => {
- console.error('Error:', error);
- sendMsg("Failed to fetch webpage content.");
- });
- };
- }, 600);
Add Comment
Please, Sign In to add comment