Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- **This version will only send the message to players who are online**
- Go to the group page you want to spam when running this.
- Inspect Element->Console and copy and paste the code.
- 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.
- 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.
- */
- 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("/messages/send",{
- subject: 'wassup m9er',
- body: 'Hello, ' + username + '.\n\nu ok m9?????',
- 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("/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();
- }
- }
- function run() {
- var timeout = 0;
- var elements = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'Name\')]/a',document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);
- var online = document.evaluate('//div[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_GroupMembersUpdatePanel\')]//div[contains(@class,\'GroupMember\')]//span[contains(@class,\'OnlineStatus\')]/img',document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);
- var currentNode = elements.iterateNext();
- var currentOnline = online.iterateNext();
- while (currentNode) {
- if (currentOnline.getAttribute('src')=='../images/online.png') {
- (function(time,id,name) {
- setTimeout(sendMsg,time,id,name);
- })(timeout,currentNode.href.match(/\d+/)[0],currentNode.textContent);
- timeout+=waitTime*1000;
- }
- currentNode = elements.iterateNext();
- currentOnline = online.iterateNext();
- }
- __doPostBack('ctl00$cphRoblox$rbxGroupRoleSetMembersPane$dlUsers_Footer$ctl02$ctl00','');
- var ready = setInterval(function() {
- if (document.getElementById('__EVENTTARGET').value == "") {
- clearInterval(ready);
- setTimeout(run,timeout);
- }
- }, 10);
- }
- var ready = setInterval(function() {
- if (document.readyState === "complete") {
- clearInterval(ready);
- run();
- }
- }, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement