Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Fri Nov 28, 2003 3:09 am   

capturing data to send to other players
 
Ok I'm trying to figure out how to capture these lines of data so i can send it to the people who ask me.

HP:230 EP:230> find player
Player is in Thranduil's Kingdom at The Thranduil Bar.
In the room: Thranduil bar.
Player is not wanted.


Sometimes there is an extra line if they are in the wilderness telling what direction they are, but that can be ignored.

I'd like to send back the data in this form

"Person Player is in Thranduil's Kingdom at The Thranduil Bar. Room: Thranduil bar

Thanks for the help on this.
Yamabushi
Reply with quote
Aldur
Beginner


Joined: 16 Sep 2003
Posts: 16
Location: Sweden

PostPosted: Fri Nov 28, 2003 7:09 am   
 
^(%w) is in (*).$In the room: (*).

say Person %1 is in %2. Room: %3.

or something like that.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Nov 28, 2003 7:12 pm   
 
#TR {^(%w is in *.)}
#COND {(In the room: (*))} {*Person %t1 Room: %t2} {Within|Param=3}

The room name appears to be redundant. In your example, both lines say that "Player" is at "The Thranduil Bar". You might reconsider whether the second line is really necessary.
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Wed Dec 03, 2003 7:06 am   
 
Sometimes it is redunant, but other times you need it to tell where in the city they are at, because the building has more than one room.

I'd like to capture the location after the name of the person I find, and after Room Name should be easy to get. But I need to get both :(
Reply with quote
Guede
Wanderer


Joined: 30 Nov 2003
Posts: 65
Location: United Kingdom

PostPosted: Wed Dec 03, 2003 9:27 pm   
 
Hi,

Haven't tested this as I don't have a wizzy to check it with! (well not a decent one anyway) but I think what you want to do is have your trigger pattern something along the lines of:

^(%w) is in (*) at (*)$^In the room:%s(*)$

You probably want an alias set up too so you can do something like tfind <player to tell> <player to find> that sticks the name of the player to tell into a variable and then runs the find on the player you want to find, e.g.

#ALIAS tfind {#VAR player_to_tell %1;~find %2}

The trigger should then fire on the find result and in the value you would have something like (feel free to use shorter variable names, I just use long ones so you know what they are doing - well what i hope they're doing)

~tell %proper(@player_to_tell) %1 is in %2 at %3 - In the room %4

If you *know* players will always send you find player requests in the same way and you will always reply to them (or if you're flash you could set up an allowed list - otherwise you may get some clowns spamming you doing tell yamabushi find someplayer on you to waste your ep before they nail you!) you could use another trigger rather than an alias to automatically run the find for you, but that should be straight forward enough. ;)

As I said, it's untested, but it should work, I did a wee test thing with the 'who' list (last two lines) to see if an almost identical trigger worked and it did, so....Let us know how you get on, there may be a simpler way to do it as well though? :)

-G-
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Dec 04, 2003 2:58 am   
 
Just in case anyone else missed it, the trigger in my first post does exactly what Yamabushi asked. That is, it matches both lines and sends the command he asked for with the information from both lines. It also allows for the extra line which he says may sometimes occur (presumably between the first and second lines, since it wouldn't matter otherwise).

My extra comments were just that, extra.

Just noticed the extra set of parentheses in the CONDITION. It should read:
#COND {In the room: (*)} {*Person %t1 Room: %t2} {Within|Param=3}
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Thu Dec 04, 2003 6:58 am   
 
I noticed by changing the *Person to a tell and a person's name i can tell them this information. So how can i change the *Person to a targeted person's name through a tell, or over the comm if need be?

Also how can i get it stored into a variable, so i can just send a tell george <@findresults> and send him the inforation, then i can also send it to bob if he needs the same find.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Dec 04, 2003 7:58 pm   
 
Sorry, for some reason I read "Person as *Person and thought it was your tell command.

To send to a targeted person, use a variable. To save the information, use another variable.
#VAR Person george
#TR {^(%w is in *.)}
#COND {In the room: (*)} {tell @Person %t1 Room: %t2;#VAR findresults {%t1 Room: %t2}} {Within|Param=3}
tell bob <@findresults>
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Fri Dec 05, 2003 7:10 am   
 
Thanks for all the help Lightbulb. It works great
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net