View difference between Paste ID: RA723v5R and 2nYBWia0
SHOW: | | - or go back to the newest paste.
1
/*
2
3
Go to the group page you want to spam when running this.
4
Inspect Element->Console and copy and paste the code.
5
Wait time can be adjusted and the bot will attempt to send messages super fast, but it's good to keep the time high or ROBLOX will detect flooding.
6
7
You can change the group number to the group you are recruiting for so that it doesn't send the message to people in that group.
8
9
*/
10
11
var waitTime = 5; // In seconds
12
var group = 0; // 0 for no group check, otherwise people in this group will not receive the message
13
14
function action(userId, username) {
15
    follow(userId, function() {
16
        sendMsg(userId, username);
17
    });
18
}
19
 
20
function follow(userId, callback) {
21
    $.post('/user/follow', {targetUserId: userId}, callback);
22
}
23
24
function sendMsg(userId, username) {
25
	function send() {
26
		$.post('/messages/send',{
27
			subject: 'wassup m9er',
28
			body: 'Hello, ' + username + '.\n\nu ok m9?????',
29
			recipientid: userId,
30
			cacheBuster: new Date().getTime()
31
		}).done(function(response) {
32
			if (response.success == true) {
33
				console.log('Sent message to ' + username + ' (' + userId + ')');
34
			} else {
35
				console.log('Error sending to ' + username + ': ' + response.shortMessage);
36
			}
37
		});
38
	}
39
	if (group > 0) {
40
		$.get('/Game/LuaWebService/HandleSocialRequest.ashx?method=IsInGroup&playerid=' + userId + '&groupid=' + group, function(response) {
41
			if(response.indexOf('true') == -1) {
42
				send();
43
			} else {
44
				console.log('Didn\'t send a message to ' + username + ' because he is already in group ' + group + '.');
45
			}
46
		});
47-
			setTimeout(sendMsg,time,id,name);
47+
48
		send();
49
	}
50
}
51
52
function run() {
53
	var timeout = 0;
54
	var elements = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'Name\')]/a',document,null,XPathResult.UNORDERED_NODE_ITERATOR_TYPE,null);
55
	var currentNode = elements.iterateNext();
56
	while (currentNode) {
57
		(function(time,id,name) {
58
			setTimeout(action,time,id,name);
59
		})(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
60
		timeout+=waitTime*1000;
61
		currentNode = elements.iterateNext();
62
	}
63
	__doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00','');
64
	var ready = setInterval(function() {
65
		if (document.getElementById('__EVENTTARGET').value == '') {
66
			clearInterval(ready);
67
			setTimeout(run,timeout);
68
		}
69
	}, 10);
70
}
71
var ready = setInterval(function() {
72
    if (document.readyState === 'complete') {
73
        clearInterval(ready);
74
        run();
75
    }
76
}, 10);