[GC | Library] - SSW: Savvy Shop Wiz

Library to call.

目前為 2024-02-15 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/487361/1327706/%5BGC%20%7C%20Library%5D%20-%20SSW%3A%20Savvy%20Shop%20Wiz.js

  1. // ==UserScript==
  2. // @name [GC | Library] - SSW: Savvy Shop Wiz
  3. // @namespace https://gf.qytechs.cn/en/users/1225524-kaitlin
  4. // @require https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.min.js
  5. // @grant GM_getValue
  6. // @grant GM_setValue
  7. // @grant GM_listValues
  8. // @grant GM_addStyle
  9. // @license MIT
  10. // @version 1.0
  11. // @author Cupkait
  12. // @icon https://i.imgur.com/4Hm2e6z.png
  13. // @description Library to call.
  14. // ==/UserScript==
  15.  
  16.  
  17. const SSWMenuContainer = document.createElement('div');
  18. SSWMenuContainer.id = 'sswcontainer';
  19.  
  20.  
  21. const SSWButton = document.createElement('button');
  22. SSWButton.textContent = 'SSW Settings';
  23. SSWButton.id = 'sswsettings';
  24.  
  25.  
  26. const SSWMenu = document.createElement('div');
  27. SSWMenu.id = 'sswmenu';
  28.  
  29. const ManualAdd = document.createElement('button');
  30. ManualAdd.textContent = 'Add User Manually';
  31. ManualAdd.id = 'menubutton';
  32. $(ManualAdd).on('click', addUsersManually);
  33. SSWMenu.appendChild(ManualAdd);
  34.  
  35.  
  36.  
  37.  
  38. const ManualRemove = document.createElement('button');
  39. const SyncFriends = document.createElement('button');
  40. const SyncBlocked = document.createElement('button');
  41. const SyncGuild = document.createElement('button');
  42.  
  43. function createSSWMenu() {
  44.  
  45. SSWMenuContainer.appendChild(SSWButton);
  46. SSWMenuContainer.appendChild(SSWMenu);
  47. $('#sb_edge').append(SSWMenuContainer);
  48.  
  49. $(SSWButton).on('click', function() {
  50. $(SSWMenu).fadeToggle(150);
  51. });
  52.  
  53. return SSWMenuContainer;
  54. return SSWMenu;
  55. };
  56.  
  57. function addUsersManually() {
  58. 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.');
  59.  
  60. if (userInput !== null && userInput.trim() !== '') {
  61. friendList.push(userInput.trim());
  62. GM_setValue('friendList', friendList);
  63. console.log('Added', userInput.trim(), 'to the friend list.');
  64.  
  65. if (window.location.href === 'https://www.grundos.cafe/market/wizard/') {
  66. if (confirm('Do you want to reload the page to see the updated results?')) {
  67. location.reload();
  68. }
  69. }
  70.  
  71. } else {
  72. console.log('No username entered. Operation canceled.');
  73. }
  74. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址