-
Member
Catch the command in the chat
Hello everyone, I'm interested in how to catch a chat command from my program c# ?
Example:
You need to catch any command (/ hello or .hello) and that my bot responds to it
-
Contributor
look for FrameScript_RegisterFunction and FrameScript_UnregisterFunction
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void LuaRegisterFunction(string szName, IntPtr pFunc);
private static LuaRegisterFunction RegisterFunctionHandler;
55 8b ec ? ? ? ? ? ? ? 6a ? ff 75 0c ? e8 ? ? ? ? ff 75
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void LuaUnregisterFunction(string szName);
private static LuaUnregisterFunction UnregisterFunctionHandler;
55 8b ec ? ? ? ? ? ? ? 56 e8 ? ? ? ? ff 75 08 56 e8
x86
-
Post Thanks / Like - 1 Thanks
shadowKD (1 members gave Thanks to Wildbreath for this useful post)
-
Contributor
[WoW][4.3.4.15595] Info Dump Thread
Alternatively, you can detour CSimpleEditBox::SetText - 0011A370 or listen for a net message SMSG_MESSAGECHAT.
Last edited by tutrakan; 08-02-2017 at 04:37 PM.
-
Post Thanks / Like - 1 Thanks
shadowKD (1 members gave Thanks to tutrakan for this useful post)
-
Originally Posted by
tutrakan
CSimpleEditBox::SetText will capture input from any text field, and capturing incoming chat packets means you've actually sent the text in chat. Why do either of these when you can just hook SendChatMessage?
-
Post Thanks / Like - 2 Thanks
-
Member
Originally Posted by
Jadd
CSimpleEditBox::SetText will capture input from any text field, and capturing incoming chat packets means you've actually sent the text in chat. Why do either of these when you can just hook SendChatMessage?
Is it possible to catch the team in a chat? I thought only to send
I need to get the team from the game, and not send))
-
Contributor
Originally Posted by
Jadd
CSimpleEditBox::SetText will capture input from any text field, and capturing incoming chat packets means you've actually sent the text in chat. Why do either of these when you can just hook SendChatMessage?
Good point. I found this way long time ago when i was total noob in ME by scanning the chat line with Cheat Engine and finding out what writes to it.
Edit: CSimpleEditBox::SetText does the job just fine.
Last edited by tutrakan; 08-04-2017 at 10:43 PM.
-
Member
Can you provide some sample code or template? I searched the entire forum and a few github projects, either I'm such a curve, or they do not exist))
-
Contributor
Originally Posted by
shadowKD
... sample code or template? ...
For what?
This post of yours is contradictory:
Originally Posted by
shadowKD
Is it possible to catch the team in a chat? I thought only to send
I need to get the team from the game, and not send))
Last edited by tutrakan; 08-05-2017 at 02:11 PM.
-
Member
I need a sample code to create my own command that will be processed by my bot