try this out for send chat
Code:
Func SendChat($aMessage, $aChannel = '!')
Local $lMessage
Local $lAddress = 256 * $mQueueCounter + $mQueueBase
If $mQueueCounter = $mQueueSize Then
$mQueueCounter = 0
Else
$mQueueCounter = $mQueueCounter + 1
EndIf
If StringLen($aMessage) > 120 Then
$lMessage = StringLeft($aMessage, 120)
Else
$lMessage = $aMessage
EndIf
MemoryWrite($lAddress + 12, $aChannel & $lMessage, 'wchar[122]');MemoryWrite($lAddress + 8, $aChannel & $lMessage, 'wchar[122]')
DllCall($mKernelHandle, 'int', 'WriteProcessMemory', 'int', $mGWProcHandle, 'int', $lAddress, 'ptr', $mSendChatPtr, 'int', 8, 'int', '')
If StringLen($aMessage) > 120 Then SendChat(StringTrimLeft($aMessage, 120), $aChannel)
Quote:
Originally Posted by Surimata
I updated headers for a/me vaettir bot too, but still struggeling with two functions.
1. TargetNearestEnemy()
Code:
Func TargetNearestEnemy()
Return PerformAction(0x93, 0x18)
EndFunc ;==>TargetNearestEnemy
2. SendChat()
Code:
Func SendChat($aMessage, $aChannel = '!')
Local $lMessage
Local $lAddress = 256 * $mQueueCounter + $mQueueBase
If $mQueueCounter = $mQueueSize Then
$mQueueCounter = 0
Else
$mQueueCounter = $mQueueCounter + 1
EndIf
If StringLen($aMessage) > 120 Then
$lMessage = StringLeft($aMessage, 120)
Else
$lMessage = $aMessage
EndIf
MemoryWrite($lAddress + 8, $aChannel & $lMessage, 'wchar[122]')
DllCall($mKernelHandle, 'int', 'WriteProcessMemory', 'int', $mGWProcHandle, 'int', $lAddress, 'ptr', $mSendChatPtr, 'int', 8, 'int', '')
If StringLen($aMessage) > 120 Then SendChat(StringTrimLeft($aMessage, 120), $aChannel)
EndFunc ;==>SendChat
The first letter of the text is not displayed.
I really don't know how to fix that :confused:
But i think if this would be fixed, the vaettir bot would run again.
|