Advertisement
Guest User

EI PM bot

a guest
May 30th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3. Change placeId to the place you want to scan for and message players.
  4. Inspect Element->Console and copy and paste the code.
  5. 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.
  6.  
  7. 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.
  8.  
  9. Built off of (but in the end most of that code was removed): http://pastebin.com/s2nR7tha
  10.  
  11. */
  12.  
  13. var placeId = 218248596; // Place to check and message
  14. var waitTime = 15; // In seconds
  15. var group = 2572720; // 0 for no group check, otherwise people in this group will not receive the message
  16. function sendMsg(userId, username) {
  17.     function send() {
  18.         $.post('http://www.roblox.com/messages/send',{
  19.             subject: "I've been watching you, we need skilled active people like you in EI",
  20.             body: "Greetings sir. I've been watching you and many other people, and I've decided to personally invite you to a power, skilled clan named Excalibur Imperium. We're the best of the best, and we want you to join our ranks. The only reason your getting this is because I've been watching you on many different alts, and I've decided your worthy of joining the great Imperium, we're planning wars on many big clans, and allying even more. To join just click this link http://www.roblox.com/Groups/Group.aspx?gid=2572720 and press the Join button! If you join now, you can get a HR really easily, and we're soon to become a super clan so when your a super clan, you'll have a HR. We're getting around 40 members a day, that means 100 days from now, we will have 4000! So please join. ~EI Crown Collin201",
  21.             recipientid: userId,
  22.             cacheBuster: new Date().getTime()
  23.         }).done(function(response) {
  24.             if (response.success == true) {
  25.                 console.log('Sent message to ' + username + ' (' + userId + ')');
  26.             } else {
  27.                 console.log('Error sending to ' + username + ': ' + response.shortMessage);
  28.             }
  29.         });
  30.     }
  31.     if (group > 0) {
  32.         $.get('http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=' + userId + '&groupid=' + group, function(response) {
  33.             if(response.indexOf('true') == -1) {
  34.                                 send();
  35.                         } else {
  36.                                 console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  37.                         }
  38.         });
  39.     } else {
  40.         send();
  41.     }
  42. }
  43.  
  44. var i=0;
  45. function run() {
  46.     var timeout = 0;
  47.     var url = 'http://www.roblox.com/games/getgameinstancesjson?placeId=' + placeId +'&startindex=' + i*10;
  48.     $.get(url).done(function(obj){
  49.         for (var server in obj.Collection) {
  50.             for (var players in obj.Collection[server].CurrentPlayers) {
  51.                 var plr = obj.Collection[server].CurrentPlayers[players];
  52.                 if (plr.Id > 0) {
  53.                     (function(time,id,name) {
  54.                         setTimeout(sendMsg,time,id,name);
  55.                     })(timeout,plr.Id,plr.Username);
  56.                     timeout+=waitTime*1000;
  57.                 }
  58.             }
  59.         }
  60.         i++;
  61.         setTimeout(run, timeout);
  62.     });
  63. }
  64. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement