|
Elariel Newbie
Joined: 14 Jun 2002 Posts: 5
|
Posted: Fri Jun 14, 2002 2:37 pm
Distress Call Trigger with Roomname |
I am trying to create a distress call trigger, but I'm not having any luck.
Here's what I would like to do:
If someone attacks me, I get the following message... "Without Warning, Enemy stabs you from behind!"
When I see this message, I would like to automatically send this tell to a friend... "tell Friend Enemy just stabbed me in roomname!" (obviously "Friend" and "Enemy" need to be variables)
On the mud that I play, you can get a brief roomname by typing the command glance. If you type glance in an empty room, you see something like:
[HP:230 EP:230> glance
Rocky Ground(n, e, s and w)
In a room with other people or items in them you would see:
[HP:230 EP:230> glance
Rocky Ground(n, e, s and w)
A Statue
Bob the Assassin (Demonic)
I can get my trigger to work in an empty room, but I can't figure out how to filter out the items and people.
Can anyone help? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jun 14, 2002 4:51 pm |
#TR {^(*)~(%t} {#VAR roomname {%1}}
LightBulb
Senior Member |
|
|
|
Elariel Newbie
Joined: 14 Jun 2002 Posts: 5
|
Posted: Fri Jun 14, 2002 5:06 pm |
That worked great! Thanks!
|
|
|
|
Ulfy Newbie
Joined: 07 Oct 2003 Posts: 7
|
Posted: Thu Jul 06, 2006 4:54 am |
I have a problem regarding the same thing. The trigger works, so as long as nothing else happens between the time you -enter- the room and the time you get attacked, rendering it useless. At least in my case.
Example:
The Plains(e, s, n and w)
[HP:230 EP:230] abc (alias to 'say I am in @roomname')
You say: I am in The Plains
Though if anything happens afterwards, the trigger is changed and does not hold the roomname anymore.
The Plains(e, s, n and w)
Without warning, Someone stabs you from behind!. (Becomes the new @roomname)
[HP:230 EP:230]abc
You say: I am in
Any way to fix this thing? |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Thu Jul 06, 2006 6:07 am |
I can see NO way that this particular trigger:
#TR {^(*)~(%t} {#VAR roomname {%1}}
can change the @roomname variable to:
Without warning, Someone stabs you from behind!.
To rule out another trigger assigning a value to @roomname, try changing the variable name in the trigger and alias.
#VAR thisroomname ""
#TR {^(*)~(%t} {#VAR thisroomname {%1}}
#AL abc {say I am in @thisroomname} |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Jul 06, 2006 9:08 am |
#TR {^(*)~([nesw,]{and|}[nesw]~)$} {#VAR roomname {%1}}
Make the pattern a bit tighter and it shouldn't be able to misfire ever. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Ulfy Newbie
Joined: 07 Oct 2003 Posts: 7
|
Posted: Thu Jul 06, 2006 10:58 pm |
Once again, the triggers work, as long as nothing else happens. Let me give you another actual log:
[HP:230 EP:230] e
A long straight tunnel(e, w and u)
[HP:230 EP:230] abc
You say: I am in A long straight tunnel (Good)
[HP:230 EP:230] abc (I type it again right after)
You say: I am in
The value is lost. How is that? Could it be an issue with the MUD I'm playing? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Jul 06, 2006 11:47 pm |
I just looked at mine again and relized that it should not even match. I forgot spaces in the pattern.
#TR {^(*)~([nesw ,]{and|}[nesw ]~)$} {#VAR roomname {%1}}
Make sure you have only 1 place where the variable is set. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Ulfy Newbie
Joined: 07 Oct 2003 Posts: 7
|
Posted: Fri Jul 07, 2006 12:09 am |
Works great! Thanks to both of you for your time. I can work on several other triggers with the knowledge now.
|
|
|
|
|
|