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


Joined: 27 Jun 2004
Posts: 3
Location: USA

PostPosted: Sun Jun 27, 2004 2:54 pm   

Setting up a status bar
 
I am trying to write an interface script for a Star Trek based MUSH that I play. I want to take the output from a status command that I manually enter, and place the data into a status bar. For example.

I type DAM STAT (Damage Status)

and I get a readout something like this

System Damage Efficiency
Warp Drive Light 92

How would I take that 92% and make a status bar out of it?

I'm brand spanking new to Zmud, and I love it, but now I want to expand it.

Any help you could give would be appreciated [:p]
Reply with quote
annex187
Beginner


Joined: 16 Mar 2003
Posts: 16
Location: USA

PostPosted: Sun Jun 27, 2004 4:19 pm   
 
#TRIGGER {^System(%s)Damage(%s)Efficiency} {}
#COND {(*) (%d)} {#VAR efficiency %2} {Within|Param=1}
#STAT {Efficiency: @efficiency}

Someone will probably give you something better, but try that for now. Also, you may want to change Param to 2 if there's a blank line after the whole System Damage Efficiency thing.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jun 27, 2004 5:19 pm   
 
Since you are trying to match a columnar display, use the fixed-width wildcard, &nn, where nn is the width. The last column, Efficiency, is a number, so I used %d along with %s to account for the variable spaces before the number.

This a multistate trigger which starts when you receive the first line of the damage report (System/Damage/Efficiency). The pattern which gets the percentages is in the #CONDITION command, where it becomes a multistate of the trigger. After the first line is matched, the trigger will advance to its next state and get the systems and percentages. Looplines|Param=10 means zMUD will look for that pattern on the next 10 lines, then the trigger will advance to its next state. Change the Param to equal the maximum number of lines you expect. Since the trigger only has two states, it returns to the starting state when it advances from the condition.

This information, if it will cover several systems, is probably better suited to the status Window (#STW) than the status Line (#STATUS). You might also consider making gauges for critical systems. Gauges are easiest to make (IMHO) in the Buttons section of the Settings Editor. I added @A simply to ensure that there would be a changing variable to make the Status Line/Window and/or Gauges update their displays.

#TR {System %s Damage %s Efficiency} {#NOOP}
#COND {(&12) (&12)%s(%d)} {#ADDK DamStat {%1} {%3};#MATH A {!@A}} {Looplines|10}
#ST {%expanddb( @DamStat)}
Reply with quote
mphelps
Newbie


Joined: 27 Jun 2004
Posts: 3
Location: USA

PostPosted: Sun Jun 27, 2004 10:20 pm   
 
Thanks for the input. I really appreciate it. I'm new to programming scripts in general, so I'll muddle through it and if I have any questions. I guess what I should do is get the programming references lol. Just dont get mad if I ask too many redundant questions

I love this software, and I'm gonna buy it when I get paid. What I want to do is create a complete interface for this game so I can get away from command line entry all together other than general walking and talking stuff. I know it sounds complex, and it probably is, but I have big dreams lol

Thanks again
Mike
Reply with quote
mphelps
Newbie


Joined: 27 Jun 2004
Posts: 3
Location: USA

PostPosted: Tue Jun 29, 2004 7:49 am   
 
Ok guys.. I appreciate the help, but I just came to the realization I have no friggin clue what I'm doing whatsoever, so I'm scrapping the whole idea until a book is actually published, if that ever hapens. Thanks anyway
Reply with quote
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Fri Jul 02, 2004 6:43 pm   
 
Don't hold your breath for the book. These guys are hard to understand, I know :) I suggest reading the help files that come with zmud. Look up some of those #COMMANDS and %functions to see what they do.

The #STATUS command is what they are referring to that would print your efficiency. I would imagine you can do what you want with a #GAUGE command too.

But first, understanding how zmud works helps. And everything you need is in the help files.
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