Valhalla Legends Archive

General => General Discussion => Topic started by: StormGage on January 20, 2004, 08:54 PM

Title: Battle.net Bot w/...
Post by: StormGage on January 20, 2004, 08:54 PM
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?
Title: Re:Battle.net Bot w/...
Post by: Stealth on January 20, 2004, 09:14 PM
You could probably adapt Grok's code here:

http://forum.valhallalegends.com/phpbbs/index.php?board=31;action=display;threadid=4255
Title: Re:Battle.net Bot w/...
Post by: 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.
Title: Re:Battle.net Bot w/...
Post by: Stealth on January 20, 2004, 10:08 PM
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.
Title: Re:Battle.net Bot w/...
Post by: StormGage on January 20, 2004, 10:12 PM
You perhaps?  :-p
Title: Re:Battle.net Bot w/...
Post by: Spht on January 21, 2004, 10:25 AM
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.
Title: Re:Battle.net Bot w/...
Post by: UserLoser. on January 21, 2004, 10:31 AM
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
Title: Re:Battle.net Bot w/...
Post by: 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.  >:(
Title: Re:Battle.net Bot w/...
Post by: Kp on January 21, 2004, 03:08 PM
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.
Title: Re:Battle.net Bot w/...
Post by: UserLoser. on January 21, 2004, 03:25 PM
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);
}
Title: Re:Battle.net Bot w/...
Post by: Kp on January 21, 2004, 03:42 PM
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.
Title: Re:Battle.net Bot w/...
Post by: Adron on January 23, 2004, 03:01 PM
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?
Title: Re:Battle.net Bot w/...
Post by: Kp on January 23, 2004, 03:28 PM
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. :)
Title: Re:Battle.net Bot w/...
Post by: DarkMinion on January 27, 2004, 06:39 AM
I am of the opinion that someone should stab you in the face.
Title: Re:Battle.net Bot w/...
Post by: Kp on January 27, 2004, 11:56 AM
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.
Title: Off Topic but yeah.
Post by: dxoigmn on January 27, 2004, 05:29 PM
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

:)
Title: Re:Battle.net Bot w/...
Post by: Chopz on January 31, 2004, 07:49 PM
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