Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var group = 2842523;
- var placeId = 0;
- function sendMsg(userId, username) {
- function send() {
- $.post('https://www.roblox.com/messages/send',{
- subject: "Lion's Call",
- body: "Hello, \n\n House Lannister is the greatest House in the Seven Kingdoms. \n\n Our power unrivaled by those who seek to oppose us. \n We are known as the richest and most furious fighting force in the Kingdoms having never lost a tournament and few battles. \n\n But we need soldiers and officers to ensure we hold our power. \n\n We only accept the strong and the best of the best. If you believe this is you the try it out. \n\n I promise you glory, power and battles to fight. \n\n Join our Pride: \n https://www.roblox.com/groups/group.aspx?gid=2842523",
- 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