Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var placeId = 13822889; // Place to check and message
- var waitTime = 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("http://www.roblox.com/messages/send",{
- subject: 'Roblox Swordfighting group',
- body: 'Hey bro :) I sent this bot to search for roblox swordfighting talents all around the world, if you know (or want to know )swordfighting please just join --->http://www.roblox.com/My/Groups.aspx?gid=1069085 Any questions? Feel free to ask!!',
- 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("http://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 = "http://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();
Add Comment
Please, Sign In to add comment