def on_packet(self, packet): if isinstance(packet, p.AsciiMessage): if packet.type == 0 and packet.serial != 0 and packet.serial != self._client.world.player.serial and \ packet.serial != 0xffffffff and \ len(packet.name) > 0 and packet.text != packet.name and packet.text[0] != '[': self._client.send(p.TalkAscii(type=packet.type, hue=packet.hue, font=packet.font, text=packet.text)) elif isinstance(packet, p.UnicodeMessage): if packet.type == 0 and packet.serial != 0 and packet.serial != self._client.world.player.serial and \ packet.serial != 0xffffffff and \ packet.language != 'Eng' and \ packet.text != '(bonded)' and \ packet.text != '(tame)' and \ packet.text != '(summoned)' and \ packet.text[0] != '*' and \ len(packet.name) > 0 and packet.text != packet.name and packet.text[0] != '[': self._client.send(p.TalkUnicode(text=packet.text, type=0x09, hue=packet.hue, font=packet.font))
def __init__(self, client, container): Engine.__init__(self, client) self._serial = container.serial self._open = False if container.is_bank(client.world.player): self._client.send(p.TalkUnicode(text='Bank!', keyword=0x02)) else: if not self._client.world.is_empty(container): # we know its contents, it seems already open self._success() return client.send(p.Use(self._serial)) self.call_id = reactor.callLater(3, self._timeout)
def call_guards(self): log.msg("Calling guards") self._client.send(p.TalkUnicode(text='.', keyword=0x07))
def get_offer(self): self._client.send(p.TalkUnicode("vendor buy", 0x3c))
def eject_mobile(self, packet): self.target = Target(packet.serial, packet.x, packet.y, packet.z, packet.body) self._client.send(p.TalkUnicode("remove thyself", 0x33))
def __init__(self, client): Engine.__init__(self, client) self._client.send(p.TalkUnicode(text='Bank!', keyword=0x02)) self.call_id = reactor.callLater(2, self._timeout)