Gearswap Scripting Tips And Tricks

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » Windower » Support » Gearswap Scripting Tips and Tricks
Gearswap Scripting Tips and Tricks
 Odin.Quixacotl
Offline
Server: Odin
Game: FFXI
user: Quixacotl
Posts: 170
By Odin.Quixacotl 2014-08-08 18:50:03
Link | Quote | Reply
 
More people than ever are converting to Gearswap as evidenced by the Help treads and from in-game banter.

I thought I would share a few of my own Gearswap scripting 'Easter Egg' codelets which might be useful to both novice and seasoned scriptwriters alike. These codes can also be used as educational ideas to inspire others to write their own scripts. Anyone can copy a script but you still have to edit it. Customization takes GS to a whole new level.

Notes: These codes are -not- stand alone. In order to utilize these codes you must have a basic concept of GS scripting.

I invite others' to share their own ideas.

Lock certain slots
Lock Mecistopins Mantle for ALL your jobs with one file. - Only works if you're using Mote's library luas.
Auto Lockstyle
-- Simple
-- Better defined
Universal Cancel spell - You need the plugin, "Cancel" for this to work.
For the Beastmasters - You can use variations of this code to cycle misc. ammo for other jobs.
-- Cycle Broths (jugs) and Pet food
Equip Twilight Cape and Obis on Day or Weather - Works for Scholar Storms.
Don't Blink when Tele-Warping
Don't Blink when Dead
Lock Gear for the duration of a buff - Buffactive Gear

More to come soon...
[+]
 Fenrir.Motenten
VIP
Offline
Server: Fenrir
Game: FFXI
user: Motenten
Posts: 764
By Fenrir.Motenten 2014-08-08 18:59:20
Link | Quote | Reply
 
If you use the cancel addon instead of the cancel plugin, you can use send_command('cancel sneak') for better readability.

Also, because I was reminded yet again of those horrific indexing patterns, like equip(sets.MeleeTP[sets.MeleeTP.index[MeleeTP_ind]]), I'm going to try to put together a more reasonable bit of code to handle that that can be used by everyone.
 Odin.Quixacotl
Offline
Server: Odin
Game: FFXI
user: Quixacotl
Posts: 170
By Odin.Quixacotl 2014-08-08 19:07:54
Link | Quote | Reply
 
Thanks Motenten. The community can certainly use any easier and streamlined way of doing things, including me. :)
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2014-08-09 01:23:54
Link | Quote | Reply
 
For lockstyle, I use (within the self_command section):
Code
if command == 'LOCKSTYLEGO' then
equip(sets.Lockstyle)
send_command('wait 1.5;input /lockstyle on;gs c equip Idle set')
end
while binding alt+Z to "gs c LOCKSTYLEGO" in the init.txt file. That way, I can equip a specific set look, though it requires that I press alt+Z every new zone I enter, and of course making a set in each lua file

Simple example:
Code
sets.Lockstyle = {head="Usukane Somen",
body="Usukane Haramaki",hands="Usukane Gote",
legs="Usukane Hizayoroi",feet="Usukane Sune-Ate"}


I also use a section in precast/buff_change to equip (and keep equipped without locking, just in case) my PDT set if I'm stunned, terror'd, or petrified:
 Fenrir.Motenten
VIP
Offline
Server: Fenrir
Game: FFXI
user: Motenten
Posts: 764
By Fenrir.Motenten 2014-08-09 02:36:05
Link | Quote | Reply
 
OK, created a utility class for 'mode' variables. It's available in the Mote-Libs repository (not pushed to Windower yet), and does -not- require using Mote-Include. It's completely independent of that.

Get the file Modes.lua from https://github.com/Kinematics/Mote-libs if you want to try it out.


The below is the comments from the file itself, but should help explain its usage so you can decide whether it's of interest to you.
Code
-------------------------------------------------------------------------------------------------------------------
-- This include library allows use of specially-designed tables for tracking
-- certain types of modes and state.
--
-- Usage: include('Modes.lua')
--
-- Construction syntax:
--
-- 1) Create a new list of mode values. The first value will always be the default.
-- MeleeMode = M{'Normal', 'Acc', 'Att'} -- Pass in a basic table, using braces.
-- MeleeMode = M('Normal', 'Acc', 'Att') -- Pass in a list of strings, using parentheses.
-- MeleeMode = M(anotherTable) -- Pass in a reference to another table, using parentheses.
--    Note: The table must have standard numeric indexing.  It cannot use string indexing.
--
-- 2) Create a boolean mode with a default value of false (note parentheses).
-- UseLuzafRing = M()
-- UseLuzafRing = M(false)
-- Create a boolean mode with a default value of true:
-- UseLuzafRing = M(true)
--
--
-- Public functions:
--
-- Assuming a Mode variable 'm':
--
-- 1) m:cycle() -- Cycles through the list going forwards.  Acts as a toggle on boolean mode vars.
-- 2) m:cycleback() -- Cycles through the list going backwards.  Acts as a toggle on boolean mode vars.
-- 3) m:toggle() -- Toggles a boolean Mode between true and false.
-- 4) m:set(n) -- Sets the current mode value to n.
--    Note: If m is boolean, n can be boolean true/false, or strings of on/off/true/false.
-- 5) m:reset() -- Returns the mode var to its default state.
-- 6) m.current -- Gets the current mode value.  Booleans will return the boolean values of true or false.
-- 7) m.value -- Gets the current mode value.  Booleans will return the strings "on" or "off".
--
-- All public functions return the current value after completion.
--
--
-- Example usage:
--
-- sets.MeleeMode.Normal = {}
-- sets.MeleeMode.Acc = {}
-- sets.MeleeMode.Att = {}
--
-- MeleeMode = M{'Normal', 'Acc', 'Att'}
-- MeleeMode:cycle()
-- equip(sets.engaged[MeleeMode.current])
--
--
-- sets.LuzafRing.on = {ring2="Luzaf's Ring"}
-- sets.LuzafRing.off = {}
--
-- UseLuzafRing = M(false)
-- UseLuzafRing:toggle()
-- equip(sets.precast['Phantom Roll'], sets.LuzafRing[UseLuzafRing.value])
-------------------------------------------------------------------------------------------------------------------


So instead of
Code
    sets.RangedTP = {}
    
    sets.RangedTP.index = {'Standard', 'Accuracy'}
    --1=Standard, 2=Accuracy--
    
    RangedTP_ind = 1
    
    sets.RangedTP.Standard = {<stuff>}
    sets.RangedTP.Accuracy = {<stuff>}
    
    elseif command == 'toggle RTP set' then
        RangedTP_ind = RangedTP_ind +1
        if RangedTP_ind > #sets.RangedTP.index then RangedTP_ind = 1 end
        send_command('@input /echo <----- Ranged TP Set changed to '..sets.RangedTP.index[RangedTP_ind]..' ----->')
        equip(sets.RangedTP[sets.RangedTP.index[RangedTP_ind]])


You could have:
Code
    RangedTPModes = M{'Standard', 'Accuracy'}

    sets.RangedTP.Standard = {<stuff>}
    sets.RangedTP.Accuracy = {<stuff>}

    elseif command == 'toggle RTP set' then
        RangedTPModes:cycle()
        send_command('@input /echo <----- Ranged TP Set changed to '.. RangedTPModes.value ..' ----->')
        equip(sets.RangedTP[RangedTPModes.value])


And, because cycle() returns the current value when done, you could even trim down the code where you cycle things to:
Code
    elseif command == 'toggle RTP set' then
        equip(sets.RangedTP[RangedTPModes:cycle()])
        send_command('@input /echo <----- Ranged TP Set changed to '.. RangedTPModes.value ..' ----->')


(Of course I'd personally use add_to_chat instead of send_command to send an echo, but I just copied this from another lua file.)
necroskull Necro Bump Detected! [40 days between previous and next post]
Offline
Posts: 46
By bubba37343 2014-09-17 18:17:24
Link | Quote | Reply
 
I was just getting used to spellcast when it was no longer supported for some reason. I don't understand any coding, so, is there a place I can get a WHM Gearswap file that I can just plug my gear into? I have been searching for weeks, and haven't found anything.

Also, how do I get Gearswap to start up other than the "//lua l gearswap" command? And how do I make it go to the certain job's file when I job change?

Any help would be appreciated. Thank you.
 Bismarck.Inference
Offline
Server: Bismarck
Game: FFXI
user: Inference
Posts: 417
By Bismarck.Inference 2014-09-17 18:22:31
Link | Quote | Reply
 
List of premades, Motenten(Kinematics) is generally regarded as the most popular for people who just want to plug in their gear and go:

http://www.bluegartr.com/threads/119444-Gearswap-Shop-Thread


If you have GearSwap toggled under your launcher, it should load the addon automatically when you start up FFXI.

Your .LUA files should go under : Windower/Addons/GearSwap/Data

If you name it as : charactername_JOB it will autoload anytime that character switches to that job(use 3 letter abbreviation for job, so Inference_WHM for example)
Offline
Posts: 46
By bubba37343 2014-09-19 14:21:47
Link | Quote | Reply
 
Thank you very much. I will learn the ways of the "Swap".
necroskull Necro Bump Detected! [57 days between previous and next post]
Offline
Posts: 516
By Kooljack 2014-11-15 14:18:08
Link | Quote | Reply
 
ok, I've been using spellcast & gearswap so long that I don't even know how to manually equip a single piece of gear through the chatlog/macro. I keep getting command error whatever i do.
necroskull Necro Bump Detected! [319 days between previous and next post]
 Phoenix.Urteil
Offline
Server: Phoenix
Game: FFXI
user: Urteil89
By Phoenix.Urteil 2015-09-30 06:04:40
Link | Quote | Reply
 
Since many people use toggles to manage various accuracy states, runes, nukes etc. . .


How would one create an onscreen display that has the indexes from the arrays passed to it and then displayed on the UI? I was thinking that the text plugin could be used to do this but no luck so far.


It would be nice to see the current indexes of my accuracy, magical accuracy, drainPotency<=>DrainAcc, and Nuke arrays at a glance rather than having to remember or cycle though them to see.
Log in to post.