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
DjNimble
Newbie


Joined: 28 Jan 2002
Posts: 1

PostPosted: Mon Jan 28, 2002 1:26 am   

Multi Line Captures (Again)
 
I'm having a bit of problem with multi-line
capturing, I'm using the basis Vijilante posted someplace earlier.

The action that triggers the multi-line capture is basically this:

You hear the faint thoughts of Somebody echo in your mind:
"blah blah................................................"

I want to grab the name of the person thinking, and route the text to another window.

Here is what I'm trying to use right now:

#GAG
#WIN Thought %1
#TRIGGER Thoughts {*} {#IF (@Testline) {
#UNTRIGGER Thoughts
#GAG
#CAPTURE Thought
} {
#CAPTURE Thought
#GAG
}}

Testline is a function that is:
%ends( %trigger, %char( 34))

For some reason, it doesn't stop routing to the other window, and I'm at a lost why :)

-DJ Nimble
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Mon Jan 28, 2002 2:14 am   
 
While it may not be elegant, try this:

#trigger {You hear the faint thoughts of (%w) echo in your mind:} {#var message %concat( %1, ": ");#t+ Thoughts}

#trigger {(*)} {#gag;#if (!%begins( %trigger, "You hear the faint thoughts")) {#var message %concat( @message, %replace( %trigger, %char( 34), "'"), " ")};#if (%ends( %trigger, %char( 34))) {#win Thoughts @message;#t- Thoughts}} "Thoughts"

Iljhar
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jan 28, 2002 4:48 am   
 
If I've parsed it correctly, this trigger:

#TRIGGER Thoughts {*} {#IF (@Testline) {
#UNTRIGGER Thoughts
#GAG
#CAPTURE Thought
} {
#CAPTURE Thought
#GAG
}}

will produce the following:
Trigger Phrase: Thoughts
Trigger Value (the commands): *
Trigger Class: #UNTRIGGER Thoughts;#GAG;#CAPTURE Thought OR #CAPTURE Thought;#GAG

Which class will depend on the value of @Testline. And I'm not even going to guess at the effect of embedded end-of-lines in the class.


LightBulb
All scripts untested unless otherwise noted
Reply with quote
shalimar
GURU


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

PostPosted: Wed Feb 05, 2003 6:50 pm   
 
quote:

While it may not be elegant, try this:

#trigger {You hear the faint thoughts of (%w) echo in your mind:} {#var message %concat( %1, ": ");#t+ Thoughts}

#trigger {(*)} {#gag;#if (!%begins( %trigger, "You hear the faint thoughts")) {#var message %concat( @message, %replace( %trigger, %char( 34), "'"), " ")};#if (%ends( %trigger, %char( 34))) {#win Thoughts @message;#t- Thoughts}} "Thoughts"

Iljhar




this does work to some extent, but its still got something to be desired, this is what it outputs

Player: You hear the subdued thoughts of Player echo in your mind: 'Anyone need a massage?'

now how can i change that up so it looks like:

Player [quality(subdued, faint, ect)]: Message

Shalimar
Reply with quote
shalimar
GURU


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

PostPosted: Wed Feb 05, 2003 8:10 pm   
 
thinking on this and looking at other pages in the forum i am begginning to wonder if #sub would work for what i want, but can substituted messages be sent to child windows as well?

Shalimar
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 12:19 am   
 
dont tell me your all stumped, came back looking for an answer (after having been to sick to mud for the past few days)

well i am gonna keep working on it and check back later

Shalimar
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sun Feb 09, 2003 12:36 am   
 
the message comes on the second line? try this trigger:

#tr {^You here the (%w) thoughts of (%w) echo in your mind:} {
#gag
name = %2
thinksas = %1}
#cond {"(*)"} {
#gag
#win Thought {@name ~[@thinksas~]~: %1}
} "" {within|Param=1}

This is attempting to add a second state to the trigger, so we don't need to create and instantly delete a trigger. Should work pretty good, assuming the "faint" thoughts can only be described in one word, i.e. "faint", "subdued", or other 1 word, and as long as the persons name doesn't exceed 1 word.

--------

moon.icebound.net:9000
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 12:45 am   
 
ok i tried replacing my current trigger with that and it stopped capturing the lines altogether

Shalimar
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 12:57 am   
 
yes the message comes on the second part (most annoting) also a persons own thoughts come out slightly differant

You hear your own faint thoughts echoing in your head:


Shalimar
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 1:19 am   
 
heh heres another variation on the thoughts, for focuses messages

You hear the subdued thoughts of (%w) touch your mind:


Shalimar
Reply with quote
DemonLlama
Beginner


Joined: 03 Nov 2002
Posts: 27
Location: USA

PostPosted: Sun Feb 09, 2003 2:54 am   
 
Shalimar, you mentioned that this trigger setup didn't work for you. Now, I haven't tested it, but I did see one thing that might be the problem. Note the highlighted word:

quote:

the message comes on the second line? try this trigger:

#tr {^You hear the (%w) thoughts of (%w) echo in your mind:} {
#gag
name = %2
thinksas = %1}
#cond {"(*)"} {
#gag
#win Thought {@name ~[@thinksas~]~: %1}
} "" {within|Param=1}

This is attempting to add a second state to the trigger, so we don't need to create and instantly delete a trigger. Should work pretty good, assuming the "faint" thoughts can only be described in one word, i.e. "faint", "subdued", or other 1 word, and as long as the persons name doesn't exceed 1 word.

--------

moon.icebound.net:9000



In the original, by Emit, it was spelled "here" instead of "hear". Try changing that.

~DemonLlama~
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 2:59 am   
 
amazing how such a simple thing goes unnoticed, now it works fine

Shalimar
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 3:07 am   
 
now then, how would i go about changing the default text color in the window thus created?

Shalimar
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sun Feb 09, 2003 5:25 am   
 
lol, i always confuse "here" and "hear"... ahh *bonk self*

for the colors, my favorite method is using mxp tags:

#win Thought {~<c red~>@name~</c~> ~[~<c #00F5FF~>@thinksas~</c~>~]~: ~<c #0088e4~>%1~</c~>}

or comparable, will give you some colors.


--------

moon.icebound.net:9000
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 5:35 am   
 
so now i need to learn the hexidecimal coloring system too or will the same numbers used in color triggers work here too?

Shalimar
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 5:50 am   
 
also, not sure if this is just do to high traffic or what, but using on of the color numbers you provided i noticed that it only gets picked up half the time... the other half it displays the color changing code along with the message

Shalimar
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 5:55 am   
 
correction, its not from high traffic but something else...

it seems that if the message gets wrapped around for more then one line then the color modifier gets ignored, if the message is under a line then it takes

Shalimar
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sun Feb 09, 2003 6:41 am   
 
you certainly don't have to learn RGB color syntax, although i prefer it. Try looking in the helpfiles at entries %ansi and %color and #pcol

--------

moon.icebound.net:9000
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 7:45 am   
 
what about the fact that the color syntax only work if the messages dont wrap? the results have been constant along those lines since i posted earlier about it

Shalimar
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 09, 2003 1:01 pm   
 
By the way, learning hexadecimal coloring is easy. It just takes three steps:
1. Digits go from 0 to F instead of 0 to 9. This is in increasing order, so F is larger than E, which is larger than D, and so on. Counting from 1 decimal to 33 decimal (you do not need to know the conversion, only recognize values that are bigger than others) would be: 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21 and so on.
2. A hexadecimal color has six digits, which are really just three numbers of two digits each put together without any spaces. Each number goes from 0 decimal to 255 decimal, thus they can go from 00 to FF.
3. The first two digits represent the amount of red in the color. The second two the amount of green and the last two are the amount of blue. In this way you can have 16777216 different colors between black (000000 - the abscence of color) and white (FFFFFF - the precense of all colors). Other examples include red (FF0000), green (00FF00), blue (0000FF), yellow (FFFF00 - a mix of red and green), cyan (00FFFF - a mix fo green and blue), and magenta (FF00FF - a mix of red and blue).

The advantage of this is that you can fine tune the color to whatever you want since you can change the amount of red, green and blue individually to 256 separate values each. You certainly don't need to know the hexadecimal number for each color, just remember what the first two, middle two and last two digits means and then combine those values to get at the color you want.

And, after wasting you time with all of this information, here is the one piece on information that you might find most valuable: You don't necessarily have to use hexadecimal colors, zMUD also accepts named colors. Thus, in each place where you see "#XXXXXX" you can also put "red", "green", "blue", "yellow", etc.

Kjata
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 09, 2003 9:02 pm   
 
right i figured that part out (converting is easy will the scientific calculatotr built into windows) but that doesnt explain to me why the color code only works on one line messages (not sure if this is tied into my wordwrap problem or not)

Shalimar
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