Advertisement
Guest User

Untitled

a guest
Jul 28th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1.  
  2. var waitTime = 7; // In seconds
  3. var group = 734830; // 0 for no group check, otherwise people in this group will not receive the message
  4. function sendMsg(userId, username) {
  5. function send() {
  6. $.post('http://www.roblox.com/messages/send',{
  7. subject: 'The Templar Order: May the Father of Understanding Guide us! ',
  8. body: 'Greetings, ' + username + '! \n\n You have been considered to be worthy of acceptance into the Templar Order, ' + username + '! \n\n The Templar Order is an order that spans generations in a war against the Assassins. We fight for peace and order throughout the Holy Lands. Our influence is spread out across the realm, but our army, tactics and the guidance of the father of understand keep us strong. If you believe that you are the capable individual our Grand Master requires to fight in his Army, we gladly accept your help! \n\n If we all pitch in, we can strengthen our hold on the Holy Lands and have tons of fun doing it! \n\n The Templar Order: http://www.roblox.com/My/Groups.aspx?gid=734830 \n\n In a harsh world of constant war and corruption we stand as a beacon of hope to bring an end to the chaos. \n\n Lastly, you will be updated on notices and events more easily if you acquire the ROBLOX Group Enhancer extension (simply google search it) for Chrome (made by Merely - Roblox dev). \n \n If you have any questions, feel free to reply to this message. \n\n Sincerely, \n The Templar Order',
  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('http://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