Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GetMobiles

Returns data for all known mobiles as an array of TMobileData records.

Возвращает данные всех известных мобайлов в виде массива записей TMobileData.

DWS

function GetMobiles: TArray<TMobileData>;

Pascal Script

function GetMobiles: TMobileDataArray;

Type definitions:

TMobileData = packed record
  serial: Cardinal;
  graphic: Word;
  color: Word;
  x: Word;
  y: Word;
  z: ShortInt;
  direction: Byte;
  world: Byte;
  flags: Byte;
  notoriety: Byte;
  hp: Integer;
  hp_max: Integer;
  sp: Integer;      // stamina
  sp_max: Integer;
  mp: Integer;      // mana
  mp_max: Integer;
end;

TMobileDataArray = TArray<TMobileData>;

Python

def GetMobiles() -> list[MobileData]: ...

Pascal Example

var
  Mobs: TArray<TMobileData>;
  i: Integer;
begin
  Mobs := GetMobiles;
  AddToSystemJournal('Known mobiles: ' + IntToStr(Length(Mobs)));
  for i := 0 to Length(Mobs) - 1 do
    AddToSystemJournal('$' + IntToHex(Mobs[i].serial, 8) + ' at (' +
      IntToStr(Mobs[i].x) + ', ' + IntToStr(Mobs[i].y) + ')');
end.

Python Example

mobs = GetMobiles()
AddToSystemJournal(f'Known mobiles: {len(mobs)}')
for mob in mobs:
    AddToSystemJournal(f'${mob.serial:08X} at ({mob.x}, {mob.y})')

See Also

GetMobile, GetWorldItems