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
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Tue Oct 09, 2007 6:35 pm   

Alias question
 
Using cMUDPro

Alias: fgrubs
pmote working next to an empty wooden cart.
#LOCAL $grcount
#LOCAL $total-grubs {%1}
#SHOW You will now gather upto @total-grubs.
#T+ find-grubs
find grubs

When I run this, for instance as fgrubs 12 it comes back on the last line find grubs 12
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Oct 09, 2007 6:53 pm   
 
Make sure you don't have the Auto-Append option enabled for your alias. If the alias was imported from zMUD, then the Auto Append option was enabled by default.

Also, keep in mind that CMUDPro is a Beta version, and you should normally post to the Beta forum since there are several bugs in the beta version that you might encounter.
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Tue Oct 09, 2007 7:01 pm   
 
Sounds good Zugg. Man has it been awhile since I played with the new versions. I was hoping to test cMUD instead of pro, but the license hasn't been reset in a long time and I got it when it had a bunch of bugs to I quit.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Oct 09, 2007 8:04 pm   
 
Also, you probably meant something like this:

pmote working next to an empty wooden cart.
#LOCAL $grcount
$total-grubs=%1
#SHOW You will now gather upto $total-grubs.
#T+ find-grubs
find grubs

When you refer to a local variable, you use the same name as when you define it. #local is only used for creating local variables. When you assign a local variable that doesn't exist, it's automatically created. Also, you don't use the $grcount variable in this alias - have you left some of the code out? If not, that line isn't needed because the local variable will be removed when the alias finishes.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Tue Oct 09, 2007 8:07 pm   
 
I got it to work. I also noticed that any variable the has a hypen in it will not display correctly to the window with a #SHOW
I was getting:
You will now gather upto -grubs.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Oct 09, 2007 10:47 pm   
 
That's because '-' is now a reserved symbol for arithmetic. Bear in mind that CMUD is stricter in syntax that zMUD was.
_________________
Asati di tempari!
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Wed Oct 10, 2007 12:47 am   
 
Thanks
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Oct 11, 2007 7:24 pm   
 
Try using a _ character instead of a - hyphen and then it should work. Most programming languages allow _ but not - in their variable names, so it's better to get into the habit of using _ instead.
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Oct 11, 2007 7:27 pm   
 
I keep forgetting you changed zScript to be more like other languages. I need to start remembering that. ;)
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
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