I would be interested in having a bot which prints timestamps that measure to the miliseconds. For instance: [hour:minute:seconds:miliseconds]. I would be interested in using one of these bots for various reasons. Does anyone know of such a bot?
You could probably adapt Grok's code here:
http://forum.valhallalegends.com/phpbbs/index.php?board=31;action=display;threadid=4255
I'm not familiar with VB, so It'd just be easier for me to have the bot with it allready implemented. But I'll see what use I can make of that code.
Quote from: StormGage on January 20, 2004, 09:19 PM
I'm not familiar with VB, so It'd just be easier for me to have the bot with it allready implemented. But I'll see what use I can make of that code.
Sorry, I misread your question. Forward that link on to your bot developer of choice.
You perhaps? :-p
Quote from: GoSS on January 21, 2004, 10:22 AM
Shouldn't this post be in the BotDev forum?
No. He's asking for a bot which has a certain feature.
I have one, supports all clients (uses BNLS) - Doesn't have much features yet but it's being worked on.. I'll upload it when I get home since I installed a new server on my system and it's not currently there
I have one as well yet, it's unreleased. I also encountered a problem that UserLoser pointed out to me. It logs milliseconds larger than the maximum millisecond number. >:(
Quote from: hismajesty on January 21, 2004, 02:19 PM
I have one as well yet, it's unreleased. I also encountered a problem that UserLoser pointed out to me. It logs milliseconds larger than the maximum millisecond number. >:(
Nice trick. If you want some help fixing it, spawn a new thread about that (preferably either in botdev or in a language specific forum, as you feel appropriate) and I'm sure someone will take a look.
Quote from: hismajesty on January 21, 2004, 02:19 PM
I have one as well yet, it's unreleased. I also encountered a problem that UserLoser pointed out to me. It logs milliseconds larger than the maximum millisecond number. >:(
void TimeStamp(char *buf, bool bMSTime)
{
SYSTEMTIME st;
GetLocalTime(&st);
if (bMSTime)
sprintf(buf, "[%02i:%02i:%02i.%03i] ", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
else
sprintf(buf, "[%02i:%02i:%02i] ", st.wHour, st.wMinute, st.wSecond);
}
Quote from: UserLoser. on January 21, 2004, 03:25 PM
void TimeStamp(char *buf, bool bMSTime)
{
SYSTEMTIME st;
GetLocalTime(&st);
if (bMSTime)
sprintf(buf, "[%02i:%02i:%02i.%03i] ", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
else
sprintf(buf, "[%02i:%02i:%02i] ", st.wHour, st.wMinute, st.wSecond);
}
A quick optimization:
sprintf(buf, bMSTime ? "[%02i:%02i:%02i.%03i] " : "[%02i:%02i:%02i] ", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);This cuts down on code size by only having one way to call sprintf. The ternary operator ?: picks a format string appropriate to the request, rather than an if/else construction which picks an entire function call. When bMSTime is false, the fourth field st.wMilliseconds is silently ignored by sprintf, since the non-ms format string only specifies three fields.
Quote from: Kp on January 21, 2004, 03:42 PM
This cuts down on code size by only having one way to call sprintf. The ternary operator ?: picks a format string appropriate to the request, rather than an if/else construction which picks an entire function call. When bMSTime is false, the fourth field st.wMilliseconds is silently ignored by sprintf, since the non-ms format string only specifies three fields.
It would also prevent the compile-time checking of printf format arguments done by some modern compilers?
Quote from: Adron on January 23, 2004, 03:01 PMIt would also prevent the compile-time checking of printf format arguments done by some modern compilers?
Sure. That's why I only make such changes when I'm going back through looking for easy enhancements, after I've already built everything and gotten any associated warnings. :)
I am of the opinion that someone should stab you in the face.
Quote from: DarkMinion on January 27, 2004, 06:39 AM
I am of the opinion that someone should stab you in the face.
Stab who? You should indicate the poster to whom you are referring.
Quote from: DarkMinion on January 27, 2004, 06:39 AM
I am of the opinion that someone should stab you in the face.
I am of the opinion that someone copies magus.
http://boards.gamers.com/messages/message_view-topic.asp?name=sayter&id=zwdel
:)
I assume he's talking to you(Kp) Ban him from the forums... He's threatening you. ;) Hehe, you shouldn't make those opinions DarkMinion... it's not very good repect... :-\
LoL