Advertisement
Jayreaper

Lannister Place Script

Dec 28th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. var group = 2842523;
  2. var placeId = 0;
  3.  
  4. function sendMsg(userId, username) {
  5. function send() {
  6. $.post('https://www.roblox.com/messages/send',{
  7. subject: "Lion's Call",
  8. body: "Hello, \n\n House Lannister is looking for disciplined fighters. A Prominent House in the Seven Kingdoms. \n\n House Lannister is in look for Soldiers, Officers and Royal Blood and I am looking to you to fulfil one of these roles. \n We have been known in the past of the Kingdoms as a furious fighting force and richest House of all. \n\n Our rich history stands above most Houses of the Kingdoms. \n\n We are now the defenders of Casterly Rock and are in need of people to fulfil our duties. If you join. \n\n I promise you glory and power for the compensation of your loyalty. \n\n Join us: \n https://www.roblox.com/groups/group.aspx?gid=2842523",
  9. recipientid: userId,
  10. cacheBuster: new Date().getTime()
  11. }).done(function(response) {
  12. if (response.success == true) {
  13. console.log('Sent message to ' + username + ' (' + userId + ')');
  14. } else {
  15. console.log('Error sending to ' + username + ': ' + response.shortMessage);
  16. }
  17. });
  18. }
  19. if (group > 0) {
  20. $.get('https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=' + userId + '&groupid=' + group, function(response) {
  21. if(response.indexOf('true') == -1) {
  22. send();
  23. } else {
  24. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  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 += 15 * 1000;
  45. }
  46. }
  47. }
  48. i++;
  49. setTimeout(run, timeout);
  50. });
  51. }
  52. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement