Server Help

Bot Questions - Watch damage?

tansey - Thu Mar 03, 2005 4:51 pm
Post subject: Watch damage?
Does MERV have a built in way to automatically watch damage for all players? Right now I have a function watchAll() that just iterates through the playerlist and pms everyone *watchdamage but for some reason that's occassionally saying it's turning watchdamage off which makes no sense.
Cyan~Fire - Thu Mar 03, 2005 6:07 pm
Post subject:
I don't think MERV has something like that. Your best bet is checking the reply and re-messaging the player if it says OFF.
D1st0rt - Thu Mar 03, 2005 6:45 pm
Post subject:
Or if you didn't want to deal with the chat messages, you could set WATCHED as a tag
50% Packetloss - Thu Mar 03, 2005 7:55 pm
Post subject:
Code: Show/Hide
case EVENT_WatchDamage:
      {
         Player *p = (Player*)event.p[0];   // player
         Player *k = (Player*)event.p[1];   // attacker
         weaponInfo wi;
         wi.n = *(Uint16*)&event.p[2];
         Uint16 energy = *(Uint16*)&event.p[3];
         Uint16 damage = *(Uint16*)&event.p[4];
      }


When you *watchdamage on a player, every time they are damaged the above function is called. The cause for *watchdamage to turn off is the player went to another arena, example: ?go duel. Then once they return, the watchdamage is still ON as long as they didn't leave the zone. So your bot is turning it off. What you need to do is watch the chat messages you recieve from the server. So one solution might be to append player names to a linklist, so send them *watchdamage and append them to a linklist. Then when you get a responce from the server, depending on the responce (ON or OFF) then you can either send them the *watchdamage again and place them at the end of the linklist or delete them from the linklist because the *watchdamage is now ON for that player. I have no idea if the server sends the *watchgreen responce messages in the same player order as you sent them or if there is a chance that the bot might not recieve a chat message packet, if either of those are true then the above solution would not work.
Subgame wasn't really built to be bot-friendly so this is one case that doesn't have a great solution.
Anonymous - Thu Mar 03, 2005 9:30 pm
Post subject:
Actually, im fairly sure watchdamage shuts off once they leave the arena...

The way MRBots work for that, is whenever a player enters the arena, it adds them to a list of people who *dont* have it. When they enter the game, the bot sends them the *watchdamage message, and removes them from the list. Works perfectly. Never once does the bot check the servers response.

The only time this doesnt work is when the bot reloads during primetime when people in the arena already have *watchdamage, so when the bot re-enters, it undoes its own work.

Of course it could all be a fluke, and I could be wrong, but whatever.
50% Packetloss - Fri Mar 04, 2005 3:15 am
Post subject:
Oops, my bad. I was thinking of *watchgreen. But that mervbot event does work.
D1st0rt - Fri Mar 04, 2005 6:12 pm
Post subject:
Cerium's way is a variation of what I was saying, you could do it that way as well
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group