
Originally Posted by
PenguinGuy
Hook ZChat::Input or use 0x3A6 or 0x3A8 (I forget which offset) for chat input. Of course, return it as a char. E.X;
Code:
char* ChatInput( )
{
return( char* ) ( ZGetGameInterface( ) + 0x3A6 /*Or 0x3A8*/ );
}
To clear your last input, I believe all you have to do is:
Code:
void Clear( )
{
(* (char* ) ( ZGetGameInterface( ) + 0x3A6 /*Or 0x3A8*/ ) ) = '\n';
}
That's chat input, but I had problems having ZChatOutput display a message after input. Previously I used:
Code:
memcmp( ChatInput( ), "/hi", 3 ) == 0 ) { /*do stuffs */ }
Here's another method to receive and use an argument in a input.
Code:
if( memicmp( ChatInput( ), "/silentchat ", 11 ) == 0 )
{
char playerName;
char msg;
sscanf( ChatInput( ), "/silentchat %s %s", &playerName, &msg );
ZPostWhisper( "From: Me", playername, msg );
ClearInput( );
}
(Code not tested)
Edit: Forgot the ClearInput

If you forget to add the "ClearInput", you will not be able to input another command.
Edit2: I plan on updating this tutorial tonight or tomorrow night on finding an using pointers, adding/removing functions in "theduel.exe", and creating custom commands in C++ and ASM.
Thanks for this. 
Ok this is the script:
Code:
#include <windows.h>
typedef void(__cdecl *ZChatType) (const char*, int, int, DWORD);
ZChatType ZChatOutput = (ZChatType)0x0042A230;
void Chat2()
{
for(;;Sleep(20)) //Infinite Loop
{
char* ChatInput( )
{
return( char* ) ( ZGetGameInterface( ) + 0x3A6 /*Or 0x3A8*/ );
}
if( memcmp( ChatInput( ), "/hi", 3 ) == 0 ) {
ZChatOutput("Hello!", 2, 0, 0xFFFFFF);
Sleep(250);
}
}
}
extern "C"
{
__declspec(dllexport) BOOL __stdcall DllMain(HINSTANCE hInst,DWORD reason,LPVOID lpv)
{
DisableThreadLibraryCalls(hInst);
if (reason == DLL_PROCESS_ATTACH)
{
MessageBox(NULL, L"I love Music!", L"Niels:", MB_OK);
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Chat2, NULL, 0, NULL); //Remember our void? "MyThread" ??
}
return true;
}
}
And I get this error:
Code:
1>c:\documents and settings\administrator\mijn documenten\visual studio 2008\projects\chat2\chat2\main.cpp(13) : error C2601: 'ChatInput' : local function definitions are illegal
1> c:\documents and settings\administrator\mijn documenten\visual studio 2008\projects\chat2\chat2\main.cpp(11): this line contains a '{' which has not yet been matched
1>c:\documents and settings\administrator\mijn documenten\visual studio 2008\projects\chat2\chat2\main.cpp(14) : error C3861: 'ZGetGameInterface': identifier not found
1>Build log was saved at "file://c:\Documents and Settings\Administrator\Mijn documenten\Visual Studio 2008\Projects\Chat2\Chat2\Debug\BuildLog.htm"
1>Chat2 - 2 error(s), 0 warning(s)
It´s probaly because of the ZGetGameInterface.
How to make it load the interface of in-game(Not lobby or room)
I posted it here because I think it get faster a respond to it.