|
Wspaedt1977 Beginner
Joined: 13 Feb 2022 Posts: 13
|
Posted: Mon Feb 14, 2022 12:06 am
Help this poor idiot out. |
If you want to give someone my location when they ask for it say in Communication Channel, I believe I'm on the right track but just missing a step.
[Channel:] Person name: Locates
So trigger pattern would be: (%w) Locates
In the command box for CmuD i put: channel I am standing here at: @room and @roomdirs
I have setup in variables: @room and @roomdirs
but not sure how to capture the data for the @room and @roomdirs variables.
FYI this is what a room looks like: Circular Courtyard [e]. |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Mon Feb 14, 2022 5:10 am |
This should "work" but someone with a higher paygrade may have a better option...
#TR {^&{room} ~[&{roomdirs}~]$} {} |
|
|
|
Wspaedt1977 Beginner
Joined: 13 Feb 2022 Posts: 13
|
Posted: Mon Feb 14, 2022 11:58 pm |
I couldn't get it to work.
Basically what I trying to do is capture the room I standing in and the exit there.
And be able to tell them where I'm located
I'm willing to start from beginning if I can get it to work. |
|
|
|
mikeC130 Apprentice
Joined: 03 Jul 2006 Posts: 110
|
Posted: Tue Feb 15, 2022 3:49 pm |
If CMUD is mapping for you, the variables you are looking for are already available. In particular, the %roomname() variable will return the name of your current room, and %roomexit() should return the list of exits.
|
|
|
|
Wspaedt1977 Beginner
Joined: 13 Feb 2022 Posts: 13
|
Posted: Tue Feb 15, 2022 4:59 pm |
No no using the mapper at all. Maybe that is the problem...
If not using the mapper how does one grab the info.
Thanks |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Wed Feb 16, 2022 6:24 am |
You would have to ALIAS your mud 'look' command.
Then apply triggers against the room info. Something like...
#ALIAS clook {
#T+ clook_trig
}
#TR clook_trig {(room name pattern)} {
$roomname=%trim(%1)
#SEND shout 'I am in room $roomname'
#T- clook_trig
} |
|
|
|
chris123zugg Apprentice
Joined: 23 Aug 2013 Posts: 175
|
Posted: Tue Mar 15, 2022 6:54 pm |
(%w) Locates <--- someone asking for location?
so it would be #TR {$(%w)%sLocates} {channel I am standing here at: @room and @roomdirs}
to capture room location:
look or whatever command shows the room information then...
#TR {(*)%s~[(%w)~].} {room=%1;roomdirs=%2}
this will capture the room info to those variables and then your "someone saying locates on "channel" line will send that info from the room capture trigger |
|
|
|
Wspaedt1977 Beginner
Joined: 13 Feb 2022 Posts: 13
|
Posted: Sat Apr 02, 2022 12:46 am |
Chris123zugg,,, That worked great!
|
|
|
|
|
|