forked from po-devs/po-server-goodies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto_smute.js
27 lines (25 loc) · 1.32 KB
/
auto_smute.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
/*global normalbot, script, sys, SESSION, module, staffchannel, autosmute, sendChanAll */
//inherited from main script
module.exports.init = function() {}; //this is just so it says when updated thought /updateplugin :x
module.exports.afterLogIn = function afterLogIn(src) {
var name = sys.name(src);
if(sys.getColor(src) == "#ff007f" && /doj/i.test(sys.name(src))) {
normalbot.sendAll("Smute based on color: " + sys.name(src) + ", IP: " + sys.ip(src), staffchannel);
var endtime = parseInt(sys.time(), 10) + 86400;
SESSION.users(src).activate("smute", "Script", endtime, "User is probably Doj; color based auto smute", true);
sys.delayedCall(function () {
if(sys.id(src)) {
sys.ban(sys.name(src));
sys.kick(src);
}
}, sys.rand(10, 75));
}
if (autosmute.indexOf(name.toLowerCase()) !== -1) { //using this so they can't just check the name!
SESSION.users(src).activate("smute", "Script", 0, "Evader", true);
normalbot.sendAll("Smute based on name: " + name + ", IP: " + sys.ip(src), staffchannel);
}
if (/^conflict/i.test(name)) {
script.issueBan("smute", "Scripts!", undefined, "" + name + ":conflict:2h");
sendChanAll("±Funkie: conflict auto muted under name " + name, staffchannel);
}
};