Gearswap Support Thread

Language: JP EN DE FR
New Items
2018-04-04
105 users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 137 138
 Asura.Patriclis
Offline
Server: Asura
Game: FFXI
user: Patriclis
Posts: 368
By Asura.Patriclis 2018-06-04 12:09:57
Link | Quote | Reply
 
Carbuncle.Kigensuro said: »
Asura.Patriclis said: »
Shiva.Hiep said: »
For some reason, my friend's BLM lua doesn't pick up Hachirin-no-obi. It works when I use it, any idea what could be the problem? Is it something with his resources?

Well since you haven't provided the lua in question and told us where the obi is implemented... then my guess is... your friend re-wrote the entire lua using the wingdings font.
that made me laugh.
but yes you are correct that we cant tell anything because we have no code and with out it there are an inf amount of possibilities from they don't have it active to using the wingdings font. (from normal to absurd)

Maybe I should write a lua interpreter for wingdings. Clearly there is a demand.
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 556
By Shiva.Hiep 2018-06-04 16:22:57
Link | Quote | Reply
 
Carbuncle.Kigensuro said: »
Asura.Patriclis said: »
Shiva.Hiep said: »
For some reason, my friend's BLM lua doesn't pick up Hachirin-no-obi. It works when I use it, any idea what could be the problem? Is it something with his resources?

Well since you haven't provided the lua in question and told us where the obi is implemented... then my guess is... your friend re-wrote the entire lua using the wingdings font.
that made me laugh.
but yes you are correct that we cant tell anything because we have no code and with out it there are an inf amount of possibilities from they don't have it active to using the wingdings font. (from normal to absurd)

Sorry guys, here you go: https://pastebin.com/ZsUmcmx6
 Asura.Patriclis
Offline
Server: Asura
Game: FFXI
user: Patriclis
Posts: 368
By Asura.Patriclis 2018-06-04 17:44:04
Link | Quote | Reply
 
Well aside from being a giant mess in need of serious refinement and linting...
Code
    if  spell.element == world.weather_element or spell.element == world.day_element or
            (spell.element == 'Lightning' and buffactive['Thunderstorm']) or
            (spell.element == 'Ice' and buffactive['Hailstorm']) or
            (spell.element == 'Water' and buffactive['Rainstorm']) or
            (spell.element == 'Fire' and buffactive['Firestorm']) or
            (spell.element == 'Earth' and buffactive['Sandstorm']) or
            (spell.element == 'Wind' and buffactive['Windstorm']) or
            (spell.element == 'Light' and buffactive['Aurorastorm']) or
            (spell.element == 'Dark' and buffactive['Voidstorm']) then
        if spell.skill == 'Elemental Magic' and spellMap ~= 'Helix' then
            equip(sets[spell.element])
        elseif string.find(spell.english,'Cure') then
            equip(sets[spell.element])
        end
    end


This block here isnt looking for storm IIs, which might be his issue though then entire block is redundant since
Code
(world.day_element == spell.element or world.weather_element == spell.element)

should be all he needs.

I can't see anything super obvious. But the code is pretty messy.

Also you're using mote-include, and those includes should handle using an obi as well... but mote didnt include the hachirin no obi in his mappings... only the base obis, so you have to add that in.
 Cerberus.Mrkillface
Offline
Server: Cerberus
Game: FFXI
user: bitchtits
Posts: 105
By Cerberus.Mrkillface 2018-06-04 17:44:27
Link | Quote | Reply
 
I'm no coder, but if I had to guess, it's because the burst set rule comes after the obi rule and overwrites that set.
 Asura.Patriclis
Offline
Server: Asura
Game: FFXI
user: Patriclis
Posts: 368
By Asura.Patriclis 2018-06-04 17:53:57
Link | Quote | Reply
 
Cerberus.Mrkillface said: »
I'm no coder, but if I had to guess, it's because the burst set rule comes after the obi rule and overwrites that set.
It does look that way... but he uses the obi rule twice, once at the start and once at the end. again, redundant messy code.

Seriously though... this is why I say your code is messy... I took the time to properly indent things and the problem becomes obvious
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.skill == 'Elemental Magic' or spell.english == "Kaustra" then
        if (spell.element == world.day_element or spell.element == world.weather_element) then
            equip(sets.Obi)
        end
        if spell.action_type == 'Magic' then
            if spell.element == "Earth" and spell.skill == 'Elemental Magic' and (state.CastingMode.value == "Normal" or state.CastingMode.value == "ConserveMP") then
                equip({neck = "Quanpur Necklace"})
            end
            if spellMap == 'Cure' and spell.target.type == 'SELF' then
                equip(sets.midcast.CureSelf)
            end
            if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
                if state.CastingMode.value == "ConserveMP" then
                    equip(sets.magic_burst.ConserveMP)
                elseif state.CastingMode.value == "MACC" then
                    equip(sets.magic_burst.MACC)
                else
                    equip(sets.magic_burst)
                end
                if spell.english == "Impact" then
                    equip(sets.midcast.Impact)
                    if spell.element == world.weather_element or spell.element == world.day_element or
                        (spell.element == 'Lightning' and buffactive['Thunderstorm']) or
                        (spell.element == 'Ice' and buffactive['Hailstorm']) or
                        (spell.element == 'Water' and buffactive['Rainstorm']) or
                        (spell.element == 'Fire' and buffactive['Firestorm']) or
                        (spell.element == 'Earth' and buffactive['Sandstorm']) or
                        (spell.element == 'Wind' and buffactive['Windstorm']) or
                        (spell.element == 'Light' and buffactive['Aurorastorm']) or
                        (spell.element == 'Dark' and buffactive['Voidstorm']) then
                        if spell.skill == 'Elemental Magic' and spellMap ~= 'Helix' then
                            equip(sets[spell.element])
                        elseif string.find(spell.english, 'Cure') then
                            equip(sets[spell.element])
                        end
                    end
                end
            end
        end
    end
end

Code
    if spell.english == "Impact" then
       equip(sets.midcast.Impact)

This little impact section neeeeeeeeeeeeeeeeeeds to have an end. and it doesnt.
seriously... indent your code people.
because currently your second obi rule only runs when casting impact.
[+]
 Asura.Patriclis
Offline
Server: Asura
Game: FFXI
user: Patriclis
Posts: 368
By Asura.Patriclis 2018-06-04 17:59:59
Link | Quote | Reply
 
Code
function job_post_midcast(spell, action, spellMap, eventArgs)
    if spell.action_type == 'Magic' then
        if spellMap == 'Cure' and spell.target.type == 'SELF' then
            equip(sets.midcast.CureSelf)
        elseif spell.skill == 'Elemental Magic' or spell.english == "Kaustra" then
            if spell.element == "Earth" and (state.CastingMode.value == "Normal" or state.CastingMode.value == "ConserveMP") then
                equip({neck = "Quanpur Necklace"})
            end
            if state.MagicBurst.value then
                if state.CastingMode.value == "ConserveMP" then
                    equip(sets.magic_burst.ConserveMP)
                elseif state.CastingMode.value == "MACC" then
                    equip(sets.magic_burst.MACC)
                else
                    equip(sets.magic_burst)
                end
            end
            if spell.english == "Impact" then
                equip(sets.midcast.Impact)
            end
        end
        if (spell.element == world.day_element or spell.element == world.weather_element) then
            if (spell.skill == 'Elemental Magic' and spellMap ~= 'Helix') or string.find(spell.english, 'Cure') then
                equip(sets[spell.element])
        end
    end
end


There. I cut 16 lines out of your code and it should do the same thing / work better.
 Carbuncle.Kigensuro
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 21
By Carbuncle.Kigensuro 2018-06-04 22:42:33
Link | Quote | Reply
 
this is how i do my obi equip
Code
sets.spell_obi={Fire={waist="Karin Obi"},Earth={waist="Dorin Obi"},Water={waist="Suirin Obi"},Wind={waist="Furin Obi"},Ice={waist="Hyorin Obi"},
    Lightning={waist="Rairin Obi"},Light={waist="Korin Obi"},Dark={waist="Anrin Obi"},}

        --catches if spell.element is number or string (yes it has happened before)
        local spell_element = (type(spell.element)=='number' and gearswap.res.elements[spell.element] or gearswap.res.elements:with('name', spell.element))
        --checks to see if world.weather_element or world.day_element is the same as spell_element.name from the above catch
        if spell_element.name == world.weather_element or spell_element.name == world.day_element then
            --checks to see if you have Hachirin-no-Obi in any bago you can equip from if so it equips Hachirin-no-Obi
            if item_to_bag("Hachirin-no-Obi") then
                equip({waist="Hachirin-no-Obi"})
            --checks to see if you have your Elemental Obi in any bag you can equip from if so it equips your Elemental Obi
            elseif item_to_bag(sets.spell_obi[spell_element.en].waist) then
                equip(sets.spell_obi[spell_element.en])
            end
        end
        
        
function item_to_bag(name)
    for _,bag in ipairs({"inventory","wardrobe","wardrobe2","wardrobe3","wardrobe4"}) do
        local item = player[bag][name]
        if item then return bag end
    end
end
 Shiva.Hiep
Offline
Server: Shiva
Game: FFXI
user: Hiepo
Posts: 556
By Shiva.Hiep 2018-06-05 11:34:35
Link | Quote | Reply
 
My friend tested these out and it worked perfectly. Thank you everyone~
 Sylph.Elgorian
Offline
Server: Sylph
Game: FFXI
user: Elgorian
Posts: 297
By Sylph.Elgorian 2018-06-13 10:04:43
Link | Quote | Reply
 
Code
	if spell.english:wcmatch('Cure*') and buff=="Aurorastorm" then
		equip(sets.midcast.Cure, {waist="Korin Obi"})
	elseif spell.english:wcmatch('Cure*') then
		equip(sets.midcast.Cure)
	elseif spell.english:wcmatch('Curaga*') and buff=="Aurorastorm" then
		equip(sets.midcast.Curaga, {waist="Korin Obi"})
	elseif spell.english:wcmatch('Curaga*') then
		equip(sets.midcast.Curaga)


Trying to get this to work. I want my obi to equip when the buff Aurorastorm is up.


Edit: Got the above working. Just trying to figure this part out now:

Also trying to get this to work:
Code
function buff_change(name,gain)
	if name == 'Aurorastorm' and not gain then
		send_command('@ input /echo >>> Aurorastorm Down <<<')
	end
end


Just so I have a reminder in case I don't notice it dropping in the middle of a fight.
It works on Paladin for Crusade, but that might be because he's engaged.
 Cerberus.Shadowmeld
Offline
Server: Cerberus
Game: FFXI
Posts: 334
By Cerberus.Shadowmeld 2018-06-14 08:26:51
Link | Quote | Reply
 
buff_change should work regardless of your Engaged status. I would recommend that you use an S{} table to keep track of all buffs that you want to monitor in this way. You could change the function this way to make it easier to do.
Code
function buff_change(buffname, isgain)
  local monitored_buffs = S{"Aurorastorm", "Phalanx",}
  if monitored_buffs:contains(buffname) and not isgain then
    windower.add_to_chat(80, ">>> " .. buffname .. " Down <<<")
  end
end


Notes:
  1. I like to change my function to have more descriptive variable names. buffname instead of name and isgain instead of gain. It makes it easier for someone else to understand what the variable means if they pick it up

  2. To add a buff to the monitored buffs, you just put another string there

  3. 80 is the color of the echo command in ffxi. other that I like to use for my add_to_chats are 39 (Red).

 Carbuncle.Kigensuro
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 21
By Carbuncle.Kigensuro 2018-06-14 08:41:18
Link | Quote | Reply
 
Sylph.Elgorian said: »
if spell.english:wcmatch('Cure*') and buff=="Aurorastorm" then
equip(sets.midcast.Cure, {waist="Korin Obi"})
elseif spell.english:wcmatch('Cure*') then
equip(sets.midcast.Cure)
elseif spell.english:wcmatch('Curaga*') and buff=="Aurorastorm" then
equip(sets.midcast.Curaga, {waist="Korin Obi"})
elseif spell.english:wcmatch('Curaga*') then
equip(sets.midcast.Curaga)
i would recommend you use something like this
Code
if spell.english:starswith('Cure') then
    if buffactive["Aurorastorm"] then
        equip(sets.midcast.Cure, {waist="Korin Obi"})
    else
        equip(sets.midcast.Cure)
    end
elseif spell.english:starswith('Curaga') then
    if buffactive["Aurorastorm"] then
        equip(sets.midcast.Curaga, {waist="Korin Obi"})
    else
        equip(sets.midcast.Curaga)
    end
end

for these reasons
1 wcmatch is a vary slow process
2 there is no reason to check to see if the spell starts with Cure or Curaga more then once
3 it may look longer or slower but in actuality it is 3+ times faster
 Sylph.Elgorian
Offline
Server: Sylph
Game: FFXI
user: Elgorian
Posts: 297
By Sylph.Elgorian 2018-06-14 13:50:38
Link | Quote | Reply
 
Carbuncle.Kigensuro said: »

Thanks! That will make things a whole lot easier!
So the 80 is just the color I want it in chat, and 39 is red? :)

Also out of curiosity is there a way to get notified when you zone if a certain buff isn't up or not? Example: I know when zoning into Ambu JA buffs usually don't stick. I will occasionally forget to pop Afflatus Solace like an idiot because I had it up before I entered.

-------------------------------------------------------------------------------------


Carbuncle.Kigensuro said: »

Oh neat, thanks! It's just kind of something I've built myself, and just coming back after 3 years. I have just kind of pulled things from here and there that make sense and slowly evolving it lol.

Is there something similar for ends with? EX: something like storm spells maybe? storm? would it just be endswith("storm")?

So, something like the following should work:
Code
	if spell.english:startswith('Cure') then
		if buffactive["Aurorastorm"] or world.weather=="Auroras" or world.weather=="Stellar glare", or world.day_element=="Light" then
			equip(sets.midcast.Cure, {waist="Korin Obi"})
		else
			equip(sets.midcast.Cure)
		end
	elseif spell.english:startswith('Curaga') then
		if buffactive["Aurorastorm"] or world.weather=="Auroras" or world.weather=="Stellar glare", or world.day_element=="Light" then
			equip(sets.midcast.Curaga, {waist="Korin Obi"})
		else
			equip(sets.midcast.Curaga)
		end
	end


I wanted to add in the Weather/Day also (is there a simplified way to do this?) for instances when I may not have /sch and would like it to equip for the weather/day.

EDIT: Just tried this out and using the startswith gives me an error in the strings lib.

"GearSwap has detected an error in the user function precast:
...strings.lua:146: attempt to get length of local 'substr' (a nil value)"
(I was missing some '' on one of the spells. Derp.)
 Carbuncle.Kigensuro
Offline
Server: Carbuncle
Game: FFXI
user: dlsmd
Posts: 21
By Carbuncle.Kigensuro 2018-06-14 15:55:43
Link | Quote | Reply
 
Sylph.Elgorian said: »
if spell.english:startswith('Cure') then
if buffactive["Aurorastorm"] or world.weather=="Auroras" or world.weather=="Stellar glare", or world.day_element=="Light" then
equip(sets.midcast.Cure, {waist="Korin Obi"})
else
equip(sets.midcast.Cure)
end
elseif spell.english:startswith('Curaga') then
if buffactive["Aurorastorm"] or world.weather=="Auroras" or world.weather=="Stellar glare", or world.day_element=="Light" then
equip(sets.midcast.Curaga, {waist="Korin Obi"})
else
equip(sets.midcast.Curaga)
end
end
if you are going to trigger it on all weather of a specific element use world.weather_element not 2 world.weather
like:
Code
if spell.english:startswith('Cure') then
    if buffactive["Aurorastorm"] or world.weather_element=="Light", or world.day_element=="Light" then
        equip(sets.midcast.Cure, {waist="Korin Obi"})
    else
        equip(sets.midcast.Cure)
    end
elseif spell.english:startswith('Curaga') then
    if buffactive["Aurorastorm"] or world.weather_element=="Light", or world.day_element=="Light" then
        equip(sets.midcast.Curaga, {waist="Korin Obi"})
    else
        equip(sets.midcast.Curaga)
    end
end

this will cut 1 check out for each spell
 Bismarck.Syuevil
Offline
Server: Bismarck
Game: FFXI
user: Syuevil
Posts: 6
By Bismarck.Syuevil 2018-06-18 09:40:27
Link | Quote | Reply
 
I'm stumped and was hoping to get some guidance. I noticed that when I cast Aspir III on GEO that my aspir set wasn't loading. I went into Mote-Mappings.lua and saw that Aspir III wasn't listed, which I thought was strange since I saw other Job Point spells like Drain III and all the Threnody IIs. So I went ahead and added it to the mappings and the specific line in the Mote-Mappings.lua should be this:
Code
['Holy']='Holy',['Holy II']='Holy',['Drain']='Drain',['Drain II']='Drain',['Drain III']='Drain',['Aspir']='Aspir',['Aspir II']='Aspir',['Aspir III']='Aspir',


Tried again and the issue persisted. I did an unload and load of GearSwap and nothing changed (logged and reload Windower too). So I entered DebugMode to try to figure out what was happening and Aspir III is being listed as Dark Magic (which it is) and using my DarkMagic midcast set. Any ideas on what might be behind this issue? I'm at work unfortunately and cannot list my GEO.lua at the moment. I do not have an Aspir mapping made in the GEO.lua (I have not tried this yet). I have one rule set that changes my Aspir spell to the next one if I try to cast a spell that is currently on cooldown but asides from that there isn't anything else happening.

I don't have Dark Knight to test Drain III or Bard setup to test Threnody IIs, perhaps it's an issue with the Job Point spells? I'm pretty sure that my Full-Cure works correctly on my White Mage. Any ideas? Thanks so much!
First Page 2 3 ... 137 138
Log in to post.