How too Use Auto-Invite Script - Tutoriale - GAMELIFE România Jump to content

Recommended Posts

  • Administrators
Posted

For this script to work, you need any browser that allows developer console to be used such as Chrome, Firefoxl, Edge, Opera, etc.

 

Go to your friends list ( https://steamcommunity.com/my/friends/ ).
Once you have done that go to your browser's developer console ( 
To open DevTools, right-click the page and select Inspect )  and paste the following code:

 

const groupID = '103582791435613873';
const friends = GetCheckedAccounts('#search_results>.selectable');
InviteUserToGroup(null, groupID, friends);

 

Script work only for GameLife Romania! Steam Group! 

 

spacer.png

 

SCW66nm.png

 

  • Like 2

Donator: SteamDB

Donator: SteamLadder

Steam Level Up: https://slvlup.com/r/krrna6

Steam™ Hour Boosting!: https://freehourboost.com/?r=cosminzm

3177671.png

  • 7 months later...
  • Scripter
Posted

Pentru a îmbunătăți experiența de invitație pe Steam, am creat un userscript pentru Tampermonkey. Puteți descărca Tampermonkey de aici: https://www.tampermonkey.net/

Pentru a crea scriptul, urmați pașii de mai jos:

 

1. Selectați extensia Tampermonkey și accesați dashboard-ul.

Spoiler

Tampermonkey Dashboard

 

2. În dashboard, faceți click pe simbolul '+' care semnifică 'Create new script'.

Spoiler

Create New Script

 

3. După ce ați creat noul script, copiați și lipiți următorul cod și salvați folosind combinația de taste CTRL + S sau din meniul File > Save.

Spoiler

Script Code

 

 

Script:

Spoiler
            // ==UserScript==
            // @name         Steam Invite Friends to Group
            // @namespace    http://tampermonkey.net/
            // @version      1.5
            // @description  Invite friends to your Steam group
            // @author       @LeX
            // @match        https://steamcommunity.com/id/*/friends
            // @match        https://steamcommunity.com/profiles/*/friends
            // @grant        none
            // ==/UserScript==

            (function() {
                'use strict';

                function addInviteButton() {
                    let titleBar = document.querySelector('.profile_friends.title_bar');
                    if (!titleBar) return;

                    let inviteButton = document.createElement('button');
                    inviteButton.id = 'add_friends_button';
                    inviteButton.className = 'profile_friends manage_link btn_green_steamui btn_medium';
                    inviteButton.innerHTML = 'Invite friends in your group';
                    inviteButton.style.marginBottom = '10px';
                    inviteButton.onclick = fetchGroups;

                    titleBar.parentNode.insertBefore(inviteButton, titleBar);
                }

                function fetchGroups() {
                    let groupUrl = location.href.includes('id') ?
                        location.href.replace('/friends', '/groups') :
                        location.href.replace('/friends', '/groups');

                    fetch(groupUrl)
                        .then(response => response.text())
                        .then(text => {
                            let parser = new DOMParser();
                            let doc = parser.parseFromString(text, 'text/html');
                            let groupBlocks = doc.querySelectorAll('.group_block');
                            let groups = Array.from(groupBlocks).map(block => {
                                let groupIdMatch = block.innerHTML.match(/OpenGroupChat\(\s*'(\d+)'/);
                                let groupName = block.querySelector('.groupTitle a').textContent.trim();
                                return {
                                    id: groupIdMatch ? groupIdMatch[1] : null,
                                    name: groupName
                                };
                            }).filter(group => group.id);

                            showGroupSelection(groups);
                        });
                }

                function showGroupSelection(groups) {
                    let select = document.createElement('select');
                    select.style.width = '100%';
                    select.style.marginBottom = '10px';
                    select.style.padding = '5px';
                    select.style.fontSize = '14px';

                    groups.forEach(group => {
                        let option = document.createElement('option');
                        option.value = group.id;
                        option.textContent = group.name;
                        select.appendChild(option);
                    });

                    let confirmButton = document.createElement('button');
                    confirmButton.textContent = 'Confirm';
                    confirmButton.className = 'btn_green_steamui btn_medium';
                    confirmButton.style.width = '100%';
                    confirmButton.onclick = () => {
                        let selectedGroupId = select.value;
                        let friends = GetCheckedAccounts('#search_results>.selectable');
                        InviteUserToGroup(null, selectedGroupId, friends);
                        document.body.removeChild(modal);
                    };

                    let modal = document.createElement('div');
                    modal.style.position = 'fixed';
                    modal.style.top = '50%';
                    modal.style.left = '50%';
                    modal.style.transform = 'translate(-50%, -50%)';
                    modal.style.backgroundColor = '#1b2838';
                    modal.style.border = '1px solid #000';
                    modal.style.padding = '20px';
                    modal.style.zIndex = '1000';
                    modal.style.width = '300px';
                    modal.style.color = '#c6d4df';
                    modal.style.boxShadow = '0px 0px 10px rgba(0,0,0,0.5)';

                    let modalTitle = document.createElement('h2');
                    modalTitle.textContent = 'Select a group';
                    modalTitle.style.marginBottom = '10px';
                    modalTitle.style.fontSize = '18px';

                    modal.appendChild(modalTitle);
                    modal.appendChild(select);
                    modal.appendChild(confirmButton);

                    document.body.appendChild(modal);
                }

                window.addEventListener('load', addInviteButton);
            })();
        


Acum totul este terminat. Nimic mai simplu!
Rezultat:

Spoiler

HcCAyvM.png



Butonul va apărea după aproximativ 1 secundă sau mai puțin și putem selecta grupul dorit.
Apăsăm confirm și invitația va fi trimisă automat către toți prietenii din listă. Acest script este mai util și mult mai automatizat.

 

Ps. Voi reveni cu un edit dacă voi mai lucra la acest script.
Momentan are o problemă: odată apăsat butonul de invitație, selectorul grupurilor nu dispare și trebuie să reîncărcați pagina.
Poate voi adăuga un event log astfel încât dacă selectorul este existent și apăsăm în afara acestuia, să dispară, dar nu promit nimic încă.

  • Like 3

277198.png?1730931816

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...

Important Information