Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var waitTime = 9; // In seconds
- var group = 3077137; // 0 for no group check, otherwise people in this group will not receive the message
- function sendMsg(userId, username) {
- function send() {
- $.post('//www.roblox.com/messages/send',{
- subject: "Need to talk to you; ASAP",
- body: "Would like to know if you are interested in joining the Regiment, come view the base if you might be interested. as I ask that you come view our tech, See what you think. https://www.roblox.com/games/626099893/ISR-Frostfall-UPDATED-AGREEMENT#!/game-instances",
- recipientid: userId,
- cacheBuster: new Date().getTime()
- }).done(function(response) {
- if (response.success == true) {
- console.log('Sent message to ' + username + ' (' + userId + ')');
- } else {
- console.log('Error sending to ' + username + ': ' + response.shortMessage);
- }
- });
- }
- if (group > 0) {
- $.get('//www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=' + userId + '&groupid=' + group, function(response) {
- if(response.indexOf('true') == -1) {
- send();
- } else {
- console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
- }
- });
- } else {
- send();
- }
- }
- function run() {
- var timeout = 0;
- 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);
- var currentNode = elements.iterateNext();
- while (currentNode) {
- (function(time,id,name) {
- setTimeout(sendMsg,time,id,name);
- })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
- timeout+=waitTime*1000;
- currentNode = elements.iterateNext();
- }
- __doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00','');
- var ready = setInterval(function() {
- if (document.getElementById('__EVENTTARGET').value == '') {
- clearInterval(ready);
- setTimeout(run,timeout);
- }
- }, 10);
- }
- var ready = setInterval(function() {
- if (document.readyState === 'complete') {
- clearInterval(ready);
- run();
- }
- }, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement