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
Irer
Beginner


Joined: 08 Feb 2007
Posts: 12

PostPosted: Tue Apr 10, 2007 11:06 pm   

Capture help
 
I'm really bad with all forms of this, so I thought this may be a better way to figure it out...I've run through just about all the files I could find on it.

Objective: To trigger a capture off a single line--the captured material is multi-line and varies in length, but is always proceeded by the prompt, which looks like this:

3220h, 4096m, 4096e, 10p ex-

The numbers vary, and the ex- may have more or fewer letters, including p, d, b, and k. Lusternia players should recognize this prompt, although it's similar to the other IRE game prompts.

The captured text is to be sent to a smaller floating window, which I'm not very familiar with. I intend to put this all into a single class to be turned on and off, but I know how to do that much, at least, although I don't know if I know how to close the extra windows.


Ideas on how to do this, please?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Apr 11, 2007 1:59 am   
 
We'll need to know what the text is and how you recognise it (is it shown when you enter a command, or is there specific text that always precedes it or what?)

As with all multi-line problems, though, by far the simplest way is just to turn off server-side word wrapping. CONFIG WRAPWIDTH 0. If you want to keep the old width, go into the preferences - you can set Word Wrap on, Auto Wrap off, Wrap column 80 and Wrap indent 0. Your screen will look exactly the same but triggers will be processed BEFORE the wrapping takes place rather than after. So if you had this:

Someone smashes you over the head, causing
a large amount of bleeding.

Before you would've needed this:

#trig {(%w) smashes you over the head, causing} {}
#cond {a large amount of bleeding.} {...} {within|param=1}

This won't fire if the person has a long name. It also makes things like capturing channels to another window immensely harder.

After setting your wrap width properly, all you need is

#trig {(%w) smashes you over the head, causing a large amount of bleeding.} {...}
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Apr 11, 2007 4:32 am   
 
Try this...

#TRIGGER {^&%d{HP}h, &%d{M}m, &%d{E}e, &%n{P}p (*)$} {}

This would capture the following in variables:

HP: 3220
M: 4096
E: 4096
P: 10

Edit: That's what I get for just scanning. I thought you were asking for a prompt trigger. Go with Fang's Answer :)
_________________
Asati di tempari!
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