|
Surreall Beginner
Joined: 16 Oct 2004 Posts: 15
|
Posted: Mon Aug 01, 2005 10:13 pm
help with a capture script |
Well. I am a complete newbie when it comes to writing out scripts so I was wondering if anyone could help me out with creating one. what im trying to do is cature all these channels into a seperate window.
You tell Xalifex ooc 'reply to this >:o'
Xalifex replies to you ooc '.'
You tell Xalifex 'and this >:o ..and send me an otell and regular tell'
Xalifex tells you ooc '.'
Xalifex replies to you '.'
(OOC) Cranigra: (edited for content)
You quote 'quote channel is awesome'
Danathos quotes '5%the darkness's disintegration does oxxx(=====- UNSPEAKABLE -=====)xxxo things to you! [7586]'
(IC) Reidin: Hmm.
[Astinus] Reidin: test
[Astinus ally] Reidin: test
You yell '...'
You shout 'weeee.'
(REINC) Reidin: (edited for content)
Xalifex says ooc 'whaaaaaaaaaaaaaaaaaaaaaaaat'
You say 'need to capture says'
You say ooc 'capturing channel says'
Xalifex says '(edited for content)'
You exclaim 'yeah!'
You ask '?'
Xalifex exclaims '!'
Xalifex asks '?'
Beldakan questions '(edited)'
Ayeka answers '(edited)'
notice there are several different versions of a 'tell' and a 'say' in the mud I play in ..consisting of tells, replies, ooc tells, ooc replies, ooc says and says.
also is there a way when capturing said channels that they appear in there original colors in the alternate window?
alltho creating the entire script for me would be awesome, I know you guys have alot of better things to do. so a simple 'general way' of doing things will suffice if you choose to answer that way :).
I thank anyone that could help me with this in advance.
Chris.
Reidin - Clandestine Mud |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Aug 01, 2005 10:58 pm |
Use the {@list} pattern. Simply populate a variable with a number of the different methods, such as...
#VARIABLE Channels {say|tell|quote|replies}
Then use the #CAPTURE command with a trigger to grab them, something like...
#TRIGGER {{@Channels}{s|} {to you|ooc|} '} {#CAPTURE Seperate}
The use of the variable is optional, but I suggest it for ease of editting. You may also find the a few different trigger configurations are needed to catch some of the forms of a given channel, so the variable may be reusable in multiple triggers. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Surreall Beginner
Joined: 16 Oct 2004 Posts: 15
|
Posted: Mon Aug 01, 2005 11:20 pm |
the only problem being, as i stated before. im a complete newbie when it comes to scripting. ..I swear Zugg should make a 'Zmud scripting for dummies' book ..Im sure hed make a mint heh. anyway, I understood some of what you where stating ..but the most of it looks like gibberish to me.
Chris |
|
_________________ Reidin Grauve, Vicar of Astinus - Clandestine Mud. |
|
|
|
Surreall Beginner
Joined: 16 Oct 2004 Posts: 15
|
Posted: Fri Feb 17, 2006 2:29 am |
Well after screwing around with htings ..ALOT I have come up with this ..a simple adaption form another script.
#CLASS {Communication}
#TRIGGER {^~((%w)~):(*)} {#var cap "%1";#class cap 1}
#TRIGGER {^(%w) tells you} {#T+ cap}
#TRIGGER {^You tell} {#T+ cap}
#TRIGGER {^(%w) tells you ooc} {#T+ cap}
#TRIGGER {^(%w) replies ooc} {#T+ cap}
#TRIGGER {^(%w) replies} {#T+ cap}
#TRIGGER {^(%w) says} {#T+ cap}
#TRIGGER {^(%w) says ooc} {#T+ cap}
#TRIGGER {^You say} {#T+ cap}
#TRIGGER {^You say ooc} {#T+ cap}
#TRIGGER {^tells you,} {#T+ cap}
#TRIGGER {[Astinus]} {#T+ cap}
#TRIGGER {^[OOC]} {#T+ cap}
#TRIGGER {^[IC]} {#T+ cap}
#TRIGGER {^(%w) tells the group} {#T+ cap}
#TRIGGER {^You tell the group} {#T+ cap}
#CLASS 0
#CLASS {Communication|Cap} {disable}
#TRIGGER {*} {#CAPTURE Channels}
#CLASS 0
now the problem is. it not only captures the channels. ..but EVERYTHING. I have attempted creating a prompt trigger to stop this but I have NO idea how to do such OR if its the right thing to do. perhaps someone has an easier way to do all of this? or perhaps know show to fire off a prompt trigger? perhaps I can luck out and someone could have the time to just create the whole script for me ..heheh. Eitherway. this is my prompt.
<54330/54330Hp | 53805/53805Mana | 52775/52775Mv | N/A|n/a|n/a|397405Xp>
and of course. everything will fluxuate as I get better armor ..adding to HP/MP/MV. as I gained xp. etc.
ANY help would be awesome
Thanks in advance. |
|
_________________ Reidin Grauve, Vicar of Astinus - Clandestine Mud. |
|
|
|
JQuilici Adept
Joined: 21 Sep 2005 Posts: 250 Location: Austin, TX
|
Posted: Fri Feb 17, 2006 4:44 am |
The point that Vigilante was making is that you can combine most of your start triggers into a single trigger by using the list-expansion feature of triggers. The short version: a list, delimited by '|' characters, inside curly braces, is expanded as an either-or option by the trigger-matching code.
For example, if you want to match the three strings, 'tells you', 'tells you ooc', and 'tells the group', you can write one trigger for all three:
Code: |
#TR {tells {you|the group}{ ooc|}} {#NOOP -- do something interesting} |
Note that the second 'option' contains a null string, which means it matches either 'ooc' or nothing at all. Bonus points if you deduced that it would also match 'tells the group ooc'.
Finally, you can also use variable expansion inside curly braces to achieve the same effect. Take a look at Vigilante's post, with fresh eyes, and you'll see what he means now.
As for your problem with capturing everything - why use a class that gets enabled and disabled? Just do the #CAPTURE directly in the trigger, and it'll only grab that one line. |
|
_________________ Come visit Mozart Mud...and tell an imm that Aerith sent you! |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Feb 18, 2006 5:44 am |
These are the triggers that are causing nearly everything to be captured by your current trigger set:
#TRIGGER {[Astinus]} {#T+ cap}
#TRIGGER {^[OOC]} {#T+ cap}
#TRIGGER {^[IC]} {#T+ cap}
The reason for this is that [] is a wildcard notation in trigger patterns. You should read the help page Pattern Matching found in the reference section of the help. The correct way to form those triggers is:
#TRIGGER {^~[Astinus~]} {#T+ cap}
#TRIGGER {^~[OOC~]} {#T+ cap}
#TRIGGER {^~[IC~]} {#T+ cap}
Also keep in what jquilici said about using #CAPTURE directly in the triggers. The way you currently have your class it is turned on but never turned off, this will again cause everything to be captured. If your mud does not allow players to produce multiline messages then there is no need for the class method. However if messages can exceed 1 line then you are right to use this method, the correction for prompt handling should actually be done within the same trigger to minimize the chances of duplicate captures.
#CLASS {Communication|Cap} {disable}
#TRIGGER {*} {#IF (%begins(%line,"~<")) {#T- Cap} {#CAPTURE Channels}} "" {prompt}
#CLASS 0 |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|