ronoo
New Member
Hi everybody, I have encountered two major problems these days.
Number one: The first problem I only encountered was on one server (server ip: ts.fine-mta.eu)
The problem was with the connection, every time I pick up the bot it is up for 10 seconds, then the connection is lost.
The log writes:
Second problem:
I'm trying to write a script that also contains mysql elements.
The problem is caused by running the script any number of times
You type the following error to connect:
My config.ini:
Thanks in advance for the help!
Number one: The first problem I only encountered was on one server (server ip: ts.fine-mta.eu)
The problem was with the connection, every time I pick up the bot it is up for 10 seconds, then the connection is lost.
The log writes:
Meanwhile, the bot:2021-05-21T20:05:32+02:00 TS |INFO |PktHandler |1 |Dropping client 7117 because of resend timeout
2021-05-21T20:05:32+02:00 TS |INFO |PktHandler |1 |Cleaning up connection because of 13 resends of COMMAND packet
<20:26:16> "Cbot" dropped (connection lost)
Second problem:
I'm trying to write a script that also contains mysql elements.
The problem is caused by running the script any number of times
You type the following error to connect:
The complete script code:2021-05-21T20:36:04+02:00 failed to run: Uncaught exception: TypeError: Cannot read property 'connect' of undefined at mpont:29:7 db.connect({ driver: 'mysql', host: 'localhost', username: 'ts3modi', password: '', database: 'modi' }, function(err) { ^ Stack trace: TypeError: Cannot read property 'connect' of undefined at mpont:29:8
by definition, i deleted the password but it was also filled out.registerPlugin({
name: 'mpont',
version: '1.0',
author: 'ronoo',
requiredModules: ['db'],
autorun: true
}, function(sinusbot, config) {
const db = require('db');
const engine = require('engine');
const backend = require('backend');
const event = require('event');
const helpers = require('helpers');
let dbc = null;
var client = backend.getClientByName('Corn');
function parseString(numberBuffer) {
if (!Array.isArray(numberBuffer)) return "";
const bytewriter = helpers.newBytes();
numberBuffer.forEach(num => bytewriter.append(helpers.bytesFromHex(num.toString(16))));
return bytewriter.toString();
}
db.connect({ driver: 'mysql', host: 'localhost', username: 'ts3modi', password: '', database: 'modi' }, function(err) {
if (err) {
engine.log(err);
}
});
if (dbc) dbc.query("SELECT * FROM loginform where rang=9", function(err, res) {
if (!err) {
res.forEach(function(row) {
client.chat(parseString(row.foo));
});
} else {
engine.log(err);
}
});
});
My config.ini:
finally the result of the run debug:[Scripts.Privileges]
mpont = ["db"]
Code:
==========================================================
SINUSBOT RELATED
SYSTEM INFORMATION
- Operating System: Ubuntu 18.04.5 LTS
- Kernel: Linux 5.4.78-2-pve x86_64
- Load Average: 51.05 41.65 40.76
- Uptime: 0 days, 6 hours, 12 minutes, 50 seconds
- OS x64 check: OK
- OS Updates: 32 (updates available!)
- OS Missing Packages: None
- OS APT Last Update: 21.05.2021 04:42:30 CEST +02:00:00
- Shell Locale: en_US.UTF-8
- Bot Start Script: not found
- CPU:
Architecture: x86_64
CPU(s): 24
Thread(s) per core: 0
Core(s) per socket: 6
Socket(s): 2
Model name: Intel(R) Xeon(R) CPU E5-2430L v2 @ 2.40GHz
CPU MHz: 2593.792
Virtualization: VT-x
- RAM: 545.57 MB/2.00 GB in use (26%)
- SWAP: 0 B/1.99 GB in use (0%)
- DISK: 12.88 GB/19.56 GB in use (65%)
- Package versions:
- libglib: 2.56.4-0ubuntu0.18.04.8
BOT INFORMATION
- Status: running (PIDs: 7785 7778, User: sinusbot)
- Webinterface: port locally reachable (Port: 8087)
- Binary: /opt/sinusbot/sinusbot
- Binary Info: MD5 Hash: 224b687db910b732fe5a7cfec4f6c78e, Perms: 755, User: sinusbot
- Version: 1.0.0-beta.10-202ee4d
- TS3 Plugin: installed (md5 hash match)
- Bot Plugin: aa483aea105cb62033392b1ce6d317ab
- TS3 Client: aa483aea105cb62033392b1ce6d317ab
- Config:
- LogLevel = 3
- TS3Path = /opt/sinusbot/teamspeak3-client/ts3client_linux_amd64 (Version 3.5.3)
- YoutubeDLPath = /usr/local/bin/youtube-dl (does exist, version: 2021.05.16)
- Installed scripts: advertising.js; alonemode.js; bookmark.js; command.js; followme.js; mpont.js; norecording.js; rememberChannel.js; sinusbot-commands.js; welcome.js
BOT TECHNICAL INFORMATION
- File exists:
- TS3Client/libqxcb-glx-integration.so: no
- LDD output:
linux-vdso.so.1 (0x00007ffda0bfd000)
libswresample.so.2 => /opt/sinusbot/libswresample.so.2 (0x00007fd89e007000)
libavfilter.so.6 => /opt/sinusbot/libavfilter.so.6 (0x00007fd89dcaf000)
libavformat.so.57 => /opt/sinusbot/libavformat.so.57 (0x00007fd89d8ae000)
libavcodec.so.57 => /opt/sinusbot/libavcodec.so.57 (0x00007fd89cf49000)
libavutil.so.55 => /opt/sinusbot/libavutil.so.55 (0x00007fd89ccd5000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd89cad1000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd89c733000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd89c514000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd89c18b000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd89bf73000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd89bb82000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd89b965000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd89b75d000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd89e221000)
REACHABILITY CHECKS
- HTTPS check with IPv4 mode: SUCCESS [Connection established to www.sinusbot.com, CODE #200]
- HTTPS check with IPv6 mode: IGNORED [Disabled]
- DNS resolution check: SUCCESS [www.sinusbot.com resolved to 172.67.132.160]
- Update server checks:
update01.sinusbot.com -> 172.67.132.160: SUCCESS [CODE #404]
update02.sinusbot.com -> 172.67.132.160: SUCCESS [CODE #404]
update03.sinusbot.com -> 172.67.132.160: SUCCESS [CODE #404]
TIME INFORMATION
- Time (local): 21.05.2021 20:12:13 CEST +02:00:00
- Time (remote): 21.05.2021 20:12:13 CEST +02:00:00
- Time (difference): 0 secs (Time diff less than 2 secs. Good.)
- Timezone: Europe/Budapest
OTHER INFORMATION
- TeamSpeak3 Version: 3.5.3
- youtube-dl Version: 2021.05.16
- DiagScript Version: 0.8.0
==========================================================
Last edited: