Advertisement
Guest User

JC Group Recruitment Bot

a guest
Nov 29th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. var placeId = 70501379; // Place to check and message
  2. var waitTime = 5; // In seconds
  3. var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
  4. function sendMsg(userId, username) {
  5. function send() {
  6. $.post("http://www.roblox.com/messages/send",{
  7. subject: 'Join JC!',
  8. body: 'Johns Cobras is an elite military that specializes in combat, You have been invited to join our Elite Military. Here is our group link: http://www.roblox.com/My/Groups.aspx?gid=72043',
  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("http://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 = "http://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();
  53.  
  54.  
  55. =======
  56. CHANGE THE PLACE ID TO WHATEVER PLACE YOU WANT TO SPAM
  57. FEEL FREE TO CHANGE THE VAR GROUP TO 72043, SO OUR MEMBERS DON'T GET MESSAGED.
  58. KEEP THE TIME HIGH, SO ROBLOX DOESNT DETECT FLOODING
  59.  
  60. FEEL FREE TO EDIT THIS AS YOU PLEASE TO FIT YOUR NEEDS!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement