Alias...

Posted by Zeno on Wed 06 Nov 2002 11:58 PM — 12 posts, 39,292 views.

USA #0
I have to make an example to show want I want...
Alias-water
Sends-cast 'create water'

But when you need to specify a target like so-
cast 'create water' jug
but when I do-
water jug
it says huh?
Someone wanna help?
USA #1
2 ways around it. Either:

A)
alias - water
send - cast 'create water' jug

B)
alias - water *
send - cast 'create water' %1
USA #2
water jug
cast 'create water'
What should the spell be cast upon?

Second doesn't work...
#3
try

alias: water( .*)?
send: cast 'create water'%1

check the 'regular expression' box
Australia Forum Administrator #4
Quote:

Second doesn't work...


The second one should work.

You make the alias:


<aliases>
  <alias
   match="water *"
   enabled="y"
  >
  <send>cast 'create water' %1</send>
  </alias>
</aliases>


(Copy the above and paste into the alias window).

Then type: water jug

It works, I tried it.

USA #5
I got it to work, but now...

water
Huh?

water jug
cast 'create water' jug
A water jug is filled.

help?
Amended on Fri 08 Nov 2002 11:11 PM by Zeno
Australia Forum Administrator #6
In that case, Vaejor's suggestion will work:


<aliases>
  <alias
   match="^water(.*?)$"
   enabled="y"
   regexp="y"
  >
  <send>cast 'create water'%1</send>
  </alias>
</aliases>
USA #7
Yeah, I tried that but when I...

compare armor
(It cast the spell)

More help? Heh
Australia Forum Administrator #8
I don't understand what you are doing here. "compare armor"?

What has that to do with the water spell?

Can you copy the alias in question, and paste it here, then copy and paste what you are typing, and what you expect it to do.
USA #9
Hehe, oops. My bad. I also have a spell just like water, armor.

armor *-
cast 'armor' %1

Then-
compare armor
(Casts spell)

ok?
Australia Forum Administrator #10
Sounds like you are mixing things up a bit here.

My earlier suggestion had some important things in it, namely the "^" and "$". These say "match start of line", "match end of line". Without them any line with "armor" in it will match. I suggest copying the working one I did, and amending it slightly to replace "water" with "armor", like this:



<aliases>
  <alias
   match="^armor(.*?)$"
   enabled="y"
   regexp="y"
  >
  <send>cast 'armor'%1</send>
  </alias>
</aliases>
USA #11
going back to the water thing, sounds like you want 2 different aliases maybe.
IF your drink container is ALWAYS going to be a jug, then just do this

<aliases>
<alias match="water"
enabled="y"
<send>cast 'water' jug</send>
</alias>
</aliases>

So if you type 'water' it will cast water on a jug always. Typing 'water keg' or something like that will not do anything.
IF you want the option to have your water container vary so it's not always going to be a jug, then do this alias

<aliases>
<alias match="water *"
enabled="y"
<send>cast 'water' %1</send>
</alias>
</aliases>

BUT if you only have this alias above, typing 'water' will do nothing, you will always have to type 'water jug' or 'water keg' or whatever.
The best thing to do is create both the aliases above, so you can just type 'water' to cast water on your jug, but you can still type 'water <item>' to cast water on an item other than your jug.
Is that what you wanted?