Skip to content

FR API UO PMove

Codex edited this page Oct 17, 2026 · 3 revisions

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

UO.PMove

void UO.PMove(object? targetX, object? targetY);
void UO.PMove(object? x, object? y, object? z);

PMove attend la recherche du chemin et la fin du déplacement. XY exige les coordonnées exactes ; XYZ exige aussi la hauteur indiquée. Retour void : comparez les coordonnées réelles. NewMoveXY ou MoveXYZ renvoient un résultat numérique. Aucun délai implicite de 30 secondes.

UO.LimitMove

Exemples

int destinationX = UO.GetX() + 1;
int destinationY = UO.GetY();
UO.PMove(destinationX, destinationY);
bool arrived = UO.GetX() == destinationX && UO.GetY() == destinationY;
UO.Print(arrived.ToString());
int savedLimit = UO.LimitMove();
try
{
    UO.LimitMove(0);
    UO.PMove(5000, 1500, 0);
    UO.Print($"{UO.GetX()}, {UO.GetY()}, {UO.GetZ()}");
}
finally
{
    UO.LimitMove(savedLimit);
}

InjectionRuntimeState.LimitMove → InjectionApiUO.MoveToCanonical / BuildPortablePath → ClassicUOInjectionApiBridge.MoveTo → Pathfinder.WalkTo. NativeFollowController / WorldMapController → Pathfinder.WalkTo.

bool arrived = WalkTo(UO.GetX() + 1, UO.GetY());
UO.Print(arrived.ToString());

bool WalkTo(int destinationX, int destinationY)
{
    UO.PMove(destinationX, destinationY);
    return UO.GetX() == destinationX && UO.GetY() == destinationY;
}
var walker = new CoordinateWalker(UO);
bool arrived = walker.Walk(UO.GetX() + 1, UO.GetY(), UO.GetZ());
UO.Print(arrived.ToString());

class CoordinateWalker(ClassicUO.CSharp.CSharpGameApi api)
{
    public bool Walk(int x, int y, int z)
    {
        api.PMove(x, y, z);
        return api.GetX() == x && api.GetY() == y && api.GetZ() == z;
    }
}

Clone this wiki locally