Server Help

Bot Questions - Loading dll

O'Shovah - Sat Feb 19, 2005 8:53 am
Post subject: Loading dll
I'm making a plugin that when a mod pms it !host <event>, it will load the event plugin and go the the proper arena. When the event is done it unloads that event plugin and goes back to a priv arena. I was able to make it work by editing the core, but I want it to be a plugin. This is the code from the core in command.cpp, does anyone know what I need to do to make it work as a plugin.
Code: Show/Hide

if (h->imports->importLibrary(c.final))   
         {
            String s;
            
            bool seen = false;

            for (int slot = 0; slot < DLL_MAX_LOADED; ++slot)
            {
               char *name = h->imports->getPlugin(slot);
               if (!name) continue;

               if (seen) s += ", ";
               s += name;
               seen = true;
            }

            h->botInfo.setSpawn(s.msg);
         }

Smong - Sat Feb 19, 2005 11:00 am
Post subject:
Have you tried adding the bot to the operators list and have it priv message itself?
D1st0rt - Sat Feb 19, 2005 11:56 am
Post subject:
That would probably be the easiest, having it pm itself !load event
Cyan~Fire - Sat Feb 19, 2005 3:49 pm
Post subject:
Talk to Catid. He could probably make an event for it.
O'Shovah - Sat Feb 19, 2005 4:25 pm
Post subject:
thx i did what smong said.
Bak - Sat Feb 19, 2005 10:25 pm
Post subject:
did it work? I had trouble making a bot pm itself commands
Mr Ekted - Sat Feb 19, 2005 11:00 pm
Post subject:
I would suggest making the MERV core setup so it assumes a command from "self" is at full access level. This is safe as long as you trust your module builders.
O'Shovah - Mon Feb 21, 2005 2:54 pm
Post subject:
All you have to do is make the bot login as sop to itself. Then it can pm itself commands.
Mr Ekted - Mon Feb 21, 2005 3:30 pm
Post subject:
Yes, but that's a silly way to do it. It means you have to add all bot names as ops. Every time you add more bots, you need to add them as ops. Bots should be ops by default.
Underlord - Tue Feb 22, 2005 5:02 am
Post subject:
to avoid dealing with operators.txt, add in the below 'me->access = OP_Owner;' line to spawn.cpp

Code: Show/Hide

case EVENT_ArenaEnter:
{
         arena = (char*)event.p[0];
         me = (Player*)event.p[1];   
         bool biller_online = *(bool*)&event.p[2];

         me->access = OP_Owner;  // add this
}
break;

Solo Ace - Tue Feb 22, 2005 1:46 pm
Post subject:
That looks ugly. icon_sad.gif
CypherJF - Tue Feb 22, 2005 1:53 pm
Post subject:
Ah but it really isn't.
Cyan~Fire - Tue Feb 22, 2005 6:27 pm
Post subject:
It's actually a lot better than putting it in Operators.txt. Just get Catid to add it to the core, it's not that hard.
Bak - Tue Feb 22, 2005 8:54 pm
Post subject:
should do it in the constructor of the bot, rather than on arenaenter
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group