Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 12 of 22 FirstFirst ... 2 10 11 12 13 14 ... LastLast
Results 221 to 240 of 421
  1. #221

    Quote Originally Posted by Spicyryan View Post
    Take weapon off, complete a cast, and...
    ok it is because your main weapon is no longer equiped
    the only thing i can do is a nil check for your main weapon
    like this
    Code:
        --replace from line 1932 to 1937
        if player.equipment.main then
            local weapon_skill = gearswap.res.items:with('en', player.equipment.main).skill
            if weapon_skill and S{1,4,6,7,8,10,12}:contains(weapon_skill) then --Checks mainhand weapon for TP set choice. See bottom notes.
                TwoHandedTP = true
            else
                TwoHandedTP = false
            end
        else
            msg("!!Main Weapon Not Equiped!!")
        end
        
        
        --replace from line 2016 to 2021
        if player.equipment.main then
            local weapon_skill = gearswap.res.items:with('en', player.equipment.main).skill
            if weapon_skill and S{4,6,7,8,10,12}:contains(weapon_skill) then --Checks mainhand weapon for TP set choice. See bottom notes.
                TwoHandedTP = true
            else
                TwoHandedTP = false
            end
        else
            msg("!!Main Weapon Not Equiped!!")
        end
    you can change msg("!!Main Weapon Not Equiped!!") to what ever you want as it just informs you of whats going on

  2. #222
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    ok it is because your main weapon is no longer equiped
    the only thing i can do is a nil check for your main weapon
    like this
    Code:
        --replace from line 1932 to 1937
        if player.equipment.main then
            local weapon_skill = gearswap.res.items:with('en', player.equipment.main).skill
            if weapon_skill and S{1,4,6,7,8,10,12}:contains(weapon_skill) then --Checks mainhand weapon for TP set choice. See bottom notes.
                TwoHandedTP = true
            else
                TwoHandedTP = false
            end
        else
            msg("!!Main Weapon Not Equiped!!")
        end
        
        
        --replace from line 2016 to 2021
        if player.equipment.main then
            local weapon_skill = gearswap.res.items:with('en', player.equipment.main).skill
            if weapon_skill and S{4,6,7,8,10,12}:contains(weapon_skill) then --Checks mainhand weapon for TP set choice. See bottom notes.
                TwoHandedTP = true
            else
                TwoHandedTP = false
            end
        else
            msg("!!Main Weapon Not Equiped!!")
        end
    you can change msg("!!Main Weapon Not Equiped!!") to what ever you want as it just informs you of whats going on
    Ty for the reply. A nil check to fix this is exactly what I have been after .

    Just plugged that in and it doesn't stop the same error though :/

  3. #223

    Quote Originally Posted by Spicyryan View Post
    Ty for the reply. A nil check to fix this is exactly what I have been after .

    Just plugged that in and it doesn't stop the same error though :/
    so you are still getting this error correct


    GearSwap: Lua runtime error: GearSwap/flow.lua:349:
    GearSwap has detected an error in the user function aftercast:
    <mylualocationandnamehere> line 2016: attempt to index a nil value


    if so put this just above line 2016 (for testing purposes) and let me know what the output is from the command window

    print("player.equipment.main = "..player.equipment.main)

  4. #224
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Yeah, same error except line 2021 now.

    It returns player.equipment.main = empty in the command log.

    EDIT: So as a result I changed the rule from:

    Code:
    	if player.equipment.main then
            local weapon_skill = gearswap.res.items:with('en', player.equipment.main).skill
            if weapon_skill and S{4,6,7,8,10,12}:contains(weapon_skill) then --Checks mainhand weapon for TP set choice. See bottom notes.
                TwoHandedTP = true
            else
                TwoHandedTP = false
            end
        else
            msg("!!Main Weapon Not Equiped!!")
        end
    to

    Code:
    	if player.equipment.main ~= 'empty' then
            local weapon_skill = gearswap.res.items:with('en', player.equipment.main).skill
            if weapon_skill and S{4,6,7,8,10,12}:contains(weapon_skill) then --Checks mainhand weapon for TP set choice. See bottom notes.
                TwoHandedTP = true
            else
                TwoHandedTP = false
            end
        else
            msg("!!Main Weapon Not Equiped!!")
        end
    Now the error has stopped, thanks

    EDIT #2: Would you have any suggestions for handling my attempt at combining a DW array to combine over my current TP index instead of making a ton of set combines?:
    https://www.bluegartr.com/threads/13...=1#post7117641

  5. #225

    Quote Originally Posted by Spicyryan View Post
    Yeah, same error except line 2021 now.

    It returns player.equipment.main = empty in the command log.

    ...

    Now the error has stopped, thanks

    EDIT #2: Would you have any suggestions for handling my attempt at combining a DW array to combine over my current TP index instead of making a ton of set combines?:
    https://www.bluegartr.com/threads/13...=1#post7117641
    with the out put being that you have player.equipment.main = empty the reason that you where getting the error is because of the fact that there is no empty weapon so your fix is correct
    --be sure to make this same adjustment to the one near line 1932



    remember you can change
    msg("!!Main Weapon Not Equiped!!")
    to auto reequip your weapon if you chose as well

    as far as combining array's im not sure what you mean lua does not use arrays but nested tables (to me it is easier to think of it that way as all of lua starts from the _G table anyways)
    --if each table is controlling a separate thing in your code and the settings are different for each then you should keep them separate

  6. #226
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    with the out put being that you have player.equipment.main = empty the reason that you where getting the error is because of the fact that there is no empty weapon so your fix is correct
    --be sure to make this same adjustment to the one near line 1932



    remember you can change
    msg("!!Main Weapon Not Equiped!!")
    to auto reequip your weapon if you chose as well

    as far as combining array's im not sure what you mean lua does not use arrays but nested tables (to me it is easier to think of it that way as all of lua starts from the _G table anyways)
    --if each table is controlling a separate thing in your code and the settings are different for each then you should keep them separate
    Yeah and I was considering that too over this. Except it wouldn't be a straight forward thing since there are multiple weapons to deal with so I will keep that a manual macro for now.

    As far as the name game, I was under the impression each series of sets was simply called an array and your place in said array was the index. So the sets.TP.xyz is all the TP array, and so on. I am probably just being dumb, but at any rate.
    The objective was to have a toggle for DW on off and have levels of DW+ stack over the existing TP set so that instead of needing +11DW for each of the 4 TP sets, then another +x DW for each of the the 4 TP sets it could just combine over it, and when toggling a TP set after DW = True, it change that with the DW gear remaining over it.

  7. #227

    Quote Originally Posted by Spicyryan View Post
    Yeah and I was considering that too over this. Except it wouldn't be a straight forward thing since there are multiple weapons to deal with so I will keep that a manual macro for now.

    As far as the name game, I was under the impression each series of sets was simply called an array and your place in said array was the index. So the sets.TP.xyz is all the TP array, and so on. I am probably just being dumb, but at any rate.
    The objective was to have a toggle for DW on off and have levels of DW+ stack over the existing TP set so that instead of needing +11DW for each of the 4 TP sets, then another +x DW for each of the the 4 TP sets it could just combine over it, and when toggling a TP set after DW = True, it change that with the DW gear remaining over it.
    1. if you are trying to do dynamic set building here: https://pastebin.com/UGhM0PQc


    2. you can do something like this (non-dynamic)

    Code:
    if DW then
        equip(sets.TP[TP_ind],sets.DW[DW_ind])
    else
        equip(sets.TP[TP_ind])
    end


    tho the dynamic set building uses less code
    this is largely personal preference

  8. #228
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    1. if you are trying to do dynamic set building here: https://pastebin.com/UGhM0PQc


    2. you can do something like this (non-dynamic)

    Code:
    if DW then
        equip(sets.TP[TP_ind],sets.DW[DW_ind])
    else
        equip(sets.TP[TP_ind])
    end


    tho the dynamic set building uses less code
    this is largely personal preference
    Got a second to look at it just now. I was doing this:

    Code:
     sets.DW.Low = (set_combine(sets.TP[sets.TP.index[TP_ind]],{
            ear1 = "Suppanomimi",
            body = AdhemarJacket.TP,
            back = Rosmerta.DW,
            waist = "Reiki Yotai",
            feet = HerculeanFeet.DW
        })
    To call as

    Code:
     ChangeGear(sets.DW.index[DW_ind]]
    Where if I dont try to combine the different indexes and instead make it:

    Code:
    sets.DW = {}
        sets.DW.index = {'Low', 'High'}
        DW_ind = 1
    
    sets.DW.Low = {
            ear1 = "Suppanomimi",
            body = AdhemarJacket.TP,
            back = Rosmerta.DW,
            waist = "Reiki Yotai",
            feet = HerculeanFeet.DW
    
    etc
        })
    To call as:

    Code:
    (set_combine(sets.TP[sets.TP.index[TP_ind]], sets.DW[sets.DW.index[DW_ind]]))
    It seems to be working at a glance. Just need to refine out the layers of rules.

    I feel retarded for trying to do it the other way before...

  9. #229

    Quote Originally Posted by Spicyryan View Post
    I feel retarded for trying to do it the other way before...
    no your not if you do not make mistakes you can't get better

  10. #230
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    no your not if you do not make mistakes you can't get better
    True, and the fact I dont need 50 different sets for haste/DW like everyone else seems to, is worth it. Thanks for your help.

  11. #231

    Quote Originally Posted by Spicyryan View Post
    True, and the fact I dont need 50 different sets for haste/DW like everyone else seems to, is worth it. Thanks for your help.
    i love these

    “There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand the world. There is no such thing as a dumb question.”
    ― Carl Sagan, The Demon-Haunted World: Science as a Candle in the Dark



    "There is no such thing as a stupid question, just stupid people who ask questions."
    ― Unknown

  12. #232
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    i love these

    “There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand the world. There is no such thing as a dumb question.”
    ― Carl Sagan, The Demon-Haunted World: Science as a Candle in the Dark



    "There is no such thing as a stupid question, just stupid people who ask questions."
    ― Unknown
    I identify with the last question due to how concise it is.



    Started making an automatic DW on off/specific value set of rules for BLU since it always has haste II. Wont make one that requires manually toggling haste 2 on/off, as is common, too much in the mix, but man the fact I am adding situations for weakness/slow with haste (again, why do the other ones i see not even do this..?) is a pain. All the if buffactives or these buff actives or these buff actives over and over with the and not buffactives is a headache.

    Think I need to create 2-3xs more situations to cover the gambit:
    Code:
    	if AutoDW == true then	
    		if ( ( (buffactive[33] or buffactive[580] or buffactive.embrava) and (buffactive.march or buffactive[604]) ) or
    			(buffactive[33] and (buffactive[580] or buffactive.embrava) ) or
    			(buffactive.march == 2 and buffactive[604] ) ) and not (buffactive[13] or buffactive[565]) then
    			DW = false
    			if player.status == 'Engaged' and not LockGearIndex and DT == false then
    				ChangeGear(sets.TP[sets.TP.index[TP_ind]])
    			end
    		elseif (buffactive[33] and not (buffactive.march or buffactive[580] or buffactive[604] or buffactive.embrava) or
    			   (buffactive[13] or buffactive[565]) and (buffactive.march == 2) and (buffactive[580]) and (buffactive[604] or buffactive.embrava) )
    			then
    			DW = true
    			DW_ind = 1
    			 if player.status == 'Engaged' and not LockGearIndex and DT == false then
    				ChangeGear(set_combine(sets.TP[sets.TP.index[TP_ind]], sets.DW[sets.DW.index[DW_ind]]))
    				send_command('@input /echo <----- Dual Wield Set is on and currently set to ' .. sets.DW.index[DW_ind] .. ' ----->')
    			end
    		elseif not buffactive[33] and not (buffactive.march or buffactive[580] or buffactive[604] or buffactive.embrava) or buffactive['Weakness'] then
    				DW = true
    				DW_ind = 2
    			 if player.status == 'Engaged' and not LockGearIndex and DT == false then
    				ChangeGear(set_combine(sets.TP[sets.TP.index[TP_ind]], sets.DW[sets.DW.index[DW_ind]]))
    				send_command('@input /echo <----- Dual Wield Set is on and currently set to ' .. sets.DW.index[DW_ind] .. ' ----->')
    			end
    		end
    	end
    end
    Works though, echos are just for testing. Otherwise, I would see them every action.

  13. #233
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,366
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    how do i have my lua wait? Like, I'd like it to do a send_command, wait 1 second, then do another send_command.


    everything i'm finding is pretty complicated and a bit beyond me.

  14. #234
    Relic Shield
    Join Date
    Mar 2007
    Posts
    1,789
    BG Level
    6
    FFXIV Character
    Rehn Valor
    FFXIV Server
    Sargatanas
    FFXI Server
    Ragnarok

    can you give an example of what commands you are wanting to send? like send_command('input /ja provoke <t>;wait 3;input /ma flash <t>)?

  15. #235
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,366
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    like



    send_command ('whatever')

    wait 2

    send_command ('other-thing')

  16. #236
    Relic Shield
    Join Date
    Mar 2007
    Posts
    1,789
    BG Level
    6
    FFXIV Character
    Rehn Valor
    FFXIV Server
    Sargatanas
    FFXI Server
    Ragnarok

    if they are ingame commands, then the above example works fine. Unless you have some strange commands you want to send in game (or console?)

  17. #237
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,366
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    Code:
        elseif cmdParams[1] == 'menu_craft' then
        local a=0
            repeat
                send_command('input /echo --- Begin Craft ---; setkey LEFT down; wait .2; setkey LEFT up; wait 1; setkey UP down; wait .2; setkey UP up; wait 1; setkey ENTER down; wait .2; setkey ENTER up; wait 1; setkey LEFT down; wait .2; setkey LEFT up; wait 1; setkey UP down; wait .2; setkey UP up; wait 1; setkey ENTER down; wait .2; setkey ENTER up; wait 23; setkey RIGHT down; wait .2; setkey RIGHT up; wait 1; setkey DOWN down; wait .2; setkey DOWN up; wait 1; setkey ENTER down; wait .2; setkey ENTER up; wait 1; setkey RIGHT down; wait .2; setkey RIGHT up; wait 1; setkey DOWN down; wait .2; setkey DOWN up; wait 1; setkey ENTER down; wait .2; setkey ENTER up; wait 23;')
                wait = 50
                    a=a+1
            until(a>=2)
        end

    not console or ingame. in lua.

  18. #238
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Anyone know the buff ID for Hojo Ichi/Ni and Weakness?

    I also assume there is no way to detect Samba from another player since you don't visibly gain that buff? User Samba be irrelevant at 5% neither capping nor changing much.

  19. #239

    Quote Originally Posted by Spicyryan View Post
    Anyone know the buff ID for Hojo Ichi/Ni and Weakness?

    I also assume there is no way to detect Samba from another player since you don't visibly gain that buff? User Samba be irrelevant at 5% neither capping nor changing much.

    Hojo Ichi/Ni = 13 or 565 (slow)
    --you can't cast this on your self but your enemy can

    Weakness = 1 (weakness)
    --if i remember correctly you should never see this buff in gearswap


    Samba:
    368 = Drain Samba
    369 = Aspir Samba
    370 = Haste Samba
    --but Samba can only be used on self so there is no buff for other player because it causes a debuff on your attack target

  20. #240
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,764
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    Hojo Ichi/Ni = 13 or 565 (slow)
    --you can't cast this on your self but your enemy can

    Weakness = 1 (weakness)
    --if i remember correctly you should never see this buff in gearswap


    Samba:
    368 = Drain Samba
    369 = Aspir Samba
    370 = Haste Samba
    --but Samba can only be used on self so there is no buff for other player because it causes a debuff on your attack target
    So Hojo shares the same ID (13 slow 565 slow 2), makes sense.

    Why wouldn't you see 1? As far as I know, Weakness is a 100% slow, dramatically reduced with haste and DW. Weakness being active would just trigger the highest DW set.

Similar Threads

  1. Gearswap Help Thread!
    By JSHidaka in forum FFXI: Everything
    Replies: 6035
    Last Post: 2018-05-06, 17:15
  2. Randomerest Question Thread III: This Time It's Random
    By isladar in forum FFXI: Everything
    Replies: 868
    Last Post: 2009-08-18, 12:03