Introduction

"Why this name?" – "Why PHP?" – "How does the module function work?"

You may have asked yourself those questions above and now we are going to clean up mistakes, confirm clishes and explain our hidden agendas. This site has been created to explain the bot in theory. If you want to get more information about the real technique behind the bot (e.g. for developing modules), you should leave this site and switch to our developers guide now.

the bot itself

The first idea of an IRC bot written in PHP came 2008. The first try was really bad, the second even worse and then we first gave it up. But a few months later we came back to the idea of an Spybot in PHP – connecting to two different networks and posting the messages of the frist to the second one. Anyways, this but never was created because before we done this one we done MsTasty. Yep, MsTasty the first. She (I call her a she from now on; maybe it's a sheobject or something like that) was a simple funbot which got extended more and more and more and more and more and more and now features over 1700 lines. 1700 lines isn't that much, but thats only one class and only one file. You probably can imagine that this is not really the clearest structure to use. The bot was only not designed to run in no-block mode which made it impossible to build two new features we really wanted it to feature: a) a quizbot and b) a mafiabot (You know that mafia game? Quite funny.) (Noblock is required to run second-exact timers). So we took the main core of MsTasty, threw all the fun-functions out and wrote MsQuizzy and MrLuigi, running on MsTasty Core 1. (They had a first improvement: In MsTasty, every function had to exist twice: if ( admin ) else . This was no longer required. Yippieyayeah!) While writing those two bots in 2009, the first idea of a completely new core popped up – making it modular, oop and so on.

The name of the bot is taken from a movie called "Sexdrive". To "visualize" her, you can search here and dream over day and night. We decided to take this name because virtual existing persons (commonly known as bots) mostly sell better. Realizing that we are not going to sell MsTasty really hit us, but we can do something good for the world so we kept on developing.

why php?

We know, PHP is not really the best scripting language and not built to keep running and running and running. But otherwise, PHP features a lot of advantages, which the best is probably the fact, that it's a very popular language and a lot of people can script in PHP but not in other common bot-scripting languages (like TCL or MSL). And, if there are people who run bots in a mIRC window they will probably be happy when they get a PHP bot. With a PHP bot we open new possibilities for PHP developers and build a new alternative to common bots such as eggdrop or supybot. PHP also doesn't require any compilers (besides PHP itself). Even beginners can use this bot with PHP-CLI without having trouble and fighting against compilers. This also allows the user to see and change the whole sourcecode.

the module principle

The new bot really had to be something special and so it was clear that a bot which features the same things for every user is nothing special. The module system we use is a system we developed earlier (but re-developed in a better, oop-way for core2) for an IRC servicebot called yserv (It has never been released and the module function was only testing, but it exists). However, creating this module system was a really exciting process. The problem is that (as you probably know) PHP doesn't allow to re-define classes or functions. We had to use a little trick that made us able to redefine classes, even if PHP (basically) doesn't want to. Modules are loaded by getting their files content, replacing the class-define-name with an unique id, defining it through eval() and then creating the module-object. It still IS possible, that a module can't be loaded due to a reserved class name. But IDs are 30 signs and every sign is chosen by random from A-Z, a-z and 0-9 (makes 62 possible characters per sign, 30 signs means 62^30, that means that you can actually rehash one module 591222134364399413463902591994678504204696392694759424 (591 sexdecillion) times until the bot collapses (I'm pretty sure it will BEFORE you reach this amount of loaded classes). But thats only in theory. Because we are not able to remove the loaded classes from the current process (and from your RAM) it means that you should not overact when rehashing modules. When developing, it is probably much better to restart the bot each time you made a change.