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
emnaki
Wanderer


Joined: 12 May 2007
Posts: 59

PostPosted: Sat Dec 15, 2007 6:59 am   

[2.18] Status bar update problem
 
Here is my status bar:
Code:
@enemy : %ansi(red,white)@attack : %class(triattack)/%class(fleeattack) %if(@attacking) |  %ansi(%item(@stwcolor,1),white)%concat(%item(@afnamelist,1)," : ",%item(@aflist,1),%item(@aflist,2)) | %ansi(%item(@stwcolor,3),white)%concat(%item(@afnamelist,3)," : ",%item(@aflist,3))

I have a variable in the bar @attacking which I can change with a macro key. In the previous release of CMUD 1.34 when I prress the macro, the status bar updates immediately (which is the correct behaviour). Now the status bar only updates when a new prompt arrives from the MUD after I press the macro key.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Dec 15, 2007 8:43 am   
 
This is because the value of @attacking isn't actually displayed on the status bar, so it's not watched for updates like variables that're displayed. You can fix this in a number of ways, the easiest probably being to add a line like

attack=@attack

to the macro so that it's given a "new" value to one of the variables that's actually on the status bar. Assuming that that doesn't work, you could also build your status bar text in a variable and then display just that variable on the status bar. That way, any update would change it, but you'd need to also update that variable any time you changed something.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
emnaki
Wanderer


Joined: 12 May 2007
Posts: 59

PostPosted: Sat Dec 15, 2007 9:58 am   
 
Below works.
Code:
$fake = @attacking
#VAR attacking "tmp"
#VAR attacking $fake
#IF (@attacking >= 1) {#T- triattack;#T- triattack2;#T- triattack3;#T- vampattack;#SAY "Attack Off";#T- fleeattack;#T- fleeattack1;#T- leadattack;#VAR attacking 0;#VAR onestrike 0} {#T+ triattack;#T+ triattack2;#T+ triattack3;#IF (@vampire = 1) {#T+ vampattack};#SAY "Attack On";#T- fleeattack;#T- fleeattack1;#T- leadattack;#VAR attacking 1}

Thanks for the ideas Fang! It seems the variable change needs to be outside (and before) the #IF loop for it to be recognized as a change by the status bar (shown by the tweak in the beginning). This is definitely a bug.
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