Скрипт под tampermonke // ==UserScript== // @name Автовыдача личных // @namespace https://lolz.live/ // @version 2.0 // @description Автовыдача личного // @author APT29388 // @match https://lolz.live/conversations/ // @match https://lolz.live/conversations/* // @grant GM_setValue // @grant GM_getValue // ==/UserScript== (function() { 'use strict'; let isScriptActive = false; function checkScriptStatus() { const wasActive = localStorage.getItem('autoPersonalActive') === 'true'; if (wasActive) { isScriptActive = true; if (window.location.href === 'https://lolz.live/conversations/') { setTimeout(openUnreadConversation, 1000); const button = document.querySelector('.auto-personal-button'); if (button) { button.style.backgroundColor = '#00ba78'; } } } } function givePersonal(conversationElement) { const allElements = conversationElement.querySelectorAll('a, span.button, .button'); for (const element of allElements) { if (element.textContent.includes('Выдать личный')) { element.click(); return true; } } return false; } function goBackToConversationsList() { localStorage.setItem('autoPersonalActive', 'true'); window.location.href = 'https://lolz.live/conversations/'; } function hasUnreadMessages() { const counter = document.querySelector('#ConversationsMenu_Counter .Total'); return counter && parseInt(counter.textContent) > 0; } function scrollConversationList(callback) { const conversationListWrapper = document.querySelector('#ConversationListScrollbar'); if (!conversationListWrapper) { if (callback) callback(); return; } let lastHeight = conversationListWrapper.scrollHeight; let scrollAttempts = 0; const maxScrollAttempts = 20; function scrollDown() { conversationListWrapper.scrollTop = conversationListWrapper.scrollHeight; const unreadConversations = document.querySelectorAll('.conversationItem._loadConversation.unread'); if (unreadConversations.length > 0 || conversationListWrapper.scrollHeight === lastHeight || scrollAttempts >= maxScrollAttempts) { if (callback) callback(); return; } lastHeight = conversationListWrapper.scrollHeight; scrollAttempts++; setTimeout(scrollDown, 500); } scrollDown(); } function processCurrentConversation() { setTimeout(() => { const conversationContainer = document.querySelector('.message-body, .messageBody, .block-body, .messageList, .conversationViewContainer, body'); if (conversationContainer) { if (givePersonal(conversationContainer)) { setTimeout(goBackToConversationsList, 1000); } else { setTimeout(goBackToConversationsList, 500); } } else { setTimeout(goBackToConversationsList, 500); } }, 1000); } function openUnreadConversation() { isScriptActive = true; localStorage.setItem('autoPersonalActive', 'true'); if (window.location.href === 'https://lolz.live/conversations/') { if (!hasUnreadMessages()) { stopScript(); return; } scrollConversationList(() => { const unreadConversations = document.querySelectorAll('.conversationItem._loadConversation.unread'); if (unreadConversations.length > 0) { const conversationHref = unreadConversations[0].getAttribute('data-href'); if (conversationHref) { window.location.href = `https://lolz.live/${conversationHref}`; } else { setTimeout(openUnreadConversation, 1000); } } else if (hasUnreadMessages()) { setTimeout(openUnreadConversation, 2000); } else { stopScript(); } }); } } function stopScript() { isScriptActive = false; localStorage.removeItem('autoPersonalActive'); const button = document.querySelector('.auto-personal-button'); if (button) { button.style.backgroundColor = ''; } } function addStartButton() { if (window.location.href === 'https://lolz.live/conversations/') { const controlsContainer = document.querySelector('.conversation-controls'); if (controlsContainer && !document.querySelector('.auto-personal-button')) { const startButton = document.createElement('a'); startButton.className = 'Tooltip conversationControl auto-personal-button'; startButton.title = 'Запустить/остановить автовыдачу личных'; startButton.innerHTML = '<i class="fa fa-robot conversationControl--icon" aria-hidden="true"></i>'; startButton.style.cursor = 'pointer'; if (isScriptActive) { startButton.style.backgroundColor = '#00ba78'; } startButton.addEventListener('click', function() { if (!isScriptActive) { isScriptActive = true; localStorage.setItem('autoPersonalActive', 'true'); this.style.backgroundColor = '#00ba78'; openUnreadConversation(); } else { stopScript(); this.style.backgroundColor = ''; } }); controlsContainer.appendChild(startButton); } } } function initialize() { checkScriptStatus(); if (window.location.href.match(/https:\/\/lolz\.live\/conversations\/\d+\//)) { processCurrentConversation(); } else { addStartButton(); } } window.addEventListener('load', function() { setTimeout(initialize, 500); }); })(); JS // ==UserScript== // @name Автовыдача личных // @namespace https://lolz.live/ // @version 2.0 // @description Автовыдача личного // @author APT29388 // @match https://lolz.live/conversations/ // @match https://lolz.live/conversations/* // @grant GM_setValue // @grant GM_getValue // ==/UserScript== (function() { 'use strict'; let isScriptActive = false; function checkScriptStatus() { const wasActive = localStorage.getItem('autoPersonalActive') === 'true'; if (wasActive) { isScriptActive = true; if (window.location.href === 'https://lolz.live/conversations/') { setTimeout(openUnreadConversation, 1000); const button = document.querySelector('.auto-personal-button'); if (button) { button.style.backgroundColor = '#00ba78'; } } } } function givePersonal(conversationElement) { const allElements = conversationElement.querySelectorAll('a, span.button, .button'); for (const element of allElements) { if (element.textContent.includes('Выдать личный')) { element.click(); return true; } } return false; } function goBackToConversationsList() { localStorage.setItem('autoPersonalActive', 'true'); window.location.href = 'https://lolz.live/conversations/'; } function hasUnreadMessages() { const counter = document.querySelector('#ConversationsMenu_Counter .Total'); return counter && parseInt(counter.textContent) > 0; } function scrollConversationList(callback) { const conversationListWrapper = document.querySelector('#ConversationListScrollbar'); if (!conversationListWrapper) { if (callback) callback(); return; } let lastHeight = conversationListWrapper.scrollHeight; let scrollAttempts = 0; const maxScrollAttempts = 20; function scrollDown() { conversationListWrapper.scrollTop = conversationListWrapper.scrollHeight; const unreadConversations = document.querySelectorAll('.conversationItem._loadConversation.unread'); if (unreadConversations.length > 0 || conversationListWrapper.scrollHeight === lastHeight || scrollAttempts >= maxScrollAttempts) { if (callback) callback(); return; } lastHeight = conversationListWrapper.scrollHeight; scrollAttempts++; setTimeout(scrollDown, 500); } scrollDown(); } function processCurrentConversation() { setTimeout(() => { const conversationContainer = document.querySelector('.message-body, .messageBody, .block-body, .messageList, .conversationViewContainer, body'); if (conversationContainer) { if (givePersonal(conversationContainer)) { setTimeout(goBackToConversationsList, 1000); } else { setTimeout(goBackToConversationsList, 500); } } else { setTimeout(goBackToConversationsList, 500); } }, 1000); } function openUnreadConversation() { isScriptActive = true; localStorage.setItem('autoPersonalActive', 'true'); if (window.location.href === 'https://lolz.live/conversations/') { if (!hasUnreadMessages()) { stopScript(); return; } scrollConversationList(() => { const unreadConversations = document.querySelectorAll('.conversationItem._loadConversation.unread'); if (unreadConversations.length > 0) { const conversationHref = unreadConversations[0].getAttribute('data-href'); if (conversationHref) { window.location.href = `https://lolz.live/${conversationHref}`; } else { setTimeout(openUnreadConversation, 1000); } } else if (hasUnreadMessages()) { setTimeout(openUnreadConversation, 2000); } else { stopScript(); } }); } } function stopScript() { isScriptActive = false; localStorage.removeItem('autoPersonalActive'); const button = document.querySelector('.auto-personal-button'); if (button) { button.style.backgroundColor = ''; } } function addStartButton() { if (window.location.href === 'https://lolz.live/conversations/') { const controlsContainer = document.querySelector('.conversation-controls'); if (controlsContainer && !document.querySelector('.auto-personal-button')) { const startButton = document.createElement('a'); startButton.className = 'Tooltip conversationControl auto-personal-button'; startButton.title = 'Запустить/остановить автовыдачу личных'; startButton.innerHTML = '<i class="fa fa-robot conversationControl--icon" aria-hidden="true"></i>'; startButton.style.cursor = 'pointer'; if (isScriptActive) { startButton.style.backgroundColor = '#00ba78'; } startButton.addEventListener('click', function() { if (!isScriptActive) { isScriptActive = true; localStorage.setItem('autoPersonalActive', 'true'); this.style.backgroundColor = '#00ba78'; openUnreadConversation(); } else { stopScript(); this.style.backgroundColor = ''; } }); controlsContainer.appendChild(startButton); } } } function initialize() { checkScriptStatus(); if (window.location.href.match(/https:\/\/lolz\.live\/conversations\/\d+\//)) { processCurrentConversation(); } else { addStartButton(); } } window.addEventListener('load', function() { setTimeout(initialize, 500); }); })(); Ставите его, жмаете кнопочку и всё, готово