Hello,
I've been using MUSH for a bit and so far I enjoy it. I'm not a coder, I just love playing text-games.
I've tried to deal with this myself for quite a while now. The first problem I've almost managed to solve, but something is missing. The second one I have no idea how to even start and hope for some input and help.
1st problem:
Every room in the MUD I play, Imperian, has a number. You can view it by hitting ROOMNUM and then you get a display that looks like this:
Quote: Room #13092 - 'Looking out over Imperial Stavenn.'
I am trying to capture that text to a variable and then send that to a certain channel. I.E
Quote: (Citytells): You say, "I am at Room #13092 - 'Looking out over Imperial Stavenn.'"
The " lines (inluding .") in the above quote is automatically insterted by the MUD
I'm using this, with some result:
Quote:
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="Room*"
send_to="9"
sequence="90"
variable="Roomnum"
>
<send>%1</send>
</trigger>
</triggers>
And then:
<aliases>
<alias
match="roomroom"
enabled="y"
expand_variables="y"
send_to="12"
sequence="100"
>
<send>world.execute ("roomnum");
world.setvariable ("Roomnum", "%1");
world.getvariable ("Roomnum");
world.doafter (1, "msg randomdude I'm at @Roomnum");</send>
</alias>
</aliases>
I used the 'getvariable' there because I've been trying to make it send the room I am in currently, instead of the last stored variable. I can capture the room in variable, but it is always the last room I checked, instead of the trigger capturing the text I get when moving a room and then running the alias. From what I understand, the script when run is sendind ghr last stored variable instead of waiting until I get a new one, but I don't know how I would write it up to make it update quick enough for me to be able to simply 'go east, check roomnum and make the trigger send that roomnum to 'randomperson''.
The 'doafter' I put in becuase I was hoping another second after getting the roomnum and hopefully storing that in the variable would send the actual room, not the room I last looked ROOMNUM in.
Problem two (maybe I should make a new post for this, since it seems more complicated, but I'll give it a go.
I have NO idea how to make this work, but basically I want to omit some text, send some text UNLESS I have that text 'saved' or 'stored' somewhere to not send it. The message from the MUD is:
Quote:
You bid your ouroboros to seek out life presences nearby.
Salish is at Skirting the Areish Mountains, at 425 health and 528 mana.
Septus is at Approaching wet plains, at 543 health and 538 mana.
Randomdude is at Approaching wet plains, at 543 health and 538 mana.
Masked man is at Approaching wet plains, at 543 health and 538 mana.
Masked woman is at Approaching wet plains, at 543 health and 538 mana.
Eathi is at Approaching wet plains, at 543 health and 538 mana.
Note, that the quotes tag put everyting on the same line here. In Imperian, after 80 characters there is a newline (perhaps not important when omitting, but I thought it would be important to mention).
What I want that to do is to just send who is in the area, while omitting some names I chose myself. With the example above, I'd like this to be sent to a channel:
clantell Septus, Randomdude, Masked man, Masked woman, Eathi is in the area.
I've omitted the name Salish and everything after the other persons names.
If someone could point me in the right direction for the 2nd issue, I'd be very glad.
Thank you for reading and hopefully replying.
|