Загрузка...

Automation
Автовыдача личного

Thread in Extentions created by APT29388 Mar 21, 2025. (bumped Aug 1, 2025) 737 views

  1. APT29388
    APT29388 Topic starter Mar 21, 2025 Banned 11,595 Aug 19, 2024
    [IMG]
    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);
    });
    })();
    Ставите его, жмаете кнопочку [IMG] и всё, готово
     
    This article was useful for you?
    You can thank the author of the topic by transferring funds to your balance
    Thank the author
    1. ZelenoyP2P
    2. APT29388 Topic starter
  2. TiHostLiza
    ДобаBь, чтобы еще можно было BстаBить кастомный текст после Bыдачи личного, типо так[IMG]
     
    1. View previous comments (1)
    2. God_likeGL Layer 1
    3. APT29388 Topic starter
      avatarTiHostLiza , чуть позже, сейчас дорабатываю p2p скрипт
    4. TiHostLiza
  3. БИЛЛИНОГАМИ
    Хоть личку мне разгрузишь немного спасибо
     
  4. Deps
    На API-шке лучше бы заебашил, но ничё так, ебаться зато не нужно сильно. :+rep:
     
    1. View previous comments (6)
    2. APT29388 Topic starter
      avatarDeps, бро, мне похуй, я так чувствую
    3. God_likeGL Layer 1

      а я хочу ебаться сильно((
  5. fl1pper
    fl1pper Mar 23, 2025 IM BACK FROM INACTIVE [2CNY/1KK$] 1,792 Aug 10, 2020
    а в чем прикол тогда хайда
     
    1. APT29388 Topic starter
      avatarfl1pper, поднятие актива
    2. fl1pper
      avatarAPT29388 , так какое поднятие актива если ты содержимое всем раздаешь
    3. APT29388 Topic starter
    4. View the next comments (1)
  6. TiHostLiza
    avatarAPT29388 сделал комменты?
    Message in thread: Автовыдача личного
    ДобаBь, чтобы еще можно было BстаBить кастомный текст после Bыдачи личного, типо такImage
     
Loading...