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
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Wed Feb 23, 2011 8:05 pm   

New to CMUD, a few questions
 
Forgive my newbness. Anyways, a couple of questions.

When I end the command line with a symbol eg. ( ! ? ) etc, it will start a new line, making me have to hit enter twice. Any way to turn this off?

Was trying to set up my status bar to show the health/mana/moves of my other 2 chars (mud allows multiplaying). I have variables set for their stats, and I have it showing on my status bar, but it's behind by 1.. turn? Like if I have 150 mvt, and move, it'll still show 150 instead of 149 until the prompt comes up again, be it through moving further, or fighting, etc. Shouldn't it be updating my status bar as soon as the variable is updated? Here's what I have

#SB PORK: @porkhp / @porkmana / @porkmove SARI: @sarihp / @sarimana / @sarimove

And then for each character I have

#ACTION {^< (%n)H (%n)M (%n)V >} {:krom:#va porkhp %1;:krom:#va porkmana %2;:krom:#va porkmove %3)

Is there something I can add that'll make it update real time?

Thanks.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Feb 23, 2011 8:20 pm   
 
1) I'm not sure exactly what you mean here. Can you give a specific example, and explain what happens?

2) The problem is that your trigger will only fire after a carriage return, and your prompt does not include a carriage return. The solution is to open the Package Editor window, select the trigger, and click the option Trigger On Prompt (I believe that is the name of the option). That option will cause the trigger to fire on prompts like this one, without waiting for the carriage return. You may want to turn off Trigger On Newline.

And--welcome to Cmud!
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Wed Feb 23, 2011 8:45 pm   
 
Thanks, that fixed the status bar thing perfectly!

As for the other, well, let's see. It's not 100% of the time, because I just tried to do it on purpose and it won't, but let me try to explain. I'll be typing in the command line, say sending a tell to a friend, and sometimes I'll hit enter and it won't send the text, instead it'll start a new line, expanding the command line to another line. Every time it's happened it seems to have been when I've ended with punctuation, be it an ! or ?, or some kind of bracket for a smiley face.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Feb 23, 2011 9:03 pm   
 
Aha! To get the ! or ? you had to use the SHIFT key. The problem is probably that you still had the SHIFT key depressed when you hit ENTER. SHIFT-ENTER in the Cmud command line will do exactly as you describe, allowing you to enter multi-line commands at one time. Solution--just be careful to release the SHIFT key before hitting ENTER.
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Wed Feb 23, 2011 9:22 pm   
 
Right again. You really are a wizard.

Thanks
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Wed Feb 23, 2011 11:14 pm   
 
Ok, a follow up question. Is it possible to colour a field on the status bar? Like if I wanted the health to show up as red?
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Thu Feb 24, 2011 12:10 am   
 
The %ansi() function can be used add color to items on your status bar.
Putting,
Code:
hp: %ansi(bright,red)@hp

into the status bar's value field in the package editor, would display hp in black, and the value of the hp variable in bright red.
Code:
%ansi(reset)

Will reset the color back to black.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Thu Feb 24, 2011 6:42 pm   
 
Back with another question!

Is there any reason why new aliases may not work at all, like it's not recognizing I'm entering an alias? I made an alias for depositing credits via a bank card. Looked something like this:

#ALIAS {depo %1} {rem pack;get card pack;deposit %1;put card pack;wear pack}

But when pressing depo it just gave me the MUD error for not being able to do that there and didn't attempt to run the alias at all. Tried renaming it to several things that would have no conflict and nothing.

Thanks again.
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Thu Feb 24, 2011 7:31 pm   
 
Figured it out myself. I discovered the %params function! I guess there was some kind of issue with having numbers or something? Shrug, anyways, figured it out.
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Thu Feb 24, 2011 7:45 pm   
 
Alright, discovered a problem. I can't execute an alias in the other window with this.

My initial alias is #alias ff {:soandso:%params}

This works great just for regular mud commands, but if I want to use a cmud alias, say my 'pack' alias, it doesn't execute the alias, just shows as an invalid mud command.
Reply with quote
Myrkul
Wanderer


Joined: 21 Aug 2008
Posts: 85

PostPosted: Thu Feb 24, 2011 8:02 pm   
 
[edit][/edit]


Last edited by Myrkul on Thu Apr 14, 2011 11:02 pm; edited 1 time in total
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Thu Feb 24, 2011 8:39 pm   
 
Hmm, %0. Is this better or worse than using something like %params? I know that from reading the help file it seemed to imply that %1 was a bad, old option. Also, will #execute still do normal mud commands as well as cmud aliases, in case I just want to be able to make my other window 'say hello'?
Reply with quote
Myrkul
Wanderer


Joined: 21 Aug 2008
Posts: 85

PostPosted: Thu Feb 24, 2011 9:08 pm   
 
[edit][/edit]


Last edited by Myrkul on Thu Apr 14, 2011 11:01 pm; edited 1 time in total
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Thu Feb 24, 2011 9:28 pm   
 
Think of %0 or %-1 for that matter as a shortcut for %params() or %params(1). They all return everything directly after the alias.

%-2 or %params(2) both return the second word and everything that follows and so on.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="test" copy="yes">
    <value>
#print %params()
#print %0
#print %params(1)
#print %-1
#print _____________________________
#print %params(2)
#print %-2
#print _____________________________
#print %params(3)
#print %-3
#print _____________________________
#print %params(4)
#print %-4
</value>
  </alias>
</cmud>

The above alias when used with: test This is a test will display the following.
Code:
This is a test
This is a test
This is a test
This is a test
_____________________________
is a test
is a test
_____________________________
a test
a test
_____________________________
test
test
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Myrkul
Wanderer


Joined: 21 Aug 2008
Posts: 85

PostPosted: Thu Feb 24, 2011 9:36 pm   
 
[edit][/edit]


Last edited by Myrkul on Thu Apr 14, 2011 11:01 pm; edited 1 time in total
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Thu Feb 24, 2011 10:41 pm   
 
Quote:
The %1 syntax was implemented to be compatible with TinTin and zMUD. However, this syntax can make scripts very difficult to support and debug over time. In addition, it becomes difficult to refer to parameters in nested statements.

In zMUD you could use %%1 to refer to nested parameters. But it was difficult to remember which parameter this syntax referred to.


That's taken from the #alias helpfile, what made me think %1, etc, wasn't very good. Will give this a try tho, thanks.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Feb 24, 2011 10:43 pm   
 
Quote:

Hmm, %0. Is this better or worse than using something like %params?


%0 is an unsupported side effect of the %1...%99 stuff, and at some point Zugg may decide to hack that piece of code out of CMud.
_________________
EDIT: I didn't like my old signature
Reply with quote
Myrkul
Wanderer


Joined: 21 Aug 2008
Posts: 85

PostPosted: Thu Feb 24, 2011 11:59 pm   
 
[edit][/edit]


Last edited by Myrkul on Thu Apr 14, 2011 11:00 pm; edited 1 time in total
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Feb 25, 2011 11:19 pm   
 
By the way, skeen77, you ought to start a new thread for every new problem that you have, rather than reusing an old thread.
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