Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. ===maby fixd by richy <3 /e blow kiss===
  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. }
  5. }
  6. function sendMsg(userId, username) {
  7. function send() {
  8. $.post("http://www.roblox.com/messages/send",{
  9. subject: 'Join the Empire! || John's Cobras',
  10. body: 'Hello, ' + username + '.\n\n You are being called to join the mighty empire of John's Cobras! \n\n Why should you join us? Three reasons: \n\n 1. It would be an honor to have such a powerful soldier like you! \n\n 2. We will enjoy your company and combat skills! \n\n 3. We will rise back up, Hail the Phoenix Era. \n\n Join the mighty army here!: \n\n http://www.roblox.com/Groups/Group.aspx?gid=72043 \n\n Thank you for reading, please reply to this message if you have decided to join. We look forward to seeing you at the next event! ',
  11. recipientid: userId,
  12. cacheBuster: new Date().getTime()
  13. }).done(function(response) {
  14. if (response.success == true) {
  15. console.log('Sent message to ' + username + ' (' + userId + ')');
  16. } else {
  17. console.log('Error sending to ' + username + ': ' + response.shortMessage);
  18. }
  19. });
  20. }
  21. if (group > 0) {
  22. $.get("http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=" + userId + "&groupid=" + group, function(response) {
  23. if(response.indexOf('true') == -1) {
  24. send();
  25. } else {
  26. console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
  27. }
  28. });
  29. } else {
  30. send();
  31. }
  32. }
  33.  
  34. function run() {
  35. var timeout = 0;
  36. 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);
  37. var currentNode = elements.iterateNext();
  38. while (currentNode) {
  39. (function(time,id,name) {
  40. setTimeout(sendMsg,time,id,name);
  41. })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
  42. timeout+=waitTime*1000;
  43. currentNode = elements.iterateNext();
  44. }
  45. __doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00','');
  46. var ready = setInterval(function() {
  47. if (document.getElementById('__EVENTTARGET').value == "") {
  48. clearInterval(ready);
  49. setTimeout(run,timeout);
  50. }
  51. }, 10);
  52. }
  53. var ready = setInterval(function() {
  54. if (document.readyState === "complete") {
  55. clearInterval(ready);
  56. run();
  57. }
  58. }, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement