Advertisement
Guest User

MS2 Survey Fairfight Bot

a guest
Feb 5th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function randEmail() {
  2.     let chrs = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
  3.     let len = Math.floor(Math.random()*20+6);
  4.     let ans = "@gmail.com";
  5.     for (let i=0;i<len;i++) {
  6.         ans = chrs.charAt(Math.floor(Math.random()*chrs.length))+ans;
  7.     }
  8.     return ans;
  9. }
  10.  
  11. function shuffle(array) { // got this shuffle off of stackoverflow, thanks whoever it was
  12.   var currentIndex = array.length, temporaryValue, randomIndex;
  13.  
  14.   // While there remain elements to shuffle...
  15.   while (0 !== currentIndex) {
  16.  
  17.     // Pick a remaining element...
  18.     randomIndex = Math.floor(Math.random() * currentIndex);
  19.     currentIndex -= 1;
  20.  
  21.     // And swap it with the current element.
  22.     temporaryValue = array[currentIndex];
  23.     array[currentIndex] = array[randomIndex];
  24.     array[randomIndex] = temporaryValue;
  25.   }
  26.  
  27.   return array;
  28. }
  29.  
  30. function getpage() {
  31.     let p = document.getElementsByClassName("page-title user-generated")[0].innerText;
  32.     return p.charAt(p.length-1);
  33. };
  34. let page;
  35. try {
  36.     page = getpage();
  37. }
  38. catch (e) {
  39.     location.replace("https://www.surveymonkey.com/r/LYK8FXD");
  40. };
  41. if (page=='1') {
  42.     document.getElementsByClassName("radio-button-label-text question-body-font-theme user-generated")[Math.floor(Math.random()*8+1)].click();
  43. }
  44. else if (page=='2' || page=='3') {
  45.     // radio buttons
  46.     let btns = shuffle(Array.prototype.slice.call(document.getElementsByClassName("radio-button-label-text question-body-font-theme user-generated")));
  47.     for (let i=0;i<btns.length;i++) {
  48.         if (!btns[i].innerText.startsWith("Other")) {
  49.             btns[i].click();
  50.         }
  51.     }
  52.     if (page=='3') {
  53.         document.getElementsByClassName("radio-button-label-text question-body-font-theme user-generated")[15].click();
  54.         document.getElementsByClassName("text other-answer-text")[0].value="fairfight";
  55.     }
  56.     // checkboxes
  57.     let btns2 = document.getElementsByClassName("answer-label checkbox-button-label no-touch touch-sensitive clearfix");
  58.     for (let i=0;i<btns2.length;i++) {
  59.         if (!btns2[i].innerText.startsWith("Other") && Math.random()<.5) {
  60.             btns2[i].click();
  61.         }
  62.     }
  63.     // emoji buttons
  64.     btns = shuffle(Array.prototype.slice.call(document.getElementsByClassName("smf-icon emoji-border")));
  65.     for (let i=0;i<btns.length;i++) {
  66.         btns[i].click();
  67.         document.getElementsByClassName("smf-icon emoji-border")[28+Math.floor(Math.random()*2)].click();
  68.     }
  69.     // textboxes
  70.     let texts = document.getElementsByClassName("textarea");
  71.     if (page=='2') {
  72.         texts[0].value="fairfight";
  73.     }
  74.     if (page=='3') {
  75.         texts[0].value="Chaos raids because there is no fairfight";
  76.         texts[1].value="Defeating foes with fairfight quickly";
  77.         texts[2].value="Fairfight";
  78.         texts[3].value="The existence of features intentionally designed to make the game less enjoyable, such as fairfight";
  79.     }
  80. }
  81. else if (page=="e") {
  82.     let texts = document.getElementsByClassName("textarea");
  83.     texts[0].value="Could you please give everyone who thought fairfight was a good idea a pay cut?";
  84.     texts[1].value="REMOVE FAIRFIGHT";
  85.     texts[2].value="REMOVE FAIRFIGHT";
  86.     document.getElementsByClassName("text medium")[0].value=randEmail();
  87. }
  88. let submits=document.getElementsByClassName("btn small survey-page-button user-generated notranslate");
  89. submits[submits.length-1].click();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement