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


Joined: 11 Mar 2003
Posts: 19
Location: USA

PostPosted: Mon Jul 14, 2003 8:33 am   

Variables as a command and Special Chars
 
I'm basically trying to use a variable as a command, mostly to help make a standard that I can use for multiple triggers. Basically here's what I got:

#tr {^You killed (*).} {#cw bold,red;#beep;@orginfo I have killed %1 at Location: }

The variable 'orginfo' is as such:
org /common/ ~@~[Inform~] :

What this does is issue a command for a channel that should appear as such when all is said and done:
[Scryers] Pyron [Inform] : I have killed Dufus at Location:

What actually appears is:
[Scryers] Pyron ~Inform : I have killed Dufus at Location:

The @ in the variable is necessary for the org command on the mud, as it allows for basically an emote over the channel of your own discretion. What I'm not understanding is why the [ or ] aren't showing up. If I were to issue the same command to the mud, it shows up properly. Any help would be appreciated.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jul 14, 2003 1:17 pm   
 
Check that after defining the variables the ~'s are still there. Since expansion occurs twice (once when definin the variable and again when expanding it to send it to the MUD), you might not have inside the variable what you think you have.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jul 14, 2003 3:55 pm   
 
This is usually done with aliases rather than variables.
#AL orginfo {org /common/ ~@~[Inform~] :}
#TR {^You killed (*).} {#CW bold,red;#BEEP;orginfo I have killed %1 at Location: }
Reply with quote
Pyron
Beginner


Joined: 11 Mar 2003
Posts: 19
Location: USA

PostPosted: Mon Jul 14, 2003 5:36 pm   
 
When doing a #sh @orginfo, it returns:
org /common/ ~Inform~ :

So somewhere it's ditching the [ ] chars, and I have no clue why it would do that as the ~ should rectify that.

Using the alias, Lightbulb, is something I didn't think of but will work. But, I still need to find a way to resolve this issue if I can, because after the Location: I use another variable to show what my actual location is, and that isn't displaying the [ ] characters either. I didn't include it in my first post as the solution to the first problem would more than likely fix the second, as they're the same. Any further thoughts would be helpful. Thanks guys.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jul 14, 2003 6:12 pm   
 
#TR {^You killed (*).} {#CW bold,red;#BEEP;orginfo I have killed %1 at Location: "["@Location"]"}
Reply with quote
Pyron
Beginner


Joined: 11 Mar 2003
Posts: 19
Location: USA

PostPosted: Wed Jul 16, 2003 1:54 am   
 
That's the stuff right there. You're the bomb diggity, LightBulb. Thanks.
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