Ts3 Adresim İçin Saldırılara Karşı Koruma adına bir script yazdırmak istiyorum sinusbot için
İsteğim Şu :
Anlık olarak ard arda 3 4 kişi banlanırsa banlayan kişiden yetkiyi alsın ve banlasın
Anlık Olarak Odalarak Silinmeye başlar herkesten yetkiler alınırsa belirleyeceğimiz yetkileri herkesten alsın süre saniye cinsinden örnek 5 saniye içinde 3 den fazla kişiyi banlarsa otomatik devreye girmesini
istiyorum
Konu
Elimde Hazır Script Var ancak banlama ve yetkileri alma işlemini yapamıyor İçini Editleyebilirsek çok yardımcı olursunuz Script Anlık olarak sunucuyu kontrol ediyor Ard Arda ban atılırsa ban listesini tarıyor ve kaldırıyor ancak ban atan kullanıcı üzerinde yetkiyi alıp banlama işlemini yapamıyor
Kod:
registerPlugin({
name: 'AntiAbuse',
version: '1.2.0',
description: 'Prevents abuse from admins',
author: 'devdanetra <[email protected]>',
vars: [
{
name: "excludedGroup",
type: "number",
title: "Excluded server Group",
},
{
name: "maxChannelAmount",
type: "number",
title: "How many channels can someone delete in given time?",
},
{
name: "channelCheckTime",
type: "number",
title: "Time in seconds for channel delete option.",
},
{
name: "maxBanAmount",
type: "number",
title: "How many clients can someone ban in given time?",
},
{
name: "banCheckTime",
type: "number",
title: "Time in seconds for bans option.",
},
{
name: "maxKickAmount",
type: "number",
title: "How many clients can someone kick in given time?",
},
{
name: "kickCheckTime",
type: "number",
title: "Time in seconds for channel kick option.",
},
{
name: "banTime",
type: "number",
title: "How much should a client get banned? (-1 = permanent)",
},
{
name: "banReason",
type: "string",
title: "Insert the reason.",
default: "Admin abuse : too many bans.",
},
{
name: "kickReason",
type: "string",
title: "Insert the reason.",
default: "Admin abuse : too many kicks.",
},
{
name: "channelReason",
type: "string",
title: "Insert the reason.",
default: "Admin abuse : too many channels deleted.",
},
],
}, function(sinusbot, config) {
const engine = require('engine');
const store = require('store');
const backend = require('backend');
const helpers = require('helpers');
const format = require('format');
var event = require('event');
setInterval(removeBanCount,config.banCheckTime *1000);
setInterval(removeKickCount,config.kickCheckTime *1000);
setInterval(removeChannelCount,config.channelCheckTime *1000);
function removeBanCount(){
var clients = backend.getClients();
engine.log("resetting ban count!");
clients.forEach(function(client) {
let uid = client.uid();
let banCount = uid + "banCount";
store.set(banCount,0);
});
}
function removeKickCount(){
var clients = backend.getClients();
engine.log("resetting kick count!");
clients.forEach(function(client) {
let uid = client.uid();
let kickCount = uid + "kickCount";
store.set(kickCount,0);
});
}
function removeChannelCount(){
var clients = backend.getClients();
engine.log("resetting channel count!");
clients.forEach(function(client) {
let uid = client.uid();
let channelCount = uid + "channelCount";
store.set(channelCount,0);
});
}
event.on('clientBanned', function(ev) {
let invoker = ev.invoker;
if(invoker.isSelf())
return;
let uid = invoker.uid();
let banCount = uid + "banCount";
engine.log("ban " + invoker.name() + " +1");
if(store.get(banCount) > config.maxBanAmount){
banPlayer(invoker,config.banReason);
return;
}
let count = store.get(banCount);
count++;
store.set(banCount,count);
return;
});
event.on('clientKicked', function(ev) {
let invoker = ev.invoker;
if(invoker.isSelf())
return;
let uid = invoker.uid();
let kickCount = uid + "kickCount";
engine.log("kick " + invoker.name() + " +1");
if(store.get(kickCount) > config.maxKickAmount){
banPlayer(invoker,config.kickReason);
return;
}
let count = store.get(kickCount);
count++;
store.set(kickCount,count);
return;
});
event.on('channelDelete', function(ev,invoker) {
if(invoker.isSelf())
return;
let uid = invoker.uid();
let channelCount = uid + "channelCount";
engine.log("channel delete " + invoker.name() + " +1");
if(store.get(channelCount) > config.maxChannelAmount){
banPlayer(invoker,config.channelReason);
return;
}
let count = store.get(channelCount);
count++;
store.set(channelCount,count);
return;
});
function banPlayer(client,reason){
let clientGroups = client.getServerGroups();
let excludedGroup = backend.getServerGroupByID(config.excludedGroup);
let ban = true;
if(client.isSelf())
return;
clientGroups.forEach(function(group) {
if(group == excludedGroup){
ban = false;
engine.log("Excluded " + client.name() + " detected : NOT BANNING.");
}
});
if(ban){
engine.log("banning " + client.name() + " for abuse.");
clientGroups.forEach(element => client.removeFromServerGroup(element));
client.ban(config.banTime*1000,reason);
}
}
});
(04-08-2021, 13:58)MawiLarq Adlı Kullanıcıdan Alıntı: bütcen x.xxx formatındaysa yardımcı olabiliriz.O civarda bi bütçeyi şuan için kaldıramam yinede teşekkürler
Son Düzenleme: 04-08-2021, 23:55, Düzenleyen: Areeeessss.
Benzer Konular
Yorum
669
Okunma
12-11-2023, 02:11
Yorum
2.122
Okunma
03-09-2023, 21:27
Yorum
2.744
Okunma
Yorum
4.646
Okunma