Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Basuka
Newbie


Joined: 30 Oct 2016
Posts: 1

PostPosted: Sun Oct 30, 2016 5:36 pm   

Updating gauges/buttons from database records
 
Hey all,

I'm trying to create a UI in a window that will make it easier to heal groups. Currently I have the player name and hp outputted to a new window, however, now I want to try and output that information to a gauge, with a button that can heal the player assigned to that gauge.

This is the output from the MUD

Code:
1.[1- 68-4 ]    Player1           100  59   31     '.......None.......'    27      (1280242)
  [2- 58-6 ]    Player2           75   39   27     '.......None.......'    30      (2818640)
  [--------]    Player3        97   25   94     '.......None.......'    30      (17669925)
  [1- 39-5 ]    Player4        96   75   100    '.......None.......'    23      (933749)
  [--------]    Player5           100  8    34     '.......None.......'    23      (-261772619)


I thought extracting the player names would to a DB would be a start, but not sure to go from there.

Essentially I'd have a button for each player (buttons are already created, just updated with the player information). Everytime a group is formed or a new player is added/removed, the gauge will update the player names, and everytime the group information is extracted, it will update the HP of those players.

I don't really need help with getting HP/player names, just how to get that into/and update a gauge/button.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Oct 31, 2016 3:59 am   
 
You don't need an actual database, a record variable would do enough. Information about your current capture triggers would be useful. Also we have no way of interpreting those numbers beyond guessing, which makes it very hard to help you.

You mentioned that you already have buttons setup. The caption and calculation fields can reference any variable and use any script function. Assuming we use a record variable with player name as the key value then the caption for the buttons to display the player name would be like %dbkeys(%item(@RecordVar,##)).
The other fields in the gauge setup depend on how the information is captured. You should look up the commands #ADDITEM and #ADDKEY.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Tue Nov 01, 2016 3:30 am   
 
Don't gauges using record variables not refresh properly on data change?
You may need to use normal variables for this.
_________________
Discord: Shalimarwildcat
Reply with quote
hogarius
Adept


Joined: 29 Jan 2003
Posts: 221
Location: islands.genesismuds.org

PostPosted: Wed Nov 02, 2016 3:43 am   
 
Would the #UPDATE command be useful in this situation?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Nov 02, 2016 4:21 pm   
 
I would just make a multistate trigger with each condition of the within type, set to 1 line.
#COND {pattern} {stuff} {Within|Param=1}
Then each state would only be defining one set of variables, including name, of who is currently in the group.

Set the variables to use a default value, but leave that default value blank, then you can null them out with #RESET.
Then you can toggle the visibility of the group buttons to match the number of current members.

#IF (@groupName3) {#T+ groupButton3} {#T- groupButton3}
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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