xabbo-scripts/Scripts/testmaze.csx
Administrator 7a548130a3 Move all scripts into Scripts/ subfolder
Keeps the repo root clean - only README.md visible on landing page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 09:49:37 +01:00

70 lines
1.6 KiB
C#

/// @group Bots
public class TrackedFurni
{
public Tile Location { get; set; }
public Point XY => Location.XY;
public int X => Location.X;
public int Y => Location.Y;
public float Z => Location.Z;
public int Direction { get; set; }
}
public class TileAction
{
private readonly Action MainAction;
public TileAction(Action mainAction) => MainAction = mainAction;
public void Execute() => MainAction();
}
Dictionary<Point, TileAction> RoomActions = new()
{
{(3,18),new(()=>Move(5,18))},{(5,18),new(()=>Move(6,17))},{(6,17),new(()=>{if(FloorItems.FirstOrDefault(i=>i.Id==9681828)?.Location.XY==(11,18))UseGate(706421113);else Move(5,18);})},
{(10,18),new(()=>{UseFloorItem(2147418273);Delay(250);UseFloorItem(2147418274);})},
{ (9, 9), new (() => Move(10, 8)) },
{ (10, 11), new (() => {
Delay(500);
Move(12, 13);
}) },
{ (7, 21), new (() => Move(7, 20)) },
{ (11, 12), new (() => Move(12, 13)) },
{ (9, 15), new (() => Move(8, 16)) },
{ (8, 16), new (() => Move(7, 20)) },
{ (7, 20), new (() => Move(6, 16)) },
{ (6, 16), new (() => Move(7, 15)) },
{ (7, 15), new (() => UseFloorItem(754376865)) },
{ (7, 13), new (() => Move(9, 11)) },
{ (9, 11), new (() => Move(12, 12)) },
{ (13, 12), new (() => Move(14, 8)) },
{ (14, 8), new (() => UseFloorItem(831488628)) }
};
public Point RealPos => (Self.CurrentUpdate.MovingTo ?? Self.Location).XY;
bool Done = false;
while (Run && !Done)
{
try
{
if (RoomActions.TryGetValue(RealPos, out var result))
{
result.Execute();
}
}
catch { }
Delay(100);
}
Log("Done");