JaiminB

Whatsapp Web Auto Message Script

Nov 25th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Whatsapp Web Spam Message Script
  2. //Copy the code and paste in the console using F12
  3. //You can change interval of the message by default it is 1000ms change it to 30000ms for more fun
  4. //Enjoy:) Jaimin Brahmbhatt
  5.  
  6. var timer = setInterval(general,1000);
  7.  
  8.     function general(){
  9.         if(document.getElementsByClassName("app-wrapper-web")[0] != null){
  10.             var item2 = document.getElementsByClassName("_3auIg")[0];
  11.             var panel = document.getElementsByClassName("swl8g")[0];
  12.             var element = item2.cloneNode(true);                              // Create text and reps inputs
  13.             element.style.zIndex = 0;                // This way the menu doesn't go below our app
  14.             element.innerHTML = "<input type='text' id='mensaje' placeholder='Message' style='margin-right:10px' size='30'><input type='number' min='1' id='repeticiones' style='width:50px;padding-left:5px;margin-right:5px'>Times<div id='spam' data-icon=\"send\" class=\"img icon icon-send\" style='margin-left: 5px;cursor:pointer;'><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\"><path opacity=\".4\" d=\"M1.101 21.757L23.8 12.028 1.101 2.3l.011 7.912 13.623 1.816-13.623 1.817-.011 7.912z\"></path></svg></div>";
  15.             panel.insertBefore(element, panel.childNodes[1]);                     // Insert everything we have created
  16.             document.getElementById("spam").addEventListener("click", spam);     // Assign a function to the botton
  17.             clearInterval(timer);
  18.         }else{
  19.             console.log("WS Spam: Waiting for whatsapp to load...");
  20.         }
  21.     }
  22.  
  23.     function dispatch(input, message) {
  24.         InputEvent = Event || InputEvent;
  25.         var evt = new InputEvent('input', {                     // Create a new event from type "input"
  26.             bubbles: true,
  27.         composer: true
  28.         });
  29.         input.innerHTML = message;                              // Get text to spam
  30.         input.dispatchEvent(evt);                               // Fire the event (inserts text) in the input field.
  31.         document.querySelector("#main > footer > div._3pkkz.copyable-area > div:nth-child(3) > button > span").click();             // Press send button
  32.     }
  33.  
  34.     function spam(){
  35.         var text = document.getElementById("mensaje").value;       // Get text to spam
  36.         var reps = document.getElementById("repeticiones").value;  // Get number of repetitions
  37.         var input = document.querySelector("#main > footer > div._3pkkz.copyable-area > div._1Plpp > div > div._2S1VP.copyable-text.selectable-text");  // Select the input
  38.         var counter = 1;                                            // Initialize a counter
  39.         while(counter <= reps){                                 // Iterate the number of repetitions needed
  40.             dispatch(input, text);                                  // Spam!
  41.             counter++;
  42.         }
  43.     }
Add Comment
Please, Sign In to add comment