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 Goto page 1, 2  Next
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Tue Aug 09, 2005 4:18 pm   

Capturing Text to another window
 
Ok guys, im new to Zmud, and am using 7.13.

Im trying to capture multi-line tells to another window. Now i have two queries about this:

1) I tried using
#CAPTURE tell
#TEMP {$} {#C-}
#C+ tell
#gag

as advised in another post, but this is still only capturing the first line. any ideas? Also, it doesnt seem to be gagging the text, AND (just to finish it off) it keeps producing triggers called $ multiple times.

Secondly, id like to set it so that when it captures the tell window doesnt actually take the focus.

Thanks for any help guys

Fergal
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Aug 10, 2005 12:20 am   
 
I believe there are a few generic tell capture scripts in the finished forum that may be worth taking a look at.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Wed Aug 10, 2005 11:55 am   
 
Ok thats great. Had a quick look this morning, although it didnt really seem to work. Will have a closer look this evening when i get home.

Any ideas on the focus issue however?

Fergal
Reply with quote
dedawgg
Beginner


Joined: 05 Aug 2005
Posts: 12

PostPosted: Wed Aug 10, 2005 2:40 pm   
 
I use the #CAPTURE option and the focus stays on the main window without doing anything extra.

I used to use the #WINDOW command, which does set the focus to that window, and when I did that, I just added another #WINDOW command at the end, with the name of the main window after it.
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Wed Aug 10, 2005 2:53 pm   
 
Ive found that (with the single line captures, anway) when i receive a tell (the initial one mainly) it takes the focus from the command line, and when i type it starts opening the menus, etc.
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Wed Aug 10, 2005 5:22 pm   
 
*Sigh*

I've tried entering in

Code:

#TRIGGER "CapTell" {%x tells you, '(*)} {
#CAP Tells
#IF (%ends( "%1", """)) {#STATE CapTell 0} {#STATE CapTell 1}
}
#COND {(*)} {
#IF (!%null( "%1")) {
#IF (%ends( "%1", """)) {
#CAPTURE tells
#STATE CapTell 0
} {
#CAPTURE tells
#STATE CapTell 1
}
} {#STATE Captell 0}
} {manual}


into my MUD. it just came back with the response 'whats that?'
The only thing i changed from the post was the endings from single quotation to double quotations.

Can you tell i dont have a clue?

Fergal
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Aug 10, 2005 9:34 pm   
 
Quote:
Ive found that (with the single line captures, anway) when i receive a tell (the initial one mainly) it takes the focus from the command line, and when i type it starts opening the menus, etc.

This will happen the first time it opens the window, after that focus shouldnt change.

Please post some output of a multiline tell between some [ code ] tags be sure to inlcude a couple of lines before and after the tell.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
artanis575
Newbie


Joined: 11 Aug 2005
Posts: 1

PostPosted: Thu Aug 11, 2005 2:09 am   
 
I've got a similar case where I need multiline capture. I'm using this script to capture auction data:

Code:
#CAPTURE Auction
#gag
#TEMP {$} {
  #C-
  #gag -2
  }
#C+ Auction


The auction output is always in this format:

Code:
AUCTION: a queen's thorax in slot E, minimum bid: 9,999, auctioner: Kweval.
         Lev(23) Loc(body shield) AC-ap(2) NoBits hps(10) mana(32) Cond(pristine - 185 Days)


Is there any easier way to capture just 2 lines? Also, how can I make it not notify me when it is capturing text? The messages saying text capture On and Off are more distracting than the auction text itself.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Aug 11, 2005 2:25 am   
 
Artanis:

You can #GAG the capture off and on lines, but if the auction is always 2 lines use a conditional trigger
#TRIGGER {^AUCTION:} {#CAP Auction;#GAG}
#COND {} {#CAP Auction;#GAG} {within|param=1}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Thu Aug 11, 2005 3:18 am   
 
I use this method for my capture script:

Code:
#var lastcap {%2} _nodef {Captures}
#if { %ismember( %1, @npc_list)} {} {#win Personal %1 tells you '@lastcap'}


That is modified to remove some %ansi colors.

I prefer #win command because it will support the use of colors in the capture...

The reason I move it to a variable is to help avoid potential abuse such as:

Atreidess tells you 'abuse!;remove all;drop all'

Which would then capture "abuse!" and execute the commands remove all;drop all (assuming parsing is on)

Another example (when the channel displays all chars, including yourself, the same) is:

Code:
#var lastcap {%2} _nodef {Captures}
#if {%1 == %char} {#win Me %ansi( high, yellow)~(%ansi( high, white)Group%ansi( high, yellow)~) %1: '%2'} {#win Personal %ansi( high, yellow)~(%ansi( high, white)Group%ansi( high, yellow)~) %1: '@lastcap'}


Now here's the catch: whenever I send swalks (and only swalks) to certain channels, for whatever reason, it will activate in the pattern of the "abuse!" example above.

If anyone can suggest a fix for that, I'd be quite happy. If anyone can't, at least here's a simple system you can use for your capturing, and just be careful when you send swalks via tells/gt/whatever channels your MUD has :P

My enitre script (written for Aardwolf MUD) can be found at:
http://www.freewebs.com/atreidess1/Captures_2.2.rar

That includes install instructions, and saved capture windows (to avoid some specific problems that repeat every time you start Zmud, you should save each capture window individually after it's creation. You should also save your layout, when you have the windows in the order you want).
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Thu Aug 11, 2005 3:22 am   
 
hahaha. In reviewing the code I just posted, I found my own problem! While I saved the capture, I forgot to update the window output (it's still displaying %2 instead of @lastcap). Or more likely I had updated it, but forgot to save my work and lost it in a zMUD crash (happens to me often)... anyway... the above system should work perfectly, just make sure to display @lastcap (as in the tell example)
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Thu Aug 11, 2005 4:54 am   
 
One final note.. updated (fixed) vers of the script I mentioned is:

http://www.freewebs.com/atreidess1/Captures_2.4.rar

It's a very simple script, so not really needed, but if you're having that much trouble, you can just try to convert this one to your needs.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Aug 11, 2005 11:00 am   
 
Atreides, see that Edit thingie next to yer posts? Use it ya post slut ;-) j/k
_________________
http://www.Aardwolf.com
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Thu Aug 11, 2005 4:00 pm   
 
Code:

1125/1280h 120/160m 49xp >
Lucrecia tells you, "Hide blocks you from being located. Melt shows you as a
shadow on the who list, and hides your location there. Still takes you off
the who list, and screen keeps people from seeking you with their shadow."
1125/1280h 120/160m 49xp >


this is what i get for multi-line tells
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Aug 11, 2005 4:48 pm   
 
Fergal1982,

I'd use something like this:

#TRIGGER "multilinecapture" {^%w tells you, ~"} {:tells:#sayp %time( hh:mm)%char( 32);#temp multilinecaptureend {~"$} {#state multilinecapture 0};#cap tells;#gag}
#COND {} {#cap tells;#gag} {looppat}

Multiline trigger that captures things to a window (used window tells) till it sees a " at the end of the line.
I threw in a time stamper as well as Lightbulb often uses.[/code]


Last edited by TonDiening on Thu Aug 11, 2005 6:49 pm; edited 1 time in total
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Thu Aug 11, 2005 4:52 pm   
 
ton, it didnt work Crying or Very sad

zmud seemed to accept it fine, but didnt do anything on a tell
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Thu Aug 11, 2005 5:17 pm   
 
stand corrected, it just needed me to log out and back in again for some reason. how do i go about removing the time stamp? to leave the trigger intact?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Aug 11, 2005 6:49 pm   
 
Strip out the time stamp line:

:tells:#sayp %time( hh:mm)%char( 32);
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Thu Aug 11, 2005 7:01 pm   
 
Dammit - now it wont work again. im using

Code:

#TRIGGER "multilinecapture" {^%w tells you, ~"} {#temp multilinecaptureend {~"$} {#state multilinecapture 0};#cap tells;#gag}
#COND {} {#cap tells;#gag} {looppat}


EDIT: it wasnt working because of the claret. sigh. the person i was testing with (as others in the realm do) has a prefix, which was interfering with the script.

now, on a final note (i promise) how do i clear the tell window?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Aug 11, 2005 7:26 pm   
 
Manually it is:
:tells:#clr

Then you can incorporate that where ever:
#alias tellclear {:tells:#clr}
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Fri Aug 12, 2005 6:10 am   
 
Thanks. Works a charm. now, to modify to to capture other text, simple enough.

Fergal
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Fri Aug 12, 2005 3:32 pm   
 
Sorry, gonna have to break my promise (sigh). Same situation, different text. It starts off:
Code:
Your shadow watches:

and can end either in a fullstop, or a quotation mark, as before. Im guessing you just add in the period to {~"$} but i could be wrong, and dont know how i would go about doing that.

Sorry again guys
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Sat Aug 13, 2005 8:03 pm   
 
Rolling Eyes Rolling Eyes Rolling Eyes Rolling Eyes Rolling Eyes Rolling Eyes Rolling Eyes
sorry again guys.

how do you put exceptions into the code? for instance, i dont want
Code:
Bardain looks at you appraisingly. He tells you, "Although we of the desert
are rich enough to buy whatever we choose, we value simplicity. Lifelong
friendships sometimes begin with the gift of a plain wooden bowl full of
water."

to appear in the tell window (its an NPC responding).
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Aug 14, 2005 3:27 am   
 
#TRIGGER "multilinecapture" {^%w tells you, ~"} {#temp multilinecaptureend {~"$} {#state multilinecapture 0};#cap tells;#gag}
#COND {} {#cap tells;#gag} {looppat}

Using the ^ will suffice for your exception. It matches from the start of a line a word (%w) followed by "tells you".

so that trigger can not match Bardain looks.. as the word looks is not tells.
Reply with quote
Fergal1982
Wanderer


Joined: 08 Aug 2005
Posts: 70

PostPosted: Sun Aug 14, 2005 8:11 am   
 
the problem with that, is that lots of people on the MUD have prefixes (for instance, my name is phoenix, but if i tell, it comes up as 'vestige phoenix' which doesnt capture.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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