Hi everyone, Im here to tell you about NimdaTS3 which is a TeamSpeak 3 bot library that I really like (JK I wrote it #ad) and I want to share with everyone. I saw a post: https://r4p3.net/threads/teamspeak-query-php-scripts.5432/ by @XRV-Webix about some performance stuff, I am going to extend on this.
So Nimda is TeamSpeak Query library, So let's review how Query libraries work. I'm going to talk about 2 query methods. The first one is a retained mode query. So when you write a retained mode query typically your program will look like this:
Where you setup a connection, some events and maybe some classes. you'll hook them up all together, create some callbacks and some fancy stuff. and after you set everything up, you run and it just goes. After that everything is handled by events and callbacks and any other logic you add.
The second way to write a query library is immediate mode, so this is an example of immediate mode.
You see the main difference the code in immediate mode gets called constantly, all the time, forever. every iteration of the program you would do stuff. that might sound kind of weird at first, but actually, it turns out 70% of bots I have seen have been coded like this. Because its easy and fast to code. But not in terms of performance.
So here's some pros and cons
Retained mode:
However, Immediate mode is power in power inefficient since it polling based, meaning its doing work no matter what, even when nothing is happening. Immediate mode is very dynamic because every loop you can completely change how the program acts depending whats going on in your program.
So NimdaTS3 is a library that implements this retained mode query paradigm in PHP. If you want to use NimdaTS3 in for your bots today there are only a few steps you need to do first go to the NimdaTS3 GitHub (which ill link at the bottom of this thread) and download the library this includes some premade plugins, Plugins like Jail, Seen and Quotes. You have a few callbacks available to use, so not very much work to get starts. just define what callbacks to want to use and the library will capture events and pass them to your plugin to process them. then after that just write your code and use Teamspeak calls. Like message a client or change server description.
Heres a link to the library: https://github.com/JABirchall/NimdaTS3
And a video demonstration how easy it is tostart writting a plugin:
So Nimda is TeamSpeak Query library, So let's review how Query libraries work. I'm going to talk about 2 query methods. The first one is a retained mode query. So when you write a retained mode query typically your program will look like this:
PHP:
$server = TeamSpeak3::factory("serverquery://serveradmin:password@127.0.0.1:10011/?server_port=9987&blocking=0");
Signal::getInstance()->subscribe("serverqueryWaitTimeout", "onWaitTimeout");
$server->getAdapter()->wait();
function onWaitTimeout($time, AbstractAdapter $adapter)
{
$adapter->getHost()->message('hello');
}
The second way to write a query library is immediate mode, so this is an example of immediate mode.
PHP:
$server =TeamSpeak3::factory("serverquery://serveradmin:password@127.0.0.1:10011/?server_port=9987&blocking=0");
while(true){
$server->message('hello');
}
So here's some pros and cons
Retained mode:
- Power efficient (interrupt based)
- Mostly static (Constructed once)
- Long-term design
- Everyday use case
- Power inefficient (polling based)
- Very dynamic (always rebuilt)
- Fast prototyping
- Real-time result use case
However, Immediate mode is power in power inefficient since it polling based, meaning its doing work no matter what, even when nothing is happening. Immediate mode is very dynamic because every loop you can completely change how the program acts depending whats going on in your program.
So NimdaTS3 is a library that implements this retained mode query paradigm in PHP. If you want to use NimdaTS3 in for your bots today there are only a few steps you need to do first go to the NimdaTS3 GitHub (which ill link at the bottom of this thread) and download the library this includes some premade plugins, Plugins like Jail, Seen and Quotes. You have a few callbacks available to use, so not very much work to get starts. just define what callbacks to want to use and the library will capture events and pass them to your plugin to process them. then after that just write your code and use Teamspeak calls. Like message a client or change server description.
Heres a link to the library: https://github.com/JABirchall/NimdaTS3
And a video demonstration how easy it is tostart writting a plugin: