Macros Vs Lua Scripts And Gear Swap

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » Windower » Support » macros vs lua scripts and gear swap
macros vs lua scripts and gear swap
 Leviathan.Arcon
VIP
Offline
サーバ: Leviathan
Game: FFXI
user: Zaphor
Posts: 666
By Leviathan.Arcon 2015-01-21 15:59:19  
Verda said: »
Is this the complete list of commands for scripts? I can't help but feel it's missing alot:
http://wiki.windower.net/doku.php?id=windower:commands

Possibly.

Verda said: »
I noticed this too for Gearswap:
http://wiki.windower.net/doku.php?id=addons:gearswap:documentation:global_variables:start

which is pretty extensive awesome!

This is not as up-to-date as the file that is bundled with GearSwap (Windower/addons/GearSwap/beta_examples_and_information/Variables.xlsx). That's actually the file it's based on, but it has to manually be updated whenever GS is updated, and I don't know if anyone still maintains it.

Verda said: »
I'm just wanting to write some basic macros. But there's a few hangups I have I hope some nice person can answer for me.

I'm not nice, but I'll answer anyway. One of the advantages of not being nice is not to have to care about what you want!

Verda said: »
Example, lets say I want a macro when hitting alt + 4 to use sneak attack, trick attack and assassin's charge followed by an evisceration:
Code
bind !4 input /ja "Sneak Attack";wait 1;/ja "Assassin's Charge";wait 1;/ja "Trick Attack";wait 1;/ws "Evisceration" <t>


Supposedly that works if I typed all the names right. But it's hard to edit and read. I'd like it if I could do more:
Code
bind !4 [[
input /ja "Sneak Attack"
wait 1
/ja "Assassin's Charge"
wait 1
/ja "Trick Attack"
wait 1
/ws "Evisceration" <t>
]]


I didn't test but I doubt that works because I can find no examples of that.

It does not. There is currently no way to do this in a regular script file.

Verda said: »
so instead you have to start making tons of txt files:

(Or use a better macro setup that doesn't chain abilities ;p)

Verda said: »
Now with gear swap, people have all sorts of conditional gear equipped for their skills and different situations. Which is great, but I don't have multiple gear sets yet being a noob. So I really just need good macros I can rely on and then add that as I get gear.

GS is not the right place for this. It's often called a "macro engine", but it's not, it's a gear change engine. You can abuse it to set key binds, but you can also use Yush for that, which is what it's intended for.

Verda said: »
Binds don't seem to show up in any of the example lua gearswap things however.

For the above reason.

Verda said: »
And I'm not sure on the syntax. But what I would like to do is make one big lua file for all my macros using the gearswap global variables.

There are Lua scripts in addition to regular Windower scripts that allow you to use Lua code. That's completely unrelated to GearSwap.

Just create a .lua file instead of a .txt file and then you can format it like this:
Code
windower.send_command('bind ^3 ' .. table.concat({
    'input /ja "Sneak Attack" <me>',
    'wait 1',
    'input /ja "Trick Attack" <me>',
    'wait 1',
    'input /ja "Assassin's Charge" <me>',
    'wait 1',
    'input /ws "Evisceration" <t>',
}, ';'))


Verda said: »
Then I can do something like for summoner cast different BP's based on what summon is out.

I.E. I want to be able to choose my summon and contextually use bloodpacts bound to the same keys.

This is something GearSwap should do! GearSwap has an option to register your own commands with the self_command function. I'm not sure on the details (someone can correct me), but I think it works something like this:
Code
self_command = function(command, ...)
    local args = {...}

    if command == 'bp' then
        -- Disambiguate here based on the provided argument
    end
end


The easiest way to do the spell disambiguation is to define a table:
Code
bps = {
    Garuda = {
        ward1 = 'Aerial Armor',
        ward2 = 'Whispering Wind',
        ...
    },
    Leviathan = {
        ward1 = 'Slowga',,
        ward2 = 'Spring Water',
        ...
    }
}

self_command = function(command, ...)
    local args = {...}

    if command == 'bp' then
        local pet = windower.ffxi.get_mob_by_target('pet')
        if pet then
            local ja = bps[pet.name][args[1]]
            if ja then
                windower.send_command('input /ja "%s" <me>':format(ja))
            end
        end
    end
end
[+]
Offline
Posts: 14420
By Pantafernando 2015-01-21 16:53:18  
About the macro bidding, im no good by any means, but i can deal with those by:

- Binding scripts directly to keyboard buttons: for example, when i want to dd, heal and stun in delve at same time, i use my whm as first person, create a script for gear changes (input /equipset 1; input /ws "vs" <t>; wait 2; input /equipset 2) and place an /console send //exec "ws.txt" directly in my macro pallete.

- Stunning is more critical, so i need fast and direct access, so i create a script (input /ma "stun" <bt>), then i bind in my space button (bind space send char "\/\/exec stun.txt"). This way, as soon as i read a tp move, quickly i hit space for stun.

- i have another binding similar to stun, for chaotic strike and shocksquall, so list becomes bigger as more buttons are consume. So, i can speed up my binding by writing a scrit responsible to bind all my necessary binds. This way, i just need to call once when i log (//exec "char.txt") and all my familiar binds are done. I can bind it directly in int.txt inside windower folder, but it loads all my binds for all chars, what becomes a nuisance losing some buttons for no reason.
 Sylph.Jeanpaul
MSPaint Champion
Offline
サーバ: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2015-01-21 17:55:18  
I thought about making a new thread for this, but figure this is a good enough place to bring it up:

Started using Yush lately, noticed that it's not working well for me with <stpc> macros, like say input /ma "Refresh" <stpc>. Often times, when I use said macros, I'll get the blue subtarget arrow and can pick a target, but then nothing happens when I hit enter. After a few tries, it'll usually work. Is this just something with Yush or generally a problem with using these kinds of macros through lua?
Offline
Posts: 14420
By Pantafernando 2015-01-21 20:09:46  
?

None of my commands have anything related to gs. From my perspective, script like mine arent more than typed command throwed at a sequence. Its like a game macro but with more lines.

I believe, from SE perspective, using scripts like mine, that dont use any packet, hardly can be recognize. Executing a script and manually typing seems the same to me from a server perspective.
 Leviathan.Arcon
VIP
Offline
サーバ: Leviathan
Game: FFXI
user: Zaphor
Posts: 666
By Leviathan.Arcon 2015-01-22 02:46:48  
Sylph.Jeanpaul said: »
I thought about making a new thread for this, but figure this is a good enough place to bring it up:

Started using Yush lately, noticed that it's not working well for me with <stpc> macros, like say input /ma "Refresh" <stpc>. Often times, when I use said macros, I'll get the blue subtarget arrow and can pick a target, but then nothing happens when I hit enter. After a few tries, it'll usually work. Is this just something with Yush or generally a problem with using these kinds of macros through lua?

Shouldn't be a problem with Lua, although technically it should also not be a problem with Yush, unless some keys are not being registered correctly.

You can enable the verbose option to see if you're in the right macro table when you press the key. However, that will only tell you the table you're currently in, not the line you're eventually executing. I can add a "super-verbose" option for debugging this if you want.
[+]
VIP
Offline
Posts: 111
By Iryoku 2015-01-22 05:48:53  
Verda said: »
I'll think over some of those ideas but I want to avoid putting gs or console commands in my macros. It just doesn't feel right to me :| I understand it does work and that's great. But maybe it's my paranoia that it just makes it even more obvious to SE what you're doing one day they decide that they don't like this windower thing. Or maybe I'm just a neat freak when it comes to not mixing ideology or something but I'd like to keep the ffxi macros ffxi related only. I like the idea of stun on the spacebar though that sounds fun!

There are certainly good reasons to avoid putting Windower or Gearswap commands in macros (so, you should probably keep doing it). However, being detected by SE is not one of them, the commands are intercepted by Windower long before SE ever sees them.
[+]
Offline
Posts: 14420
By Pantafernando 2015-01-22 06:02:21  
Iryoku said: »
Verda said: »
I'll think over some of those ideas but I want to avoid putting gs or console commands in my macros. It just doesn't feel right to me :| I understand it does work and that's great. But maybe it's my paranoia that it just makes it even more obvious to SE what you're doing one day they decide that they don't like this windower thing. Or maybe I'm just a neat freak when it comes to not mixing ideology or something but I'd like to keep the ffxi macros ffxi related only. I like the idea of stun on the spacebar though that sounds fun!

There are certainly good reasons to avoid putting Windower or Gearswap commands in macros (so, you should probably keep doing it). However, being detected by SE is not one of them, the commands are intercepted by Windower long before SE ever sees them.

What kind of problems can that result?
necroskull Necro Bump Detected! [66 days between previous and next post]
 Leviathan.Protey
Offline
サーバ: Leviathan
Game: FFXI
user: Protey
Posts: 685
By Leviathan.Protey 2015-03-29 00:46:53  
Having a bit of trouble with macros and was hoping someone with more knowledge can help. Basically the problem is some (not all) of my precast equipment is staying equipped on my BLM nuking macros. The macros look like this:

input /equip precast gears
wait .1
input /ma spell
wait .3
input /equip cast gears

So I tried adding another command to put cast gear to see if it would help:

input /equip precast gears
wait .1
input /ma spell
wait .3
input /equip cast gears
wait .3
input /equip cast gears

But I still get the same problem with one or two precast pieces of equipment when my nuke goes off. Anyone know how I can fix this?
 Shiva.Malthar
Offline
サーバ: Shiva
Game: FFXI
user: Malthar
Posts: 518
By Shiva.Malthar 2015-03-29 01:55:42  
Use gearswap. Seriously, use gearswap. The game sucks at swapping out gear quickly if it's not sent by packets.
Log in to post.