forked from sentanos/roblox-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopacetic.js
46 lines (41 loc) · 1.07 KB
/
copacetic.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Posts one of three random messages to all new threads in a subforum.
var rbx = require('roblox-js');
var subforum = 32; // C&G
var username = '';
var password = '';
function login () {
return rbx.login(username, password);
}
// Bypass duplicate post blocking
function clear () {
var str = '';
for (var i = 0; i < 20; i++) {
if (Math.random() < 0.5) {
str += '\u200B';
} else {
str += ' ';
}
}
return str;
}
login()
.then(function () {
var evt = rbx.onForumPost(subforum);
evt.on('data', function (post) {
console.log(post);
var response;
var rand = Math.random();
if (rand < 0.3) {
response = 'Disagreed';
} else if (rand > 0.4 && rand < 0.45) {
response = 'The FitnessGram Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues.';
} else {
response = 'Agreed';
}
rbx.forumPost({postId: post.id, body: response + clear()});
});
evt.on('error', function (err) {
console.error('Event error: ' + err.stack);
});
});
setInterval(login, 86400000);