Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Assumed environment functions:
- // writeCharAt(char, color, x, y)
- // w.on('cursor', callback)
- // w.cursors()
- // Color IDs
- const CID = {
- BLACK: 0, GRAY: 1, LIME: 8, YELLOW: 7, CYAN: 10, WHITE: 15, RED: 4
- };
- // Authorization List
- const Auth = ["KiwiTest", "Ultimer"];
- // State variables
- let fieldText = "";
- let shiftActive = false;
- let symActive = false;
- let lastChar = "";
- let authOnly = true;
- let miniHudVisible = true;
- let startTime = Date.now();
- const userCooldowns = {};
- const lastPositions = {};
- const keyMap = {};
- // HUD State
- let scriptRunning = true;
- let hudMinimized = false;
- let autoRefreshEnabled = true;
- let hudKeyMap = {};
- let pollingInterval = null;
- let timerInterval = null;
- let floatingHudEl = null;
- let floatingHudStyleEl = null;
- // Animation Queue Control
- let animAbortFlag = { stop: false };
- // Invert Y-axis wrapper
- function draw(char, color, x, y) {
- if (!scriptRunning) return;
- writeCharAt(char, color, x, -y);
- }
- function drawString(str, color, x, y) {
- for (let i = 0; i < str.length; i++) draw(str[i], color, x + i, y);
- }
- const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
- // --- FLOATING GLASSMORPHIC POPUP HUD (In-Page, Draggable) ---
- function createFloatingHud() {
- try {
- floatingHudStyleEl = document.createElement('style');
- floatingHudStyleEl.textContent = `
- @keyframes rkh-fadeIn { from { opacity: 0; transform: translateY(-10px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
- @keyframes rkh-glow { 0%, 100% { box-shadow: 0 0 15px rgba(0,255,255,0.4), 0 0 30px rgba(150,0,255,0.2); } 50% { box-shadow: 0 0 25px rgba(0,255,255,0.7), 0 0 50px rgba(150,0,255,0.4); } }
- #rkh-container {
- position: fixed; top: 80px; right: 40px; width: 340px;
- background: rgba(15, 15, 25, 0.75);
- backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
- border: 1px solid rgba(0, 255, 255, 0.4);
- border-radius: 14px;
- font-family: 'Segoe UI', 'Courier New', monospace;
- color: #e0faff;
- z-index: 999999;
- animation: rkh-fadeIn 0.35s ease-out, rkh-glow 3s infinite ease-in-out;
- overflow: hidden;
- user-select: none;
- }
- #rkh-header {
- display: flex; justify-content: space-between; align-items: center;
- padding: 10px 14px;
- background: linear-gradient(90deg, rgba(0,255,255,0.15), rgba(150,0,255,0.15));
- cursor: grab; border-bottom: 1px solid rgba(0,255,255,0.3);
- }
- #rkh-header:active { cursor: grabbing; }
- #rkh-title { font-weight: bold; font-size: 14px; letter-spacing: 1px; color: #7dfcff; text-shadow: 0 0 8px #00ffff; }
- .rkh-winbtn {
- background: rgba(255,255,255,0.08); border: none; color: #e0faff;
- width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
- font-size: 12px; margin-left: 5px; transition: 0.2s;
- }
- .rkh-winbtn:hover { background: rgba(0,255,255,0.3); }
- #rkh-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
- #rkh-body.rkh-hidden { display: none; }
- #rkh-input {
- background: rgba(0,0,0,0.4); border: 1px solid rgba(0,255,255,0.3);
- color: #baffff; padding: 10px; border-radius: 8px; font-family: inherit;
- font-size: 13px; outline: none; transition: 0.2s;
- }
- #rkh-input:focus { border-color: #00ffff; box-shadow: 0 0 10px rgba(0,255,255,0.5); }
- .rkh-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
- .rkh-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
- .rkh-btn {
- background: linear-gradient(135deg, rgba(0,255,255,0.12), rgba(150,0,255,0.12));
- border: 1px solid rgba(0,255,255,0.3);
- color: #e0faff; padding: 9px 6px; border-radius: 8px;
- font-family: inherit; font-size: 12px; cursor: pointer;
- transition: 0.2s; text-align: center;
- }
- .rkh-btn:hover { background: linear-gradient(135deg, #00ffff, #9600ff); color: #05050a; box-shadow: 0 0 12px rgba(0,255,255,0.6); transform: translateY(-1px); }
- .rkh-btn.rkh-danger { border-color: rgba(255,50,50,0.4); }
- .rkh-btn.rkh-danger:hover { background: linear-gradient(135deg, #ff3333, #990000); box-shadow: 0 0 12px rgba(255,50,50,0.6); color: #fff; }
- .rkh-status { font-size: 11px; opacity: 0.6; text-align: center; margin-top: 2px; }
- `;
- document.head.appendChild(floatingHudStyleEl);
- floatingHudEl = document.createElement('div');
- floatingHudEl.id = 'rkh-container';
- floatingHudEl.innerHTML = `
- <div id="rkh-header">
- <span id="rkh-title">⌨ REMOTE KEYBOARD</span>
- <div>
- <button class="rkh-winbtn" id="rkh-min">_</button>
- <button class="rkh-winbtn" id="rkh-close">✕</button>
- </div>
- </div>
- <div id="rkh-body">
- <input type="text" id="rkh-input" placeholder="Type message + Enter to send...">
- <div class="rkh-row3">
- <button class="rkh-btn" id="rkh-nl">↵ NewLine</button>
- <button class="rkh-btn" id="rkh-bksp">⌫ Bksp</button>
- <button class="rkh-btn" id="rkh-space">␣ Space</button>
- </div>
- <div class="rkh-row">
- <button class="rkh-btn" id="rkh-sym">Ω Symbols: ON</button>
- <button class="rkh-btn" id="rkh-clearqueue">🧹 Clear Queue</button>
- </div>
- <div class="rkh-row">
- <button class="rkh-btn" id="rkh-auto">⏱ Auto-Refresh: ON</button>
- <button class="rkh-btn" id="rkh-minihud">🎛 Mini HUD: ON</button>
- </div>
- <div class="rkh-row">
- <button class="rkh-btn" id="rkh-clear">🗑 Clear Box</button>
- <button class="rkh-btn" id="rkh-auth">🔒 Auth: ON</button>
- </div>
- <div class="rkh-row">
- <button class="rkh-btn" id="rkh-refresh">⟳ Refresh</button>
- <button class="rkh-btn rkh-danger" id="rkh-quit">⏻ Quit</button>
- </div>
- <div class="rkh-status" id="rkh-status">Connected to keyboard engine</div>
- </div>
- `;
- document.body.appendChild(floatingHudEl);
- const $ = (id) => floatingHudEl.querySelector(id);
- const input = $('#rkh-input');
- const status = $('#rkh-status');
- const flashStatus = (msg) => { status.textContent = msg; setTimeout(() => status.textContent = "Connected to keyboard engine", 1200); };
- const sendText = () => {
- if (input.value.length > 0) {
- fieldText += input.value;
- if (fieldText.length > 760) fieldText = fieldText.slice(-760);
- renderField();
- flashStatus(`Sent: "${input.value.slice(0,20)}${input.value.length>20?'...':''}"`);
- input.value = '';
- }
- };
- input.addEventListener('keypress', (e) => { if (e.key === 'Enter') sendText(); });
- $('#rkh-nl').addEventListener('click', () => { processKey('NEWLINE'); flashStatus('New line inserted'); });
- $('#rkh-bksp').addEventListener('click', () => { processKey('BACKSPACE'); flashStatus('Backspace'); });
- $('#rkh-space').addEventListener('click', () => { processKey('SPACE'); flashStatus('Space added'); });
- $('#rkh-clear').addEventListener('click', () => { fieldText = ""; renderField(); flashStatus('Input box cleared'); });
- $('#rkh-sym').addEventListener('click', () => {
- processKey('SYM');
- drawHUD();
- updateFloatingLabels();
- flashStatus(`Symbols Mode: ${symActive ? 'ON' : 'OFF'}`);
- });
- $('#rkh-clearqueue').addEventListener('click', () => {
- clearQueue();
- flashStatus('Animation queue cleared');
- });
- $('#rkh-auth').addEventListener('click', () => {
- authOnly = !authOnly;
- drawHUD();
- updateFloatingLabels();
- flashStatus(`Auth-Only: ${authOnly ? 'ON' : 'OFF'}`);
- });
- $('#rkh-auto').addEventListener('click', () => {
- autoRefreshEnabled = !autoRefreshEnabled;
- drawHUD();
- updateFloatingLabels();
- flashStatus(`Auto-Refresh: ${autoRefreshEnabled ? 'ON' : 'OFF'}`);
- });
- $('#rkh-minihud').addEventListener('click', () => {
- toggleMiniHud();
- updateFloatingLabels();
- flashStatus(`Mini HUD: ${miniHudVisible ? 'SHOWN' : 'HIDDEN'}`);
- });
- $('#rkh-refresh').addEventListener('click', () => { refreshUI(); flashStatus('UI Refreshing...'); });
- $('#rkh-quit').addEventListener('click', () => { quitScript(); });
- let popupMinimized = false;
- $('#rkh-min').addEventListener('click', () => {
- popupMinimized = !popupMinimized;
- $('#rkh-body').classList.toggle('rkh-hidden', popupMinimized);
- });
- $('#rkh-close').addEventListener('click', () => {
- floatingHudEl.style.display = 'none';
- });
- const header = $('#rkh-header');
- let isDragging = false, offsetX = 0, offsetY = 0;
- header.addEventListener('mousedown', (e) => {
- isDragging = true;
- const rect = floatingHudEl.getBoundingClientRect();
- offsetX = e.clientX - rect.left;
- offsetY = e.clientY - rect.top;
- floatingHudEl.style.right = 'auto';
- });
- document.addEventListener('mousemove', (e) => {
- if (!isDragging) return;
- floatingHudEl.style.left = (e.clientX - offsetX) + 'px';
- floatingHudEl.style.top = (e.clientY - offsetY) + 'px';
- });
- document.addEventListener('mouseup', () => { isDragging = false; });
- updateFloatingLabels();
- } catch (e) {
- console.log("Floating HUD failed to initialize:", e);
- }
- }
- function updateFloatingLabels() {
- if (!floatingHudEl) return;
- const autoBtn = floatingHudEl.querySelector('#rkh-auto');
- const authBtn = floatingHudEl.querySelector('#rkh-auth');
- const hudBtn = floatingHudEl.querySelector('#rkh-minihud');
- const symBtn = floatingHudEl.querySelector('#rkh-sym');
- if (autoBtn) autoBtn.textContent = `⏱ Auto-Refresh: ${autoRefreshEnabled ? 'ON' : 'OFF'}`;
- if (authBtn) authBtn.textContent = `🔒 Auth: ${authOnly ? 'ON' : 'OFF'}`;
- if (hudBtn) hudBtn.textContent = `🎛 Mini HUD: ${miniHudVisible ? 'ON' : 'OFF'}`;
- if (symBtn) symBtn.textContent = `Ω Symbols: ${symActive ? 'ON' : 'OFF'}`;
- }
- function destroyFloatingHud() {
- if (floatingHudEl) { floatingHudEl.remove(); floatingHudEl = null; }
- if (floatingHudStyleEl) { floatingHudStyleEl.remove(); floatingHudStyleEl = null; }
- }
- // --- IN-GAME MINI HUD LOGIC ---
- function registerHudButton(text, color, startX, startY, action) {
- drawString(text, color, startX, startY);
- for (let i = 0; i < text.length; i++) hudKeyMap[`${startX + i},${startY}`] = action;
- }
- function toggleMiniHud() {
- miniHudVisible = !miniHudVisible;
- drawHUD();
- }
- function drawHUD() {
- for (let x = 20; x <= 95; x++) draw(' ', CID.BLACK, x, -32);
- hudKeyMap = {};
- if (!miniHudVisible) return;
- if (hudMinimized) {
- registerHudButton("[+]", CID.WHITE, 22, -32, "HUD_EXPAND");
- } else {
- registerHudButton("[-]", CID.WHITE, 22, -32, "HUD_MINIMIZE");
- const autoText = autoRefreshEnabled ? "[Auto: ON ]" : "[Auto: OFF]";
- registerHudButton(autoText, autoRefreshEnabled ? CID.LIME : CID.GRAY, 26, -32, "HUD_AUTO");
- const authText = authOnly ? "[Auth: ON ]" : "[Auth: OFF]";
- registerHudButton(authText, authOnly ? CID.LIME : CID.GRAY, 38, -32, "HUD_AUTH");
- registerHudButton("[Clear]", CID.YELLOW, 50, -32, "HUD_CLEAR");
- registerHudButton("[Refresh]", CID.CYAN, 58, -32, "HUD_REFRESH");
- registerHudButton("[Quit]", CID.RED, 68, -32, "HUD_QUIT");
- const symText = symActive ? "[Sym: ON ]" : "[Sym: OFF]";
- registerHudButton(symText, symActive ? CID.LIME : CID.GRAY, 75, -32, "HUD_SYM");
- registerHudButton("[ClrQ]", CID.YELLOW, 86, -32, "HUD_CLEARQUEUE");
- }
- }
- function processHudAction(action) {
- if (action === 'HUD_MINIMIZE') { hudMinimized = true; drawHUD(); }
- else if (action === 'HUD_EXPAND') { hudMinimized = false; drawHUD(); }
- else if (action === 'HUD_AUTO') { autoRefreshEnabled = !autoRefreshEnabled; drawHUD(); updateFloatingLabels(); }
- else if (action === 'HUD_AUTH') { authOnly = !authOnly; drawHUD(); updateFloatingLabels(); }
- else if (action === 'HUD_CLEAR') { fieldText = ""; renderField(); }
- else if (action === 'HUD_REFRESH') { refreshUI(); }
- else if (action === 'HUD_QUIT') { quitScript(); }
- else if (action === 'HUD_SYM') { processKey('SYM'); drawHUD(); updateFloatingLabels(); }
- else if (action === 'HUD_CLEARQUEUE') { clearQueue(); }
- }
- // --- KEYBOARD LOGIC (Improved ASCII Styling) ---
- function getKeyboardLayout() {
- const layout = [];
- if (!symActive) {
- layout.push(...'1234567890'.split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -20 + i * 3, y: -5, color: CID.WHITE })));
- layout.push(...'QWERTYUIOP'.split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -19 + i * 3, y: -6, color: CID.CYAN })));
- layout.push(...'ASDFGHJKL'.split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -18 + i * 3, y: -7, color: CID.LIME })));
- layout.push(...'ZXCVBNM'.split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -17 + i * 3, y: -8, color: CID.YELLOW })));
- } else {
- layout.push(...'!@#$%^&*()'.split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -20 + i * 3, y: -5, color: CID.WHITE })));
- layout.push(...'_+-=[]{}\\|'.split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -19 + i * 3, y: -6, color: CID.CYAN })));
- layout.push(...";:'\",./<>?".split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -18 + i * 3, y: -7, color: CID.LIME })));
- layout.push(...'~`^°•○●□■'.split('').map((k, i) => ({ label: `⟦${k}⟧`, key: k, x: -17 + i * 3, y: -8, color: CID.YELLOW })));
- }
- // Special keys use lenticular brackets for visual distinction
- layout.push({ label: '【Shift】', key: 'SHIFT', x: -20, y: -9, color: CID.RED });
- layout.push({ label: '【Bksp 】', key: 'BACKSPACE', x: -13, y: -9, color: CID.RED });
- layout.push({ label: '【Sym 】', key: 'SYM', x: -6, y: -9, color: CID.RED });
- layout.push({ label: '【 x2 】', key: 'X2', x: -1, y: -9, color: CID.RED });
- layout.push({ label: '【NL】', key: 'NEWLINE', x: 5, y: -9, color: CID.RED });
- layout.push({ label: '【Space】', key: 'SPACE', x: 9, y: -9, color: CID.RED });
- return layout;
- }
- function updateKeyMap() {
- for (let k in keyMap) delete keyMap[k];
- getKeyboardLayout().forEach(k => {
- for (let i = 0; i < k.label.length; i++) keyMap[`${k.x + i},${k.y}`] = k.key;
- });
- }
- function drawKeyboard() {
- for (let y = -9; y <= -5; y++) for (let x = -22; x <= 22; x++) draw(' ', CID.BLACK, x, y);
- getKeyboardLayout().forEach(k => {
- for (let i = 0; i < k.label.length; i++) draw(k.label[i], k.color, k.x + i, k.y);
- });
- }
- function processKey(key) {
- if (key === 'SHIFT') shiftActive = !shiftActive;
- else if (key === 'BACKSPACE') fieldText = fieldText.slice(0, -1);
- else if (key === 'X2') { if (lastChar) fieldText += lastChar.repeat(2); }
- else if (key === 'SPACE') { fieldText += ' '; lastChar = ' '; shiftActive = false; }
- else if (key === 'NEWLINE') { fieldText += '\n'; lastChar = '\n'; shiftActive = false; }
- else if (key === 'SYM') { symActive = !symActive; drawKeyboard(); updateKeyMap(); }
- else {
- let c = shiftActive ? key.toUpperCase() : key.toLowerCase();
- fieldText += c; lastChar = c; shiftActive = false;
- }
- if (fieldText.length > 760) fieldText = fieldText.slice(-760);
- renderField();
- }
- // --- UI RENDERING ---
- function buildStaticChars() {
- const chars = [];
- chars.push({ c: '┌', col: CID.GRAY, x: -20, y: -10 });
- chars.push({ c: '┐', col: CID.GRAY, x: 19, y: -10 });
- for (let x = -19; x <= 18; x++) chars.push({ c: '─', col: CID.GRAY, x: x, y: -10 });
- chars.push({ c: '└', col: CID.GRAY, x: -20, y: -29 });
- chars.push({ c: '┘', col: CID.GRAY, x: 19, y: -29 });
- for (let x = -19; x <= 18; x++) chars.push({ c: '─', col: CID.GRAY, x: x, y: -29 });
- for (let y = -28; y <= -11; y++) {
- chars.push({ c: '│', col: CID.GRAY, x: -20, y: y });
- chars.push({ c: '│', col: CID.GRAY, x: 19, y: y });
- }
- getKeyboardLayout().forEach(k => {
- for (let i = 0; i < k.label.length; i++) chars.push({ c: k.label[i], col: k.color, x: k.x + i, y: k.y });
- });
- const desc = "This is for kiwitest, by: Ultimer";
- for (let i = 0; i < desc.length; i++) chars.push({ c: desc[i], col: CID.YELLOW, x: -20 + i, y: -3 });
- return chars;
- }
- async function drawStaticAnimated() {
- const localFlag = { stop: false };
- animAbortFlag = localFlag;
- const delay = 1000 / 450;
- const staticChars = buildStaticChars();
- for (const item of staticChars) {
- if (!scriptRunning || localFlag.stop) break;
- draw(item.c, item.col, item.x, item.y);
- await sleep(delay);
- }
- }
- // Halts any in-progress typing animation immediately
- function clearQueue() {
- animAbortFlag.stop = true;
- }
- function renderField() {
- for (let y = -28; y <= -11; y++) for (let x = -19; x <= 18; x++) draw(' ', CID.BLACK, x, y);
- let lines = [], currentLine = "";
- for (let i = 0; i < fieldText.length; i++) {
- let char = fieldText[i];
- if (char === '\n') { lines.push(currentLine); currentLine = ""; }
- else {
- currentLine += char;
- if (currentLine.length === 38) { lines.push(currentLine); currentLine = ""; }
- }
- }
- lines.push(currentLine);
- if (lines.length > 18) lines = lines.slice(-18);
- let startY = -11;
- for (let i = 0; i < lines.length; i++) {
- let line = lines[i];
- for (let j = 0; j < line.length; j++) draw(line[j], CID.LIME, -19 + j, startY - i);
- }
- }
- function drawTimer() {
- if (!scriptRunning) return;
- let elapsed = Math.floor((Date.now() - startTime) / 1000);
- let h = String(Math.floor(elapsed / 3600)).padStart(2, '0');
- let m = String(Math.floor((elapsed % 3600) / 60)).padStart(2, '0');
- let s = String(elapsed % 60).padStart(2, '0');
- for (let x = -20; x <= 10; x++) draw(' ', CID.BLACK, x, -2);
- drawString(`Uptime: ${h}:${m}:${s}`, CID.WHITE, -20, -2);
- }
- async function refreshUI() {
- if (!scriptRunning) return;
- for (let y = -35; y <= 0; y++) for (let x = -25; x <= 20; x++) draw(' ', CID.BLACK, x, y);
- await drawStaticAnimated();
- renderField();
- drawHUD();
- drawTimer();
- }
- function quitScript() {
- if (pollingInterval) clearInterval(pollingInterval);
- if (timerInterval) clearInterval(timerInterval);
- clearQueue();
- destroyFloatingHud();
- scriptRunning = false;
- const clearArea = (x1, x2, y1, y2) => {
- for (let y = y1; y <= y2; y++) for (let x = x1; x <= x2; x++) writeCharAt(' ', CID.BLACK, x, -y);
- };
- clearArea(20, 95, -32, -32);
- clearArea(-20, 19, -29, -10);
- clearArea(-22, 22, -9, -5);
- clearArea(-20, 15, -3, -3);
- clearArea(-20, 10, -2, -2);
- }
- // --- STRICT CURSOR DETECTION ---
- function handleCursorInput(x, y, name) {
- if (!scriptRunning || !name) return;
- const normalizedName = String(name).trim();
- const rx = Math.round(x), ry = Math.round(y);
- const posStr = `${rx},${ry}`;
- if (lastPositions[normalizedName] === posStr) return;
- const now = Date.now();
- if (userCooldowns[normalizedName] && (now - userCooldowns[normalizedName] < 200)) {
- lastPositions[normalizedName] = posStr; return;
- }
- const pos = `${rx},${-ry}`;
- const isAuth = Auth.some(a => a.toLowerCase() === normalizedName.toLowerCase());
- if (authOnly && !isAuth) { lastPositions[normalizedName] = posStr; return; }
- const hudAction = hudKeyMap[pos];
- if (hudAction) {
- lastPositions[normalizedName] = posStr;
- userCooldowns[normalizedName] = now;
- processHudAction(hudAction);
- return;
- }
- const key = keyMap[pos];
- if (key) {
- lastPositions[normalizedName] = posStr;
- userCooldowns[normalizedName] = now;
- processKey(key);
- } else {
- lastPositions[normalizedName] = posStr;
- }
- }
- function setupCursorDetection() {
- if (typeof w !== 'undefined' && typeof w.on === 'function') {
- try {
- w.on('cursor', (data) => {
- if (!data) return;
- let name = data.n || data.name || data.username || data.id;
- let x = data.l ? data.l[0] : data.x;
- let y = data.l ? data.l[1] : data.y;
- if (name !== undefined && x !== undefined && y !== undefined) handleCursorInput(x, y, name);
- });
- } catch(e) {}
- }
- pollingInterval = setInterval(() => {
- if (!scriptRunning) return;
- try {
- let cursors = [];
- if (typeof w.cursors === 'function') cursors = w.cursors();
- else if (typeof w.cursors !== 'undefined') cursors = w.cursors;
- if (!Array.isArray(cursors)) cursors = [];
- cursors.forEach(c => {
- if (!c) return;
- let name = c.n || c.name || c.username || c.id;
- let x = c.l ? c.l[0] : c.x;
- let y = c.l ? c.l[1] : c.y;
- if (name !== undefined && x !== undefined && y !== undefined) handleCursorInput(x, y, name);
- });
- } catch(e) {}
- }, 50);
- }
- // --- MAIN EXECUTION ---
- async function main() {
- updateKeyMap();
- await drawStaticAnimated();
- renderField();
- drawHUD();
- drawTimer();
- setupCursorDetection();
- createFloatingHud();
- timerInterval = setInterval(() => { if (scriptRunning) drawTimer(); }, 1000);
- (async () => {
- while (scriptRunning) {
- await sleep(15000);
- if (!scriptRunning) break;
- if (autoRefreshEnabled) { try { await refreshUI(); } catch (e) {} }
- }
- })();
- }
- main();
Advertisement
Add Comment
Please, Sign In to add comment