Server Help

Bot Questions - All objects off

The Cubbies - Thu Sep 21, 2006 1:58 am
Post subject: All objects off
Is there a way to toggle all objects off at the same time with Merv? If I had 20+ objects on, it would be nice to not have to turn each off one at a time. And if this can be done, can it be sent to a single person rather than the whole public?
k0zy - Thu Sep 21, 2006 11:06 am
Post subject:
Best way would be to sendPrivate an "*objset"
Quote:
After the objset command (either public or private), you will need a space. Then you will place a + or - symbol. Next comes the object's id number. At last, a comma at the end. You repeat this step for every object set you are toggling from the +/- to the end comma.

Example to turn on 5, off 80 and 90:
*objset +5,-80,-90,


You have to know your object ids, though.

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Bak - Thu Sep 21, 2006 2:00 pm
Post subject:
I think there's a better way where you send out an objset packet, rather than the chat packet containing the text "*objset ...".

Yup, use the queue_enable and queue_disable functions. If it doesn't do it automatically, you'll also need to do toggle_objects to dump the buffer.
The Cubbies - Thu Sep 21, 2006 2:21 pm
Post subject:
I use the toggle_objects already (btw all that does is make the bot group things into a *objset). What I want to do is turn off all the objects that are on for a person without having to remember which ones are on.
Bak - Thu Sep 21, 2006 3:22 pm
Post subject:
not always. If the bot has less than sysop, then yes, it sends a chat message. If it has sysop, it will call generateObjectToggle in clientprot.cpp which sends a binary packet out with the object data in it.

Code: Show/Hide
case EVENT_ToggleObjects:
      {
         objectInfo *objects = (objectInfo *)event.p[0];
         int num_objects = *(int*)&event.p[1];
         int player_id = *(int*)&event.p[2];

         if (num_objects < 0)
            break;

         if (h->hasSysOp)
         {
            h->postRR(generateObjectToggle(player_id, objects, num_objects));
         }
         else
         {
            String s;

            s += "*objset ";

All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group