Advertisement
Guest User

Ascendancy Clickbait

a guest
Feb 25th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. var placeId =
  2. var bod = "Ascendancy believes you are a very skilled fighter and we want you to join our group! When you join, you will be automatically promoted to the second rank if you either go to our base Lucent when people are there or just message a high rank. Join Today! https://www.roblox.com/My/Groups.aspx?gid=3004277"
  3. var head = "Ascendancy"
  4. var waitTime = 8; // In seconds
  5. var group = 2713497; // 0 for no group check, otherwise people in this group will not receive the message
  6. function sendMsg(userId, username) {
  7. function send() {
  8. $.post("https://www.roblox.com/messages/send",{
  9. subject: head,
  10. body: 'Greetings, ' + username + ' ' + bod,
  11. recipientid: userId,
  12. cacheBuster: new Date().getTime()
  13. }).done(function(response) {
  14. if (response.success == true) {
  15. console.log('Sent message to ' + username + ' (' + userId + ')');
  16. } else {
  17. console.log('Error sending to ' + username + ': ' + response.shortMessage);
  18. }
  19. });
  20. }
  21. if (group > 0) {
  22. $.get("https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  23. if(response.indexOf('true') == -1) {
  24. send();
  25. }
  26. });
  27. } else {
  28. send();
  29. }
  30. }
  31.  
  32. var i=0;
  33. function run() {
  34. var timeout = 0;
  35. var url = "https://www.roblox.com/games/getgameinstancesjson?placeId=" + placeId +"&startindex=" + i*10;
  36. $.get(url).done(function(obj){
  37. for (var server in obj.Collection) {
  38. for (var players in obj.Collection[server].CurrentPlayers) {
  39. var plr = obj.Collection[server].CurrentPlayers[players];
  40. if (plr.Id > 0) {
  41. (function(time,id,name) {
  42. setTimeout(sendMsg,time,id,name);
  43. })(timeout,plr.Id,plr.Username);
  44. timeout+=waitTime*1000;
  45. }
  46. }
  47. }
  48. i++;
  49. setTimeout(run, timeout);
  50. });
  51. }
  52. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement