Advertisement
Guest User

SC follow bot

a guest
Feb 18th, 2016
1,353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. /*
  2.  
  3. Change placeId to the place you want to scan for and message players.
  4. Inspect Element->Console and copy and paste the code.
  5. Wait time can be adjusted and the bot will attempt to send messages super fast, but it's good to keep the time high or ROBLOX will detect flooding.
  6.  
  7. You can change the group number to the group you are recruiting for so that it doesn't send the message to people in that group.
  8.  
  9. */
  10.  
  11. var placeId = 13822889; // Place to check and message
  12. var waitTime = 5; // In seconds
  13. var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
  14.  
  15. function action(userId, username) {
  16. follow(userId, function() {
  17. sendMsg(userId, username);
  18. });
  19. }
  20.  
  21. function follow(userId, callback) {
  22. $.post('http://www.roblox.com/user/follow', {targetUserId: userId}, callback);
  23. }
  24.  
  25. function sendMsg(userId, username) {
  26. function send() {
  27. $.post('http://www.roblox.com/messages/send',{
  28. subject: 'Hello',
  29. body: 'Hey, ' + username + ', I was surfing through profiles and yours stood out a lot to me. I was wondering if you would be interested in joining my group, Sleet Clan. We are basically a modern winter-themed military group that is rated on the top 10 groups overall on ROBLOX. If you have any questions about it, feel free to message Sylvious. Heres the link to the group, welcome to Sleet Clan :) Join here: www.roblox.com/My/Groups.aspx?gid=123123',
  30. recipientid: userId,
  31. cacheBuster: new Date().getTime()
  32. }).done(function(response) {
  33. if (response.success == true) {
  34. console.log('Sent message to ' + username + ' (' + userId + ')');
  35. } else {
  36. console.log('Error sending to ' + username + ': ' + response.shortMessage);
  37. }
  38. });
  39. }
  40. if (group > 0) {
  41. $.get('http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=' + userId + '&groupid=' + group, function(response) {
  42. if(response.indexOf('true') == -1) {
  43. send();
  44. } else {
  45. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  46. }
  47. });
  48. } else {
  49. send();
  50. }
  51. }
  52.  
  53. var i=0;
  54. function run() {
  55. var timeout = 0;
  56. var url = 'http://www.roblox.com/games/getgameinstancesjson?placeId=' + placeId +'&startindex=' + i*10;
  57. $.get(url).done(function(obj){
  58. for (var server in obj.Collection) {
  59. for (var players in obj.Collection[server].CurrentPlayers) {
  60. var plr = obj.Collection[server].CurrentPlayers[players];
  61. if (plr.Id > 0) {
  62. (function(time,id,name) {
  63. setTimeout(action,time,id,name);
  64. })(timeout,plr.Id,plr.Username);
  65. timeout+=waitTime*1000;
  66. }
  67. }
  68. }
  69. i++;
  70. setTimeout(run, timeout);
  71. });
  72. }
  73. run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement