WhatsApp BombText Button

Creates a button that when pressed copies and pastes the text written in the chatbox

  1. // ==UserScript==
  2. // @name WhatsApp BombText Button
  3. // @namespace https://www.youtube.com/channel/UCgZDJZnndc9LNcVzhD85csw
  4. // @version 1.0.0
  5. // @description Creates a button that when pressed copies and pastes the text written in the chatbox
  6. // @author KRAMOS
  7. // @icon https://i.pinimg.com/originals/f7/09/99/f70999bf2fe7f1d8bd6bd0994787cbb1.png
  8. // @match https://web.whatsapp.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var repetir = null;
  13. var repeatingCreateSpamButtonFunction = null;
  14. var message = '';
  15.  
  16.  
  17.  
  18.  
  19.  
  20. document.onclick = function(){
  21. createSpamButton();
  22. creatcredit();
  23. creatnovocredit();
  24. };
  25.  
  26. function getElementByXpath(path) {
  27. return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  28. }
  29.  
  30.  
  31. function createSpamButton () {
  32. if(document.getElementById('botaospam') != null)
  33. return;
  34. var composeBar = getElementByXpath("//*[@id=\"main\"]/footer/div/div[1]");
  35. if(composeBar == null)
  36. return;
  37. composeBar.oninput = function(){
  38. editSpamButton();
  39. };
  40.  
  41. var spamButton = document.createElement('button');
  42. spamButton.setAttribute("id", "botaospam");
  43. spamButton.innerHTML = '💣';
  44. spamButton.style.fontSize = '100%';
  45. spamButton.style.padding = '7px 10px 10px 10px';
  46. composeBar.append(spamButton);
  47. editSpamButton();
  48. }
  49.  
  50.  
  51.  
  52. function sendMessage () {
  53. var evt = new Event('input', {
  54. bubbles: true
  55. });
  56.  
  57. var input = getElementByXpath("//*[@id=\"main\"]/footer/div[1]/div[2]/div/div[2]");
  58. input.innerHTML = message;
  59. input.dispatchEvent(evt);
  60.  
  61. getElementByXpath("//*[@id=\"main\"]/footer/div[1]/div[3]/button").click();
  62. }
  63.  
  64. function doSpam(element) {
  65. if(element.innerHTML == '💣'){
  66. var input = getElementByXpath("//*[@id=\"main\"]/footer/div[1]/div[2]/div/div[2]");
  67. if(input.innerHTML == '' || input.innerHTML == null){
  68. window.alert('Coloque Um Texto Primeiramente');
  69. return;
  70. }
  71. element.innerHTML = '🛑';
  72. message = input.innerHTML;
  73. var interval = parseInt;
  74. repetir = window.setInterval(function(){
  75. sendMessage();
  76. }, 1);
  77. } else {
  78. element.innerHTML = '💣';
  79. window.clearInterval(repetir);
  80. }
  81. editSpamButton();
  82. }
  83.  
  84. function editSpamButton(){
  85. var spamButton = document.getElementById('botaospam');
  86. var input = getElementByXpath("//*[@id=\"main\"]/footer/div/div[1]");
  87. if(input.innerHTML == '' || input.innerHTML == null){
  88. spamButton.style.cursor = 'not-allowed';
  89. spamButton.style.color = '#D3D3D3';
  90. spamButton.onclick = null;
  91. } else {
  92. spamButton.style.cursor = 'pointer';
  93. spamButton.style.color = '#039be5';
  94. spamButton.onclick = function(){
  95. doSpam(this);
  96. };
  97. }
  98. }
  99.  
  100.  
  101.  
  102. function creatcredit () {
  103. if(document.getElementById('kramostext') != null)
  104. return;
  105. var ota = getElementByXpath("//*[@id=\"main\"]/header/div/div[2]");
  106. if(ota == null)
  107. return;
  108. ota.oninput = function(){
  109. creatnovocredit();
  110. };
  111. var kramostext = document.createElement('text');
  112. kramostext.setAttribute("id", "kramostext");
  113. kramostext.innerHTML = 'KamozinMaker';
  114. kramostext.style.fontSize = '100%';
  115. kramostext.style.padding = '0px 10px 10px 10px';
  116. ota.append(kramostext);
  117. }
  118.  
  119. function creatnovocredit () {
  120. if(document.getElementById('makertext') != null)
  121. return;
  122. var mak = getElementByXpath("//*[@id=\"side\"]/header/div[2]");
  123. if(mak == null)
  124. return;
  125. mak.oninput = function(){
  126. };
  127. var makertext = document.createElement('text');
  128. makertext.setAttribute("id", "makertext");
  129. makertext.innerHTML = 'KramozinMaker';
  130. makertext.style.fontSize = '100%';
  131. makertext.style.padding = '0px 0px 10px 10px';
  132. mak.append(makertext);
  133. }
  134.  
  135.