|
Talus Newbie
Joined: 21 May 2006 Posts: 4
|
Posted: Sun May 21, 2006 11:30 pm
Gagging text in a multiple window situation |
Hi, I'm attempting to try to take the information gathered by a command and display it into a secondary window without displaying that same information in the first window. So far, I have:
#ONINPUT {score} {#gagblock;#name main;:score:#clr;#C+ score}
#TRIGGER {~<*hp *sp *st~>} {:score:#GAG 2;#C-;#STATE 1}
#COND {score} {#STATE 0} {input}
#CLASS 0
(This code is written for command "score", printing to window of the same name:"score".)
This is basically what I am using for several different commands.
For most of the commands, they work perfectly. However, there are a few commands that return information in several paragraphs separated by blank lines, which prevents #gagblock from squelching the information in the main window.
I have tried using the other #gag commands, but these attempts have produced incredibly strange results, some of which have even crashed zMud. I have also tried just using #makew <window> redirect instead to bypass having to gag stuff, but that didn't work either.
This is an example of what I am trying to work with:
You are using:
<worn on finger> a bronze ring (new)
<worn around neck> a crystal necklace (new)
<worn on body> a cavern chestplate (new)
<worn on head> a head casque (new)
<worn on legs> a pair of leather trews (new)
<worn on feet> a pair of leather boots (new)
<worn on hands> a pair of gloves (new)
<worn on arms> copper armbands (new)
<worn over shoulder> a black leather quiver
<worn about body> a leather backpack (new)
<worn about waist> a leather scabbard (new)
<worn around wrist> a fine opal bracelet (new)
<right hand> a silver-plated crossbow (new)
<left hand> a small sapphire gemstone
Current Armor Resistance (AR):
(Head ) Pierce: 2 Bash: 4 Slash: 1 Exotic: 0
(Torso ) Pierce: 1 Bash: 1 Slash: 1 Exotic: 0
(Arms ) Pierce: 2 Bash: 4 Slash: 2 Exotic: 0
(Legs ) Pierce: 2 Bash: 4 Slash: 2 Exotic: 0
Equipped weapon damage:
With your current knowledge of 'archery', a silver-plated crossbow will cause 12 points of damage against 0 ar. |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Sun May 21, 2006 11:41 pm |
Is #CAPTURE of no use to you?
#TRIGGER {You are using:} {#CAP Inv;#GAG}
#COND {^(*)$} {#CAP Inv;#GAG} {looppat}
#COND {^$}
That should get the first block of the inventory and do a similar thing for the rest. |
|
_________________ Taz :) |
|
|
|
edb6377 Magician
Joined: 29 Nov 2005 Posts: 482
|
Posted: Mon May 22, 2006 2:22 am |
Once again this pertains to Materia magica. There are a few issues in gagging in MM. One being the blank lines issue that happens because of spacing in MM. You can end up with an entire window of spaces because #GAG causes spaces to be left in MM.
There is a script written to control this and seperate it into windows however if you have any plans are upgrading to the cmud version you may want to wait as it will be better optimized and better written to control and display this in a pop out window.
And if you must use it now i agree this is how its setup on MMINFO as well.
Although for MM this is inefficient and with MM it causes other issues which im sure you will find. Other changes will be done to this script its relatively simple and needs some work. The full script which controls a total of 7 pop out windows controlled by positions and sizes at this point is too unstable in ZMUD to work effectively and with the upcoming release of CMUD wont be published until i can write it specifically for Cmud as it will have the capabilities built into it directly....
Code: |
#CLASS {EQ Capture}
#TRIGGER {^You are using:$} {#CAP Inv;#GAG}
#COND {^~<(*)$} {#CAP Inv;#GAG} {looppat}
#COND {^$}
#TRIGGER {^Current Armor Resistance (AR):$} {#CAP AR;#GAG}
#COND {^~((*)$} {#CAP AR;#GAG} {looppat}
#COND {^$}
#class 0
|
|
|
|
|
Talus Newbie
Joined: 21 May 2006 Posts: 4
|
Posted: Mon May 22, 2006 2:54 am |
You can use this code to skip the lines, thereby allowing gagblock to work correctly.
#TRIGGER {%crlf} {
#gagblock
} "" {skip} |
|
|
|
Talus Newbie
Joined: 21 May 2006 Posts: 4
|
Posted: Tue May 23, 2006 9:32 pm |
Edit: Alrighty. This is a little hackish, but it now works for the materia magica equipment screen as it does the rest.
#CLASS {Isaril Scripts|Equipment}
#ONINPUT {equipment} {
#name main
:score:#clr
#var block "yes"
#C+ score
}
#TRIGGER "switcher2" {{~<*hp *sp *st~>|(Mount: *st)}} {
#var block "no"
#cr
#gag -3
:score:#gag 2
#C-
#STATE 1
} "" {prompt}
#COND {equipment} {#STATE 0} {input}
#TRIGGER {%crlf} {#if (@block="yes") {#gag}}
#CLASS 0 |
|
|
|
|
|