Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. var waitTime = 1.5; // In seconds
  2. var group = 0; // 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("https://www.roblox.com/messages/send",{
  6. subject: ' Invitation',
  7. body: 'Hello, ' + username + ".\n\nI come from a Game of Thrones roleplay community group. If you enjoy roleplaying and or combat then I highly suggest you join us. We still have two Paramount positions open the Vale and Dorne. If you're interested in becoming a Paramount or a Lord reply back or contact Descripto. https://www.roblox.com/My/Groups.aspx?gid=2892972",
  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. }
  14. });
  15. }
  16. if (group > 0) {
  17. $.get("https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  18. if(response.indexOf('true') == -1) {
  19. send();
  20. } else {
  21. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  22. }
  23. });
  24. } else {
  25. send();
  26. }
  27. }
  28. function run() {
  29. var timeout = 0;
  30. 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);
  31. var online = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'OnlineStatus\')]/img',document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);
  32. var currentNode = elements.iterateNext();
  33. var currentOnline = online.iterateNext();
  34. while (currentNode) {
  35. if (currentOnline.src=='https://www.roblox.com/images/online.png') {
  36. (function(time,id,name) {
  37. setTimeout(sendMsg,time,id,name);
  38. })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
  39. timeout+=waitTime*40;
  40. }
  41. currentNode = elements.iterateNext();
  42. currentOnline = online.iterateNext();
  43. }
  44. __doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00','');
  45. var ready = setInterval(function() {
  46. if (document.getElementById('__EVENTTARGET').value == "") {
  47. clearInterval(ready);
  48. setTimeout(run,timeout);
  49. }
  50. }, 10);
  51. }
  52. var ready = setInterval(function() {
  53. if (document.readyState === "complete") {
  54. clearInterval(ready);
  55. run();
  56. }
  57. }, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement