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


Joined: 28 May 2002
Posts: 17
Location: USA

PostPosted: Wed May 29, 2002 3:46 am   

one more variable ?
 
i swear if i get this you wont hear from me on this subject for a while!
this is what i have so far a variable names ARENA
#addi arena "text" this adds a line of text to the variable
#addi arena "text2" this adds a second line of text to the variable
it shows up in the STW as text|text2
my question is how do i get them to show up like this:
text
text2 considering that two different triggers put each text line into the variable that is the big problem... i can do it with a single trigger, but when i use 2 seperate triggers, as the MUD demands, that is how it shows up
Thanks!
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Wed May 29, 2002 4:42 am   
 
Ok, this was a bit more difficult. The best way I found was to add this to EVERY trigger that changes the variable. The reason is is you arent actually putting the variable into the status window, only the values. So any trigger or alias you have that adds or removes something from this you'll have to put this in at the end:
#STW "";#FORALL @test {#STW + %i}

It rests the status window to null, then for each item in the list it ADDs it to a new line.And yes, thats suppose to be %i.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed May 29, 2002 11:11 am   
 
#STW {%replace(@arena,"|","%cr)}

StatusWindow is one of those commands that preforms no expansion of it arguements. However it does full expansion on each display call.

Dacheeba's method has far to much processing overhead to be useable.
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Wed May 29, 2002 2:44 pm   
 
Hmmm, yeah, I tried to pull functions to do it straight from the #STW command, but I just couldnt do it. What really bites is the %cr is nowhere in my help files*boggle*. I was trying with %nltocr and all sorts of silliness. Ah well.
Btw, you have one " too many in your example.

#STW {%replace(@arena,"|",%cr)}

Thats better :P
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 29, 2002 4:20 pm   
 
For future reference:
%cr is in the helpfiles. It's the third one down in the list of Predefined Variables.

Hard to find if you don't know where to look.

LightBulb
Vague questions get vague answers
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Wed May 29, 2002 4:53 pm   
 
Yeah, I limited my search to the Function Reference and function wizard. It isnt on either of those. But it does show up on the index, but like ya said, its hard to search for something if you dont know what it is
Ok, maybe you didnt say that, but it is hard, heh
Reply with quote
braumen
Beginner


Joined: 28 May 2002
Posts: 17
Location: USA

PostPosted: Thu May 30, 2002 1:08 am   
 
just q quick ?
is it possible to replace values using:
#stw {%replace(@arena, "text1","text2")}?
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Thu May 30, 2002 2:56 am   
 
quote:

just q quick ?
is it possible to replace values using:
#stw {%replace(@arena, "text1","text2")}?


Why do ya try it and find out? :P

But yeah you could do that, but it isnt a logical #STW function. You might want %replace somewhere in your triggers/aliases, but really the only thing to use it in your status window is to remove the '|' and add a new line in its place.Also, the script you used would replace the value 'text1' with 'text2' so the new value of @arena would be 'text2|text2'. Gotta watch your logic, and dont be timid to play around with it :)
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