added OPER support (let the bots try to op themselves)
[NeonServV5.git] / src / modules / NeonSpam.mod / bot_NeonSpam.c
index 10b4083e9010e81d811f879d41ba209f01437361..f29cb903e7c98ba8ba92fb096cc2f79480a1861f 100644 (file)
@@ -132,9 +132,12 @@ static void neonspam_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]);
     }