• Welcome to Valhalla Legends Archive.
 

C++ .NET

Started by iNsaNe, December 02, 2007, 05:32 PM

Previous topic - Next topic

iNsaNe

Sorry guys about the topic name, I just didn't know what to name it.

I have a question -- how can I create a program that reacts when a user types something into the Warcraft III chat line? Preferably C++.NET

Hell-Lord

I don't think you can do that because it is almost impossible to determine when other people are typing on there computers. Unless you mean your own computer or on a network?

brew

Quote from: Hell-Lord on December 02, 2007, 06:04 PM
I don't think you can do that because it is almost impossible to determine when other people are typing on there computers. Unless you mean your own computer or on a network?
... ehh..
I'm pretty sure he means on his own computer. There are a few ways, really (I'm not sure what chat line you're talking about...). If it's out of game, on battle.net, you could just hook that textbox, and if you mean ingame, you could use GetAsyncKeyState to detect presses of the enter button, if the game is active and the warcraft 3 hwnd == GetFocus. Sorry it's win32 api, I doubt there are any special classes in C++ .NET for this.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

iNsaNe

yeah that's what I thought, I've just never done anything like this before. An example would be wc3banlist, like when the user types "/fromall"in the warcraft chat line it determines the origin of every player in the custom game. I'm just making a simple program that will return ladder records when the user types their name into the chat line.

brew

Are you sure hooking the socket and intercepting the commands sent wouldn't be an even better idea?
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

MyndFyre

Why are you wasting your time with C++/CLI?

If you're going to use a .net language, IMO, you should be using one of the ones created *for* .net (C#, VB).  C++/CLI was introduced for control developers who had a significant investment already in C++/ActiveX controls.  Doing .net stuff in C++ sucks balls.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Hell-Lord

It would still be suitable to write C++ code in the VS2005 IDE because the compiler is better and more standarized right?

Banana fanna fo fanna

Quote from: Hell-Lord on December 02, 2007, 09:24 PM
It would still be suitable to write C++ code in the VS2005 IDE because the compiler is better and more standarized right?

The C++ code generator, which is the important part to have "better" and "standardized" is entirely different between C++ and C++.NET. The C++.NET compiler is real young.

iNsaNe

hey thanks guys i got it working and i appreciate the help but is there any better way of recording keystrokes other than GetAsyncKeyState? Sometimes when i go to type the letters quickly it scrambles all the letters around..

l2k-Shadow

Quote from: iNsaNe on December 04, 2007, 12:11 AM
hey thanks guys i got it working and i appreciate the help but is there any better way of recording keystrokes other than GetAsyncKeyState? Sometimes when i go to type the letters quickly it scrambles all the letters around..

set your timer to 1-10 milliseconds. i don't think anyone could type faster than that. ;p
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

Barabajagal

When you use GetAsyncKeyState, what return values are you checking for?

MyndFyre

Quote from: l2k-Shadow on December 04, 2007, 12:32 AM
Quote from: iNsaNe on December 04, 2007, 12:11 AM
hey thanks guys i got it working and i appreciate the help but is there any better way of recording keystrokes other than GetAsyncKeyState? Sometimes when i go to type the letters quickly it scrambles all the letters around..

set your timer to 1-10 milliseconds. i don't think anyone could type faster than that. ;p
Incidentally, it is well documented that Windows timers are only accurate to about 10ms unless using a high resolution timer.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

brew

Quote from: l2k-Shadow on December 04, 2007, 12:32 AM
Quote from: iNsaNe on December 04, 2007, 12:11 AM
hey thanks guys i got it working and i appreciate the help but is there any better way of recording keystrokes other than GetAsyncKeyState? Sometimes when i go to type the letters quickly it scrambles all the letters around..

set your timer to 1-10 milliseconds. i don't think anyone could type faster than that. ;p

It'd be an even better idea to set it to 150-175 ms. That's the delay that I would personally use for continuously checking key states.
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P