[Only registered and activated users can see links. Click Here To Register...]
but the numer 9742236 i get, is no item in pw database.Quote:
uint dwItemId // 0x0C ID of an item linked in chat
Well, damn that was surprising. Ctrl + D clears the chat window but also has the side effect of putting focus on the chat entry area. So, since the program on the first page already has a copy of the chat log in memory, we don't care if it gets cleared in elementclient.Quote:
You guys are amazing. Thanks so much for this thread! As far as actually chatting, I know it's a lame way to do it but you can send keystroke messages to the elementclient window directly. I'm playing around with sending WM_KEYDOWN and WM_KEYUP to the window now. I just need to figure out how to put keyboard focus on the chat area. I'll post again if I get it working.
take a look on this autoit function:Quote:
My hope is to leave elementclient minimized and yet be able to send chat messages. If I get that working then I'll post the total project. :)
now your window can be minimized :)Quote:
Global $APP_BASE_ADDRESSFZ=10825500
;repeat this call every second or so...
unFreeze()
; the function...
Func unFreeze()
$FZ = _MemoryRead($APP_BASE_ADDRESSFZ, $PROCESS_INFORMATION)
If $FZ <> 1 Then
_MemoryWrite($APP_BASE_ADDRESSFZ, $PROCESS_INFORMATION, "1")
EndIf
EndFunc
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
public void LocalChatMessage(string message)
{
// Give elementclient focus
SetForegroundWindow(m_hWnd);
// Send the Control-D key sequence to give the chat area focus
SendKeys.SendWait("^d");
// Press backspace a bunch of times to get rid of any whisper names
// or PWI chat identifiers (!@, !~, !!, etc.)
SendKeys.SendWait("{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}{BS}");
// Type the message in local chat
SendKeys.SendWait(message + "\n");
}
more explained here: [Only registered and activated users can see links. Click Here To Register...]Quote:
_SendMessage($HANDLE, 256, KEYCODE("{F1}"))
so just expand the keycode function with all keys and there codes...or grab them from this udf: [Only registered and activated users can see links. Click Here To Register...]Quote:
Func Keycode($key)
If $key == "{F1}" Then
Return 112
endif
EndFunc
sendText(0x774E00, L"I'm talking in normal chat"); sendText(0x774E01, L"I'm talking in world chat"); //requires a teleacoustic sendText(0x774E02, L"I'm talking in party chat"); sendText(0x774E07, L"I'm talking in trade chat");
class RealBase
{
public:
Base* base; //0x0000 base
};//Size=0x0004(4)
class Base
{
public:
char unknown0[28]; //0x0000
Structures* structures; //0x001C
void* packetPtr;//0x0020
char unknown32[592];
HWND hWnd; //0x0274
char unknown632[12]; //0x0278
char serverAddress[100]; //0x0284
char unknown744[160]; //0x02E8
char serverName[100]; //0x0388
char unknown1004[176]; //0x03EC
float FPS; //0x049C
char unknown1184[96]; //0x04A0
};//Size=0x0500(1280)
static RealBase* realBase = (RealBase*)0xA521C0;
typedef char (__fastcall* __sendTextPacket)(void* pThis, int extra, int msgType, wchar_t* text, int int3, int int4);
static __sendTextPacket sendTextPacket = (__sendPacketFunction)0x63ab50;
static char sendText(int msgType, wchar_t* text)
{
return sendTextPacket(realBase->base->packetPtr, 0, msgType, text, -1, -1);
}
public static uint baseCall = 0xA521C0; // v624 public static uint playerBase = 0; // Calculated later public static uint nameOffset = 0x664; // v624 public static uint chatObjectsBase = 0xA57A98; // v624 public static uint lastChatObject = 0xA57AA4; // v624 public static uint sendChatCall = 0x00540630; // v624 sendChat function address
private int sendChatOpcodeAddress;
private byte[] sendChatOpcode = new byte[]
{
0x60, // PUSHAD
0xB8, 0x9C, 0x47, 0x95, 0x00, // MOV EAX,ElementC.0095479C ; ASCII "speak"
0x50, // PUSH EAX
0xBB, 0x01, 0x01, 0x00, 0x00, // MOV EBX, 101
0xBE, 0x00, 0x00, 0x00, 0x00, // MOV ESI,chatSystemClassPtr ; [[[[[[baseCall]+1C]+18]+8]+C4]+20]
0x8B, 0x16, // MOV EDX,DWORD PTR DS:[ESI]
0x8B, 0xCE, // MOV ECX,ESI
0xE8, 0x00, 0x00, 0x00, 0x00, // CALL sendChat()
0x61, // POPAD
0xC3 // RETN
};