I tried applying this using ChatGPT, but it didn't work for me. Can you tell me where to put this code to make my code work?
// Функция для эмуляции нажатия мыши внутри элемента <canvas data-sentry-element="Stage"> function simulateMouseClickInCanvas() { const canvas = document.querySelector('canvas[data-sentry-element="Stage"]'); if (!canvas) { console.error("Элемент <canvas> не найден."); return; } const rect = canvas.getBoundingClientRect(); // Выбираем случайные координаты внутри элемента <canvas> const randomX = Math.random() * rect.width + rect.left; const randomY = Math.random() * rect.height + rect.top; // Создаём события мыши const mouseDownEvent = new MouseEvent("mousedown", { bubbles: true, cancelable: true, clientX: randomX, clientY: randomY, }); const mouseUpEvent = new MouseEvent("mouseup", { bubbles: true, cancelable: true, clientX: randomX, clientY: randomY, }); const clickEvent = new MouseEvent("click", { bubbles: true, cancelable: true, clientX: randomX, clientY: randomY, }); // Эмулируем события canvas.dispatchEvent(mouseDownEvent); canvas.dispatchEvent(mouseUpEvent); canvas.dispatchEvent(clickEvent); } // Функция для выполнения кликов с рандомной задержкой function performRandomClicksInCanvas(maxClicks) { let clicksCount = 0; function clickWithRandomDelay() { if (clicksCount >= maxClicks) { console.log("Все клики выполнены"); return; } const delay = Math.random() * (2000 - 100) + 100; // Рандомная задержка от 0.1 до 2 секунд setTimeout(() => { simulateMouseClickInCanvas(); clicksCount++; console.log(`Клик ${clicksCount} выполнен (задержка: ${Math.round(delay)} мс)`); clickWithRandomDelay(); // Рекурсивный вызов для следующего клика }, delay); } clickWithRandomDelay(); } // Запуск выполнения 10 кликов performRandomClicksInCanvas(10);Delete Current Element Doesn't Work
-
Hi, I'm using delete current element from Resources Module but its don't delete resource from txt.
Can you help me about this problem ?
-
оно не сразу удаляет строку насколько я помню , давно уже не юзал для файла
-
@Roy-Mustang Yeah it doesn't @Fox can you help us ?
-
@GuarDofErun может быть там настройки не такие в ресурсах , нужно смотреть что в ресурсе выставленно полностью , вроде как там нужно поставить условия для удаления но я точно не помню
-
@Roy-Mustang I did everything perfectly but same problem
-
что вы сделали, скрин дайте , ресурса где вы удаляете
-
-
что внутри ресурса нужно
-
@Roy-Mustang like RoyMustang:Social Media Service
but its doesn t matter because I tried another text, txt, bat and resource but still same
-
@GuarDofErun Use a set variable action and set it to a random name then as the value, use the resource you want to delete just to interact with the resource, then use the delete element after. Sometimes that fixes resource errors.