more alias help

syrik
Posts: 90
Joined: Sat Jun 26, 2010 9:57 pm

more alias help

Post by syrik »

Ok, in the mud I play I am currently playing 2 different attack setups that require the same aliases to pull of successfully. So I need a way to switch what my aliases do really quickly. It would be like this:
"b" would go from bash to backstab
"h" would go from rescue to hide
and visa versa. Thanks in advance!

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: more alias help

Post by Yetzederixx »

I'm baffled why you can't use multiple alias'...doesn't make sense to me.

alias b:
Code: [show] | [select all] lua
-- This will default to bash since isBackstab is undefined, switch around at will
-- Then modify for your 'h' alias
if isBackstab then send("backstab") else send("bash") end 

isBackstab = not isBackstab

syrik
Posts: 90
Joined: Sat Jun 26, 2010 9:57 pm

Re: more alias help

Post by syrik »

Ok, so I tried this and just kinda alternated between bash/backstab. Sorry if I am being dense.
The reason I don't use multiple aliases, btw, is that most of the rest of the easy to reach keys on my keyboard are actually used up atm :(.

Edited to make more sense.
Last edited by syrik on Mon Nov 29, 2010 7:00 am, edited 1 time in total.

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: more alias help

Post by Yetzederixx »

the first time you typed b (since this is the alias) it will send bash to the mud, then backstab, so on and so forth.

syrik
Posts: 90
Joined: Sat Jun 26, 2010 9:57 pm

Re: more alias help

Post by syrik »

Oh, maybe I didn't make this clear at the beginning, sorry! I would like to be able to switch in between them when I want to. So if I am in my bash setup, but want to switch to stab, I can just type like "change" or something and it will switch my aliases.

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: more alias help

Post by Yetzederixx »

Are you doing this for two different characters? If you are there's an easier approach.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: more alias help

Post by Heiko »

Check the API reference in the manual for enableAlias(name) and disableAlias(name). You can define as many input trigger patterns (=alias) as you like and enable or disable them when necessary.

Casimar
Posts: 22
Joined: Sun Nov 07, 2010 3:47 pm

Re: more alias help

Post by Casimar »

here's what I'd do:

create my alias "change" =
Code: [show] | [select all] lua
 if setup == nil or setup == 0 then
setup = 1
echo("now using backstab and hide")
else
setup = 0
echo("Now using stab and rescue")
end
then the "b" would have:
Code: [show] | [select all] lua
if setup == 0 or setup == nil then
send("bash")
else
send("backstab")
end
and the "h"
Code: [show] | [select all] lua
if setup == 0 or setup == nil then
send("rescue")
else
send("hide")
end
now with those set up you don't have to create a variable as it will create it by default the first time you hit any of those aliases.

syrik
Posts: 90
Joined: Sat Jun 26, 2010 9:57 pm

Re: more alias help

Post by syrik »

That looks pretty sweet, thanks.

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: more alias help

Post by Yetzederixx »

I use the same alias', and some triggers, for multiple characters many with different commands.

I log my characters with buttons that when pressed set various values that those alias' work from. So if you want to bash on a warrior and backstab on your thief you can press the same button, you just make a group with your characters name, put the alias b with the command send("bash") in the warrior's folder, and send("backstab") in the thieves. Now with your login button you disableAlias("OTHERCHARS") so you don't get double fires.

Post Reply