Auto Rearm Weapon - shastaxc/silver-libs GitHub Wiki

Whenever your weapons are removed, this function will re-equip whatever you previously had equipped. This covers 'main', 'sub', 'ranged', and 'ammo' slots.

Implementation

Ensure you have the silibs precast hook in your job lua. See the Installation page for more details.

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_weapon_rearm()
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_weapon_rearm()
end

Usage

Simply including the "enable" line from the Implementation section above will allow the re-arming to work. However, if you want more control to turn this function on and off, you can do so with the following command: gs c toggle RearmingLock

You can tie this command to a keybind by adding the following line to your job_setup function if using Mote Lib, or user_job_setup if using Selindrile's Lib.

send_command('bind @w gs c toggle RearmingLock')

WIN+W is the keybind used in this example, but it can be anything you want.