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


Joined: 26 May 2007
Posts: 7

PostPosted: Tue Dec 22, 2009 12:41 am   

Sendting text to a window.
 
When a variable is set to 1, I'm trying to force it to send text to a window, as a list. I've experimented with events, but it's a bit out of my reach. For example, I'd like it to appear as:
Text

and later be able to add to it without removing the original, as long as the variable hasn't been reset to 0.

Text
Text1.

Any ideas as to the command I should look into?
Reply with quote
ixy
Novice


Joined: 18 Mar 2007
Posts: 39

PostPosted: Tue Dec 22, 2009 1:28 am   
 
are you doing it as a trigger? a manual alias? add what to the list manually or something captured via another trigger?
Reply with quote
Yrael
Newbie


Joined: 26 May 2007
Posts: 7

PostPosted: Tue Dec 22, 2009 3:15 am   
 
A trigger sets the variable; I was looking into using an event to check wether or not it the variable was true. However, I think the best option is to make it check every time the prompt appears by executing an alias, refreshing the window. Which still leaves the question of how to apply the text as a persistent thing, unfortunately my tawling through the cmud help files isn't doing much for me in this instance.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Dec 22, 2009 5:06 am   
 
No need for an event, just use an expression-type trigger:

#trigger (@variable = 1) {do stuff whenever @variable changes from not-1 to 1}
_________________
EDIT: I didn't like my old signature
Reply with quote
Yrael
Newbie


Joined: 26 May 2007
Posts: 7

PostPosted: Tue Dec 22, 2009 11:31 am   
 
[quote="MattLofton"]No need for an event, just use an expression-type trigger:

#trigger (@variable = 1) {do stuff whenever @variable changes from not-1 to 1}[/quote]

Really? I thought patterns were required for triggers, not variables. Okay. Any idea on how to list the variables - and some additional text - in a new window?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Dec 22, 2009 1:53 pm   
 
Triggers can be used for many things. The trigger Matt gave is a trigger dependant on a variable, which will be tested whenever the variable value changes. If the new value of the variable meets the condition in the trigger pattern, the trigger value is executed. It's a cool feature that is underutilized.

The command to send text to a new window is #window. The following lines should send the value of a variable to mywindow, then some other text:
Code:
#window mywindow @variable
#window mywindow "some other text"
Reply with quote
Yrael
Newbie


Joined: 26 May 2007
Posts: 7

PostPosted: Wed Dec 23, 2009 1:34 pm   
 
[quote="Rahab"]Triggers can be used for many things. The trigger Matt gave is a trigger dependant on a variable, which will be tested whenever the variable value changes. If the new value of the variable meets the condition in the trigger pattern, the trigger value is executed. It's a cool feature that is underutilized.

The command to send text to a new window is #window. The following lines should send the value of a variable to mywindow, then some other text:
Code:
#window mywindow @variable
#window mywindow "some other text"
[/quote]
Alright, I've gotten that hammered out, but short of clearing and redrawing the window, I'm out of ideas on how to clear specific items from it. Anything, or am I out of luck?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Dec 23, 2009 5:20 pm   
 
Are you by chance trying to duplicate the functionality of the status bar or status window? Check out the commands #STATUS and #STWIN.

As for clearing specific items from an ordinary window, you are probably out of luck
Reply with quote
Yrael
Newbie


Joined: 26 May 2007
Posts: 7

PostPosted: Wed Dec 23, 2009 9:29 pm   
 
[quote="Rahab"]Are you by chance trying to duplicate the functionality of the status bar or status window? Check out the commands #STATUS and #STWIN.

As for clearing specific items from an ordinary window, you are probably out of luck[/quote]
Ordinary window. I didn't know abut status window, but it's not really what I was after.

Thanks for all your help, everyone.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Mon Dec 28, 2009 1:05 am   
 
From reading your post, I believe the status window is exactly what you're after. For this example, I'm going to use a variable called @var. Obviously you can name your variable something different. Use New > New Statusbar in the settings editor. Give it a name (in this example MyStatus) and make the value
Code:
%expandlist(@var,%crlf)

Also make sure to uncheck "Show in status bar" and check "Show in status window".
Then when you want to add/delete a line, use:
Code:
#additem var {Line that you want to add.}
#delitem var {Line that you want to delete.}

Note that both of those do NOT have an @ sign by the variable name, on purpose. When you want to enable or disable showing the whole thing, use
Code:
#stw on
#stw off

or if you're also using the status window for other things you can use
Code:
#t+ MyStatus
#t- MyStatus

which leaves the window but removes the text.
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