Alright, it's pretty long though. It's probably longer than it needs to be even. Here it is -
Sub Compass(Name, Line, Wildcards)
dim n, ne, e, se, s, sw, w, nw, u, d, i, o, exits
exits = Wildcards(1)
dim tExits(12)
tExits(1) = "north"
tExits(2) = "northeast"
tExits(3) = "east"
tExits(4) = "southeast"
tExits(5) = "south"
tExits(6) = "southwest"
tExits(7) = "west"
tExits(8) = "northwest"
tExits(9) = "up"
tExits(10) = "down"
tExits(11) = "in"
tExits(12) = "out"
dim a
for a = 1 to 12
if instr(exits, tExits(a)) > 0 then
select case a
case 1
n = 1
case 2
ne = 1
case 3
e = 1
case 4
se = 1
case 5
s = 1
case 6
sw = 1
case 7
w = 1
case 8
nw = 1
case 9
u = 1
case 10
d = 1
case 11
i = 1
case 12
o = 1
end select
else
select case a
case 1
n = 0
case 2
ne = 0
case 3
e = 0
case 4
se = 0
case 5
s = 0
case 6
sw = 0
case 7
w = 0
case 8
nw = 0
case 9
u = 0
case 10
d = 0
case 11
i = 0
case 12
o = 0
end select
end if
next
world.replaceNotepad "Compass", ""
if o = 1 and i = 1 then
world.appendToNotepad "Compass", "Out In " & vbcrlf
elseif o = 1 and i = 0 then
world.appendToNotepad "Compass", "Out " & vbcrlf
elseif o = 0 and i = 1 then
world.appendToNotepad "Compass", " In " & vbcrlf
else
world.appendToNotepad "Compass", vbcrlf
end if
if n = 1 then
world.appendToNotepad "Compass", " N " & vbcrlf
end if
if ne = 1 and nw = 1 then
world.appendToNotepad "Compass", "NW | NE " & vbcrlf
elseif ne = 1 and nw = 0 then
world.appendToNotepad "Compass", " | NE " & vbcrlf
elseif ne = 0 and nw = 1 then
world.appendToNotepad "Compass", "NW | " & vbcrlf
else
world.appendToNotepad "Compass", " | " & vbcrlf
end if
if u = 1 then
world.appendToNotepad "Compass", " \|/ up " & vbcrlf
else
world.appendToNotepad "Compass", " \|/ " & vbcrlf
end if
if w = 1 and e = 1 then
world.appendToNotepad "Compass", "W--X--E " & vbcrlf
elseif w = 1 and e = 0 then
world.appendToNotepad "Compass", "W--X-- " & vbcrlf
elseif w = 0 and e = 1 then
world.appendToNotepad "Compass", " --X--E " & vbcrlf
else
world.appendToNotepad "Compass", " --X-- " & vbcrlf
end if
if d = 1 then
world.appendToNotepad "Compass", " /|\ down" & vbcrlf
else
world.appendToNotepad "Compass", " /|\ " & vbcrlf
end if
if sw = 1 and se = 1 then
world.appendToNotepad "Compass", "SW | SE " & vbcrlf
elseif sw = 1 and se = 0 then
world.appendToNotepad "Compass", "SW | " & vbcrlf
else
world.appendToNotepad "Compass", " | " & vbcrlf
end if
if s = 1 then
world.appendToNotepad "Compass", " S " & vbcrlf
end if
MoveNotepadWindow "Compass", 758,0,262,401
End Sub
This is the trigger that calls the script -
<triggers>
<trigger
enabled="y"
match="^You see exits leading (.*?)$"
regexp="y"
script="Compass"
sequence="100"
>
</trigger>
</triggers>
And here's what you see when you enter a room -
A quiet hallway near the Hall of Inner Peace.
A vigilant monk stands here, alert and watchful for enemies of the city.
You see exits leading north, east, south and west(closed).
H:2380 M:2848 E:99% W:93% B:100% [eb] |