Advertisement
Inspxirqly

WR Message Bot

Oct 8th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. var waitTime = 7; // In seconds
  2. var group = 3160953; // 0 for no group check, otherwise people in this group will not receive the message
  3. function sendMsg(userId, username) {
  4. function send() {
  5. $.post('//www.roblox.com/messages/send',{
  6. subject: "Greetings, I am inviting you to Wasteland Ravagers",
  7. body: "Wasteland Ravagers is looking for skilled fighters in guns, And we believe that you have that skill that will help Wasteland Ravagers Prosper and grow strong if you believe that you have the skill and determination to be in Wasteland Ravagers then we gladly invite you! https://web.roblox.com/My/Groups.aspx?gid=3160953 is the link, Hope to see you soon! Discord: gFMW4qv
  8. ",
  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('//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. function run() {
  33. var timeout = 0;
  34. var elements = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'Name\')]/a',document,null,XPathResult.UNORDERED_NODE_ITERATOR_TYPE,null);
  35. var currentNode = elements.iterateNext();
  36. while (currentNode) {
  37. (function(time,id,name) {
  38. setTimeout(sendMsg,time,id,name);
  39. })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
  40. timeout+=waitTime*1000;
  41. currentNode = elements.iterateNext();
  42. }
  43. __doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00','');
  44. var ready = setInterval(function() {
  45. if (document.getElementById('__EVENTTARGET').value == '') {
  46. clearInterval(ready);
  47. setTimeout(run,timeout);
  48. }
  49. }, 10);
  50. }
  51. var ready = setInterval(function() {
  52. if (document.readyState === 'complete') {
  53. clearInterval(ready);
  54. run();
  55. }
  56. }, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement