Aliases and Spells

Report bugs and suggest new features for the web client here.

Moderator: Eowul

Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
User avatar
Amorana
Expert
Posts: 296
Joined: 04 Nov 2013 20:26

Aliases and Spells

Post by Amorana » 04 Nov 2013 20:42

Hey,

This may just be something to do with how I am creating aliases, but currently the way aliases work is a little troublesome for spell casters, in my opinion. For example if I have a spell called "superawesomeheal" and I alias it through the client to be "heal" = "cast superawesomeheal", when I use the command:

heal eowulthealmostdeadwizard

the alias simply spits out "cast superawesomeheal" and drops eowulthealmostdeadwizard.

This essentially makes it so that through the client I can't alias a spell that I want to be able to cast on someone else. It's able to be worked around right now by just aliasing it in game but not the client, but it seems as though it would be ideal to be able to have all aliasing through the client.

User avatar
Eowul
Wizard
Posts: 106
Joined: 03 Mar 2010 21:55
Location: Middle Earth

Re: Aliases and Spells

Post by Eowul » 04 Nov 2013 22:35

Try 'cast superawesomeheal $*'
Those $<something> get replaced by the arguments passed to your alias.
Where $* returns the text as is, $0 the arguments without quotes, and $1 - $num the specific argument.
Caretaker of Arda

User avatar
Amorana
Expert
Posts: 296
Joined: 04 Nov 2013 20:26

Re: Aliases and Spells

Post by Amorana » 04 Nov 2013 22:48

Hmm, I assume you mean this would have to be a JS alias then?

Could you give me sort of a written out example to go by (both pattern and return portions), because as I am reading it and putting it in, I am getting errors about expected declarations and what not.

This still gets back to my initial point though - my thought is that we should strive to make "raw command" aliases work as they do in the in-game system. Someone shouldn't have to be a JS wiz to be able to write an alias to cast a spell. Why not do something along the lines of (just as a diagram of sorts, more pseudo code than anything below):

alias {args[]}
{
if args.length == 0
{
send alias
}

if args.length > 0
{
String aliasandargs=alias;
for(i=0; i < args.length; i++)
{
aliasandargs=aliasandargs+args;
}

send aliasandargs;
}
}


Just seems like if we had something similar to the logic above built into the alias section, raw command aliases would work exactly as aliases do in the game code.
Zhar wrote: "Man, this guild I'm in is so god damn powerful! Please nerf or I'll have to leave it because it's no fun any more..."

User avatar
Eowul
Wizard
Posts: 106
Joined: 03 Mar 2010 21:55
Location: Middle Earth

Re: Aliases and Spells

Post by Eowul » 05 Nov 2013 08:33

While I was apparently wrong about $* (will need to check that), you can do all this without having to make a javascript alias. Just set pattern to 'heal', then using raw commands you can type 'cast superdupaheal $1'

The $1 will be replaced by your first argument. For 'heal eowul', $1 would be replaced by 'eowul'. I see however, that the case where you type no arguments is not covered by that, so that's something that I should address.
Caretaker of Arda

Yanus
Adventurer
Posts: 95
Joined: 08 Mar 2010 15:58

Re: Aliases and Spells

Post by Yanus » 05 Nov 2013 13:35

.
Last edited by Yanus on 30 May 2014 01:36, edited 1 time in total.

User avatar
Amorana
Expert
Posts: 296
Joined: 04 Nov 2013 20:26

Re: Aliases and Spells

Post by Amorana » 05 Nov 2013 18:06

Yanus wrote:Type: javascript
Body:

Code: Select all

if (args[1] === undefined ) {
  gwc.output.append("  -> Whom you want to heal?  <-");
} else {
  gwc.connection.send("cast whateveryouwish $1",true);
}
There will be a problem with healing unintroduced ones, as they are related to by more than one description. But I didn't want to obfuscate the code.

Close! I have one small edit to what you wrote above for when there is an argument, and then I fixed the first half to make it work the way I'd like it to. See below:

Code: Select all

if (args[1] === undefined ) {
  gwc.connection.send("cast whateryouwish",true);
} else {
  gwc.connection.send("cast whateveryouwish " + $1,true);
}
With the above, you can put in no argument to have the spell that is being cast effect only yourself, and put in a singular argument to have it effect someone else.
Zhar wrote: "Man, this guild I'm in is so god damn powerful! Please nerf or I'll have to leave it because it's no fun any more..."

User avatar
Snowrose
Rising Hero
Posts: 307
Joined: 09 Mar 2012 22:04
Location: Reseda
Contact:

Re: Aliases and Spells

Post by Snowrose » 07 Nov 2013 14:53

yeah i was trying to figure the client wildcard also

i had an alias comp that was compare first $1 with second $1 then typed comp sword.
i tried %1, $1, $* ect for wildcard.

if it works now ill be thrilled as i dont like messing with java when i dont have to.
Image

User avatar
cotillion
Site Admin
Posts: 310
Joined: 04 Mar 2010 01:14

Re: Aliases and Spells

Post by cotillion » 07 Nov 2013 22:24

Snowrose wrote:yeah i was trying to figure the client wildcard also

i had an alias comp that was compare first $1 with second $1 then typed comp sword.
i tried %1, $1, $* ect for wildcard.

if it works now ill be thrilled as i dont like messing with java when i dont have to.
What you want is something like:
comp $0 with second $0

$0 is the entire argument
It's perfectly fine to use the same substitution several times

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/