[GC | Library] - SSW: Savvy Shop Wiz

Library to call.

Este script no debería instalarse directamente. Es una biblioteca que utilizan otros scripts mediante la meta-directiva de inclusión // @require https://update.greasyfork.org/scripts/487361/1327714/%5BGC%20%7C%20Library%5D%20-%20SSW%3A%20Savvy%20Shop%20Wiz.js

// ==UserScript==
// @name        [GC | Library] - SSW: Savvy Shop Wiz
// @namespace   https://greasyfork.org/en/users/1225524-kaitlin
// @require	https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.min.js
// @grant	GM_getValue
// @grant	GM_setValue
// @grant	GM_listValues
// @grant	GM_addStyle
// @license     MIT
// @version     1.0
// @author      Cupkait
// @icon        https://i.imgur.com/4Hm2e6z.png
// @description		Library to call.
// ==/UserScript==

var friendList = GM_getValue('friendList', []);
var syncedGuilds = GM_getValue('syncedGuilds', []);
var blockList = GM_getValue('blockList', []);


    const SSWMenuContainer = document.createElement('div');
	  SSWMenuContainer.id = 'sswcontainer';


    const SSWButton = document.createElement('button');
          SSWButton.textContent = 'SSW Settings';
  	  SSWButton.id = 'sswsettings';


    const SSWMenu = document.createElement('div');
	  SSWMenu.id = 'sswmenu';

    const ManualAdd = document.createElement('button');
          ManualAdd.textContent = 'Add User Manually';
	  ManualAdd.id = 'menubutton';
          $(ManualAdd).on('click', addUsersManually);
	  SSWMenu.appendChild(ManualAdd);


    const ManualRemove = document.createElement('button');
          ManualRemove.textContent = 'Remove User Manually';
	  ManualRemove.id = 'menubutton';
	  SSWMenu.appendChild(ManualRemove);


    const SyncFriends = document.createElement('button');
          SyncFriends.textContent = 'Sync Friends';
          SyncFriends.id = 'menubutton';
          SSWMenu.appendChild(SyncFriends);
               

    const SyncBlocked = document.createElement('button');
          SyncBlocked.textContent = 'Sync Blocked Users';
          SyncBlocked.id = 'menubutton';
          SSWMenu.appendChild(SyncBlocked);


    const SyncGuild = document.createElement('button');
	  SyncGuild.textContent = 'Sync Guild Members';
	  SyncGuild.id = 'menubutton';
          SSWMenu.appendChild(SyncGuild);

function createSSWMenu() {

    SSWMenuContainer.appendChild(SSWButton);
    SSWMenuContainer.appendChild(SSWMenu);
    $('#sb_edge').append(SSWMenuContainer);

    $(SSWButton).on('click', function() {
        $(SSWMenu).fadeToggle(150);
    });

    return SSWMenuContainer;
		return SSWMenu;
};





function addUsersManually() {
    var userInput = prompt('Who would you like to add to your list? This is CASE SENSITIVE! Enter one username then click OK. When you are done adding, click cancel.');

    if (userInput !== null && userInput.trim() !== '') {
        friendList.push(userInput.trim());
        GM_setValue('friendList', friendList);
        console.log('Added', userInput.trim(), 'to the friend list.');

if (window.location.href === 'https://www.grundos.cafe/market/wizard/') {
    if (confirm('Do you want to reload the page to see the updated results?')) {
        location.reload();
    }
}

} else {
        console.log('No username entered. Operation canceled.');
    }
}