|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Mon May 26, 2008 5:11 pm
Status Bar, Color and IF/Switch statements? |
Am I able to put an IF/Switch statement in a status bar item, and use color?
So, for instance
#status {
#SWITCH (@questitem)
("Royal Sceptre") {#COLOR Some purple color;@questitem}
("Crown Jewels") {#COLOR some green color;@questiem}
...
}
Also, how do I put a name in a status, every time I try #status name { text } it puts the name in with the text... |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Mon May 26, 2008 5:51 pm |
I'd personally use an alias to do the work
#ALIAS setStatus {
#SWITCH (@questitem)
("Royal Sceptre") {#STATUS {whatever}}
("Crown Jewels") {#STATUS {whatever}}
}
Or you could use %switch if not |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Mon May 26, 2008 6:14 pm |
Well, I don't want it to add new instances to the status every time I quest and this needs to update for each new quest.
As it is right now it' just sits there on the status bar, empty if it has no value [ ] or, if it does have a value [Crown Jewels] |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon May 26, 2008 6:37 pm |
Statusbar items, I believe, operate under the same restrictions as #VARFUNC functions do. So, basically, you cannot use #commands in them. There's enough functions available for you to get around this, though:
#COLOR/#CW ==> %ansi() or <color colorname/colorcode></color>
#SWITCH ==> %switch()
#IF ==> %if() |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon May 26, 2008 8:34 pm |
Guinn - you could just put the @QuestItem variable in the status bar. If you want to put some other output based on the item, you could just have a variable @QuestItemText or something that you set, as you're doing there, with an alias and #switch.
Matt's right about status windows only containing text and functions. You might find %case useful, too. |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Mon May 26, 2008 10:12 pm |
So use the functions instead of commands? IF they're the same thing, what's the point in the distinction?
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Tue May 27, 2008 1:53 am |
I hate getting involved in this, but commands are directives to CMUD while functions just return values (otherwise they would not be called functions...). So the status must be something that evaluates to a string, commands don't evaluate to anything.
|
|
_________________ Sic itur ad astra. |
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Tue May 27, 2008 2:09 am |
simple enough distinction to me. Why do you hate getting involved in it?
|
|
|
|
|
|