-
Автор темы
- #1
Python:
#мой ентити класс
class DotaEntity(object):
def __init__(self, ent_addr) -> None:
self.addr = ent_addr
@property
def name(self):
_name = "unknown"
try:
_name = dota.read_string(ui(ui(ui(self.addr) + 0x10) + 0x18))
except pymem.exception.MemoryReadError:
try:
_name = dota.read_string(ui(ui(ui(self.addr) + 0x10) + 0x20))
except pymem.exception.MemoryReadError:
pass
return _name
@property
def health(self):
_health = None
try:
_health = dota.read_int(ui(self.addr) + 0x32C)
except pymem.exception.MemoryReadError:
pass
return _health
@property
def owner(self):
_owner = None
try:
_owner = dota.read_int(ui(self.addr) + 1096)
except pymem.exception.MemoryReadError:
pass
#code
return _owner
@property
def inVision(self):
_value = None
try:
_value = dota.read_int(ui(self.addr) + 3572)
if _value == 22:
return False
elif _value == 30:
return True
except pymem.exception.MemoryReadError:
pass
return _value
@property
def isIllusion(self):
_value = None
try:
_value = dota.read_int(ui(self.addr) + 0x17E4)
if _value < 0:
_value = False
else:
_value = True
except pymem.exception.MemoryReadError:
pass
return _value
@property
def color(self):
_lenght = 1
return int_from_bytes(dota.read_bytes(ui(self.addr) + 0x594 + 0, _lenght)), \
int_from_bytes(dota.read_bytes(ui(self.addr) + 0x594 + 1, _lenght)), \
int_from_bytes(dota.read_bytes(ui(self.addr) + 0x594 + 2, _lenght)), \
int_from_bytes(dota.read_bytes(ui(self.addr) + 0x594 + 3, _lenght))
def setColor(self, r, g, b, a):
dota.write_bytes(ui(self.addr) + 0x594 + 0, int_to_bytes(r), 1)
dota.write_bytes(ui(self.addr) + 0x594 + 1, int_to_bytes(g), 1)
dota.write_bytes(ui(self.addr) + 0x594 + 2, int_to_bytes(b), 1)
dota.write_bytes(ui(self.addr) + 0x594 + 3, int_to_bytes(a), 1)
#__main__
for ent in entList:
entity = DotaEntity(ent)
if "npc_dota_hero_" in entity.name:
print(entity.name)
if entity.isIllusion:
entity.setColor(0, 0, 0 , 255)
это до выполнение моей перекраски
это после
мне нужно чтобы сама моделька черной стала