Sub MassMove() ; Maximalni vzdalenost od pozice kam se presunul prvni item v batohu ; [ > 0 - vzdalenost ; [ <= 0 - zakazat ; [ base 10 var bagDistance = 10; ; Maximalni vzdalenost od pozice kam se presunul prvni item na zemi ; [ > 0 - vzdalenost ; [ <= 0 - zakazat ; [ base 0 ; [ recommended 0 var groundDistance = 0; var target = GetObject("Co chces presunout?"); if (UO.IsNPC(target) == 1) then UO.Print("Musis zamerit vec.."); return 0; endif var graphic = UO.GetGraphic(target); var color = UO.GetColor(target); var srcX = UO.GetX(target); var srcY = UO.GetY(target); var srcZ = UO.GetZ(target); var sourceContainer = UO.ContainerOf(target); if (sourceContainer == "0xFFFFFFFF") then sourceContainer = "ground"; endif UO.Print("Presun oznacenou vec na nove umisteni"); WaitForItemMove(-1, target); var destContainer = UO.ContainerOf(target); var destX = UO.GetX(target); var destY = UO.GetY(target); var destZ = UO.GetZ(target); var distance = bagDistance; if (destContainer == "0xFFFFFFFF") then destContainer = "ground"; distance = groundDistance; endif if (sourceContainer == "ground") then UO.Set("finddistance", 15); endif UO.FindType(graphic, color, sourceContainer); var itemsTotal = UO.FindCount(); var xModifier = 0; var yModifier = 0; while (UO.FindCount() > 0) UO.Print("Zbyva presunout " + Str(UO.FindCount()) + "/" + Str(itemsTotal) + "veci."); if (distance > 0) then xModifier = Random(-distance, distance); yModifier = Random(-distance, distance); endif if (sourceContainer <> "ground" || (srcX == UO.GetX("finditem") && srcY == UO.GetY("finditem") && srcZ == UO.GetZ("finditem"))) then UO.MoveItem("finditem", -1, destContainer, destX + xModifier, destY + yModifier, destZ); endif WaitForItemMove(2, "finditem"); Wait(500); if (sourceContainer == destContainer || sourceContainer == "ground") then UO.Ignore(UO.GetSerial("finditem")); endif UO.FindType(graphic, color, sourceContainer); wend UO.IgnoreReset(); UO.Print("Veci presunuty."); end sub Sub Random(min, max) Wait(50); return UO.Random(max - min) + min; end sub Sub WaitForItemMove(timeOut, serial) if (timeOut > 0) then timeOut = timeOut / 100 + UO.Timer(); endif var ox = UO.GetX(serial); var oy = UO.GetY(serial); var container = UO.ContainerOf(serial); while (timeOut > UO.Timer() || timeOut <= 0) if ((UO.GetX(serial) <> ox || UO.GetY(serial) <> oy || UO.ContainerOf(serial) <> container) && not (UO.GetX(serial) == 0 && UO.GetY(serial) == 0)) then return 1; endif Wait(100); wend return 0; end sub Sub GetObject(message) AddObject("temp", message); return UO.GetSerial("temp"); end sub Sub AddObject(object, message) UO.Print(message); UO.Set("quiet", 1); UO.AddObject(object); while UO.Targeting() Wait(100); wend UO.Set("quiet", 0); return UO.GetSerial(object); end sub