Super Duper Simple Question

Posted by Cera on Mon 18 Aug 2008 06:17 PM — 11 posts, 35,854 views.

USA #0
Ok, I hope I am really missing something basic, because I simply cannot figure out how to set an alias with a variable.

I play aardwolf, and I have been using zmud. What I'm used to is this:
in the command line, I type

#var spellname immolate
#alias {cass} {cast @spellname}


and afterwards, when I type "cass" in the command line, "cast immolate" goes to the mud, and if I type "cass dragon" then "cast immolate dragon" goes to the mud.

ok, how do I get that to work in here?

-dana
USA #1
CTRL+SHIFT+9 brings up the add alias dialog.

match: cass*
Send: cast immolate %1

From the command line, it's a bit messier in that you'd need to call the scripting character (normally / ) and then...


/AddAlias ("immolate", "cass *", "cast immolate %1", 1)


(Note: the default scripting engine, Lua, is case sensitive.)
USA #2
what about the variable, I need to be able to change the spell cast as I get new spells...

-dana
Australia Forum Administrator #3
See: http://mushclient.com/faq points 21, 22 and 50.
USA #4
so, if I understand this right, the following will do what I want?

<aliases>
  <alias
   match="newspell *"
   enabled="y"
   variable="spellname"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </alias>
</aliases>


<aliases>
  <alias
   match="cass"
   enabled="y"
   expand_variables="y"
   sequence="100"
  >
  <send>cast @spellname</send>
  </alias>
</aliases>


<aliases>
  <alias
   match="^cass( .*){0,1}$"
   enabled="y"
   regexp="y"
   sequence="100"
  >
  <send>cast @spellname%1</send>
  </alias>
</aliases>


did I get that right? I can type "newspell immolate" then "cass dragon" and the mud will get "cast immolate dragon"?

-dana
Australia Forum Administrator #5
You could always try it and see ... :-)

You left out expand_variables="y" in your third alias, as that uses the variable "spellname" that should be checked there as well. Otherwise, it seemed to work when I tried it.
USA #6
ok, I added the line.

now, one more question... how do I get this code into the client? I can't put it in the command line, I tried that. So which menu item or dialog box can I copy and paste this into?

and why is this so difficult? I have a ton of aliases, triggers, and macros that would have to be converted... I don't get it.

-dana
USA #7
It's not really that hard to make those aliases in the GUI... it's just different from what you're used to.
Australia Forum Administrator #8
Quote:

and why is this so difficult?


When you read the FAQ items I directed you to, there was a line:


See http://mushclient.com/pasting for hints on how to copy those examples and paste them into MUSHclient.


If you do that, then it is easy to copy those examples into the client. However as David says, the GUI interface is your friend, you can check settings like expand variables easily enough.

Australia Forum Administrator #9
When I was playing Aardwolf recently, I started using a complicated set of aliases like you have, but really, it isn't that hard, because Aardwolf remembers your target.

So what I ended up doing was simply using the Macro configuration screen to set up various things (like F2, F3, F4 etc.) to do things like:

F2: cast 'magic missile'
F3: cast 'immolate'
F4: cast 'cause serious'

(and so on).

Now the trick is to get your target, so I usually start of with:


k kobold


(or whatever the enemy is) and then just mash away at F2/ F3 / F4 etc. Since the MUD remembers the target, you can quickly cast various spells that way.
Australia Forum Administrator #10
Also check out this thread:

http://www.gammon.com.au/forum/bbshowpost.php?id=6442

That shows how to make an alias that adds other tintin-like aliases.