addon.js // ==UserScript== // @name cytrus = kot // @namespace http://tampermonkey.net/…
- User
addon.js // ==UserScript== // @name cytrus = kot // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://*.margonem.pl // @grant none // ==/UserScript== class Game { constructor(){ this.ws = new WebSocket('ws://localhost:8080'); g.delays.limit = 150; this.mobs = () => { return Object.values(g.npc).filter(npc => (npc.type == 2 || npc.type == 3) && !npc.hasOwnProperty('walkover')); } this.storage = JSON.parse(localStorage.getItem('mamon666')) || { position: { x: 0, y: 0 }, ExpButton: false, TuniaButton: false, expMapy: "", selectedIndex: 0, minlvl: 1, maxlvl: 300, } }; createMenu(){
const maindiv = document.createElement("div") maindiv.id = 'main-div' maindiv.style.cssText =
border-radius: 20px;border: 2px solid #0bff8b;background: linear-gradient(90deg, rgba(46,46,52,1) 0%, rgba(0,0,0,1) 35%, rgba(55,55,55,1) 100%);width: 416px;height: 320px;position: absolute;display: block;top: ${this.storage.position.x}px;left: ${this.storage.position.y}px;z-index: 999;;const title = document.createElement("div") title.innerHTML = "nienawidze bociarzy" title.id = 'main-title'
const content = document.createElement("div") content.id = 'main-content'
const h1 = document.createElement('h'); h1.textContent = 'Exp';
const expButton = document.createElement('input'); expButton.type = 'checkbox'; expButton.id = 'ExpButton'; expButton.checked = this.storage.ExpButton;
const tuniaH1 = document.createElement('h'); tuniaH1.textContent = 'Tunia';
const tuniaButton = document.createElement('input'); tuniaButton.type = 'checkbox'; tuniaButton.id = 'TuniaButton'; tuniaButton.checked = this.storage.TuniaButton;
const gotomapsdiv = document.createElement('textarea'); gotomapsdiv.placeholder = 'Mapy do chodzenia..'; gotomapsdiv.id = 'gotomaps';
const lvlsdiv = document.createElement('span');
const lvlH1 = document.createElement('h'); lvlH1.textContent = 'Lvl:';
const minlvldiv = document.createElement('input'); minlvldiv.type = 'text'; minlvldiv.id = 'minlvl';
const hyphen = document.createElement('h'); hyphen.textContent = '-';
const maxlvldiv = document.createElement('input'); maxlvldiv.type = 'text'; maxlvldiv.id = 'maxlvl';
const selectsetup = document.createElement("select"); selectsetup.id = 'main-setups' selectsetup.style = "margin-left: 10px;margin-top: -4px;color: rgb(75 255 0);border-width: 1px;border-style: solid;border-radius: 2px;border-color: rgb(0 255 119);background: rgba(0, 0, 0, 0.1);width: 268px;";
const save = document.createElement('button'); save.textContent = 'Zapisz'; save.id = 'save';
lvlsdiv.append(lvlH1, minlvldiv, hyphen, maxlvldiv, selectsetup); content.append(h1, expButton, tuniaH1, tuniaButton, gotomapsdiv, lvlsdiv, save); maindiv.append(title, content); document.body.appendChild(maindiv); this.loadSetups(); save.addEventListener('click', () => { this.saveSetup() });
- Assistant
Błąd wynika z próby utworzenia obiektu
currentz wartością domyślną{x, y}. W tym kontekściexiynie są zdefiniowane. Jeśli chcesz użyć wartości domyślnej, musisz podać konkretną wartość, np.export async function goTo(page, path, current = { x: 0, y: 0 }) { // reszta kodu }Co do wysyłania wielu żądań, upewnij się, że funkcja
goToMapjest wywoływana tylko raz, gdy jest to konieczne. Jeśli kod nie działa prawidłowo, spróbuj dodać instrukcjęconsole.logw strategicznych miejscach, aby zobaczyć, jakie operacje są wykonywane i w jakiej kolejności. Na przykład, możesz dodaćconsole.log("Going to map " + id)na początku funkcjigoToMap, aby zobaczyć, ile razy jest wywoływana.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.