Getting dch++ Bots into Operator list

DCH++ has been abandoned, this forum serves mainly as an archive

Moderator: Moderators

Locked
kinky_tom
Posts: 2
Joined: 2005-01-11 13:40

Getting dch++ Bots into Operator list

Post by kinky_tom » 2005-01-11 13:58

Has anyone been able to get their dch++ Bots to go into the op list (ie. have a key)

Ive looked into the Bots and i can only see a place for the username so i cannot (with my knowledge) create it so it can send a password. So i cannot "Reg" it that way.

Am i missing something or is there a specific thing you can do to "Put" them into the Op list?

kinky_tom
Posts: 2
Joined: 2005-01-11 13:40

Post by kinky_tom » 2005-01-11 18:04

Well after some excelent help from Pothead i have been able to rectify this and now have the bots in the op list.

And this is how he showed me to do it....


Change the following

clientmanager.h
DLL void addNick(const string& aNick, int aLevel, bool op = false) throw();

to

DLL void addNick(const string& aNick, int aLevel, bool op) throw();


OpCom.cpp
ClientManager::getInstance()->addNick(botNick, 0)

to

ClientManager::getInstance()->addNick(botNick, 0, true);


OpChat.cpp
ClientManager::getInstance()->addNick(nick, minLevel);

to

ClientManager::getInstance()->addNick(nick, minLevel, true);


SimpleLog.cpp
ClientManager::getInstance()->addNick(d_botnick, d_log_minlevel);

to

ClientManager::getInstance()->addNick(d_botnick, d_log_minlevel, true);


BigBrother.cpp
ClientManager::getInstance()->addNick(botNick, minLevel);

to

ClientManager::getInstance()->addNick(botNick, minLevel, true);


ClientManager.cpp
void ClientManager::addNick(const string& aNick, int aLevel, bool op /* = false */) throw() {
extraNicks.push_back(ExtraNickInfo(aNick, aLevel, op));
strtmp.clear();
strtmp += "$Hello ";
strtmp += aNick;
strtmp += '|';

sendToAll(strtmp);
}



to


void ClientManager::addNick(const string& aNick, int aLevel, bool op /* = false */) throw() {
extraNicks.push_back(ExtraNickInfo(aNick, aLevel, op));
if (op) {
addOp(aNick);
}
strtmp.clear();
strtmp += "$Hello ";
strtmp += aNick;
strtmp += '|';

sendToAll(strtmp);
}


then clean then compile

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-07 21:46
Location: .pa.us

Post by GargoyleMT » 2005-01-12 13:24

if you specify the third parameter to addNick(), there shouldn't be any reason to modify the function prototype to omit the "= false".

A patch should be the minimal amount of code to solve the problem, and not one line more. :)

Pothead
Posts: 223
Joined: 2005-01-15 06:55

Post by Pothead » 2005-01-15 07:00

Also i don't like this which i did, as if they are set to True, it makes in the Min Level part obsolete, as the bot's get sent out in the Oplist, meaning everyone can see them, when they shouldn't do.

yakko
Posts: 258
Joined: 2003-01-27 01:04
Contact:

Post by yakko » 2005-01-15 13:58

if you just want the bots to be at the top of the list why don't you put a special character in the name. My bots names are surrounded by "-= =-" and are always before users.

Pothead
Posts: 223
Joined: 2005-01-15 06:55

Post by Pothead » 2005-01-16 18:41

yakko wrote:if you just want the bots to be at the top of the list why don't you put a special character in the name. My bots names are surrounded by "-= =-" and are always before users.
hehe, i have that too, but () are above them. So (-= =-) will probably work better. ;)

Locked