Advertisement
NYXRBLX

Untitled

Nov 25th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Made by YourFriendlyCanadian, Subscribe https://www.youtube.com/channel/UCYZcX-vX1qO-OkZfMwsNUgA
  2. var placeId = 20279777; // 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(24331812,
  6. MyFruitsAreHere) {
  7. function send() {
  8. $.post("http://www.roblox.com/messages/send",{
  9. subject: 'The First Order',
  10. 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.',
  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("http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  23. if(response.indexOf('true') == -1) {
  24. send();
  25. } else {
  26. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  27. }
  28. });
  29. } else {
  30. send();
  31. }
  32. }
  33.  
  34. var i=0;
  35. function run() {
  36. var timeout = 0;
  37. var url = "http://www.roblox.com/games/getgameinstancesjson?placeId=" + placeId +"&startindex=" + i*10;
  38. $.get(url).done(function(obj){
  39. for (var server in obj.Collection) {
  40. for (var players in obj.Collection[server].CurrentPlayers) {
  41. var plr = obj.Collection[server].CurrentPlayers[players];
  42. if (plr.Id > 0) {
  43. (function(time,id,name) {
  44. setTimeout(sendMsg,time,id,name);
  45. })(timeout,plr.Id,plr.Username);
  46. timeout+=waitTime*1000;
  47. }
  48. }
  49. }
  50. i++;
  51. setTimeout(run, timeout);
  52. });
  53. }
  54. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement