hwm_spam

hwm spam script

目前为 2023-11-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name hwm_spam
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.4
  5. // @author Лосось
  6. // @description hwm spam script
  7. // @match /^https{0,1}:\/\/((www|qrator|my)\.(heroeswm|lordswm)\.(ru|com)|178\.248\.235\.15)\/(sms|sms-create|home).php*/
  8. // @include /^https{0,1}:\/\/((www|qrator|my)\.(heroeswm|lordswm)\.(ru|com)|178\.248\.235\.15)\/(sms|sms-create|home).php*/
  9. // @license MIT
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. // local storage vars
  17. let spam_list = JSON.parse(localStorage.getItem('spam_list'));
  18. let subjectLS = JSON.parse(localStorage.getItem('subjectLS'));
  19. let msgLS = JSON.parse(localStorage.getItem('msgLS'));
  20. let timerLS = Number(JSON.parse(localStorage.getItem('timerLS')));
  21. let toogleStopSpam = JSON.parse(localStorage.getItem('toogleStopSpam'));
  22. let toogleStopSpamVar = toogleStopSpam;
  23. let isShowScriptLS = JSON.parse(localStorage.getItem('hwmSpamScriptToogle'));
  24. let isShowScript = isShowScriptLS;
  25.  
  26. if (!spam_list) {
  27. localStorage.setItem('spam_list', JSON.stringify([]));
  28. location.reload();
  29. }
  30. if (!subjectLS) {
  31. localStorage.setItem('subjectLS', JSON.stringify('введите тему'));
  32. location.reload();
  33. }
  34. if (!msgLS) {
  35. localStorage.setItem('msgLS', JSON.stringify('введите сообщение'));
  36. location.reload();
  37. }
  38. if (!timerLS) {
  39. localStorage.setItem('timerLS', JSON.stringify(60000));
  40. location.reload();
  41. }
  42. if (toogleStopSpam === null) {
  43. localStorage.setItem('toogleStopSpam', JSON.stringify(false));
  44. location.reload();
  45. }
  46. if (!isShowScriptLS) {
  47. localStorage.setItem('hwmSpamScriptToogle', JSON.stringify(false));
  48. }
  49.  
  50. // ui buttons
  51.  
  52. let showScriptBtn = document.createElement('button');
  53. showScriptBtn.innerText = 'Spam script';
  54. showScriptBtn.style = 'position: absolute; left: 10px; top: 2px; z-index: 999998; '
  55.  
  56. let stopSpamBtn = document.createElement('button');
  57. stopSpamBtn.innerText = toogleStopSpam ? 'Остановить спам' : 'Продолжить спам';
  58. stopSpamBtn.style = 'position: absolute; left: 100px; top: 2px; z-index: 999997;';
  59. let block = document.createElement('div');
  60. block.style = 'position: absolute; left: 10px; top: 24px; z-index: 999999; width: 400px; min-height: 50px; background: rgb(238,174,202); background: radial-gradient(circle, rgba(238,174,202,1) 0%, rgba(148,187,233,1) 100%); display: flex; flex-direction: column; align-items: center;';
  61. block.style.visibility = isShowScript ? 'visible' : 'hidden';
  62.  
  63. let addInputNicks = document.createElement('input');
  64. addInputNicks.style = 'width: 400px; height: 50px; background: transparent; border: 1px solid white; color: white; font-size: 16px; margin-bottom: 3px;';
  65. addInputNicks.placeholder = 'вставьте или введите никнеймы';
  66.  
  67. let timerBlock = document.createElement('div');
  68. timerBlock.style = 'display: flex; flex-direction: column; align-items: center; gap: 5px';
  69.  
  70. let timer = document.createElement('div');
  71. timer.innerText = `Таймер ${timerLS / 1000} сек`
  72. timer.style = 'color: white';
  73.  
  74. let setTimerBtn = document.createElement('input');
  75. setTimerBtn.style = 'border: 1px solid white; width: 120px; height: 30px; background: transparent; color: white; border-radius: 10px; margin-top: 5px;';
  76. setTimerBtn.placeholder = 'введите таймер';
  77.  
  78. let subjectInput = document.createElement('input');
  79. subjectInput.value = subjectLS;
  80. subjectInput.placeholder = 'введите тему';
  81. subjectInput.style = 'width: 400px; height: 50px; background: transparent; border: 1px solid white; color: white; font-size: 16px; margin-bottom: 3px;';
  82.  
  83. let msgInput = document.createElement('textarea');
  84. msgInput.value = msgLS;
  85. msgInput.placeholder = 'введите сообщение';
  86. msgInput.style = 'width: 400px; height: 150px; background: transparent; border: 1px solid white; color: white; font-size: 16px; margin-bottom: 3px;';
  87.  
  88. let addMessageBtn = document.createElement('button');
  89. addMessageBtn.innerText = 'Добавить/изменить сообщение';
  90. addMessageBtn.style = 'border: 1px solid white; background: pink; width: 250px; height: 30px; margin-top: 1px; margin-bottom: 3px; cursor: pointer; font-weigth: bold; color: white; border-radius: 10px;'
  91.  
  92. let uiList = document.createElement('ol');
  93. uiList.style = '';
  94.  
  95. let deleteAllNicksBtn = document.createElement('button');
  96. deleteAllNicksBtn.innerText = 'удалить весь список';
  97. deleteAllNicksBtn.style = 'border: 1px solid white; width: 140px; height: 50px; background: transparent; color: white; cursor: pointer; border-radius: 10px;';
  98. deleteAllNicksBtn.addEventListener('click', () => {
  99. let conf = confirm('точно удалить весь список?');
  100. if (!conf) return;
  101. spam_list = [];
  102. localStorage.setItem('spam_list', JSON.stringify(spam_list));
  103. location.reload();
  104. });
  105.  
  106. showScriptBtn.addEventListener('click', () => {
  107. isShowScript = !isShowScript;
  108. localStorage.setItem('hwmSpamScriptToogle', isShowScript);
  109. block.style.visibility = isShowScript ? 'visible' : 'hidden';
  110. })
  111.  
  112. stopSpamBtn.addEventListener('click', () => {
  113. toogleStopSpamVar = !toogleStopSpamVar
  114. localStorage.setItem('toogleStopSpam', toogleStopSpamVar);
  115. location.reload();
  116. })
  117.  
  118. setTimerBtn.addEventListener('keypress', (e) => {
  119. if (e.key === 'Enter') {
  120. localStorage.setItem('timerLS', JSON.stringify(Number(setTimerBtn.value) * 1000));
  121. location.reload();
  122. }
  123. })
  124.  
  125. subjectInput.addEventListener('keypress', (e) => {
  126. if (e.key === 'Enter') {
  127. localStorage.setItem('subjectLS', JSON.stringify(subjectInput.value));
  128. location.reload();
  129. }
  130. })
  131.  
  132. addMessageBtn.addEventListener('click', () => {
  133. localStorage.setItem('msgLS', JSON.stringify(msgInput.value));
  134. location.reload();
  135. })
  136.  
  137. addInputNicks.addEventListener('keypress', (e) => {
  138. if (e.key === 'Enter') {
  139. let text = addInputNicks.value;
  140. text = text.split(',');
  141. text = text.filter(el => el.length !== 0);
  142. text = text.map(el => el.trim());
  143. spam_list = [...spam_list, ...text];
  144. localStorage.setItem('spam_list', JSON.stringify(spam_list));
  145. location.reload();
  146. }
  147. })
  148.  
  149. spam_list.forEach(el => {
  150. let li = document.createElement('li');
  151. let nickname = document.createElement('span');
  152. let deleteNickBtn = document.createElement('button');
  153. deleteNickBtn.style = 'border: 1px dotted red; border-radius: 50%; cursor: pointer; margin-left: 5px;'
  154. deleteNickBtn.innerText = 'x';
  155. nickname.innerText = el;
  156. nickname.style = 'color: white;';
  157. deleteNickBtn.addEventListener('click', () => {
  158. spam_list = spam_list.filter(nick => nick !== el);
  159. localStorage.setItem('spam_list', JSON.stringify(spam_list));
  160. location.reload();
  161. })
  162. li.appendChild(nickname);
  163. li.appendChild(deleteNickBtn);
  164. uiList.appendChild(li);
  165. })
  166.  
  167. timerBlock.appendChild(setTimerBtn);
  168. timerBlock.appendChild(timer);
  169.  
  170. block.appendChild(addInputNicks);
  171. block.appendChild(subjectInput);
  172. block.appendChild(msgInput);
  173. block.appendChild(addMessageBtn);
  174. block.appendChild(deleteAllNicksBtn);
  175. block.appendChild(timerBlock);
  176. block.appendChild(uiList);
  177. document.body.appendChild(showScriptBtn);
  178. document.body.appendChild(stopSpamBtn);
  179. document.body.appendChild(block);
  180.  
  181. if (toogleStopSpam === false) return;
  182.  
  183. if (location.href === 'https://my.lordswm.com/sms.php') {
  184. if (spam_list.length === 0) return;
  185. location.replace('https://my.lordswm.com/sms-create.php');
  186. }
  187.  
  188. if (location.href === 'https://www.heroeswm.ru/sms.php') {
  189. if (spam_list.length === 0) return;
  190. location.replace('https://www.heroeswm.ru/sms-create.php');
  191. }
  192.  
  193. if (location.href === 'https://my.lordswm.com/sms-create.php') {
  194. if (spam_list.length === 0) return;
  195. let nickInput = document.getElementsByName("mailto")[0].value = spam_list[0];
  196.  
  197. let subjectInput = document.getElementsByName("subject")[0].value = subjectLS;
  198.  
  199. let msgInput = document.getElementsByName("msg")[0].value = msgLS;
  200.  
  201. setTimeout(() => {
  202. let submitBtn = document.getElementsByName("subm")[0].click();
  203. if (document.fmail.getElementsByTagName('center')[0].innerText.includes('Сообщение может быть отправлено через')) return;
  204. spam_list.shift();
  205. localStorage.setItem('spam_list', JSON.stringify(spam_list));
  206. }, timerLS);
  207. }
  208.  
  209. if (location.href === 'https://www.heroeswm.ru/sms-create.php') {
  210. if (spam_list.length === 0) return;
  211. let nickInput = document.getElementsByName("mailto")[0].value = spam_list[0];
  212.  
  213. let subjectInput = document.getElementsByName("subject")[0].value = subjectLS;
  214.  
  215. let msgInput = document.getElementsByName("msg")[0].value = msgLS;
  216.  
  217. setTimeout(() => {
  218. let submitBtn = document.getElementsByName("subm")[0].click();
  219. if (document.fmail.getElementsByTagName('center')[0].innerText.includes('Сообщение может быть отправлено через')) return;
  220. spam_list.shift();
  221. localStorage.setItem('spam_list', JSON.stringify(spam_list));
  222. }, timerLS);
  223. }
  224.  
  225.  
  226. })();