Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. var waitTime = 5; // In seconds
  2. var group = 2811024; // 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("/messages/send",{
  6. subject: 'A new adventure',
  7. body: 'Hello, \n Currently, functionized genre is under new management and we need new houses. Due to us having a restart of sorts it should be easier for people to gain power and establish yourself earlier so that later on it wont be as hard. \n \n We invite you to join us on this new adventure and be apart of this amazing experience. \n \n Come join us! https://www.roblox.com/My/Groups.aspx?gid=2701476 ',
  8. recipientid: userId,
  9. cacheBuster: new Date().getTime()
  10. }).done(function(response) {
  11. if (response.success == true) {
  12. console.log('Sent message to ' + username + ' (' + userId + ')');
  13. } else {
  14. console.log('Error sending to ' + username + ': ' + response.shortMessage);
  15. }
  16. });
  17. }
  18. if (group > 0) {
  19. $.get("/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  20. if(response.indexOf('true') == -1) {
  21. send();
  22. } else {
  23. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  24. }
  25. });
  26. } else {
  27. send();
  28. }
  29. }
  30.  
  31. function run() {
  32. var timeout = 0;
  33. var elements = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'Name\')]/a',document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);
  34. var currentNode = elements.iterateNext();
  35. while (currentNode) {
  36. (function(time,id,name) {
  37. setTimeout(sendMsg,time,id,name);
  38. })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
  39. timeout+=waitTime*1000;
  40. currentNode = elements.iterateNext();
  41.  
  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