Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var placeId =
- var bod = "Ascendancy is a new group that is up and coming. We have spotted you at GRP knowing you are looking for a group. Ascendancy is a really fun community and improves all aspects in fighting, communication, discipline, etc. If you are interested - join here https://www.roblox.com/My/Groups.aspx?gid=3004277"
- var head = "Ascendancy"
- var waitTime = 8; // In seconds
- var group = 2713497; // 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: head,
- body: 'Greetings, ' + username + ' ' + bod,
- 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 {
- 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+=waitTime*1000;
- }
- }
- }
- i++;
- setTimeout(run, timeout);
- });
- }
- run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement