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


Joined: 27 Feb 2003
Posts: 69
Location: Australia

PostPosted: Fri Oct 17, 2003 12:00 am   

Last line in a window...
 
Is there any way of finding out what the last line in a window is?

What I'm trying to do is capture certain text to another window (using C+) and then gagging the lines from the main window.

However, for this to work I need to know when I am back at the "Capture text ON" line, which has eluded me up to now.

There is no easy way of identifying all the lines in the block, so the alternative, as far as I can tell, would be a state-based trigger which starts the capture at the beginning of the block and stops it at the end. I'd prefer another way of doing this, however.

Any ideas?
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Fri Oct 17, 2003 1:27 pm   
 
I'm sure someone would be happy to help you, but I'm guessing that we need more information. A cut and paste of your commands along with mud output for the text you're working with, plus a line or two before and after would certainly be a great help.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Oct 17, 2003 6:19 pm   
 
It won't work. #C+ won't capture lines that appear before the "Capture text ON" message.

It sounds like you are trying to capture a single line which is long enough so that zMUD wordwraps it. You can do that with #CAPTURE. You can gag the same line from the main window using #GAG.
#TR {This is a long line} {#CAP Experiment;#GAG}
#SHOW {This is a long line that is being used to experiment with the ~#CAPTURE and ~#GAG commands. It is intended to be long enough to take up at least two or three lines on the zMUD screen. If it works correctly, it should only show up in the Experiment window.}
Reply with quote
Cbisazza
Wanderer


Joined: 27 Feb 2003
Posts: 69
Location: Australia

PostPosted: Sat Oct 18, 2003 2:50 am   
 
OK, I think I messed up my explanation. Here is a more clear one.

I am looking at the items in a container, and they come out as a list. The list is word-wrapped, but I don't do the word-wrapping -It's done by the MUD.

What I'd like to do is to get the list of items and put it into one of my windows. The list looks like:

In your backpack you see <list of random items>
<list of random items>
<list of random items>
<list of random items>.


Now I was toying with the idea of creating two triggers, something like:
#TRIG {^In your %w you see} {#C+ items}
#TRIG {~.$} {gagalias}


...where gagalias gags all lines from the bottom of the screen until it reaches the "Capture text ON" line.

Having said all that, at this point I'm pretty convinced that this is a job tackled easiest by a conditional trigger of the form:

#TRIG Items {^In your %w you see} {#Capture items ;#gag ;#TEMP {~.$} {#STATE Items 0}}
#COND {} {#Capture items ;#gag} {LoopLines|Param=10}


I am still curious, however, as to how I could have done what I wanted to do in the first instance - that is check what the last line in a window is. I consider that very useful in general, because that would probably be a line not caught by my 'normal' processing.
Reply with quote
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Sat Oct 18, 2003 3:11 am   
 
Does your mud have a prompt?
I do this alot when capturing multiline tells/channels/etc. to a new window

#TR {In your backpack you see} {#T+ Capture}
#TR {PROMPT GOES HERE} {#T- Capture}

#CLASS Capture
#TR {*} {#CAP WindowName;#GAG}
#CLASS 0

I believe this is how the written setup would be, its alot easier making this happen in the settings window then writing it out by scratch *grin* specially when I dont have a copy of my settings around to look at, but this should give you general idea.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Oct 18, 2003 3:51 am   
 
Try the predefined variables.
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