-
Notifications
You must be signed in to change notification settings - Fork 15
/
travelstone.csx
35 lines (30 loc) · 1007 Bytes
/
travelstone.csx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#load "Specs.csx"
#load "common.csx"
using Infusion.Commands;
public static class TravelStone
{
// doesn't support destinations on the second page yet
public static void TravelTo(string destination)
{
var travelStone = UO.Items.OnGround().MaxDistance(4).Matching(Specs.TravelStone).FirstOrDefault();
if (travelStone != null)
{
UO.Use(travelStone);
UO.WaitForGump();
UO.LastGumpInfo();
UO.SelectGumpButton(destination, Infusion.Gumps.GumpLabelPosition.Before);
}
else
{
UO.Console.Error("Cannot find travelstone.");
}
}
public static void TravelToCommand(string parameters)
{
if (string.IsNullOrEmpty(parameters))
throw new CommandInvocationException("Destination name not specified.");
TravelTo(parameters);
Common.WaitForChangedLocation();
}
}
UO.RegisterCommand("travelto", TravelStone.TravelToCommand);