Advertisement
Froast

Online Only Spam Bot (Groups)

May 4th, 2015
1,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3. **This version will only send the message to players who are online**
  4.  
  5. Go to the group page you want to spam when running this.
  6. Inspect Element->Console and copy and paste the code.
  7. Wait time can be adjusted and the bot will attempt to send messages super fast, but it's good to keep the time high or ROBLOX will detect flooding.
  8.  
  9. You can change the group number to the group you are recruiting for so that it doesn't send the message to people in that group.
  10.  
  11. */
  12.  
  13. var waitTime = 5; // In seconds
  14. var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
  15. function sendMsg(userId, username) {
  16.     function send() {
  17.         $.post("/messages/send",{
  18.             subject: 'wassup m9er',
  19.             body: 'Hello, ' + username + '.\n\nu ok m9?????',
  20.             recipientid: userId,
  21.             cacheBuster: new Date().getTime()
  22.         }).done(function(response) {
  23.             if (response.success == true) {
  24.                 console.log('Sent message to ' + username + ' (' + userId + ')');
  25.             } else {
  26.                 console.log('Error sending to ' + username + ': ' + response.shortMessage);
  27.             }
  28.         });
  29.     }
  30.     if (group > 0) {
  31.         $.get("/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  32.             if(response.indexOf('true') == -1) {
  33.                 send();
  34.             } else {
  35.                 console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  36.             }
  37.         });
  38.     } else {
  39.         send();
  40.     }
  41. }
  42.  
  43. function run() {
  44.     var timeout = 0;
  45.     var elements = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'Name\')]/a',document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);
  46.     var online = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'OnlineStatus\')]/img',document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);
  47.     var currentNode = elements.iterateNext();
  48.     var currentOnline = online.iterateNext();
  49.     while (currentNode) {
  50.         if (currentOnline.getAttribute('src')=='../images/online.png') {
  51.             (function(time,id,name) {
  52.                 setTimeout(sendMsg,time,id,name);
  53.             })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
  54.             timeout+=waitTime*1000;
  55.         }
  56.         currentNode = elements.iterateNext();
  57.         currentOnline = online.iterateNext();
  58.     }
  59.     __doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00','');
  60.     var ready = setInterval(function() {
  61.         if (document.getElementById('__EVENTTARGET').value == "") {
  62.             clearInterval(ready);
  63.             setTimeout(run,timeout);
  64.         }
  65.     }, 10);
  66. }
  67. var ready = setInterval(function() {
  68.     if (document.readyState === "complete") {
  69.         clearInterval(ready);
  70.         run();
  71.     }
  72. }, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement