|
kiara2425 Newbie
Joined: 04 Feb 2016 Posts: 3
|
Posted: Thu Feb 04, 2016 5:28 am
Using an alias to update a trigger |
Hey all.
I am a recent convert over from zmud, and near everything ported over flawlessly. The one thing that didn't was an alias that updated a trigger I had..
Here is what is supposed to happen:
I type:
st pirate
The alias then updates a trigger named 'ghost leaves' with 'attack pirate'
If I type st bandit, it updates ghost leaves with 'attack bandit'
Etc.
On zmud, it was simple: I just had the alias
st
#trigger {ghost leaves} {attack %1}
On cmud, it tries to update the trigger, but it just puts attack %1 -- As in the percent sign and number one. :P
..
Since I suck at coding and have pretty much stayed basic, I'm completely lost as to why it doesn't work. Can someone help me out and tell me what I am doing wrong? :P My % is 'parameter char' and enabled in special characters... and is the same in zmud. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Feb 04, 2016 8:05 am |
I would suggest switching to a variable.
Code: |
#ALIAS st {AttackTarget=%-1}
#TRIGGER {ghost leaves} {attack @AttackTarget}
#VAR AttackTarget {} "" |
The #VAR command at the end creates the variable. I included this command to set the default value to "" which should cause CMud to not record changes to the value of this variable into the package file. This can be a bit of a speed boost. If you need the variable to retain its value between sessions then leave that line off and the variable will be created by the first usage of the st alias. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
kiara2425 Newbie
Joined: 04 Feb 2016 Posts: 3
|
Posted: Thu Feb 04, 2016 6:42 pm |
Alright, I updated with the code you gave, but now when I type st pirate, I get:
>{AttackTarget=%-1}
What?
That pops up, and the trigger is not updated. :( |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Feb 04, 2016 9:08 pm |
You should just have to copy and paste all of it into the command line. It should change your "st" alias, the "ghost leaves" trigger, and create a variable.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
kiara2425 Newbie
Joined: 04 Feb 2016 Posts: 3
|
Posted: Thu Feb 04, 2016 9:49 pm |
Awesome, it works now! :)
I just deleted out the old stuff and added that code in. Thank you so much. That had bothered me for weeks with me trying to figure out what was wrong and how to fix it! :) :) |
|
|
|
|
|