No strings attatched (AKA smart macros)

Moink

Artifact Armor
Adventurer
Joined
Jul 22, 2006
Messages
801
Location
Windurst Walls
Website
www.themoink.com
Main Job
WhiteMage-Male
Secondary Job
Summoner-Male
Third Job
Puppetmaster-Male
Server
Quetzalcoatl
Linkshell
Persephone
I can't say that this a big deal but I figured... meh why not make it public so atleast the QCDN community knows about it.

It has to deal with making macros and although this is still entirely up to you to do it or not... doing it just makes your macros more clean.


When making a macro... I more often then not see players saying to do this.

/ja "Activate" <me>

...

As much as doing this will work and the code is still vaild, those " aren't needed it.

Quotations are used for whats called string. A string is used for taking multiple words and combining them as one word such as:

Fire Manuever

Without the quotes, the database will look for the word fire and/or manuever and it will call back to you with an error. specifically because the word fire or manuever don't exist in the JA database. Adding quotaions like so:

"Fire Manuever"

Will allow the server to search for the proper ability and it will find it and call it back to you. The reason quotes were implimented was because the space between words is not recognized as a valid variable. All this works even with google and if your knowledgible about it, It can even make your google searches easier. Although I think google has some of those commands installed.

Quotation marks are needed for items that have multiple words to them. those that do not have multiple words do not need the quotation marks.


The one thing that FFXI has drawn me to is the code or programs the game runs and the ability that a user has to change or adapt the code to fit his or her personal playing style. This by all means is up to you.

In anycase, carry about your business, I was just bored at work and felt the need to share that tid bit lol...
 
Last edited:
The reason I use those quotations on macros no matter what they are is because, while it's acceptable not to, it's just good coding practice. Also, I've created a pallet of template macros to make creating new macros easier, just copy paste and fill in the blanks.
 
As much as doing this will work and the code is still vaild, those " aren't needed

I'm a fan of consistency, the " may not be needed, but having them sometimes, and not others isn't something I like. Take the macro `/ma Thunder <t>`, imagine you now learn thunderII, it'd be easy to make this mistake `/ma Thunder II <T>`. Had the double quotes been there from the start, it'd be immediately apparent upon updating the macro to add the II within the double quotes. In terms of speed, either way should be close enough in cpu cycles that one is much much much less than a second longer than the other, and for practicle purposes, the same speed. (assuming SE aren't idiots, which is sadly an assumption that may be wrong)

Without the quotes, the database will look for the word fire and/or manuever and it will call back to you with an error. specifically because the word fire or manuever don't exist in the JA database.
Specifically the database would look for only "fire" assuming it looks up anything at all, "maneuver" would either cause a parse error, or be treated by the code that handles the target code like <t>, where it will then cause an error for not being a valid target, the JA lookup code would never see or touch the word maneuver.

The reason quotes were implimented was because the space between words is not recognized as a valid variable.
A variable stores data, a space between words indicates a break in the string, and beginning of a new string, not an invalid variable.

The one thing that FFXI has drawn me to is the code or programs the game runs and the ability that a user has to change or adapt the code to fit his or her personal playing style. This by all means is up to you.
Actually I find it rather unimpressive that ffxi requires quotes for multi-word commands, considering the format is always

`/[command] [ja/spell name] [optional target code enclosed in angle brackets]`

I should be able to type `/ma <t> thunder II`, `/ma thunder ii <t>` and `/ma "Thunder II" <t>` with the same result. The code to handle such things is trivial.
 
Maybe so dave but remember FFXI is atleast 10 years old in terms of the code thats in involved. Some things that are available now, weren't then.
 
Maybe so dave but remember FFXI is atleast 10 years old in terms of the code thats in involved. Some things that are available now, weren't then.

Regular expressions have existed since before the final fantasy franchise even started.
 
Very simple script I wrote that separates a command http://waywardrobot.com/dev/tst/macro_parse.php

It has almost zero error checking, and bound to have bugs, but I'm no expert, not by a long shot, and this took about 10mins to write up.

/ma thunder II <t>
/ma "Thunder II" <t>
/ma <t> "Thunder II"
/ma <t> Thunder II

all should work
 
It's sad that SE's hopefully more experienced programmers could figure this out and make their command parser not ridiculously limited. I mean this is stuff you learn first year in CS.
 
This is stuff you learn in middle school on your TI-83...
 
Did SE make it so you could see other people's macros or something ;)

Haha no. Screenies like ones on here with Myrrh doing

/ma "Crabuncle" <me>

or people stating how to make macros in linkshell or party chat and they use

/ja "Provoke" <(b)t>



I will say SE system is primitive when amature/experienced programmers look at it. Unfortunately nothing we can do about it and I highly doubt SE will revamp their code to fit new standards.
 
Primitive = easy to use. Not everyone who plays FFXI knows programming/coding.

Im not calling gamers primitive, im calling SE's coding primitive.

This thread is to help gamers understand whats not really needed.
 
Im not calling gamers primitive, im calling SE's coding primitive.

This thread is to help gamers understand whats not really needed.

I know you are calling SE's coders primitive. But i'm guessing they just wanted it as easy as possible so everyone would be able to make macros.
 
You guys are cracking me up, and Daveman's right. Regular expressions have been in existence for a long, long, long, long, long time. I also agree that the "" are just good coding practice. With programming, consistency is key. For instance, and I'm just using PHP here because it's what I've been using for about a decade, you could print a string either of the following ways:

print("this is a string");
printf("this is a string");
echo("this is a string");
echo "this is a string";
echo 'this is a string';

If you're throwing in a variable, things get a little bit more complicated, but if I were to take the double-quote vs single quote approache, I'd be left with these:

echo "hi there $username";
echo 'hi there'.$username;

The thing is, single quotes aren't parsed for variables, so if you already know that no variables exist within the quote, you'll speed up your code a little by using single quotes. Plus, in my opinion, it's just bad practice to throw a variable inside a double quote. Just looks ugly as hell, in my opinion. But this comes down to user-preference, which is what the FFXI programmers had when they developed their macros the way they did.

They could have forced all strings typed into the chat log to be thrown into an array and then looped to build a macro if a macro was detected, but they chose the simplistic approach, which is usually better. Which would you prefer, more lag? Or less lag? Also, occasionally, programmers compromise beautiful code for fast code.

So, until you know EXACTLY why SE programmers did things the way they did--which I won't pretend to--I wouldn't assume that they're somehow amateur.
 
Back
Top