def Rotor(name): wiringConfiguration = WiringFactory.Wiring(name) offset = Offset(wiringConfiguration, "A") ringSetting = Ringsetting(offset, "A") turnover = RotorFactory.turnovers[name] return Rotor(ringSetting, turnover)
from offset import Offset from math import sqrt offset = Offset() def is_unit(obj, process): if process.readuint4(obj + offset.ObjectManager.ObjType) == 3: return True else: return False def is_player(obj, process): if process.readuint4(obj + offset.ObjectManager.ObjType) == 4: return True else: return False def position(unit, process): if is_unit(unit, process): x = process.readfloat(unit + offset.Unit.PosX) y = process.readfloat(unit + offset.Unit.PosY) z = process.readfloat(unit + offset.Unit.PosZ) elif is_player(unit, process): x = process.readfloat(unit + offset.Unit.PosX) y = process.readfloat(unit + offset.Unit.PosY) z = process.readfloat(unit + offset.Unit.PosZ) else: return False