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

Dist

Returns distance between two point (X1,Y1 to X2,Y2) in tiles.

If char not connected or UO files not loaded - returns 0.

Pascal

function Dist(X1 : Word;Y1 : Word;X2 : Word;Y2 : Word) : Word;

Python

def Dist(x1, y1, x2, y2) -> word

Example Pascal

if (Dist(GetX(Self), GetY(Self), GetX(creatureID), GetY(creatureID)) > 3 then
  AddToSystemJournal(GetName(creatureID) + 'too far');