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
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 10:51 am   

Capturing a room description into a string variable
 
.....
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000

Last edited by Mumra on Fri Jul 20, 2012 7:04 pm; edited 1 time in total
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 11:22 am   
 
......
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000

Last edited by Mumra on Fri Jul 20, 2012 7:05 pm; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 12:15 pm   
 
try making #TAGs, and add an #OK to the exit line, so long as the mapper can properly capture it, you can reference it via %roomdesc
_________________
Discord: Shalimarwildcat
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 12:16 pm   
 
This is not for the mapper.. I have no idea how to use the mapper at all. Just looking to take everything into a string list.
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 12:19 pm   
 
I'm just saying that what you want is already included with the mapper.
If you can get the mapper to work, you wont need this.
_________________
Discord: Shalimarwildcat
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 12:20 pm   
 
I don't see how the mapper would do what I want this to do. Isn't that just going to keep it all in %roomdesc?

This string is intented to be used in a loop to 'exam' every word in the description to look for clues, etc.
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 12:23 pm   
 
try something like...

#TR "roomdescs" {*} {#FORALL %replace(%line, " ", "|") {#ADDITEM testVar %i}}
_________________
Discord: Shalimarwildcat
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 12:26 pm   
 
That definitely captures it all. I'll be able to use it in my loop now. Thanks a bunch Shalimar :) Perhaps I will get around to using the mapper.. but I just got back, and it is enough to be relearning triggers, etc :)
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 12:30 pm   
 
no problem, glad to help
_________________
Discord: Shalimarwildcat
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 12:32 pm   
 
Oh, one last thing I guess. This way it is adding punctuation to the end of a word in the list. Is there an easy way to strip that off ?
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 12:41 pm   
 
Hrm.. also, it is capturing tons of stuff that is not in a room desc. Clantalk, Ordertalk, ANYTHING that happens.. That is decidedly odd to me. Perhaps I'll have to go back to finding the other way to do it. I have a feeling this would loop the crap out of me, since everything it sees gets added right back to the variable.
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 12:44 pm   
 
yea, just run it through another replave for the punctiation

%replace(%replace(%line, " ", "|"), ",")

and so on
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 12:45 pm   
 
well the trigger was named so you could toggle it on and off as needed
_________________
Discord: Shalimarwildcat
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 2:10 pm   
 
......
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000

Last edited by Mumra on Fri Jul 20, 2012 7:05 pm; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 2:41 pm   
 
#ADDITEM only allows one instance of a given word to be in a variable, to use more you need to use %additem, i think that is the variable oddity at least.

also, i notice you have "'s" replaced twice.
_________________
Discord: Shalimarwildcat
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 2:55 pm   
 
Oh, no, I definitely want #ADDITEM, no need to look at the same word twice. I do see the 's twice, guess I didn't notice it before. I was messing around with wanting to do ' and 's you know for plurality, but keep the word also with the S on the end, just in case. Didn't get it figured out yet, not sure if it is possible. Is there an easy way to make it all lowercase before the additem ? this way I won't have The and the, A and a. etc.
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 3:00 pm   
 
just by making sure it strips out the 's first
_________________
Discord: Shalimarwildcat
Reply with quote
Mumra
Wanderer


Joined: 12 Feb 2003
Posts: 93
Location: USA

PostPosted: Fri Jul 20, 2012 3:00 pm   
 
So like redundancy. do 's, then ' ?
_________________
Mumra the Everliving, Realms of Despair
216.251.47.10 Port 4000
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 20, 2012 3:11 pm   
 
right, and run it all through %lower as well
_________________
Discord: Shalimarwildcat
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