View unanswered posts | View active topics It is currently 17 Jul 2019 11:41

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.



Reply to topic  [ 8 posts ] 
Aliases and Spells 
Author Message
Expert
User avatar

Joined: 04 Nov 2013 20:26
Posts: 296
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.


04 Nov 2013 20:42
Profile
Wizard
User avatar

Joined: 03 Mar 2010 21:55
Posts: 106
Location: Middle Earth
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


04 Nov 2013 22:35
Profile
Expert
User avatar

Joined: 04 Nov 2013 20:26
Posts: 296
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[i];
}

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..."


04 Nov 2013 22:48
Profile
Wizard
User avatar

Joined: 03 Mar 2010 21:55
Posts: 106
Location: Middle Earth
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


05 Nov 2013 08:33
Profile
Adventurer

Joined: 08 Mar 2010 15:58
Posts: 95
.


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



05 Nov 2013 13:35
Profile
Expert
User avatar

Joined: 04 Nov 2013 20:26
Posts: 296
Yanus wrote:
Type: javascript
Body:
Code:
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:
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..."


05 Nov 2013 18:06
Profile
Rising Hero
User avatar

Joined: 09 Mar 2012 22:04
Posts: 307
Location: Reseda
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


07 Nov 2013 14:53
Profile ICQ YIM
Site Admin
User avatar

Joined: 04 Mar 2010 01:14
Posts: 305
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


07 Nov 2013 22:24
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.