* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../module.h"
+#include "../botid.h"
#include "bot_DummyServ.h"
#include "../../modcmd.h"
#include "../../EventLogger.h"
#include "../../bots.h"
-#define BOTID 3
+#define BOTID DUMMYSERV_BOTID
#define BOTALIAS "DummyServ"
static void dummyserv_bot_ready(struct ClientSocket *client) {
MYSQL_RES *res;
MYSQL_ROW row;
- printf_mysql_query("SELECT `automodes` FROM `bots` WHERE `id` = '%d'", client->clientid);
+ printf_mysql_query("SELECT `automodes`, `oper_user`, `oper_pass` FROM `bots` WHERE `id` = '%d'", client->clientid);
res = mysql_use();
if ((row = mysql_fetch_row(res)) != NULL) {
+ if(row[1] && row[2]) {
+ putsock(client, "OPER %s %s", row[1], row[2]);
+ }
putsock(client, "MODE %s +%s", client->user->nick, row[0]);
}