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


Joined: 02 Feb 2007
Posts: 2

PostPosted: Fri Feb 02, 2007 12:08 pm   

Status window help
 
I'm trying to start out in zmud after using another client for
quite awhile. Getting started on a whole new system is
quite challenging.

I'm wondering if someone could help me put together something
to capture my hpbar as it appears round to round in combat,
sends it to the status window, and gags it from appearing
in the main window.
My hpbar would look kinda like this in general.

HP:1100/1148 SP:515/602 PU:7782/7800(3750) CPC:7729/10000 E:A Hea(bleeding)
RC: 4062562 Bias:[ 150% | 40% ] TS: 3/3(62%)EField[40 min] EDNA[27 min]
[> Attacks <] [--------] [ furies ] [ sonar ] [synergy ]
A Healthy Rabbit is at 38% strength.

The 4 bars next to [> Attacks <] have varying messages.
The []'s around bias sometimes change to ()'s.
Most of the numbers vary except the 10000.

I'm sure seeing and dissecting a working example of what
could accomplish this would help me learn more about zmud
and status window than reading every single help file ever
could.

Thanx to anyone who bothers to take up this annoying
task for an annoying zmud noob.

vvildvveasel
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Feb 02, 2007 3:31 pm   
 
Use the Pattern Matching help topic to better understand what this does.

Code:
#trig {HP:(%d)/(%d) SP:(%d)/(%d) PU:(%d)/(%d)~((%d)~) CPC:(%d)/(%d) E:*~((%d)~)} {#var CurrentHP %1;#var MaxHP %2;#var CurrentSP %3;#var MaxSP %4;#var CurrentPU %5;#var MaxPU %6;#var CurrentCPC %7;#var MaxCPC %8;#gag}
#cond {RC: (%d) Bias:[~[~(] (%d)~% ~| (%d)~% [~]~)] TS: (%d)/(%d)~((%d)~%~)EField~[(%d) min~] EDNA~[(%d) min~]} {assign some more variables here starting from %n again and gag} {Within|Param=1}
#cond {~[> Attacks <~] ~[(*)~] ~[(*)~] ~[(*)~] ~[(*)~]} {and again} {Within|Param=1}
#cond {(*) is at (%d)~% strength.} {#var CurrentEnemyStrength %1;#gag} {Within|Param=1}


This is by far the most complicated prompt I've ever seen! I couldn't handle typing out that many variable names. Hopefully you can do the second and third lines yourself based on the first :P

To display them in the status window, you create a status window item and give it the value you want to display and use %cr for a new line, for example

Code:
HP: @CurrentHP/@MaxHp%crSP: @CurrentSP/@MaxSP
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
vvildvveaesl
Newbie


Joined: 02 Feb 2007
Posts: 2

PostPosted: Sat Feb 03, 2007 9:48 am   Thanx
 
Wow.. that helped alot. Just looking at it and seeing how it would
work gave me a big jumping off spot for which help files to look for
and at, and how to start building it. Just to follow up incase anyone
else is checking how this went, I can put what I ended up with as
a final version and what I put in the status window as an output.

First thing I did is make each line a trig... whenever something
got inbetween the lines it invalidated the capture. I shoulda been
more specific that those lines wern't always nescessarily right together.
Of course I put in the variables as was suggested. Made a few
minor corrections as I tested each step. Final result of the triggers
was this...

#trig {HP:(%d)/(%d) SP:(%d)/(%d) PU:(%d)/(%d)~((%d)~) CPC:(%d)/(%d) E:*~((%w)~)} {#var CurrentHP %1;#var MaxHP %2;#var CurrentSP %3;#var MaxSP %4;#var CurrentPU %5;#var MaxPU %6;#var CurrentSPU %7;#var CurrentCPC %8;#var MaxCPC %9;#var EnemyCondition %10;#gag}
#trig {RC: (%d) Bias:[~[~(] (%d)~% ~| (%d)~% [~]~)] TS: (%d)/3~((%d)~%~)EField~[(%d) min~] EDNA~[(%d) (%w)~]} {#var CurrentRC %1;#var AttackBias %2;#var DefenseBias %3;#var CurrentTS %4;#var Reset %5;#var EfieldDur %6;#var EdnaDur %7;#var EdnaTime %8;#gag}
#trig {~[> Attacks <~] ~[(*)~] ~[(*)~] ~[(*)~] ~[(*)~]} {#var IBemote %1;#var DDBemote %2;#var STHemote %3;#var SYNemote %4;#gag}
#trig {is at (%d)~% strength.} {#var CurrentEnemyStrength %1;#gag}


Then I put together something for status window. Through trial and error
I found that I could skip the next line command by just putting it on
another line in the 'window' box inside settings editor. When I finally got
it done and working I also found a help file on ansi and shined it up a bit
so that it would catch my eye better. Final result is below...

%ansi(bold,red)HP: %ansi(bold,white)@CurrentHP/@MaxHp %ansi(bold,blue)SP: %ansi(bold,white)@CurrentSP/@MaxSP %ansi(bold,green)PU:%ansi(bold,white)@CurrentPU/@MaxPU (@CurrentSPU) %ansi(bold,magenta)CPC:%ansi(bold,white) @CurrentCPC/1000 %ansi(bold,red)E:%ansi(bold,white) @CurrentEnemyStrength% %ansi(bold,red)E:%ansi(bold,white)@EnemyCondition
%ansi(bold,cyan)RC:%ansi(bold,white) @CurrentRC Bias [ %ansi(bold,red)@AttackBias %ansi(bold,white)| %ansi(bold,cyan)@DefenseBias %ansi(bold,white) ] TS: @CurrentTS/3(%ansi(bold,green)@Reset%ansi(bold,white)) %ansi(yellow)Efield%ansi(bold,white)(@EfieldDur min) EDNA(@EdnaDur @EdnaTime)
%ansi(bold,white)[>Attacks<] [@IBemote][%ansi(bold,red)@DDBemote%ansi(bold,white)][%ansi(bold,blue)@STHemote%ansi(bold,white)][@SYNemote]

So far everything is going great.. but I have run into one problem. When
the third trigger captures the various emote messages inside the boxes
next to attacks, one of them sometimes contains two words instead of
just one. In using the test box inside the trigger editor I saw that both
words are captured to the variable. But inside the status box when I
tell it to put out "@STHemote" it only echos the first of the two words.
Is there something I need to do/put that will make it display the whole
variable? Thanx again for any help.

vvildvveasel
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Feb 03, 2007 3:03 pm   
 
Ah yes, I'd forgotten about that. I'm used to using CMUD where it wasn't a problem, but in zMUD if %n contains more than one word you have to enclose it in "" or {} so zMUD knows it's all one argument.

#var STHemote "%1"
#var STHemote {%1}

otherwise, when it contains more than one word zMUD expands it like this:

#var STHemote something something2

and the third argument for #var creates a default setting for the variable. With the brackets or quotes, zMUD knows it's all the second parameter.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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