|
Rider Newbie
Joined: 20 Jul 2012 Posts: 3 Location: Ohio
|
Posted: Fri Jul 20, 2012 11:57 pm
Variable Capture |
I used to use zmud back in the day, about 5 computers ago, and recently have a renewed interest in MUDs. I am trying to create a trigger (maybe it should be something else) to quickly set a variable for PKing. I am thinking is should be something like this:
#trigger {pk {%w}} {#var target %1}
my goal here is to be able to type 'pk person' and it would set @target to person
I would then use aliases such as:
#alias kk {kill @target}
to use this variable.
The Alias works, because i can manually set the variable, but the trigger does not. Any help with this would be appreciated.
Thanks,
Rider |
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Sat Jul 21, 2012 12:05 am |
should be #trigger {pk (%w)} {#var target %1}
that is if you have something that shows pk <name> |
|
|
|
Rider Newbie
Joined: 20 Jul 2012 Posts: 3 Location: Ohio
|
Posted: Sat Jul 21, 2012 12:12 am |
In this situation, i would be the one entering 'pk ThatGuyIWantToPK' This command does not get passed to the mud, but is handle by cmud to set the variable.
Hadar, your code does not work for me, maybe i am doing something incorrect.
thanks,
Rider |
|
|
|
Rider Newbie
Joined: 20 Jul 2012 Posts: 3 Location: Ohio
|
Posted: Sat Jul 21, 2012 12:14 am |
OK, I replied too soon. I set the type to 'Command Input' and it works perfectly.
Thanks for the help.
Rider |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Jul 21, 2012 12:33 am |
If you aren't sending anything to the mud, why don't you turn this into an alias instead of a trigger?
[edit]The alias would be made thus:
Code: |
#alias pk {#var target %1} |
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sat Jul 21, 2012 1:14 am |
Personally, I would try this:
Code: |
<trigger name="pktrig" type="Command Input" priority="1" regex="true" id="1">
<pattern>pkt ([^$]+)$</pattern>
<value>target = %1</value>
</trigger>
|
(You could even issue the kill command from the trigger, though that would be botting.)
Then:
Code: |
<alias name="pk" id="2">
<value>kill @target</value>
</alias>
|
So...
pkt Anaristos followed by pk would do the job. |
|
_________________ Sic itur ad astra. |
|
|
|
|
|