您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically change avatar every second in Haxball
// ==UserScript== // @name Haxball Avatar Auto Change // @namespace http://tampermonkey.net/ // @version 1.0 // @description Automatically change avatar every second in Haxball // @author Your Name // @match https://www.haxball.com/play // @grant unsafeWindow // ==/UserScript== (function() { 'use strict'; // Array of emojis to use as avatars const avatars = ['👊🏿', '😝', '🖕🏿', '😢', '🍆', '😍', '💩', '😎', '🤡', '🥳', '👋🏿', '🤬', '❄️', '🤣', '👶🏻', '🤫', '👄', '😴']; let currentIndex = 0; // Index to track the current avatar // Function to change the avatar const changeAvatar = function(key) { let inputHax = document.querySelector('.input input'); let buttonHax = document.querySelector('.input button'); inputHax.value = '/avatar ' + key; buttonHax.click(); removeAvatarSet(); }; // Function to remove the "Avatar set" notice const removeAvatarSet = function() { let noticeList = document.querySelectorAll('div.log p.notice'); for (let i = 0; i < noticeList.length; i++) { if (noticeList[i].innerText === 'Avatar set') { noticeList[i].parentNode.removeChild(noticeList[i]); } } }; // Function to cycle through avatars const cycleAvatars = function() { changeAvatar(avatars[currentIndex]); currentIndex = (currentIndex + 1) % avatars.length; }; // Set an interval to change the avatar every second setInterval(cycleAvatars, 1000); })();