Server Help

Bot Questions - Flood Arena w/ stats.

blackmoon - Wed Aug 04, 2004 2:36 am
Post subject: Flood Arena w/ stats.
Okay... I am learning all of this, and it is slow going. I took the flag.dll plugin and cleaned up the Winners Stats somewhat then added a line to prize the arena. But now what I want to do is flood the player with his stats from the end of the game. Any help with that??
Bak - Wed Aug 04, 2004 7:20 am
Post subject:
sendPrivate(p,"Your kills: " + (String)kills);
sendPrivate(p,"Your deaths: " + (String)deaths);
sendPrivate(p,"Your skill: 0");

where p is a Player*
D1st0rt - Wed Aug 04, 2004 8:17 am
Post subject:
What I like to do:

Code: Show/Hide
String s[3];
s[0] = "Your kills: "+ (String)kills);
s[1] = "Your deaths: " + (String)deaths);
s[2] = "Your skill: 0");

for(int x = 0; x < 3; x++)
     sendPrivate(p,s[x]);

It works well when you have lots of messages to send

You might need to put s[x].msg if s[x] doesn't work
blackmoon - Wed Aug 04, 2004 9:40 am
Post subject:
thanks.. this gives me alot to work with! appreciate it!
Bak - Wed Aug 04, 2004 11:16 am
Post subject:
A magic trick someone showed me when I was learning mervbot is the playerlist. Say you want to message every player in the bot's arena "Hello!" (or in your case their stats)

you can do:

Code: Show/Hide
for (_listnode <Player> *parse = playerlist->head;parse;parse = parse->next)
{
    Player *p = parse->item;

    sendPrivate(p,"Hello");
}


and you can access this playerlist in any function that is part of the botInfo class (so therefore in all the events).
CypherJF - Wed Aug 04, 2004 11:54 am
Post subject:
You can also do a while-loop as well.
blackmoon - Wed Aug 04, 2004 12:37 pm
Post subject:
Thanks... I will try that one too. Considering I am not a programmer by nature, this is difficult, but you guys are giving me some good info! thanks!
Cyan~Fire - Wed Aug 04, 2004 1:16 pm
Post subject:
Or you could just write the ASM yourself, Cyph.

And d1s, that's 3 more lines of C++ and more than 3 more lines of ASM. icon_confused.gif
CypherJF - Wed Aug 04, 2004 5:42 pm
Post subject:
Well, considering I don't know ASM; LOL.. I doub't I'd be writting it in it.. tongue.gif
D1st0rt - Thu Aug 05, 2004 10:59 am
Post subject:
Cyan, while using it for 3 isn't as helpful, if you had like 10 lines, it makes it a lot easier. Also, it allows you to define them at one time, and then control if maybe you didn't want to send them just yet.
Cyan~Fire - Thu Aug 05, 2004 5:30 pm
Post subject:
It still requires one more line of code for each new message...

At least do:
Code: Show/Hide
String s[3] =
{
"Your kills: "+ (String)kills,
"Your deaths: " + (String)deaths,
"Your skill: 0"
};


Saves a bit...
D1st0rt - Fri Aug 06, 2004 4:51 pm
Post subject:
Good call
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group