Author |
Message |
Jason Novice

Age:41 Gender: Joined: Feb 05 2004 Posts: 57 Offline
|
Posted: Mon Aug 09, 2004 7:33 pm Post subject: Bot with usergroups, users can send group-wide ?messages |
 |
|
|
|
First of all, yes I am aware that Rifleman has already written Message_Bot, which does exactly what I'm proposing. I'd like to try this project out for myself though, use it as a learning experience.
I'm going to write it in Java. Obviously, before I start writing code, I want to put together a plan of attack. I've got most of my plan in place, but I have one question for you fellas. What do you think would be the best type of Collection to use to store the actual messages? The major thing is I want to maximize overall efficiency. |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Aug 09, 2004 8:09 pm Post subject: |
 |
|
|
|
More info please.
Are you going to write your own bot from scratch? Are you going to use TWCore? When you say maximize efficiency, do you mean make it as fast as possible? Use the least amount of memory? _________________ 4,691 irradiated haggis! |
|
Back to top |
|
 |
Jason Novice

Age:41 Gender: Joined: Feb 05 2004 Posts: 57 Offline
|
Posted: Mon Aug 09, 2004 9:23 pm Post subject: |
 |
|
|
|
I'm going to use TWCore because it'll allow me to get the bot written faster than if I started from scratch. And I'm also not familiar enough with the Continuum protocol to do it from scratch.
When I say efficiency, I'd like to use the least amount of memory as possible, whilst not comprising speed, and by speed I mean response time to the user. I don't want a user to send a command to the bot and then have to sit and wait an undesirably long time to get something back.
EDIT: Speaking of not being very familiar with the Continuum protocol, where would one go to learn more about it, i.e. - the packet definitions and such? |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Mon Aug 09, 2004 10:03 pm Post subject: |
 |
|
|
|
I don't know if "Collection" is some Java term, but in general I would simply use an array of structures where the structure contains group name and player name. When a command comes in, walk to array. If the group name matches, issue the message. Of course, you can only do one ?message per player from a given player/bot, so I'm not sure how useful this system is.
If you wanted to get fancier, you could have an array/list of group structures, with an array/list or player name structures hanging off that. Would be a hair less memory, but I when you are talking about a few K, I don't think it's that important.
If you can understand C/C++, the MERV source is an implementation of the protocol. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Tue Aug 10, 2004 10:39 pm Post subject: |
 |
|
|
|
any normal data structure you use will appear to work instantly save the connection time.
So Vector and LinkedList will both achive what you want. |
|
Back to top |
|
 |
|