Premade Self Commands - shastaxc/silver-libs GitHub Wiki

Every GearSwap file has the ability to create custom commands in its job.lua file using the job_self_command function. SilverLibs has a few premade commands you can utilize so you don't have to write everything yourself.

Implementation

If Using Mote Libs

If the specified functions already exist, just put the silibs part inside of it in the appropriate spot. Please add the following:

function job_setup()
  silibs.enable_premade_commands()
end

If Using Selindrile Libs

If the specified functions already exist, just put the silibs part inside of it in the appropriate spot. Please add the following in your char_job_gear.lua file:

function user_job_setup()
  silibs.enable_premade_commands()
end

Configuration Options

Disabling lowercase param rewrite. By default, this feature will also force all cmdParams to lowercase. If you need to keep capitalization in your commands, you can disable this lowercase overwrite by setting it in the feature enabling command.

Example configuration:

silibs.enable_premade_commands({force_lower_cmd=false})

Usage

There are a few pre-built commands available to you in SilverLibs. Keep in mind that all gearswap commands can be added to in-game macros with the following pattern: /con c gs c NameOfCommand.

These commands can be added to keybinds as well using the following pattern: send_command('bind !s gs c faceaway'). The bind command is usually put into the job_setup function for Mote's Lib or the user_job_setup function for Selindrile's Lib.

The table below lists all the commands available through SilverLibs and describes what they do.

Command Description
sneak Use Sneak. Goes through a list of possible Sneak options that you might have available, prioritizing free/cheap options. First will check if you have a JA that can Sneak you, then spells, then consumable items.
invisible Use Invisible. Goes through a list of possible Invisible options that you might have available, prioritizing free/cheap options. First will check if you have a JA that can Invisible you, then spells, then consumable items.
noinvis Cancels Invisible effects on you. This includes buffs with similar effect as Invisible such as Camouflage and Hide.
interact Cancels Invisible effects on you because you cannot interact with things while invisible. It will also perform a few other functions depending on your target and/or area. See table below for more details on supported interactions.
faceaway Turns your character 180 degrees in-place.
pause Pauses and unpauses (toggle) equip loop.
soultrapper Equip Soultrapper and plates as long as you have them in inventory and use item.
autoreraise Set or cycle AutoReraise state.
lock Lock slots (prevent gear swapping) with 'manual' lock.
unlock Unlock slots (enable gear swapping) with 'manual' lock.
clearlocks Removes all locks (enable gear swapping).

Supported Interactions:

Target Description
Sturdy Pyxis If you are in Abyssea targeting a Sturdy Pyxis, it will attempt to use Forbidden Key.
Other Chests If you are THF and targeting a valid chest (besides Sturdy Pyxis), it will attempt to use (in this order) Skeleton Key, Living Key, and Thief's Tools. Valid chests are: Treasure Chest, Treasure Coffer, Chest, Coffer, Aurum Strongbox.
Logging Point Use Hatchet
Harvesting Point Use Sickle
Mining Point Use Pickaxe
Sanraku Trade Soul Plate
Maze Mongers Shopfront Trade Maze Tabula
Abyssea NM spawn point (named '???') Call command //abysseapopper pop from the AbysseaPopper addon.