Hey,
I'am new at Script Development, i don't know why the channels don't change their Codec(-Quality)!
Here is my Code:
I hope you can help me
I'am new at Script Development, i don't know why the channels don't change their Codec(-Quality)!
Here is my Code:
Code:
registerPlugin({
name: 'Channel Updater - Quality',
version: '1.3.1',
description: 'Changing',
author: 'WolfsWelpe',
vars: []
}, function(sinusbot, config) {
var engine = require('engine');
var event = require('event');
var currentChannel;
var newChannel;
var codecOld;
var qualityOld;
var codecNew = 5;
var qualityNew = 10;
engine.log("Quality Script Loaded");
event.on('clientMove', function(ev) {
if(ev.client.isSelf()) {
if(ev.fromChannel != null) {
currentChannel = ev.fromChannel;
newChannel = ev.toChannel;
engine.log(currentChannel.name() + " >> " + newChannel.name());
engine.log(currentChannel.codec() + ";" + currentChannel.codecQuality());
if(codecOld != null && qualityOld != null) {
currentChannel.setCodec(codecOld);
currentChannel.setCodecQuality(qualityOld);
};
if(newChannel.name() != "● Freie Musikbots"){
codecOld = newChannel.codec();
qualityOld = newChannel.codecQuality();
currentChannel.setCodec(codecNew);
currentChannel.setCodecQuality(qualityNew);
} else {
codecOld = null;
qualityOld = null;
}
};
};
});
});