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
Troublemag
Wanderer


Joined: 14 Jul 2004
Posts: 83

PostPosted: Tue Mar 27, 2007 2:16 am   

[1.26] Alias/Trigger/Variable combo
 
I've been giving myself a headache trying to figure this out and I'm beginning to think it's a lack of caffiene as it surely wouldn't be a lack of brain power. No sirree.

What I'm trying to do is to use an alias to create a variable then set a trigger to write information into that new variable. Here's what I have so far:
Code:
#alias study {~study;#var tempvar1 %1;#trig {Key is: (*)} {#var tempvar2 %1};#rename tempvar2
The problem is, I don't know what value to put in for the rename. Suggestions? Improvements to code? Any and all would be welcome.[/u]
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Mar 27, 2007 4:08 am   
 
At this point, it's probably just better overall if you simply describe the task you want to do (the larger one in which this alias is supposed to be a part of.)

1)#trigger shouldn't even be in the alias, since it creates a permanent setting every time you run the alias (that is, if you run the alias 20 times then you get 20 identical triggers)

2)why are you even considering a renaming?

3)what the heck are you doing with tempvar1?
_________________
EDIT: I didn't like my old signature
Reply with quote
Troublemag
Wanderer


Joined: 14 Jul 2004
Posts: 83

PostPosted: Tue Mar 27, 2007 4:15 am   
 
The mud I play on has a gating system with complex keys to it. To learn the key, you have to study the room. To be able to use the key, you either have to keep an outside file with them and cut and paste them into the command line or save them as variables. I prefer the latter. It's much quicker. I attempted simply having the Key is: portion set the variable to the name recorded now as tempvar1 and the key itself (*) to %2
Code:
#trig {Key is: (*)} {#var %1 %2}
but that simply ended up with an empty variable named this impossible string which happened to be the value of the key. Not what I'm looking to have it do. I want to type "study roomname" and have the trigger pick up the value of the key and put it into the variable roomname.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Tue Mar 27, 2007 4:24 am   
 
It looks like you would be better off using database variables for this. Then you could have key value pairs corresponding to room name.

#alias findkey {study;roomname=%1;#T+ studyT}
#trigger "studyT" {Key is: (*)} {#addkey portalkeys {@roomname=%1};#T- studyT}

Then you could access your keys later. Something like this.

#alias gateto {open gate to %1 using @portalkkeys.%1}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Mar 27, 2007 6:04 am   
 
I believe there's a bug with rename anyway where settings that involve the newly-renamed setting aren't recompiled to reflect the new name. Until something forces them to recompile, they won't work.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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