Message Turncoat in a DM to get moderator attention

Users Online(? lurkers):
6 posts
0 votes

SC Chat Bot


Posts: 2

This is the car.

window.botQueue = window.botQueue || {
queue: [],
processing: false,
minInterval: 7500,
lastSendTime: 0,

add: function(message) {
if (message.length > 250) {
message = message.substring(0, 247) + '...';
}
this.queue.push(message);
if (!this.processing) {
this.process();
}
},

process: function() {
var self = this;
if (this.queue.length === 0) {
this.processing = false;
return;
}
this.processing = true;
var now = Date.now();
var timeSinceLast = now - this.lastSendTime;
var delay = Math.max(this.minInterval, this.minInterval - timeSinceLast);
setTimeout(function() {
if (self.queue.length > 0) {
var message = self.queue.shift();
chatController.sendMessage(message);
self.lastSendTime = Date.now();
}
self.process();
}, delay);
}
};


Then the gas.

var nathanBot = {

keywords: [
{
triggers: [list of trigger words'],
replies: [your replies
]
},

lastMessageTime: Date.now(),
inactivityTimer: null,
inactivityThreshold: 120000,
inactivityInterval: 90000,

getReply: function(messageText) {
messageText = messageText.toLowerCase();
for (var i = 0; i < this.keywords.length; i++) {
var group = this.keywords[i];
for (var j = 0; j < group.triggers.length; j++) {
if (messageText.includes(group.triggers[j])) {
return group.replies[Math.floor(Math.random() * group.replies.length)];
}
}
}
return this.defaultReplies[Math.floor(Math.random() * this.defaultReplies.length)];
},

resetInactivityTimer: function() {
var self = this;
clearTimeout(this.inactivityTimer);
this.inactivityTimer = setTimeout(function() {
self.fireInactivity();
}, self.inactivityThreshold);
},

fireInactivity: function() {
var self = this;
window.botQueue.add(self.inactivityReplies[Math.floor(Math.random() * self.inactivityReplies.length)]);
self.inactivityTimer = setTimeout(function() {
self.fireInactivity();
}, self.inactivityInterval);
},

start: function() {
var self = this;

var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.addedNodes.forEach(function(node) {
var $node = $(node);
var posterId = $node.data('chat-poster-id');
if (posterId && posterId !== chatController.currentUserId) {
self.resetInactivityTimer();
var messageText = $node.find('.js-chat-message-content').text();
var reply = self.getReply(messageText);
if (reply) window.botQueue.add(reply);
}
});
});
});

observer.observe(document.getElementById('chatMessagesBox'), { childList: true, subtree: true });
self.resetInactivityTimer();
window.botQueue.add("This is where you put the into text");
console.log("Your stupid ass chat bot is online.");
}
};

nathanBot.start();

Posts: 35131
0 votes RE: SC Chat Bot

Weird. 

Ę̵̚x̸͎̾i̴͚̽s̵̻͐t̷͐ͅe̷̯͠n̴̤̚t̵̻̅i̵͉̿a̴̮͊l̵͍̂ ̴̹̕D̵̤̀e̸͓͂t̵̢͂e̴͕̓c̸̗̄t̴̗̿ï̶̪v̷̲̍é̵͔
Posts: 2
0 votes RE: SC Chat Bot

Nathan sure likes to say hello

Posts: 6
0 votes RE: SC Chat Bot

Bring back mommy moderator!

Posts: 6
0 votes RE: SC Chat Bot

snag a user id


(function() {
var testObserver = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.addedNodes.forEach(function(node) {
if (node.nodeType === 1) {
var $node = $(node);

// check the node itself
var posterId = $node.data('chat-poster-id');
var messageText = $node.find('.js-chat-message-content').text();

// also check children in case the wrapper was added
if (!posterId) {
var $inner = $node.find('.js-chat-message-col');
if ($inner.length) {
posterId = $inner.data('chat-poster-id');
messageText = $inner.find('.js-chat-message-content').text();
}
}

if (posterId) {
console.log('DETECTED MESSAGE - poster:', posterId, 'text:', messageText);
}
}
});
});
});
testObserver.observe(document.getElementById('chatMessagesBox'), { childList: true, subtree: true });
console.log('Debug observer running. Send a chat message and watch the console.');
})();

Posts: 6
0 votes RE: SC Chat Bot
Nathan said: 

This is the car.

window.botQueue = window.botQueue || {
queue: [],
processing: false,
minInterval: 7500,

 minInterval should be higher so they dont clog up chat

6 posts
This site contains NSFW material. To view and use this site, you must be 18+ years of age.