Packet 0xC1
Posted: Tue Mar 07, 2006 10:19 pm
Send Speech [0x1C]
Now heres my script( its not working its too long )
Here's pol output
Here's my code
Any help is appreciated. 
Code: Select all
Send Speech (Variable # of bytes)
BYTE cmd
BYTE[2] blockSize
BYTE[4] itemID (FF FF FF FF = system)
BYTE[2] model (item hex # - FF FF = system)
BYTE Type
BYTE[2] Text Color
BYTE[2] Font
BYTE[30] Name
BYTE[?] Null-Terminated Message (? = blockSize - 44)
Here's pol output
Code: Select all
Unexpected message type e0, 3 bytes (IP:127.0.0.1, Account:admin)
0000: e0 86 2c ..,..... ........
Client#2: Too-long message length of 27360
Code: Select all
Use uo;
use os;
use polsys;
use cfgfile;
program SingleClickHook()
Print("Hooking Single Click 0x09");
return 1;
endprogram
const SPEECH_PKT := 0x1c;
const TYPE_TEXT := 0;
const TEXT_FONT := 3;
const TEXT_COLOR := 910;
Exported Function SendSpeechPacket( character, byref packet )
var objserial := packet.GetInt32(1);
var mobserial := SystemFindObjectBySerial(character);
objserial := SystemFindObjectBySerial(objserial);
if(!objserial.IsA(POLCLASS_ITEM))
return;
endif
var outpkt := CreatePacket(SPEECH_PKT, MSGLEN_VARIABLE);
outpkt.SetInt16(1, outpkt.GetSize()); // set the size of the packet
outpkt.SetInt32(3, objserial); // set the serial of the item
outpkt.SetInt16(7, objserial.objtype); // set the model of the item
outpkt.SetInt8(9, TYPE_TEXT); // set the type of text
outpkt.SetInt16(10, TEXT_COLOR); // set the text color
outpkt.SetInt16(12, TEXT_FONT); // set the text font
outpkt.SetString(14, objserial.name, 1); // set the item name
outpkt.SendPacket(character);
EndFunction