I found the packets and their ids but dont really know how to access the important information.. Just by storing 'packet.key' into a variable if its a reconnect packet?
2nd problem: Im trying to write a chat notifier with spam filter but i cant get this code to work
Code:
function displayRealmRelayNotification(event, playerObjectId, color, text) {
var notificationPacket = event.createPacket(ID_NOTIFICATION);
notificationPacket.objectId = playerObjectId;
notificationPacket.message = "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + text + "\"}}";
notificationPacke*****lor = color;
event.sendToClient(notificationPacket);
}
function onServerPacket(event) {
var packet = event.getPacket();
switch (packet.id()) {
case ID_TEXT: {
var text = packet.text;
var boss = this
if(text.IndexOf('lab') != -1) || (text.IndexOf('mad') != -1){
player_id = packet.objectId;
var toPrint = "Lab Callers:\\n";
toPrint += player_id
boss.displayRealmRelayNotification(event, player_id, 0xFF7700, toPrint);
}
}
}
}