anyone know the code to have an idle set for town use?
to do it ware you would have to at lest heal once when you enter or leave a town its not so hard but if you want to have it done automatically thats harder
(have to heal when entering or leaving town)
Code:function status_change(new,old) if new=='Idle' then if S{"Ru'Lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno","Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls", "Heavens Tower","Port San d'Oria","Northern San d'Oria","Southern San d'Oria","Port Bastok","Bastok Markets","Bastok Mines","Metalworks", "Aht Urhgan Whitegate","Tavanazian Safehold","Nashmau","Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham"}:contains(world.area)then equip(sets.city) else equip(sets.Idle) end end ... end
hmm how does get_spell_recasts() work?...
trying to make this to work, for my RDM Mule, to cast Haste 2 by default.. but if Haste 2 is on recast, then cast Haste
have tried different ways..Code:if spell.english == "Haste" and player.main_job_level == 99 and windower.ffxi.get_spell_recasts()[78] < 1 then cancel_spell() send_command('input /ma "Haste II" '..spell.target.raw..'') end
windower.ffxi.get_spell_recasts()[78]
windower.ffxi.get_spell_recasts(78)
get_spell_recasts()[78]
get_spell_recasts(78)
this is what i use
if there is less then a second left it will not workCode:if spell.english ~= 'Ranged' and spell.type ~= 'WeaponSkill' then if spell.action_type == 'Ability' then if spell and (windower.ffxi.get_ability_recasts()[spell.recast_id] > 0) then cancel_spell() return elseif spell then if spell.tp_cost > player.tp then cancel_spell() return end end elseif spell.action_type == 'Magic' then if spell and (windower.ffxi.get_spell_recasts()[spell.recast_id] > 0)then cancel_spell() return elseif spell then if spell.mp_cost > player.mp and not (buffactive['Manawell'] or buffactive['Manafont']) then cancel_spell() return true end end end end
Is there a way in gearswap or luacore to check if an item has charges left on it or is ready for use? I'm attempting to write a function into my gearswap to automatically use Vocation/Capacity Ring whenever the commitment buff is not active. This works great with Vocation because the timer is up when the buff wears off, but with Capacity Ring there is a 1 hour recharge rate. I've been scouring for similar projects and have had no luck.
Can anyone who is a bit more experienced with gearswap/luacore give me some pointers?
Here is what I have so far:
Thanks!Code:function jpRing() local expBuff = buffactive.Commitment if AUTORING == 'ON' then if not expBuff then equip(sets.VocationRing) if player.equipment.right_ring == "Vocation Ring" then -- ideally add check for ring ready for use here -- disable("ring2") add_to_chat(158,'Equipping Vocation Ring') send_command('@wait 16; input /item "Vocation Ring" <me>;') else equip(sets.CapacityRing) if player.equipment.right_ring == "Capacity Ring" then -- ideally add check for ring ready for use here --- disable("ring2") add_to_chat(158,'Equipping Capacity Ring') send_command('@wait 16; input /item "Capacity Ring" <me>;') else add_to_chat(128,'Disabling Auto JP Ring, No Commitment Buff Ring Available') AUTORING = 'OFF' enable("ring2") end end else if player.equipment.right_ring == "Vocation Ring" or player.equipment.right_ring == "Capacity Ring" then enable("ring2") end end end end
Made some changes so that it now detects if either ring is in inventory, or wardrobe. I'm still stuck with it spamming capacity ring when buff is down, but charge isn't ready yet. I tried viewing extdata in console, but it just returns weird characters. Can I export it to a file and view?
Code:function jpRing() local expBuff = buffactive.Commitment if AUTORING == 'ON' then if not expBuff then if vocationRing() then equip(sets.VocationRing) if player.equipment.right_ring == "Vocation Ring" then disable("ring2") add_to_chat(158,'Equipping Vocation Ring') send_command('@wait 16; input /item "Vocation Ring" <me>;') end elseif capacityRing() then equip(sets.CapacityRing) if player.equipment.right_ring == "Capacity Ring" then disable("ring2") add_to_chat(158,'Equipping Capacity Ring') send_command('@wait 16; input /item "Capacity Ring" <me>;') end else enable("ring2") add_to_chat(128,'You do not have a Commitment Ring') end else if player.equipment.right_ring == "Vocation Ring" or player.equipment.right_ring == "Capacity Ring" then enable("ring2") end end end end function capacityRing() local itemsInv = windower.ffxi.get_items().inventory local itemsWar = windower.ffxi.get_items().wardrobe i = 0 while i < table.getn(itemsInv) do i = i + 1 if itemsInv[i].id == 28546 then return true; end end i = 0 while i < table.getn(itemsWar) do i = i + 1 if itemsWar[i].id == 28546 then return true; end end end function vocationRing() local itemsInv = windower.ffxi.get_items().inventory local itemsWar = windower.ffxi.get_items().wardrobe i = 0 while i < table.getn(itemsInv) do i = i + 1 if itemsInv[i].id == 28563 then return true; end end i = 0 while i < table.getn(itemsWar) do i = i + 1 if itemsWar[i].id == 28563 then return true; end end end
just so you know you can just use
player.inventory[<item name here>]
and
player.wardrobe[<item name here>]
it should be nil if you do not have the item and true if you do
or
player.inventory:contains(<item name here>)
and
player.wardrobe:contains(<item name here>)
this should be true or false
i use this when checking for nin toolsCode:nin_tools ={ ["Monomi: Ichi"] = {tool='Sanjaku-Tenugui',tool_bag="Toolbag (Sanja)",tool_bag_id=5417,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Aisha: Ichi"] = {tool='Soshi',tool_bag="Toolbag (Soshi)",tool_bag_id=5734,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Katon: Ichi"] = {tool='Uchitake',tool_bag="Toolbag (Uchi)",tool_bag_id=5308,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Katon: Ni"] = {tool='Uchitake',tool_bag="Toolbag (Uchi)",tool_bag_id=5308,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Katon: San"] = {tool='Uchitake',tool_bag="Toolbag (Uchi)",tool_bag_id=5308,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Hyoton: Ichi"] = {tool='Tsurara',tool_bag="Toolbag (Tsura)",tool_bag_id=5309,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Hyoton: Ni"] = {tool='Tsurara',tool_bag="Toolbag (Tsura)",tool_bag_id=5309,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Hyoton: San"] = {tool='Tsurara',tool_bag="Toolbag (Tsura)",tool_bag_id=5309,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Huton: Ichi"] = {tool='Kawahori-Ogi',tool_bag="Toolbag (Kawa)",tool_bag_id=5310,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Huton: Ni"] = {tool='Kawahori-Ogi',tool_bag="Toolbag (Kawa)",tool_bag_id=5310,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Huton: San"] = {tool='Kawahori-Ogi',tool_bag="Toolbag (Kawa)",tool_bag_id=5310,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Doton: Ichi"] = {tool='Makibishi',tool_bag="Toolbag (Maki)",tool_bag_id=5311,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Doton: Ni"] = {tool='Makibishi',tool_bag="Toolbag (Maki)",tool_bag_id=5311,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Doton: San"] = {tool='Makibishi',tool_bag="Toolbag (Maki)",tool_bag_id=5311,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Raiton: Ichi"] = {tool='Hiraishin',tool_bag="Toolbag (Hira)",tool_bag_id=5312,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Raiton: Ni"] = {tool='Hiraishin',tool_bag="Toolbag (Hira)",tool_bag_id=5312,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Raiton: San"] = {tool='Hiraishin',tool_bag="Toolbag (Hira)",tool_bag_id=5312,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Suiton: Ichi"] = {tool='Mizu-Deppo',tool_bag="Toolbag (Mizu)",tool_bag_id=5313,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Suiton: Ni"] = {tool='Mizu-Deppo',tool_bag="Toolbag (Mizu)",tool_bag_id=5313,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Suiton: San"] = {tool='Mizu-Deppo',tool_bag="Toolbag (Mizu)",tool_bag_id=5313,uni_tool="Inoshishinofuda",uni_tool_bag="Toolbag (Ino)",uni_tool_bag_id=5867}, ["Utsusemi: Ichi"] = {tool='Shihei',tool_bag="Toolbag (Shihe)",tool_bag_id=5314,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Utsusemi: Ni"] = {tool='Shihei',tool_bag="Toolbag (Shihe)",tool_bag_id=5314,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Utsusemi: San"] = {tool='Shihei',tool_bag="Toolbag (Shihe)",tool_bag_id=5314,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Jubaku: Ichi"] = {tool='Jusatsu',tool_bag="Toolbag (Jusa)",tool_bag_id=5315,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Jubaku: Ni"] = {tool='Jusatsu',tool_bag="Toolbag (Jusa)",tool_bag_id=5315,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Jubaku: San"] = {tool='Jusatsu',tool_bag="Toolbag (Jusa)",tool_bag_id=5315,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Hojo: Ichi"] = {tool='Kaginawa',tool_bag="Toolbag (Kagi)",tool_bag_id=5316,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Hojo: Ni"] = {tool='Kaginawa',tool_bag="Toolbag (Kagi)",tool_bag_id=5316,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Hojo: San"] = {tool='Kaginawa',tool_bag="Toolbag (Kagi)",tool_bag_id=5316,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Kurayami: Ichi"] = {tool='Sairui-Ran',tool_bag="Toolbag (Sai)",tool_bag_id=5317,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Kurayami: Ni"] = {tool='Sairui-Ran',tool_bag="Toolbag (Sai)",tool_bag_id=5317,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Kurayami: San"] = {tool='Sairui-Ran',tool_bag="Toolbag (Sai)",tool_bag_id=5317,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Dokumori: Ichi"] = {tool='Kodoku',tool_bag="Toolbag (Kodo)",tool_bag_id=5318,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Dokumori: Ni"] = {tool='Kodoku',tool_bag="Toolbag (Kodo)",tool_bag_id=5318,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Dokumori: San"] = {tool='Kodoku',tool_bag="Toolbag (Kodo)",tool_bag_id=5318,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Tonko: Ichi"] = {tool='Shinobi-Tabi',tool_bag="Toolbag (Shino)",tool_bag_id=5319,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Tonko: Ni"] = {tool='Shinobi-Tabi',tool_bag="Toolbag (Shino)",tool_bag_id=5319,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Tonko: San"] = {tool='Shinobi-Tabi',tool_bag="Toolbag (Shino)",tool_bag_id=5319,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Gekka: Ichi"] = {tool='Ranka',tool_bag="Toolbag (Ranka)",tool_bag_id=6265,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Yain: Ichi"] = {tool='Furusumi',tool_bag="Toolbag (Furu)",tool_bag_id=6266,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Myoshu: Ichi"] = {tool='Kabenro',tool_bag="Toolbg. (Kaben)",tool_bag_id=5863,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Yurin: Ichi"] = {tool='Jinko',tool_bag="Toolbag (Jinko)",tool_bag_id=5864,uni_tool="Chonofuda",uni_tool_bag="Toolbag (Cho)",uni_tool_bag_id=5869}, ["Kakka: Ichi"] = {tool='Ryuno',tool_bag="Toolbag (Ryuno)",tool_bag_id=5865,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, ["Migawari: Ichi"] = {tool='Mokujin',tool_bag="Toolbag (Moku)",tool_bag_id=5866,uni_tool="Shikanofuda",uni_tool_bag="Toolbag (Shika)",uni_tool_bag_id=5868}, } if (player.inventory[nin_tools[spell.english].tool] == nil or player.inventory[nin_tools[spell.english].uni_tool] == nil) and (player.inventory[nin_tools[spell.english].tool_bag] ~= nil or player.inventory[nin_tools[spell.english].uni_tool_bag] ~= nil) then
Do Mote's files have Elemental Obis for magical WS? Eg, Wildfire/Leaden Salute/Quick Draw.
Still transitioning
e: Found a link:
http://www.ffxiah.com/forum/topic/41...ad/23/#2661945
I found something strange in my lua.
There's a function that gets executed and gives the correct (expected) result only from the second time onwards it gets executed, but produces a wrong result on the first time. I cannot understand why and maybe someone in here can help me see where the problem is.
First of all, the function itself.
Note that the add-to-chat lines are completely unnecessary, I added them temporarily to debug and see where the problem was.
Spoiler: show
This small custom function gets executed inside another small one which, itself, gets executed once every time the Lua is loaded (I put it at the end of get_sets) and each time subjob is changed.
Spoiler: show
It also gets executed when I activate a manual command.
Now, back to the issue.
The first time this function gets executed (for instance after a //gs reload) it goes to the third branch of the "if". No Dagger found.
Even if either (or both) of those daggers are in inventory or wardrobe.
The second time onwards (if I swap subjob again or press the manual command) it works perfectly.
Note: it's not a matter of inventory not loaded, it happens even if I've been in the zone for a long time.
So, what could be the issue? I'm not getting it.
its this player.inventory["Izhiikoh"] if you look in my above post i had tried this but it is not always 100% and can give nil errors
try
if player.inventory["Izhiikoh"] ~= nil or player.wardrobe["Izhiikoh"] ~= nil then
and
elseif player.inventory["Atoyac"] ~= nil or player.wardrobe["Atoyac"] ~= nil then
Didn't see a behaviour change.
I analyzed it a bit more though.
1) When the Function is called from within the self_command, it seems to be always working
2) When the function is called from within the set_idle_mode function it never works. The variable for some reason gets "stucked" on whatever value it already is. Which will be "no value" for a newly loaded Lua, or whatever value was set by point 1) last.
I cannot understand this different behaviour, it's the same exact function... why does it act so strange? >.>
Don't get me wrong it's not a big deal, it just gets on my nerves, I want to understand!
If the items were still loading I think I would get a different behaviour, the behaviour of my custom function not recognizing an item there, when it actually is.
But this happens even when items have been loaded, and we have the same exact function behaving correctly when called from a Self_command, but behaving incorrectly when called from within another function.
This is really strange, it's the same fucking function, how can it work in one place but not in another? >.>
try putting this as the first line in your item check function
gearswap.refresh_globals()
it refreshes all of gearswaps global tables but this will only work if you use player.inventory or player.wardrobe
Just got a zodiac ring, but I can't seem to get it to fire with QD.
Spoiler: show
And here's a link to the full code: http://pastebin.com/mq6gU8a3
gear.ElementalRing is Zodiac on the right day, correct? Trying to get it to trigger on IceShot but it doesn't seem to be working.
e: It's working on Fire Shot in Fire Weather, but not on Ice Shot on Ice Day. Is it failing because I don't have the Ice obi, too?
e: Thunder Shot on Thunder day works. I have Fire and Thunder obi, maybe it is the fact that I don't have an Ice obi.
Thanks for this command, I could get some more insight on what is happening, which I'm going to describe now.
1) Atoyac is already in inventory
2) I swap job to BRD from /NIN to /DNC
3) The two functions get launched, and it swaps my variable correctly to "Atoyac", print_set displays Atoyac in the items list.
4) I try swapping job (launches the function automatically from within the other one) or using the self_command (launches the specific function only) and both seem to work.
5) I take off my Atoyac and put it in my Satchel, and do the opposite with my Izhiikoh
6) I try to swap job again between /NIN and /DNC
7) The variable remains set to "Atoyac" and the print_set still displays Atoyac in my inventory, even if it's not there anymore. It doesn't display Izhiikoh instead.
8) I try to repeat step 6) multiple times, but nothing changes
9) I try to launch the function directly from the self_command, it correctly swaps the variable to Izhiikoh, Print_set displays Izhiikoh in the inventory list and no more Atoyac.
Repeated this whole process a few times with the same results, I'm really puzzled.
It seems like launching the dagger function from within that other function makes the inventory list get stuck on whatever the inventory was when the Lua file was loaded (???), but launching the function directly instead refreshes the inventory correctly?
I think this is what's happening but I don't get why. Seems to be a Gearswap issue, not in my lua though.
What actual GearSwap events (not your personal functions) are the base from which you call the function that may or may not find the dagger? sub_job_change? Which event works, and which event does not?