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


Joined: 15 Sep 2011
Posts: 3

PostPosted: Thu Sep 15, 2011 2:35 am   

Targeting Alias help
 
I am new to cmud and I am trying to figure out a basic target alias. I would like to be able to type (x target name ) and then be able to backstab target kick target ect.... what do i need to do? Any help would be great or an old post that O can understand. Thanks
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Thu Sep 15, 2011 1:30 pm   
 
That's extremely vague and the answer depends a lot on the MUD and how much you want to continue interacting. At the very basic, you could have something like this, where you type in "x (target)", and keep pressing enter to cycle through the attacks:
Code:
#VAR Attacks=backstab|jab|kick  //creates a variable containing your list of attacks, in order, separated by |
#ALIAS x {  //defines the following block as alias "x"
  #EXEC @Attacks.1 %-1  //execute (send to the MUD) the first item in the list variable @Attacks followed by all parameters passed into the alias
  Attacks=%additem(%pop(Attacks),@Attacks)  //removes the first item from the list and puts it at the end of the list
  }

You'll want to look up each command and function to become familiar with them. You can build it up using triggers so that instead of pressing enter for each command, it knows when to send the next. Here's an adjusted code so that typing "x (target)" just sets the target, but it doesn't do anything until it receives from the MUD "You're ready to attack." (the ^ means it will only match at the beginning of the line and the $ will only match at the end, so by enclosing a line in between ^$, it must be a complete line by itself to match):
Code:
#VAR Attacks=backstab|jab|kick
#ALIAS x {Target=%-1}
#TR  {^You're ready to attack.$} {
  #EXEC @Attacks.1 @Target
  Attacks=%additem(%pop(Attacks),@Attacks)
  }

I hope this gets you pointed in the right direction!
_________________
.geniusclown
Reply with quote
Binnesman
Newbie


Joined: 15 Sep 2011
Posts: 3

PostPosted: Thu Sep 15, 2011 10:15 pm   
 
In Mushclient we would set the Var like this:

Alias: x *

SetVariable ("Target", "%1")
ColourNote ("white", "green", "Target is now: %1")
SetStatus ("Target: %1")


In this example it would allow me to type X target and we will call the target a goblin the x would be the variable set to the NPC and the MUD would show: Target is now: goblin highlighted in Green.


Then I have another Alias


Alias: K

kill @target

so every time I hit the letter k it would attack the goblin. then i could make other alias such as

Alias:B

Backstab @target

This is what I am trying to do. I hope this explains it better.
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Thu Sep 15, 2011 10:58 pm   
 
Each of the three code blocks to follow can be copied directly into the command line to create the aliases.

This first alias will set your target variable to whatever you type after x then give you a message telling you the new target like you had above if I understand the colors you had set correctly.
Code:
#alias {x} {Target = %-1;#show {Target is now: %ansi(green)%-1%ansi(reset)}}


This alias will send kill @Target, where @Target is whatever you have your target variable set to if you just type k. If you were to type k bear however it would set the target variable to bear then send kill bear. Just a little extra functionality to eliminate the need to set the target manually.
Code:
#alias {k} {#if (%null(%-1)) {#send kill @target} {Target = %-1;#show {Target is now: %ansi(green)%-1%ansi(reset)};#send kill %-1}}


This does the same as the above alias but it switches kill with backstab.
Code:
#alias {b} {#if (%null(%-1)) {#send backstab @target} {Target = %-1;#show {Target is now: %ansi(green)%-1%ansi(reset)};#send backstab %-1}}


Hope that helps get you started. Also like geniusclown suggested being new to the program, taking a little time to read through the help files will give you a better understanding of how things work in CMUD and hopefully make the transition from MC to CMUD easier.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Binnesman
Newbie


Joined: 15 Sep 2011
Posts: 3

PostPosted: Fri Sep 16, 2011 1:12 am   
 
Thank you so much worked perfect and i will read the manual:)
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