War Gearswap Lua -- Need A Little Help

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » Windower » Support » War Gearswap lua -- need a little help
War Gearswap lua -- need a little help
 
Offline
Posts:
By 2022-03-07 08:17:41
| Edit  | Link | 引用 | 返事
 
Post deleted by User.
 Odin.Phinneus
Offline
サーバ: Odin
Game: FFXI
user: ayer
Posts: 24
By Odin.Phinneus 2022-03-07 08:40:17  
You're not defining what gear should be equipped when you're in each mode.

Code
    state.Weapons:options('None','Sword','KChop','Loxo','KLance','Zulfiq')


add this under function init_gear_sets()
Code
sets.weapons.Sword = {main="Naegling",sub="Blurred Shield +1"}
sets.weapons.Kchop = {main="Kaja Chopper", sub="Blurred Shield +1"}
sets.weapons.Loxo = {main="Loxotic Mace", sub="Blurred Shield +1"}
sets.weapons.KLance = {main="Kaja Lance", sub="Utu Grip"}
sets.weapons.Zulfiq = {main="Zulfiqar", sub="Utu Grip"}


You can remove these lines:
Code
    sets.engaged.Normal = {}
    sets.engaged.Sword = {main="Naegling",sub="Blurred Shield +1"}
    sets.engaged.KChop = {main="Kaja Chopper",sub="Utu Grip"}
    sets.engaged.Loxo = {main="Loxotic Mace",sub="Blurred Shield +1",}
    sets.engaged.KLance = {main="Kaja Lance",sub="Utu Grip"}
    sets.engaged.Zulfiq = {main="Zulfiqar",sub="Utu Grip"}
 
Offline
Posts:
By 2022-03-07 08:44:54
 Undelete | Edit  | Link | 引用 | 返事
 
Post deleted by User.
 Bahamut.Ayasha
Offline
サーバ: Bahamut
Game: FFXI
user: Ayasha
Posts: 89
By Bahamut.Ayasha 2022-03-07 10:04:37  
Try this small modification to the code posted above. You need to define the "weapons" variable first:

Code
sets.weapons = {}
sets.weapons.Sword = {main="Naegling",sub="Blurred Shield +1"}
sets.weapons.Kchop = {main="Kaja Chopper", sub="Blurred Shield +1"}
sets.weapons.Loxo = {main="Loxotic Mace", sub="Blurred Shield +1"}
sets.weapons.KLance = {main="Kaja Lance", sub="Utu Grip"}
sets.weapons.Zulfiq = {main="Zulfiqar", sub="Utu Grip"}


Can't test this, but I'm fairly confident this is your issue. Good luck!
 
Offline
Posts:
By 2022-03-07 10:15:05
 Undelete | Edit  | Link | 引用 | 返事
 
Post deleted by User.
 Bahamut.Ayasha
Offline
サーバ: Bahamut
Game: FFXI
user: Ayasha
Posts: 89
By Bahamut.Ayasha 2022-03-07 10:41:18  
Have you tried changing your status? E.g. resting, casting, engaging. The only thing that I can see that may cause it to not work is that you have explicitly defined your WeaponMode sets, so Gearswap may not be able to really know that "Zulfiq" means "Zulfiqar" when you call the self_commands function:

Code
function job_self_command(commandArgs, eventArgs)
        if commandArgs[1] == 'WeaponMode' then
        handle_cycle(commandArgs)
        enable('main','sub')
        equip(sets.engaged[state.WeaponMode.value])
        if state.WeaponMode.value ~= 'Normal' then
            disable('main','sub')
            end
        end
    gearswap_jobbox:text(gearswap_box())
    gearswap_jobbox:show()
end


I'm not a pro at lua, but I think the snippet:
Code
equip(sets.engaged[state.WeaponMode.value])


where state.WeaponMode.value = "Zulfiq", for example, would be equivalent to:
Code
equip(sets.engaged['Zulfiq'])


I am not sure, however, that this is equivalent to:
Code
equip(sets.engaged.Zulfiq)


I assume you've already adjusted this section referenced above, so can you please re-post your lua after the changes? May help diagnose a bit more.
[+]
 
Offline
Posts:
By 2022-03-07 11:09:52
 Undelete | Edit  | Link | 引用 | 返事
 
Post deleted by User.
 Bahamut.Ayasha
Offline
サーバ: Bahamut
Game: FFXI
user: Ayasha
Posts: 89
By Bahamut.Ayasha 2022-03-07 11:43:56  
I'll play with this tonight to see if I can make something work for you in the event someone else doesn't solve your problem.

And yes, you can directly modify the state by typing on the command line:
Code
//gs c set WeaponSet Loxo


Or via macros:
Code
 /console gs c set WeaponSet Loxo


Can replace 'set' with cycle and omit the 'loxo' to just cycle through everything, too.

I know you are trying to solve this problem using a general case, but you can definitely get it to work using if-then-else statements:
Code
function job_self_command(commandArgs, eventArgs)
	if commandArgs[1] == 'WeaponSet' then
		handle_cycle(commandArgs)
		enable('main','sub')
		if state.WeaponSet.value == 'Sword' then
			equip(sets.WeaponSet.Sword)
		elseif state.WeaponSet.value == 'KChop' then
			equip(sets.WeaponSet.KChop)
		elseif state.WeaponSet.value == 'Loxo' then
			equip(sets.WeaponSet.Loxo)
		elseif state.WeaponSet.value == 'KLance' then
			equip(sets.WeaponSet.KLance)
		elseif state.WeaponSet.value == 'Zulfiq' then
			equip(sets.WeaponSet.Zulfiq)            
		else
		    disable('main','sub')
		end
	end
    gearswap_jobbox:text(gearswap_box())
    gearswap_jobbox:show()
end


To enable disabling main/sub swapping, change the line:
Code
    state.WeaponSet:options('Sword','KChop','Loxo','KLance','Zulfiq')


to:
Code
     state.WeaponSet:options('Normal','Sword','KChop','Loxo','KLance','Zulfiq')


This is a bit hacky, and may have errors since I can't test it, but it should brute force it to work the way you want.
[+]
 
Offline
Posts:
By 2022-03-07 12:05:41
 Undelete | Edit  | Link | 引用 | 返事
 
Post deleted by User.
 
Offline
Posts:
By 2022-03-07 13:50:03
 Undelete | Edit  | Link | 引用 | 返事
 
Post deleted by User.
Log in to post.