How do I match with a trigger the exits on my mud?
I want to capture the exit so I can use it as a wild card in a trigger or a variable.
I always see a line like the ones below.
Directions, south west northeast southeast
Directions, north south down east west
Directions, north south up
Directions, south up north
Directions, southwest west northwest in up
Directions are always a compass direction never a room name.
They always have two spaces after them, even the last one.
One problem is the mud does not list the directions in the same order even in rooms with similar directions.
Another is they can even spread across two lines if there are many directions.
I think the trigger would have to start like:
^Directions, (.*?)$
:)
But how do I set it so that there is a wildcard for every possible exit? Some rooms have 1 and others can have up to 10.
I just want a random auto walk trigger that doesn't send invalid directions to the mud.
Sort of like
randomize
social = Int( (n= number of directions*rnd)
if social=0 then
World.Send "%1"
elseif social=1 then
World.Send "%2"
elseif social=2 then
World.Send "%3"
etc
end if
I think would work
or using variables tho that would be more complicated and pointless I'd imagine?
randomize
social = Int(3*rnd)
if social=0 then
World.Send "getvariable("direction1")
elseif social=1 then
World.Send "getvariable("direction2")
elseif social=2 then
World.Send "getvariable("direction3")"
etc
end if
It's the matching trigger I have trouble with.
I want to capture the exit so I can use it as a wild card in a trigger or a variable.
I always see a line like the ones below.
Directions, south west northeast southeast
Directions, north south down east west
Directions, north south up
Directions, south up north
Directions, southwest west northwest in up
Directions are always a compass direction never a room name.
They always have two spaces after them, even the last one.
One problem is the mud does not list the directions in the same order even in rooms with similar directions.
Another is they can even spread across two lines if there are many directions.
I think the trigger would have to start like:
^Directions, (.*?)$
:)
But how do I set it so that there is a wildcard for every possible exit? Some rooms have 1 and others can have up to 10.
I just want a random auto walk trigger that doesn't send invalid directions to the mud.
Sort of like
randomize
social = Int( (n= number of directions*rnd)
if social=0 then
World.Send "%1"
elseif social=1 then
World.Send "%2"
elseif social=2 then
World.Send "%3"
etc
end if
I think would work
or using variables tho that would be more complicated and pointless I'd imagine?
randomize
social = Int(3*rnd)
if social=0 then
World.Send "getvariable("direction1")
elseif social=1 then
World.Send "getvariable("direction2")
elseif social=2 then
World.Send "getvariable("direction3")"
etc
end if
It's the matching trigger I have trouble with.