Help creating casting alias
Posted: Mon Mar 05, 2018 5:18 pm
Hello, I'm having a problem creating simple casting and targeting aliases since I do not have much experience with scripting and I was wondering if I could get some assistance
Example 1
I've created an alias to cast lightning on a target;
pattern: ^cl(.+)$
send("cast lightning"..(matches[2] or target))
This works fine. If I "cl bear", it casts "cast lightning bear".
However, it's conflicting with basic in-game commands. For example, if I "clanwhere" to check where my clannies are located, it'll do the following "cast lightninganwhere"
Example 2
I've created two aliases for different spells;
The first casts shocking on a target:
pattern: ^cs(.+)$
send("cast shocking"..(matches[2] or target))
Again, this works fine. "cs bear" casts "cast shocking bear"
The second casts sanctuary without a target (because it doesn't need one, it casts only on the user);
pattern: ^css$
command: cast sanctuary
Again, this works fine. However, it also casts shocking because of the similar syntax. So, I'll see in-game
"cast shockings"
"cast sanctuary"
In both cases, I'd like it to use the exact match of the alias syntax without conflicting with in-game commands or other aliases. I know I could simply change the pattern in example 2 to something like "^csanc$" but this does not solve the conflict with in-game commands and there are numerous ones. Is there a way to change the pattern or the sending without having to change the alias naming itself and fix this conflict?
Like I said, I have very little experience with scripting so any help would be appreciated!
Example 1
I've created an alias to cast lightning on a target;
pattern: ^cl(.+)$
send("cast lightning"..(matches[2] or target))
This works fine. If I "cl bear", it casts "cast lightning bear".
However, it's conflicting with basic in-game commands. For example, if I "clanwhere" to check where my clannies are located, it'll do the following "cast lightninganwhere"
Example 2
I've created two aliases for different spells;
The first casts shocking on a target:
pattern: ^cs(.+)$
send("cast shocking"..(matches[2] or target))
Again, this works fine. "cs bear" casts "cast shocking bear"
The second casts sanctuary without a target (because it doesn't need one, it casts only on the user);
pattern: ^css$
command: cast sanctuary
Again, this works fine. However, it also casts shocking because of the similar syntax. So, I'll see in-game
"cast shockings"
"cast sanctuary"
In both cases, I'd like it to use the exact match of the alias syntax without conflicting with in-game commands or other aliases. I know I could simply change the pattern in example 2 to something like "^csanc$" but this does not solve the conflict with in-game commands and there are numerous ones. Is there a way to change the pattern or the sending without having to change the alias naming itself and fix this conflict?
Like I said, I have very little experience with scripting so any help would be appreciated!