Wedz0ff
Member
Hello, i'm trying to modify a mass poke script to poke only specifics server groups, i dunno why it's not wrong.
Can any1 help me?
Code:
registerPlugin({
name: 'Privat message or poke to all clients',
version: '1.0',
description: 'Send privat message or poke to all clients',
author: 'Filtik <[email protected]>',
vars: [{
name: 'adminarray',
title: 'IDs which have allowed to send:',
indent: 1,
type: 'array',
vars: [{
name: 'ID',
title: 'TS-Users ID',
indent: 2,
type: 'string'
}]
}]
}, function(sinusbot, config) {
var engine = require('engine');
var backend = require('backend');
var event = require('event');
require('event').on('load', function() {
var lib = require ('OKlib.js');
main(lib);
});
function main(lib){
event.on('chat', function(ev) {
if (!ev.client.isSelf()) {
var parts = ev.text.split(" ");
if (parts[0] == "!pmtoall" && parts[1] != "") {
var client = ev.client;
config.adminarray.forEach(function(row) {
if (row.ID == client.uid())
{
var clients = backend.getClients();
var currentClients = backend.getClients();
for (var i in currentClients){
var currentClient = currentClients[i];
for (var j in config.serverGroups){
if (lib.client.isMemberOfGroup(currentClient, 128)){
currentClient.poke(ev.text.replace(parts[0]+" ", ""));
}
}
}
return;
}
});
}
}
});
}
});
Can any1 help me?