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


Joined: 20 Jul 2012
Posts: 3
Location: Ohio

PostPosted: 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
Reply with quote
hadar
Apprentice


Joined: 30 Aug 2009
Posts: 198
Location: my apt, in california

PostPosted: 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>
_________________
if you build it they will come, assuming that they have not already come to build it
Aardwolf Bootcamp
My youtube channel
Reply with quote
Rider
Newbie


Joined: 20 Jul 2012
Posts: 3
Location: Ohio

PostPosted: 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
Reply with quote
Rider
Newbie


Joined: 20 Jul 2012
Posts: 3
Location: Ohio

PostPosted: 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
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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}
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: 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.
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