Abyssea Red Proc Weapon Swap Lua Snippet For NIN

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » Windower » General » Abyssea Red Proc weapon swap lua snippet for NIN
Abyssea Red Proc weapon swap lua snippet for NIN
 Asura.Technicz
Offline
Server: Asura
Game: FFXI
user: technicz
Posts: 18
By Asura.Technicz 2017-11-04 14:05:45
Link | Quote | Reply
 
I did some searching on my own, but came up with nothing for this type of little feature. Therefore, I tried to make my own solution, and somehow scraped something together that actually works fairly well.

I've been working on Almace trials in Abyssea, and it was bugging me to manually swap my weapons for red procs, so I made a rudimentary weapon toggle to help reduce manual effort.

The following snippet is set in my NIN.lua for GearSwap, but be sure to read all of my notes here since I had to debug and figure out some of my own silly oversights.


  • The logic is two-fold, with the main logic coming from the keypress Alt+F9 to cycle through the weapon types that can red proc an NM, RedProc.

  • The secondary logic is an F9 keypress to switch to your main weapons, MainSet, regardless of what proc weapon you are using at the time.

  • This is for quick swaps to kill the NM after you proc it.

  • I start with Staff, but any 2 hander will do, since as Ninja I'm typically dual wielding katanas.

  • By swapping to a 2 hander initially, it forces my offhand to unequip, which I had trouble setting up in the equip sets themselves.

  • This prevents you from swapping to a crappy weapon to proc, but your offhand is still ilvl 119 and killing the NM too fast.



Issues I found while getting this to work:


  • This does not appear to work when using includes for Motes' stuff.

  • Motes' stuff appears to have pre-defined classes and options, so it wouldn't recognize my custom RedProc set.

  • I tried to fool it with some of Motes' options, but failed miserably.

  • If anyone wants to take a stab at making this custom toggle work with Motes' includes, be my guest.



  • The set names and toggle options have to be one word, but you will see I typically use camel or pascal casing.

  • For example, when I called the set GreatKatana, but asked it to toggle through 'Great Katana', this did not work since they don't match, so keep that in mind.



  • As mentioned above, the starting point in my toggle list is Staff because it is a 2 hander, and my Rep. Signet Staff had the lowest delay.

  • If you set it to a one hander initially, like I did, then your ilvl 119 offhand will remain equipped and you will kill stuff way too quickly.

  • I did not find an elegant option to tell it to uneqip my offhand, so I worked around this by starting with a 2 hander.



  • The snippet here is mostly copy+paste, but just be aware of the parent functions these are being called within.

  • I would highly HIGHLY HIGHLY recommend doing a Save As of your current LUA as a backup just to save yourself some headaches if you have copy+pasta failures.

  • If you copy and paste this exactly, then you may have specific issues.

  • For example, if you copy and paste my entire function get_sets(), and you already have this defined in your LUA, then I would expect an error.

  • I would work around this by copying the content within my function get_sets(), and paste it into your LUA within your function get_sets() -- not necessarily replacing all the code, but in addition to it.

  • Hopefully, that makes sense.



Anyone is welcome to improve upon this if they so desire. I'm unsure if setting something up for Blue Procs would be helpful considering how limited it is, and/or Yellow Procs since it's casting. This works for me for Red Proccing with less effort, but it's pretty rudimentary to get the job done. My wrists have already thanked me for creating this little toggle. #carpalTunnelAwareness


Code
--CUSTOM CODE START--

-- ALT+F9 cycles Primary weapons when Red proccing in Abyssea
-- After you succeed in a Red proc, hit F9 to immediately swap to your Main Set and kill the NM quickly
-- Binds
send_command('bind f9 gs c toggle MainSet set') --change f9 to whatever you want, ^f9 = CTRL+F9, !f9 = ALT+F9
send_command('bind !f9 gs c toggle RedProc set')

function self_command(command)
	if command == 'toggle RedProc set' then
		RedProc_ind = RedProc_ind + 1
		if RedProc_ind > #sets.RedProc.index then RedProc_ind = 1 end
		ChangeGear(sets.RedProc[sets.RedProc.index[RedProc_ind]])
	elseif command == 'toggle MainSet set' then
	RedProc_ind = 1 end
	send_command('@input /echo <----- RedProc Set changed to ' .. sets.RedProc.index[RedProc_ind] .. ' ----->')
	ChangeGear(sets.RedProc[sets.RedProc.index[RedProc_ind]])
end

-- Initialization function for this job file.
function get_sets()
    --commented out includes to match BLU.lua, which allows custom toggle sets; would not seem to work if these includes were not commented out
	--mote_include_version = 2

    -- Load and initialize the include file.
    --include('Mote-Include.lua')
	
	--custom start
	--Abyssea Red Proc Sets--
	sets.RedProc = {}
	sets.RedProc.index = { 'MainSet', 'Staff', 'Dagger', 'Sword', 'Scythe', 'Polearm', 'Katana', 'GreatKatana', 'Club' } --'GreatSword' goes after Sword once I get an All Classes one
	RedProc_ind = 1
	
	--sets.RedProc.MainSet = {main="Kiikanemitsu", sub="Claymore Grip"} skilling up Great Katana
	sets.RedProc.MainSet = {main={ name="Ochu", augments={'STR+9','DEX+9','Ninjutsu skill +9','DMG:+13',}}, sub={ name="Ochu", augments={'STR+1','DEX+2','Ninjutsu skill +2',}}}
	--starting with Staff since equipping a 2 hander after dual wielding my main set forces the offhand to unequip; if you set Dagger first, for example, then your offhand remains strong and you kill stuff too fast
	sets.RedProc.Staff = {main="Rep. Signet Staff", sub="Claymore Grip"}
	sets.RedProc.Dagger = {main="Trainee's Needle"}
	sets.RedProc.Sword = {main="Excalipoor"}
	sets.RedProc.Scythe = {main="Hoe", sub="Claymore Grip"}
	sets.RedProc.Polearm = {main="Pitchfork +1", sub="Claymore Grip"}
	sets.RedProc.Katana = {main="Kunai"}
	sets.RedProc.GreatKatana = {main="Ark Tachi", sub="Claymore Grip"}
	sets.RedProc.Club = {main="Heartbeater"}
	--sets.RedProc.GreatSword = {main="Irradiance Blade", sub="Claymore Grip"} All Classes Great Sword from master trial
	--custom end
end

function ChangeGear(GearSet)

	equipSet = GearSet
	equip(GearSet)
end

function msg(str)
	send_command('@input /echo <----- ' .. str .. ' ----->')
end

--CUSTOM CODE END--
[+]
 Phoenix.Tigertail
Offline
Server: Phoenix
Game: FFXI
user: Tigertail
Posts: 118
By Phoenix.Tigertail 2017-11-04 16:11:58
Link | Quote | Reply
 
This is a cool idea. I just made a bunch of macros for staff, club, etc. and always try to do staff first to remove the sub weapon when checking for proc. But anything that makes it easier I'm all for. It is a pain to manually switch especially when your weapons are in different wardrobes :D
[+]
 Asura.Technicz
Offline
Server: Asura
Game: FFXI
user: technicz
Posts: 18
By Asura.Technicz 2017-11-04 17:37:59
Link | Quote | Reply
 
Yes, I feel like others do something similar about Aby procs in their wardrobes, but this may be new in the sense of toggling weapon swaps, since that's usually a big no-no for TP reset.

I'd still be curious if someone can apply the idea that works with Mote's includes. I just couldn't find a way around it, but I only spent about 1-2 hours on this. I would have to spend more time understanding Mote's libraries, and how things are defined to try and make it work with it.
 Cerberus.Mrkillface
Offline
Server: Cerberus
Game: FFXI
user: bitchtits
Posts: 241
By Cerberus.Mrkillface 2017-11-05 10:20:45
Link | Quote | Reply
 
I use a casting mode with everything empty for procs on BLM.

You can do something like this to stop your ilvl weapon from staying equipped in the off hand:
Code
sets.RedProc.Dagger = {main="Trainee's Needle",sub=empty}

That will un-equip whatever you had in your off hand.

As for mote's includes, I'm guessing that hybrid mode isn't really needed in abyssea. You could always just add the sets there and comment them out when you're not farming pops.

When in abyssea:
Code
-- state.HybridMode:options('Normal', 'Evasion', 'PDT')

state.HybridMode:options('MainSet', 'Normal', 'Staff', 'Dagger', 'Sword', 'Scythe', 'Polearm', 'Katana', 'GreatKatana', 'Club')

The standard hybrid sets are commented out so it uses your custom abyssea sets.

outside abyssea:
Code
state.HybridMode:options('Normal', 'Evasion', 'PDT')
-- state.HybridMode:options('MainSet', 'Normal', 'Staff', 'Dagger', 'Sword', 'Scythe', 'Polearm', 'Katana', 'GreatKatana', 'Club')


I don't use hybrid mode at all on ninja, so I wouldn't have to worry about it, but if you do, you'll need to swap out which hybrid modes are commented out and reload GS.
 Asura.Technicz
Offline
Server: Asura
Game: FFXI
user: technicz
Posts: 18
By Asura.Technicz 2017-11-05 23:15:45
Link | Quote | Reply
 
@Mrkillface -- Thanks for your notes on the use of empty! I was using "" or null, but had no luck. I feel a bit dumb after not trying something like empty.

I recall trying to do something similar to your suggestion of HybridMode with WeaponskillMode, but still had issues with it. I can double check with HybridMode and the includes with Motes' stuff and see if it works out.
Log in to post.