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


Joined: 24 Jul 2006
Posts: 11

PostPosted: Mon Jul 24, 2006 12:51 am   

Help please? - Group health display
 
I need some help...I have a basic grasp of the Zmud fun gizmos - triggers, buttons, aliases, no problem. Anything more complex than that and I'm lost.

What I'm looking for is a group health display (a common theme I know.) Now, the mud I play (Shattered Kingdoms) has a special set-up for groups - a sample 'info' as follows:

Code:
Group: Dragon Hunters
(11:F1)  [         Bob]   (12:F2)  [         Joe]   (13:F3)  [------------]   
(21:M1)  [       Larry]   (22:M2)  [------------]   (23:M3)  [------------]   
(31:B1)  [         Moe]   (32:B2)  [------------]   (33:B3)  [------------]   
Characters            Rank    Pos    In room  Follow    H     ME    PE 
Larry                 Leader  21:M1  Yes      No      100%   87%  100%
Bob                   Member  11:F1  Yes      Yes      67%  100%   93%
Moe                   Member  31:B1  Yes      Yes     100%   82%  100%
Joe                   Member  12:F2  Yes      Yes      95%  100%   98%


There was one offered for the 6.40 Zmud, and I don't know if that's the problem, but it errors out for me, and I can't make heads nor tails of the coding to try to fix it. It has more fripperies than I'd need - buttons to invite and heal and such, when all I really am looking for is the raw info - but if it would work, it'd be swell.

If anybody has an idea for just the health percentage in group formation, or how to make the following work:

Code:
#CLASS {Toolbars|AdvancedControl|GroupControl}
#VAR btn {}
#VAR f1 {------------}
#VAR f2 {------------}
#VAR f3 {------------}
#VAR m1 {------------}
#VAR m2 {------------}
#VAR m3 {------------}
#VAR b1 {------------}
#VAR b2 {------------}
#VAR b3 {------------}
#VAR haveGroup {0}
#VAR charHP {100}
#VAR tmpMove {}
#VAR colButton {black, white}
#VAR typeCom {0}
#TRIGGER {You are not in a group.} {haveGroup = 0}
#TRIGGER {Group: } {haveGroup = 1}
#ONINPUT "infoTrig" {info} {#NOOP %btncol( f1, white, white);#NOOP %btncol( f2, white, white);#NOOP %btncol( f3, white, white);#NOOP %btncol( m1, white, white);#NOOP %btncol( m2, white, white);#NOOP %btncol( m3, white, white);#NOOP %btncol( b1, white, white);#NOOP %btncol( b2, white, white);#NOOP %btncol( b3, white, white)}
#COND "infoTrig" {^~(11:F1~)  ~[&f1~]   ~(12:F2~)  ~[&f2~]   ~(13:F3~)  ~[&f3~]} {f1 = %trim( @f1);f2 = %trim( @f2);f3 = %trim( @f3)}
#COND "infoTrig" {^~(21:M1~)  ~[&m1~]   ~(22:M2~)  ~[&m2~]   ~(23:M3~)  ~[&m3~]} {m1 = %trim( @m1);m2 = %trim( @m2);m3 = %trim( @m3)}
#COND "infoTrig" {^~(31:B1~)  ~[&b1~]   ~(32:B2~)  ~[&b2~]   ~(33:B3~)  ~[&b3~]} {b1 = %trim( @b1);b2 = %trim( @b2);b3 = %trim( @b3)}
#COND "infoTrig" {Characters} {#TEMP {^$} { #STATE infoTrig 0}}
#COND "infoTrig" {:(??)%s%x%s%x%s&charHP} {btn = %1;#if (@charHP = 100) {colButton = "black, white"};#if (@charHP < 100) {colButton = "blue, white"};#if (@charHP < 80) {colButton = "green, white"};#if (@charHP < 60) {colButton = "magenta, white"};#if (@charHP < 40) {colButton = "red, white"};#NOOP %btncol( @btn, @colButton)} {looplines|param=10}
#BUTTON 40 {@f1} {btn = f1;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {1} {1} {32895} {} {} {} "" {} {} {f1} {3}
#BUTTON 41 {@f2} {btn = f2;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {1} {80} {32895} {} {} {} "" {} {} {f2} {3}
#BUTTON 42 {@f3} {btn = f3;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {1} {159} {32895} {} {} {} "" {} {} {f3} {3}
#BUTTON 43 {@m1} {btn = m1;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {15} {1} {32895} {} {} {} "" {} {} {m1} {3}
#BUTTON 44 {@m2} {btn = m2;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {15} {80} {32895} {} {} {} "" {} {} {m2} {3}
#BUTTON 45 {@m3} {btn = m3;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {15} {159} {32895} {} {} {} "" {} {} {m3} {3}
#BUTTON 46 {@b1} {btn = b1;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {29} {1} {32895} {} {} {} "" {} {} {b1} {3}
#BUTTON 47 {@b2} {btn = b2;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {29} {80} {32895} {} {} {} "" {} {} {b2} {3}
#BUTTON 48 {@b3} {btn = b3;#if (@tmpMove = "") {tmpMove = @@btn;typeCom = 1} {#if (@typeCom=1) {position %word( @tmpMove, %numwords( @tmpMove)) @btn};#if (@typeCom=2) {cast 'cure critical' %eval( @@btn)};#if (@typeCom=3) {eject %eval( @@btn)};tmpMove = "";info}} {} {} {} {} {} {Size} {80} {15} {Pos} {29} {159} {32895} {} {} {} "" {} {} {b3} {3}
#BUTTON 49 {} {#PROMPT tmp "Invite whom?";invite @tmp} {} {} {} {} {WALK} {Size} {20} {20} {Pos} {1} {240} {} {} {} {} "" {} {Invite person...} {} {3}
#BUTTON 50 {} {group 'the adventurer in us shall not die'} {} {} {} {} {GROUP} {Size} {20} {20} {Pos} {20} {240} {} {} {} {} "" {} {Create default group} {} {3}
#BUTTON 51 {} {tmpMove = "Heal";typeCom = 2;#SHOW %ansi( white)"Click group member to heal..."} {} {} {} {} {HEART} {Size} {20} {20} {Pos} {1} {259} {} {} {} {} "" {} {Heal person} {} {3}
#BUTTON 53 {} {tmpMove = "Eject";typeCom = 3;#SHOW %ansi( white)"Click group member to eject..."} {} {} {} {} {RUNBACK} {Size} {20} {20} {Pos} {20} {259} {} {} {} {} "" {} {Eject person} {} {3}
#BUTTON 54 {} {tmpMove = "";typeCom = 0;#SHOW %ansi( white)"Cancelled group control command"} {} {} {} {} {EXCLAIM} {Size} {20} {20} {Pos} {1} {278} {} {} {} {} "" {} {Cancel group command} {} {3}
#BUTTON 55 {} {tmpMove = "";typeCom = 0;#yesno "Are you sure you wish to disband the group?" {disband} {};info} {} {} {} {} {PERSON} {Size} {20} {20} {Pos} {20} {278} {} {} {} {} "" {} {Disband the group} {} {3}
#CLASS 0


...I'd be most obliged! I'm so over my head here.

Thanks!
-eironia
Reply with quote
Raikirah
Newbie


Joined: 23 Jul 2006
Posts: 3

PostPosted: Mon Jul 24, 2006 1:46 pm   
 
Well, just a couple things I noticed when scanning over it:

Firstly, check all those variable evaluations (variable=something) to make sure you have the @ in front of the var. There were a couple I noticed missing it. This will throw the script off, as it doesn't know to set the variable to that argument.

Secondly, use of this script is going to cause you some serious bog-down. Even with all its conditionals to that one multi-state oninput trigger, with all those buttons, you're going to be hosed. What you might think to do is put this information (captured as the variables) into the status window. That way you're not dealing with a graphical display (something that zMUD doesn't like and has to work really hard for) but a set of raw numbers (which zMUD likes and processes relatively quickly.)
Reply with quote
eironia
Beginner


Joined: 24 Jul 2006
Posts: 11

PostPosted: Mon Jul 24, 2006 5:25 pm   
 
I wouldn't mind knocking out superfluous buttons, but even when I cut out that which looked safe to cut, Zmud had conniptions with it. But I'll sort through and try to do what you said - variables confuse me like this script confuses Zmud. Does anyone offer a course in Zmud programming? :P

I'd be willing to try the status window, but I'm not certain how to handle the variables for it. Any chance I could get a nudge in the right direction?

Thanks for the quick response! I'll be trying to work out the extant variable issues.
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