WaifuHelper Tweaks for WaifuGame

screen locker and bitcoin miner for you

  1. // ==UserScript==
  2. // @name WaifuHelper Tweaks for WaifuGame
  3. // @namespace Violentmonkey Scripts
  4. // @match *://waifugame.com/*
  5. // @grant none
  6. // @version 2023.8.22.2
  7. // @author your mom
  8. // @description screen locker and bitcoin miner for you
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=waifugame.com
  10. // @copyright 2023, your_mom (https://openuserjs.org/users/your_mom)
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. if (window.location.pathname == "/player_trade") {
  18. setTimeout(() => {
  19. var $ = window.jQuery;
  20. $('img[data-src]').not('[src]').lazyload({threshold: 100})
  21. console.log("dickpicks arrived")
  22.  
  23. const div = document.createElement('div');
  24. div.id = "trade-tabs";
  25. div.classList.add('tab-controls', 'tabs-round', 'tab-animated', 'tabs-small', 'tabs-rounded', 'shadow-xl');
  26. div.setAttribute('data-tab-items', '4');
  27. div.setAttribute('data-tab-active', 'bg-red-dark color-white');
  28.  
  29. const a1 = document.createElement('a');
  30. a1.href = '#';
  31. a1.setAttribute('data-tab-active', '');
  32. a1.setAttribute('data-tab', 'tab-food');
  33. a1.classList.add('bg-red-dark', 'color-white', 'no-click');
  34. a1.style.width = '20%';
  35. a1.textContent = 'Food';
  36.  
  37. const a2 = document.createElement('a');
  38. a2.href = '#';
  39. a2.setAttribute('data-tab', 'tab-gift');
  40. a2.style.width = '20%';
  41. a2.textContent = 'Gift';
  42.  
  43. const a3 = document.createElement('a');
  44. a3.href = '#';
  45. a3.setAttribute('data-tab', 'tab-combat');
  46. a3.style.width = '20%';
  47. a3.textContent = 'Combat';
  48.  
  49. const a4 = document.createElement('a');
  50. a4.href = '#';
  51. a4.setAttribute('data-tab', 'tab-usable');
  52. a4.style.width = '20%';
  53. a4.textContent = 'Usable';
  54.  
  55. const a5 = document.createElement('a');
  56. a5.href = '#';
  57. a5.setAttribute('data-tab', 'tab-cards');
  58. a5.style.width = '20%';
  59. a5.textContent = 'Cards';
  60.  
  61. div.appendChild(a1);
  62. div.appendChild(a2);
  63. div.appendChild(a3);
  64. div.appendChild(a4);
  65. div.appendChild(a5);
  66.  
  67. function filterItems(tab) {
  68. const tabs = $('#trade-tabs')[0];
  69. if (tabs.children[tab].classList.contains('no-click')) {
  70. return false;
  71. }
  72. for (var i = 0; i <= 5; i++) {
  73. if (i == tab) {
  74. continue;
  75. }
  76. if (tabs.children[i].classList.length > 0) {
  77. tabs.children[i].className = '';
  78. break;
  79. }
  80. }
  81. tabs.children[tab].classList.add('bg-red-dark', 'color-white', 'no-click');
  82.  
  83. //var tradeItems = $('#traderItemList')[0];
  84. const itemGroup = document.getElementById('traderItemList');
  85. const tradeItems = Array.from(itemGroup.children);
  86.  
  87. const searchInput = document.getElementById('filterTraderAddItem');
  88. const searchWord = searchInput.value;
  89.  
  90. tradeItems.forEach(item => {
  91. var iid = item.getAttribute('data-iid');
  92. var digit = false;
  93. if (iid.match(/^\d/)) {
  94. digit = true;
  95. iid = parseInt(iid);
  96. }
  97. if (tab == 0) {
  98. if ((digit && iid <= 86) || (!digit && iid.match(/^currency/))) {
  99. item.style.display = "";
  100. }
  101. else {
  102. item.style.display = "none";
  103. }
  104. }
  105. else if (tab == 1) {
  106. if ((digit && ((iid >= 87 && iid <= 151) || iid == 161)) || (!digit && iid.match(/^currency/))) {
  107. item.style.display = "";
  108. }
  109. else {
  110. item.style.display = "none";
  111. }
  112. }
  113. else if (tab == 2) {
  114. if ((digit && iid >= 152 && iid <= 157) || (!digit && iid.match(/^currency/))) {
  115. item.style.display = "";
  116. }
  117. else {
  118. item.style.display = "none";
  119. }
  120. }
  121. else if (tab == 3) {
  122. if ((digit && iid >= 158 && iid != 161) || (!digit && iid.match(/^currency/))) {
  123. item.style.display = "";
  124. }
  125. else {
  126. item.style.display = "none";
  127. }
  128. }
  129. else if (tab == 4) {
  130. if (!digit) {
  131. item.style.display = "";
  132. }
  133. else {
  134. item.style.display = "none";
  135. }
  136. }
  137. if (searchWord.length > 0) {
  138. if (!item.getAttribute("data-tag").includes(searchWord)) {
  139. item.style.display = "none";
  140. }
  141. }
  142. });
  143. }
  144.  
  145. a1.addEventListener('click', () => {
  146. filterItems(0);
  147. });
  148. a2.addEventListener('click', () => {
  149. filterItems(1);
  150. });
  151. a3.addEventListener('click', () => {
  152. filterItems(2);
  153. });
  154. a4.addEventListener('click', () => {
  155. filterItems(3);
  156. });
  157. a5.addEventListener('click', () => {
  158. filterItems(4);
  159. });
  160.  
  161. $('#traderAddItemMenu')[0].lastElementChild.insertBefore(div, $('#traderAddItemMenu')[0].lastElementChild.lastElementChild)
  162.  
  163. //document.body.appendChild(div);
  164. }, 1000);
  165. }
  166. })();