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
mikespot
Newbie


Joined: 25 Oct 2016
Posts: 1

PostPosted: Tue Oct 25, 2016 6:24 pm   

Alias Names in Triggers
 
Hey everyone, quick question here, sorry if this has been asked before

I'm trying to have an event trigger the usage of an alias - however, the name of the alias being triggered is not explicit - in one possible example it would be concatted from characters from the trigger

Example


Trigger:
Code:

From MUD: "You need to send a letter north"

My Trigger: "You need to send a (%w) (%w)"

Trigger Code: %concat(%1,%2)

Output: letternorth


I have an alias named "letternorth", but that alias does not execute the commands in it. It just sends "letternorth" to the MUD.

Any ideas? I have a number of triggers and aliases that are going to overlap and I'd like to avoid creating a new trigger for each specific situation

Thank you!
[/code]
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Oct 26, 2016 1:09 am   
 
Best method is to acknowledge that 'letter north' should be parameters passed to a single alias.
Trigger Code: doSomething %1 %2
Alias doSomething code: #IF (%1="letter") {#SEND {mail letter %2}}

Alternately you can use the #EXECUTE command.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Scarn
Apprentice


Joined: 24 Jul 2005
Posts: 134

PostPosted: Sun Oct 30, 2016 6:49 am   
 
Try

Code:
#Exec letternorth
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