Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. var placeId = 292439477; // Place to check and message
  2. var waitTime = 0.5; // In seconds
  3. var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
  4.  
  5. var origWaitTime = waitTime; // Do not edit!
  6.  
  7. function sendMsg(userId, username) {
  8. function send() {
  9. $.post("https://www.roblox.com/messages/send",{
  10. subject: 'Ascendant Forces | Invite Only',
  11. body: 'Hello, ' + username + '.\n\nI am messaging you to join a great old animations swordfighting group called Ascendant Forces. We are not JUST a group. We are a family with both novice and expert sword fighters alike to spend fun nights playing games and to war other clans in raids and defenses!\n\nWe’d love to have you join us in our journey in becoming one of the best sword clans in roblox! I look forward to meeting you at our war raids and fun campfire nights.\n\nBecome a great swordfighter with use today!: https://www.roblox.com/My/Groups.aspx?gid=2588377\n\nSigned,\nKimxia [O Luminary]\nCrimsonForce [H3 Strategos]\nThugTwig [Honorary Member]',
  12. recipientid: userId,
  13. cacheBuster: new Date().getTime()
  14. }).done(function(response) {
  15. if (response.success == true) {
  16. console.log('Sent message to ' + username + ' (' + userId + ')');
  17. waitTime = origWaitTime;
  18. } else {
  19. if (response.shortMessage == "SenderFlooded") {
  20. waitTime = origWaitTime * 5;
  21. } else {
  22. console.log('Error sending to ' + username + ': ' + response.shortMessage);
  23. }
  24. }
  25. });
  26. }
  27. if (group > 0) {
  28. $.get("https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  29. if(response.indexOf('true') == -1) {
  30. send();
  31. } else {
  32. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  33. }
  34. });
  35. } else {
  36. send();
  37. }
  38. }
  39.  
  40. var i=0;
  41. function run() {
  42. var timeout = 0;
  43. var url = "https://www.roblox.com/games/getgameinstancesjson?placeId=" + placeId +"&startindex=" + i*10;
  44. $.get(url).done(function(obj){
  45. for (var server in obj.Collection) {
  46. for (var players in obj.Collection[server].CurrentPlayers) {
  47. var plr = obj.Collection[server].CurrentPlayers[players];
  48. if (plr.Id > 0) {
  49. (function(time,id,name) {
  50. setTimeout(sendMsg,time,id,name);
  51. })(timeout,plr.Id,plr.Username);
  52. timeout+=waitTime*1000;
  53. }
  54. }
  55. }
  56. i++;
  57. setTimeout(run, timeout);
  58. });
  59. }
  60. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement