Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var waitTime = 1.5; // In seconds
- var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
- function sendMsg(userId, username) {
- function send() {
- $.post("https://www.roblox.com/messages/send",{
- subject: ' Invitation',
- 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",
- recipientid: userId,
- cacheBuster: new Date().getTime()
- }).done(function(response) {
- if (response.success == true) {
- console.log('Sent message to ' + username + ' (' + userId + ')');
- }
- });
- }
- if (group > 0) {
- $.get("https://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.ORDERED_NODE_ITERATOR_TYPE,null);
- 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);
- var currentNode = elements.iterateNext();
- var currentOnline = online.iterateNext();
- while (currentNode) {
- if (currentOnline.src=='https://www.roblox.com/images/online.png') {
- (function(time,id,name) {
- setTimeout(sendMsg,time,id,name);
- })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
- timeout+=waitTime*40;
- }
- currentNode = elements.iterateNext();
- currentOnline = online.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