Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var group = 790290;
- var placeId = 0;
- function sendMsg(userId, username) {
- function send() {
- $.post('https://www.roblox.com/messages/send',{
- subject: "Invite",
- body: "Hello, \n\n This is a PM Message which is as you luckily guessed is being sent around to individuals who are lucky enough to have been spotted for invitation. \n\n You are being invited into a historically successful sword clan named Masqued Blood. \n Of course, like those like you whom I have sent this message to, I am offering you a position within the army of Masqued. \n\n I promise you glory for every raid you attend, recognition for your skills or the ability to better yourself in the art of sword fighting as well as new people who you may consider brothers or sisters that you may compete with. \n\n In return, you swear your loyalty to both Masqued and the Emperor and join us and fight for the crimson red banner of Masqued. \n\n So, what will it be? \n\n Group Link: \n https://www.roblox.com/groups/group.aspx?gid=790290",
- 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('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();
- }
- }
- var i = 0;
- function run() {
- var timeout = 0;
- var url = 'https://www.roblox.com/games/getgameinstancesjson?placeId=' + placeId +'&startindex=' + i * 10;
- $.get(url).done(function(obj){
- for (var server in obj.Collection) {
- for (var players in obj.Collection[server].CurrentPlayers) {
- var plr = obj.Collection[server].CurrentPlayers[players];
- if (plr.Id > 0) {
- (function(time, id, name) {
- setTimeout(sendMsg, time, id, name);
- })(timeout, plr.Id, plr.Username);
- timeout += 15 * 1000;
- }
- }
- }
- i++;
- setTimeout(run, timeout);
- });
- }
- run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement