Advertisement
Guest User

ROBLOX PM Spam Bot

a guest
Feb 8th, 2016
3,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. // Made by YourFriendlyCanadian, Subscribe https://www.youtube.com/channel/UCYZcX-vX1qO-OkZfMwsNUgA
  2. var placeId = 198817751; // Place to check and message
  3. var waitTime = 5; // In seconds
  4. var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
  5. function sendMsg(userId, username) {
  6. function send() {
  7. $.post("http://www.roblox.com/messages/send",{
  8. subject: 'The First Order',
  9. body: 'Hello, ' + username + '.\n\We noticed that you are an extremly skilled fighter, and we can use you in the line of duty! Join today we are looking for High Ranks! Enlist today! http://www.roblox.com/Groups/Group.aspx?gid=2748530 If you have any questions feel free to contact me! I always reply.',
  10. recipientid: userId,
  11. cacheBuster: new Date().getTime()
  12. }).done(function(response) {
  13. if (response.success == true) {
  14. console.log('Sent message to ' + username + ' (' + userId + ')');
  15. } else {
  16. console.log('Error sending to ' + username + ': ' + response.shortMessage);
  17. }
  18. });
  19. }
  20. if (group > 0) {
  21. $.get("http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  22. if(response.indexOf('true') == -1) {
  23. send();
  24. } else {
  25. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  26. }
  27. });
  28. } else {
  29. send();
  30. }
  31. }
  32.  
  33. var i=0;
  34. function run() {
  35. var timeout = 0;
  36. var url = "http://www.roblox.com/games/getgameinstancesjson?placeId=" + placeId +"&startindex=" + i*10;
  37. $.get(url).done(function(obj){
  38. for (var server in obj.Collection) {
  39. for (var players in obj.Collection[server].CurrentPlayers) {
  40. var plr = obj.Collection[server].CurrentPlayers[players];
  41. if (plr.Id > 0) {
  42. (function(time,id,name) {
  43. setTimeout(sendMsg,time,id,name);
  44. })(timeout,plr.Id,plr.Username);
  45. timeout+=waitTime*1000;
  46. }
  47. }
  48. }
  49. i++;
  50. setTimeout(run, timeout);
  51. });
  52. }
  53. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement