Gearswap Support Thread

Language: JP EN DE FR
users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 ... 183 184 185
 Shiva.Siral
Offline
Server: Shiva
Game: FFXI
user: Siral
Posts: 193
By Shiva.Siral 2013-12-25 07:45:35
Link | Quote | Reply
 
Just looking for someone to explain this addon a bit for me. It looks like it is an alternative to Spellcast.

Is it going to be replacing Spellcast? In which ways is it better or worse. I don't know any programming but I've slowly learned more and more about spellcast and the 'language' used in gearswap is confusing to me.

It says it uses packets so it potentially could be more detectable? but does that also eliminate any lag that spellcast may encounter?

I plan on redoing my PUP xml to include pet casting sets thanks to the new addon petschool. I'm just not sure if it's worth it to just wait until gearswap gets more popular or to go ahead and do it in spellcast.

If anyone could give me more info I'd greatly appreciate it.
[+]
VIP
Offline
Posts: 6194
By Byrthnoth 2013-12-25 08:11:48
Link | Quote | Reply
 
Well, here's something I wrote on BG, slightly updated:

Quote:
First I'll tackle Shortcuts and GearSwap. Before I can really explain what they are and how they're useful, I need to explain how Spellcast works.



Spellcast:
Spellcast loads your .xml file into memory. This file is interpretted each time Spellcast detects a relevant action in your outgoing text buffer. Spellcast iterates over the file once replacing all the standard variables (%Spell, etc.) and then once for each variable you use (in alphabetical order). This is monumentally inefficient, which is why some users experience lag when using complicated spellcast files.

Anwyay, it does all this replacement on the .xml text and then goes through and interprets the resulting logic, generating precast, midcast, and aftercast sets as relevant. It outputs these sets as a series of "input /equip <slot> <gear> <me>;" commands in console (with one /raw /prefix "spell name" <target> command), essentially as a temporary oldschool windower equipment swapping script. The wait commands between precast, midcast, and aftercast are determined by your cast/precast/midcast/aftercast delays and there is no logic after that.

The features can basically be broken down into this:
1) Interpret outgoing text (including shortened forms of spells, spells without prefixes, etc.)
2) Generate a script of equipment changing and dump it into console with the defined "wait" values and the associated /raw command
3) Remove the "/raw " and don't interpret anything prefixed with /raw.
4) Replace any instances of %variables in the outgoing text buffer (for example, %EquipMain).



Shortcuts:
Shortcuts handles the first feature of Spellcast. It does outgoing text interpretation, and I daresay it does it pretty well. It does:
1) Interprets the slugged form of spell names (cure4 = "Cure IV", these are just permutations of the spell names)
2) Default alias interpretation (c4 = Cure IV, these are aliases in the resources)
3) Creates targets if they aren't provided
4) Handles double "//" commands
5) Autocompletes targets -- If you handed Spellcast an invalid target, it would look up the potential targets in your party array and see if the invalid target could possibly be any of them. Shortcuts does this but also looks through the entire monster array. In the case of multiple results, priority will be given to names that start with the phrase you entered. If there are still multiple results, priority will be given to the closest character.
6) Handles single "/" commands -- /cure4 works the same way that //cure4 does. Saves you a character.
7) Handles ambiguous cases. -- /blizzard2 on SMN sub BLM would give you /pet "Blizzard II" <t> if you had Shiva out and the BP:Rage recast timer was below 2 seconds, otherwise it would give you /ma "Blizzard II" <t>. This also works for ambiguous monsterskills, blue magic, BST pet commands, etc.
8) Autocompletes targets for non-battle commands -- /c, /t, /em, /pcmd, etc. It is glorious to be able to check the bazaar of a character named "Pooooooooooo" with /c po.

I've italicized the cases that are also handled by Spellcast. The others are unique to Shortcuts. Please let me know if you find something that is not working.



GearSwap:
GearSwap handles the second and third features of Spellcast. It interprets properly formed incoming chat commands and allows you to swap gear in response to them. However, the way that it does this is a little bit different from Spellcast.

First, GearSwap user files are written in Lua and loaded into memory as code chunks instead of text. When you write a GearSwap file, you are actually writing a part of the program that will load when you are on the relevant job. This means it's very fast and should not cause lag even on your Pentium III Craptop. You can use it like a real scripting language, because it is a real scripting language. There are also a bunch of guides for scripting in Lua because WoW used it for their addons.

Second, GearSwap is modular. Instead of having one file that you interpret once at one point in time and generate all your sets from, you have several functions in your GearSwap file that are called at specific points in time. This allows you to react to changing conditions. Do you want to change to your PDT TP set if your Utsusemi casting is interrupted? You can do that now.

Third, GearSwap defines its precast, midcast, and aftercast time points based on actual game information, rather than simply making them a predefined wait. This also allows me to include pet_midcast and pet_aftercast. Here's how they're defined:
1) precast - This function is executed before the spell is put into the outgoing text buffer, so before your ability. Some features (like cancel_spell or verify_equip) only work in this function.
2) midcast - This function is executed after receiving a "readies" action packet. If you were casting Fire IV, this would be the "Jim starts casting Fire IV" message. Instant actions (like JAs and pet commands) have no midcast.
3) aftercast - This function is executed after receiving the "result" action packet. If you were casting Fire IV, this would be the "Fire IV does 3250 damage to so-and-so" message. This also fires for failures, like "Yumcax is out of range."
4) pet_midcast - Pet midcast fires when you get a "readies" action packet for your own pet. So, "Shiva readies Heavenly Strike." or "Automaton starts casting Cure IV"
5) pet_aftercast - Pet aftercast fires when you get a "result" action packet for your own pet. So "Heavenly Strike does 9500 damage." This also fires for failures.

Fourth, GearSwap injects equip packets to change gear instead of pushing equip commands into the outgoing text buffer. This makes it so you can swap equipment with menus open, including your equipment menu (which lets you watch your gear change). This was a major pet peeve of mine with SpellCast. Also, no more "Equipment changed." messages.

Fifth, GearSwap rejects input for 1 second after sending an outgoing command. If you're a macro spammer (like me), then this will prevent you from accidentally swapping back to your precast gear after you put on your midcast gear. The server rejects input for at least 1 second after entering a command anyway, so this costs you nothing and helps ensure you're wearing the right gear. It doesn't do this anymore automatically, but the framework is still there and you can implement it if desired.

Sixth, GearSwap allows you to react to events that people formerly relied on AutoExec + Dummy spells + Spellcast for. These would be status_change (engaged, idle, etc.), buff_change (gain a march, lose a march, etc.) and self_command. Additionally, we intend to get windower.register_event() working in user files, which would let you basically react to any change with a little work. There's also an initialization (get_sets) and unload (file_unload) event.

Seventh, GearSwap actually tells you the number of each buff that is active on yourself. buffactive['march'] will either return 0, 1, or 2, for instance. This allows you to finally make automatic delay cap sets.


There are more differences, but these are the most immediately noticeable changes. Spellcast is a wooden bicycle with square wheels and GearSwap is a modern racing bike. Check out the documentation and example files, which download into ../addons/GearSwap/beta_examples_and_information.

-- Also, be aware that GearSwap is still in beta. I do not anticipate major API changes, but anything is possible. --





The fourth feature of Spellcast (%variable replacement in the outgoing text buffer) is currently unhandled. It's not a difficult addon to make, but I have made too many addons and can hardly support the ones that I've released. Someone else will have to take that one.

If you find problems, please report them: https://github.com/Byrth/Lua/issues



As far as packet injection, many plugins and addons inject or modify packets (now). They basically fall into two categories:
1) Outgoing modification/injection - Questionably safe in theory.
2) Incoming modification/injection - Except in situations where you inject an incoming packet that generates an outgoing packet, very safe in theory.

Now, I say "in theory" above because the fact of the matter is that Windower has been doing outgoing packet injection for years and SE has yet to do anything about it. Every time lightluggage sorts your inventory or passes something, that's an injected packet. Itemizer/GearCollector moving crap around? Injected packets. When packet injection is done properly, it appears to be reasonably safe in practice. Now... you can probably still get banned for doing packet injection poorly and sending packets that the normal client would never have generated... in theory. In practice, I've sent a shitton of bad packets over the last few months, exceeded any kind of reasonable packets/second metric, etc. and never heard from a GM. It seems like SE is asleep at the wheel, but obviously it's safer to be conservative about this than to just go all willy-nilly packety-injecty, so afaik we're rejecting outgoing packet injection/manipulation addons from the repository that haven't been tested extensively.
[+]
 Shiva.Siral
Offline
Server: Shiva
Game: FFXI
user: Siral
Posts: 193
By Shiva.Siral 2013-12-25 09:03:32
Link | Quote | Reply
 
Thanks much for your response. I understood *most* of what you said. haha. It was exactly what I was looking for.

The advantages of gearswap makes me want to at least try to figure some of it out. I think I'll just start by building new gearsets for any possible situation I can think of and then try to slowly implement them into a file.

Out of curiousity can gearswap differentiate between the automaton nuking or healing. Or maybe even get more advanced than that? Like read pet_midcast and then depending on the type of spell choose which gear to change into?

As far as the master I assume you set the specific JA/etc in the precast and then follow up with the appropriate midcast(similar to spellcast), but if pets only have midcast I just wasn't sure if it could read the spell and immediately know what midcast to use?

Not sure if that makes sense, like I said I'm not very educated on programming.

I'll be sure to read the documentation, I'm sure it will answer a handful of questions. I'm just at work right now and rather wait to jump into it when I can fiddle with it with ffxi open too.
 Lakshmi.Byrth
VIP
Offline
Server: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6195
By Lakshmi.Byrth 2013-12-25 09:17:22
Link | Quote | Reply
 
Check out the summoner example file that downloads when you activate gearswap in the launcher.

I pass in exactly the spell/ability to the pet_midcast function, so you can even macro Cure III and IV differently if you want.
[+]
 Phoenix.Lithical
Offline
Server: Phoenix
Game: FFXI
Posts: 194
By Phoenix.Lithical 2013-12-25 11:53:07
Link | Quote | Reply
 
Byrthnoth said: »
Fifth, GearSwap rejects input for 1 second after sending an outgoing command. If you're a macro spammer (like me), then this will prevent you from accidentally swapping back to your precast gear after you put on your midcast gear. The server rejects input for at least 1 second after entering a command anyway, so this costs you nothing and helps ensure you're wearing the right gear. It doesn't do this anymore automatically, but the framework is still there and you can implement it if desired.
How would I go about implementing this? Would help me out a ton on WHM
 Lakshmi.Byrth
VIP
Offline
Server: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6195
By Lakshmi.Byrth 2013-12-25 11:58:40
Link | Quote | Reply
 
From BG yesterday:
Code
function precast(spell,abil)
    if midaction() then
        midaction_counter = midaction_counter + 1
        if midaction_counter > 3 then
            midaction(false)
            midaction_counter = 0
        else
            return
        end
    else
        midaction_counter = 0
    end
end
The above code would prevent your first 3 attempts to start a new action after initiating an action. The below code just adds the 1 second midaction delay back in, for those that liked it:
Code
function precast(spell,abil)
    if midaction() then
            return
    else
        windower.send_command('wait 1;gs c midact')
    end
end

function self_command(cmd)
    if cmd == 'midact' then
        midaction(false)
    end
end
 Phoenix.Chomeymatt
Offline
Server: Phoenix
Game: FFXI
Posts: 282
By Phoenix.Chomeymatt 2013-12-25 12:09:43
Link | Quote | Reply
 
Lakshmi.Byrth said: »
From BG yesterday:
Code
function precast(spell,abil)
    if midaction() then
        midaction_counter = midaction_counter + 1
        if midaction_counter > 3 then
            midaction(false)
            midaction_counter = 0
        else
            return
        end
    else
        midaction_counter = 0
    end
end
The above code would prevent your first 3 attempts to start a new action after initiating an action. The below code just adds the 1 second midaction delay back in, for those that liked it:
Code
function precast(spell,abil)
    if midaction() then
            return
    else
        windower.send_command('wait 1;gs c midact')
    end
end

function self_command(cmd)
    if cmd == 'midact' then
        midaction(false)
    end
end

What file would you paste that into?
[+]
 Phoenix.Suji
Offline
Server: Phoenix
Game: FFXI
user: suji
Posts: 962
By Phoenix.Suji 2013-12-25 12:31:55
Link | Quote | Reply
 
Phoenix.Chomeymatt said: »
What file would you paste that into?
It goes into your <Player>_<Job>.lua within Addons/GearSwap/data but if you already have a GearSwap file for your job, just pasting won't be enough. You'll have to merge the desired functionality into your GearSwap file. There can only be one definition of those functions.
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-02 17:32:02
Link | Quote | Reply
 
Blargh...now I must learn the ways of writing scripts for Gearswap as I was just getting the hang of Spellcast...is there somewhere where I can read up on what the hell it all means? Its gibberish to me at the moment.
[+]
 Lakshmi.Eyrhika
Offline
Server: Lakshmi
Game: FFXI
user: Eyrhika
Posts: 764
By Lakshmi.Eyrhika 2014-01-02 17:49:40
Link | Quote | Reply
 
Hades.Triet said: »
Blargh...now I must learn the ways of writing scripts for Gearswap as I was just getting the hang of Spellcast...is there somewhere where I can read up on what the hell it all means? Its gibberish to me at the moment.

Im kinda in the same boat.. I was able to frankenstein an existing gearswap to work basics on WAR, but things like locking twilight when weak still escape me
[+]
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-02 18:57:35
Link | Quote | Reply
 
anyone able to help clarify what it is I am doing wrong? I keep getting error "...lua:3: '=' expected near 'Affinity'" error when I try to load Gearswap, here is the line:
Code
sets.precast.ChainAffinity = {head="Mavi Kavuk +2"}
Offline
Posts: 107
By Miang 2014-01-02 19:08:30
Link | Quote | Reply
 
Don't think you can use . twice like that in one line, change it to
Code
sets.precast['Chain Affinity'] = {head="Mavi Kavuk +2"}


I'm new to lua so I'm still finding the way it handles objects/associative arrays strange too
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-02 19:11:17
Link | Quote | Reply
 
Miang said: »
Don't think you can use . twice like that in one line, change it to
Code
sets.precast['Chain Affinity'] = {head="Mavi Kavuk +2"}


I'm new to lua so I'm still finding the way it handles objects/associative arrays strange too
Still gave the same error after reload><
Offline
Posts: 107
By Miang 2014-01-02 19:12:02
Link | Quote | Reply
 
Locking isn't as easy as spellcast at the moment, but one of the ways I'm seeing being suggested is as follows:
Code
equip({head="Twilight Helm",body="Twilight Mail"})
send_command('@wait 0.5;gs disable head body;')
Offline
Posts: 107
By Miang 2014-01-02 19:17:48
Link | Quote | Reply
 
My bad, looking at Byrth's examples, we need to define the sub table as a table first:
Code
sets.precast = {}
sets.precast.ChainAffinity = {head="Mavi Kavuk +2"}


Just tried that and worked on mine
 Fenrir.Jinjo
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 2269
By Fenrir.Jinjo 2014-01-02 19:21:00
Link | Quote | Reply
 
You can do that, you just have to define the precast table first.

sets.precast = {}
sets.precast.ChainAffinity = {head = ""}


sets.precast.ChainAffinity == sets.precast['ChainAffinity'] == sets['precast'].ChainAffinity == sets['precast']['ChainAffinity'], you can use whatever
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-02 19:42:09
Link | Quote | Reply
 
Yeah I have that line before the Chain Affinity one. I used the Byrth_MNK.lua as a template and worked in my BLU sets. Those are the 2 lines I have it just keeps giving me that error. I even tried spacing between the Chain Affinity and nada. D:

Here is what I have atm. (Don't judge my gear atm lol)
 Fenrir.Jinjo
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 2269
By Fenrir.Jinjo 2014-01-02 19:44:30
Link | Quote | Reply
 
I find that specific error is often thrown when the line # before the line shown has a syntactic error near the end of it.

Edit: Looking at the file, sec.
 Fenrir.Jinjo
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 2269
By Fenrir.Jinjo 2014-01-02 19:48:47
Link | Quote | Reply
 
Line 11, you forgot a { after =
 Quetzalcoatl.Crystalchan
Leonardo da Clippi
Offline
Server: Quetzalcoatl
Game: FFXI
Posts: 1184
By Quetzalcoatl.Crystalchan 2014-01-03 12:11:38
Link | Quote | Reply
 
I would love to get into figuring out gearswap because it sounds so much better than spellcast! Where can I find all of Byrth's examples? (or even more examples!)

I've only found this thread on BG. I only really see Motenten and some others posting their gearswaps, which are extremely helpful but I need a bit more examples since I'm really horrible at this kind of thing! I don't really go on BG very often so I'm not exactly sure where to find everything there D: it's hard for me to search for since gearswap is a really common term! I tried looking at guildwork too but I'm not familiar with that site either.

Sorry and thank you! D:

Edit: Gah, it was inside the gearswap folder .~. but if there are other completed ones too, that would be awesome to look at! (WHM would be really fantastic!)
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-03 13:47:14
Link | Quote | Reply
 
Quetzalcoatl.Crystalchan said: »
After installing the Gearswap addon via windower it will place the Gearswap folder into your addons folder. When you open that up there is a folder called "beta_examples_and_information." In there are a few examples for some jobs and a Variables excel file for reference. I just took one of his examples and started filling it in myself, still need some practice though. :x
[+]
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-05 02:05:45
Link | Quote | Reply
 
Curious if there is a link to a collection of .lua files like they had for .xml's for spellcast on pastebin (or wherever it was). Getting lost with the ability commands and what not. D:
 Fenrir.Jinjo
VIP
Offline
Server: Fenrir
Game: FFXI
user: Minjo
Posts: 2269
By Fenrir.Jinjo 2014-01-05 04:13:06
Link | Quote | Reply
 
Byrthnoth said: »
The fourth feature of Spellcast (%variable replacement in the outgoing text buffer) is currently unhandled. It's not a difficult addon to make, but I have made too many addons and can hardly support the ones that I've released. Someone else will have to take that one.

Tah-dah, done. No reason to ever use spellcast.
Offline
Posts: 429
By Selindrile 2014-01-05 17:30:56
Link | Quote | Reply
 
After reading all this, I want to transition to gearswap, but my god, I'm not following all this yet, (I'm a ***coder) I read that Sylow was making his to be stupid-proof by commenting the crap out of them, but his aren't done yet, are there any ready-ish easy-to-adjust XMLs (would love even a rather basic one) out there? Would love one for every job as I to some extent play them all, sadly.
[+]
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-05 17:41:20
Link | Quote | Reply
 
Exactly what I was wondering. I ended up taking Byrth's MNK .lua (as a sort of shell .lua) and adjusted gearsets to my own for a couple jobs (MNK, basic melee BLU, and PLD). Also, someone on here sent me a PM with their .lua (for BLU) and I am looking it over atm trying to decipher what I can.
 Ragnarok.Sekundes
Offline
Server: Ragnarok
Game: FFXI
user: Sekundes
Posts: 4197
By Ragnarok.Sekundes 2014-01-05 18:49:15
Link | Quote | Reply
 
A question. Does gearswap have any special effects on things that take "time" to show up? Things like wyvern hp and such?
 Lakshmi.Byrth
VIP
Offline
Server: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6195
By Lakshmi.Byrth 2014-01-05 18:59:22
Link | Quote | Reply
 
I'm not sure exactly what you're asking, but GearSwap shows you the value in memory for everything except equipment, which it keeps its own registry of. So if you're, for instance, using Release on SMN. You would have to wait a second for your avatar to disappear before you'll officially not have a pet. This is just a limitation of the game and I'm not interested in programming and documenting the hundreds of special exceptions.
[+]
 Valefor.Prothescar
Guide Master
Offline
Server: Valefor
Game: FFXI
Posts: 19647
By Valefor.Prothescar 2014-01-05 19:16:57
Link | Quote | Reply
 
not sure what I'm doing wrong here, but it must be on a fundamental level. I assume there's uncountable errors, mostly because it won't load the file passed line 9.

error i'm getting right now is:

User file problem: *path*:10: '}' expected (to close '{' at line 9) near 'head'
 Hades.Triet
Offline
Server: Hades
Game: FFXI
user: Sirseiko
Posts: 1615
By Hades.Triet 2014-01-05 19:17:59
Link | Quote | Reply
 
At least you made it to 9. Lol mine stopped at 3
[+]
 Quetzalcoatl.Mystery
Offline
Server: Quetzalcoatl
Game: FFXI
user: Thps
Posts: 15
By Quetzalcoatl.Mystery 2014-01-05 19:38:49
Link | Quote | Reply
 
Does GearCollector work with Gearswap?
[+]
First Page 2 ... 183 184 185
Log in to post.