Item Search
     
BG-Wiki Search
Page 255 of 302 FirstFirst ... 205 245 253 254 255 256 257 265 ... LastLast
Results 5081 to 5100 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #5081
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Roland_J View Post
    Code:
                if EngagedTP > -1 and player.tp > (EngagedTP+80) and player.status == 'Engaged' then
    After the April 5th update this code is now printing the following error.

    "User Event Error: blu.lua:99: attempt to compare number with nil"

    How do I fix that? :/ Or I suppose it might fix itself as more work is done to synch all the addons with the update?

    That code is part of the Treasure Hunter code that is posted higher up on this page, by the way.
    here is how you can tell whats causing the error
    put this in the same function as your above code
    to a windower console line
    print("EngagedTP = "..EngagedTP," player.tp = "..player.tp," player.status = "..player.status)
    or(to a chat line)
    add_to_chat(7,"EngagedTP = "..EngagedTP..", player.tp = "..player.tp..", player.status = "..player.status)

  2. #5082
    Puppetmaster
    Join Date
    Sep 2015
    Posts
    73
    BG Level
    2

    Thank you dlsmd. I woke up this morning to find that the error has fixed itself. I suppose that something in the .lua framework of gearswap got updated which stopped this error from happening anymore. Either that or I was doing something wrong that I am still oblivious of

    Edit: nvm, the error message still lingers o.o I'll investigate later

  3. #5083
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    I have a question about the THF JSE Cape with Augments

    I'm making an advanced variable for it and I have it like this.

    Code:
    gear.thf.canny = {name="Canny Cape", augments={'DEX+4 AGI+4', '"Dual Wield"+2'}}
    My question is, do the DEX+4 and AGI+4 get their own strings or are they part of the same string?

    Meaning should it be this instead:

    Code:
    gear.thf.canny = {name="Canny Cape", augments={'DEX+4', 'AGI+4', '"Dual Wield"+2'}}
    Edit: I do recall that there was a way for you to get gs to print out the augments, but I don't remember how to do it.

  4. #5084
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Shadowmeld View Post
    Edit: I do recall that there was a way for you to get gs to print out the augments, but I don't remember how to do it.
    equip your gear then "/gs export"

  5. #5085
    Puppetmaster
    Join Date
    Sep 2015
    Posts
    73
    BG Level
    2

    Quote Originally Posted by Roland_J View Post
    Thank you dlsmd. I woke up this morning to find that the error has fixed itself. I suppose that something in the .lua framework of gearswap got updated which stopped this error from happening anymore. Either that or I was doing something wrong that I am still oblivious of

    Edit: nvm, the error message still lingers o.o I'll investigate later
    Now gearswap is giving me an error on my WHM's (mote based) lua.

    "if state.Defense.Active then" is reporting the following error.

    ...ents\Windower4\/addons/GearSwap/data/Estherr/WHM.lua:734: attempt to index field 'Defense' (a nil value)

    I guess some stuff got broke afterall D: Both of these functions worked perfectly fine until April 5th, 2016.

  6. #5086
    Hydra
    Join Date
    Jan 2008
    Posts
    113
    BG Level
    3

    Anyone else having issues with Mog Wardrobe #2 not equipping items that are defined line such?

    back=gear.ElementalCape,waist=gear.ElementalObi

    It's using the defaulted items that I have defined only even when storm is up. It works fine in Wardobe 1 and Inventory.

  7. #5087
    Hydra
    Join Date
    Nov 2009
    Posts
    127
    BG Level
    3
    FFXI Server
    Odin

    Quote Originally Posted by Reposado View Post
    Anyone else having issues with Mog Wardrobe #2 not equipping items that are defined line such?

    back=gear.ElementalCape,waist=gear.ElementalObi

    It's using the defaulted items that I have defined only even when storm is up. It works fine in Wardobe 1 and Inventory.
    Having the same issue.

  8. #5088
    BG Content
    Join Date
    Jul 2007
    Posts
    22,361
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    It's possible that Motenten's file checks wardrobe 1/inventory to see whether you have the requisite obis.

  9. #5089
    Hydra
    Join Date
    Jan 2008
    Posts
    113
    BG Level
    3

    Indeed. Is there a small fix or do i need to ditch his GS?

  10. #5090
    BG Content
    Join Date
    Jul 2007
    Posts
    22,361
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    It's probably a small fix if you can find what to fix.

  11. #5091
    Hydra
    Join Date
    Jan 2008
    Posts
    113
    BG Level
    3

    I will do what I can. As you know not the best with this

  12. #5092
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    does GearSwap have access to timers (not the plugin, but clock functions) in any way?

    I'm looking at doing a register event for magic burst based on timers and I was wondering if I might be able to do something like this

    (pseudocode)
    Code:
    windower.register_event('action message', function(actor_id, target_id, actor_index, target_index, message_id, param_1, param_2, param_3) end)
      if message_id > 287 and message_id < 303 then -- Skill chain message ids start at 288 and go through 302
        send_command("gs c mb_start")
    end
    
    function self_command(command)
      if command == 'mb_start' then
    
        state.MagicBurst = true
        mb_timer = os.clock()
    
        send_command("wait 5; gs c mb_fin")
      elseif command == 'mb_fin' then
        if os.clock() - mb_timer  > 4 then
          state.MagicBurst = false
        end
      end
    end

  13. #5093
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Shadowmeld View Post
    does GearSwap have access to timers (not the plugin, but clock functions) in any way?

    I'm looking at doing a register event for magic burst based on timers and I was wondering if I might be able to do something like this

    (pseudocode)
    Code:
    windower.register_event('action message', function(actor_id, target_id, actor_index, target_index, message_id, param_1, param_2, param_3) end)
      if message_id > 287 and message_id < 303 then -- Skill chain message ids start at 288 and go through 302
        self_command("mb_start")
    end
    
    function self_command(command)
      if command == 'mb_start' then
    
        state.MagicBurst = true
        mb_timer = os.clock()
    
        send_command("wait 5; gs c mb_fin")
      elseif command == 'mb_fin' then
        if os.clock() - mb_timer.value  > 5 then
          state.MagicBurst = false
          mb_timer.stop()
        end
      end
    end
    yes and no
    you cant do sleep in gearswap but you can trigger another function to go off after a specific amount of time (aka start a custom thread)
    Example:
    --this is how i time my xp/cp ring re equip
    Code:
    function get_item_next_use(name)--returns time that you can use the named item again
        for _,n in pairs({"inventory","wardrobe","wardrobe2"}) do
            for _,v in pairs(gearswap.items[n]) do
                if type(v) == "table" and v.id ~= 0 and gearswap.res.items[v.id].en == name then
                    return gearswap.extdata.decode(v)
                end
            end
        end
    end
    function xp_cp_ring_equip(ring)--equips selected ring
         if auto_ring then
             enable("left_ring")
             gearswap.equip_sets('xp_cp_ring_auto_equip',nil,{left_ring=ring})
             disable("left_ring")
         end
    end
    function schedule_xpcp_ring()--scheduals equip of selected ring
        local ring_time = os.time(os.date("!*t", get_item_next_use(rings[rings_count]).next_use_time))-os.time()
        if type(xpcpcoring) == "thread" then
            coroutine.close(xpcpcoring)
        end
        xpcpcoring = coroutine.schedule(xp_cp_ring_equip:prepare(rings[rings_count]),(ring_time > 0 and ring_time or 1))
    end
    --if you just want to trigger another function (that does not require any vaiables)
    Code:
    thenameofyourfunction:schedule(timeinseconds)
    --if you just want to trigger another function (that does require vaiables)--sometime one works but the other does not
    Code:
    thenameofyourfunction:schedule(timeinseconds,yourfunctionvarables)
    or
    coroutine.schedule(thenameofyourfunction:prepare(yourfunctionvarables),timeinseconds)
    --if you want to equip something after a timer
    Code:
    gearswap.equip_sets:schedule(timeinseconds,'timed_equip', nil, setname)
    this is how i would do your code
    Code:
    function end_mb()
        state.MagicBurst = false
    end
    function action_message(actor_id, target_id, actor_index, target_index, message_id, param_1, param_2, param_3)
        if message_id > 287 and message_id < 303 then -- Skill chain message ids start at 288 and go through 302
            state.MagicBurst = true
            end_mb:schedule(5)
        end
    end
    windower.raw_register_event('action message', action_message)

  14. #5094
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    I'm wondering if the timeit.lua lib is part of the gearswap framework. It seems like that is the perfect thing for this withought making complex coroutines. I'm thinking this:

    Code:
    -- this is probably in get_sets()
    mb_timer = timeit.new()
    mb_timer:start()
    
    function mb_check()
      if mb_timer:check() > 5 then
        -- mb_timer:stop(), I don't think I would need this, I could just have it running all the time, the next function in the action message event would restart the timer from the time of the call.
        state.MagicBurst = false
      end
    end
    
    function action_message(actor_id, target_id, actor_index, target_index, message_id, param_1, param_2, param_3)
        if message_id > 287 and message_id < 303 then -- Skill chain message ids start at 288 and go through 302
            state.MagicBurst = true
            mb_timer:next()
            mb_check:schedule(5)
        end
    end
    
    windower.raw_register_event('action message', action_message)
    
    function on_file_unload()
      mb_timer:stop()
    end

  15. #5095
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Shadowmeld View Post
    I'm wondering if the timeit.lua lib is part of the gearswap framework. It seems like that is the perfect thing for this withought making complex coroutines. I'm thinking this:

    Code:
    -- this is probably in get_sets()
    mb_timer = timeit.new()
    mb_timer:start()
    
    function mb_check()
      if mb_timer:check() > 5 then
        -- mb_timer:stop(), I don't think I would need this, I could just have it running all the time, the next function in the action message event would restart the timer from the time of the call.
        state.MagicBurst = false
      end
    end
    
    function action_message(actor_id, target_id, actor_index, target_index, message_id, param_1, param_2, param_3)
        if message_id > 287 and message_id < 303 then -- Skill chain message ids start at 288 and go through 302
            state.MagicBurst = true
            mb_timer:next()
            mb_check:schedule(5)
        end
    end
    
    windower.raw_register_event('action message', action_message)
    
    function on_file_unload()
      mb_timer:stop()
    end
    the issue with the above code is that after 5 seconds(i could be wrong) it will always set state.MagicBurst to false the the timer thread will always be running

    but the code i posted will only change state.MagicBurst to false 5 second after it changes it to true and the thread will be gone when it does so, so if its not needed it does not take up memory and does not require any requirements which take even more memory

    if you want to check to see if the timer is already running you can do this to re set the timer
    Code:
    c_mb = nil
    function end_mb()
        state.MagicBurst = false
    end
    function action_message(actor_id, target_id, actor_index, target_index, message_id, param_1, param_2, param_3)
        if message_id > 287 and message_id < 303 then -- Skill chain message ids start at 288 and go through 302
            state.MagicBurst = true
            if type(c_mb) == "thread" then
                coroutine.close(c_mb)
            end
            c_mb = end_mb:schedule(5)
        end
    end
    reg_event.level_down_id = windower.raw_register_event('action message', action_message)

  16. #5096
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    in timeit the next function returns the time difference from the beginning of the timer and then restarts the timer.

    The reason I want it that way rather than the other is I think this would work better in situations where multiple consecutive skillchains are done.

    With the way your code is set up, if a second skillchain is done 4 seconds in, it will set the state.MagicBurst variable to false 1 second into the second skillchain because the end_mb function doesn't check to see if it should keep going.

    I'm going to try it and see if it works tonight when I can.

    Edit: So basically the same thing you did as the final example in your last post.

  17. #5097
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Shadowmeld View Post
    in timeit the next function returns the time difference from the beginning of the timer and then restarts the timer.

    The reason I want it that way rather than the other is I think this would work better in situations where multiple consecutive skillchains are done.

    With the way your code is set up, if a second skillchain is done 4 seconds in, it will set the state.MagicBurst variable to false 1 second into the second skillchain because the end_mb function doesn't check to see if it should keep going.

    I'm going to try it and see if it works tonight when I can.
    thats what this fixes
    Code:
    c_mb = 1
    function end_mb()
        state.MagicBurst = false
    end
    windower.raw_register_event('action message', function (actor_id, target_id, actor_index, target_index, message_id, param_1, param_2, param_3)
        if message_id > 287 and message_id < 303 then -- Skill chain message ids start at 288 and go through 302
            state.MagicBurst = true
            if type(c_mb) == "thread" then --if the timer is started stop it
                coroutine.close(c_mb)
            end
            c_mb = end_mb:schedule(5)--start timer
        end
    end)

  18. #5098
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    Yeah, we are on the same page, I noticed after I had originally replied and edited that in there.

    I guess if timeit is already part of the framework I'll try it my way, otherwise I'll do it your way.

  19. #5099
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Shadowmeld View Post
    Yeah, we are on the same page, I noticed after I had originally replied and edited that in there.

    I guess if timeit is already part of the framework I'll try it my way, otherwise I'll do it your way.
    no timeit is not part of gearswap you will have to require it like one of these(im not sure which tho i have never used timeit)
    timeit = require("timeit")
    timeit = require 'timeit'
    require("timeit")
    require 'timeit'

  20. #5100
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    Ok, then I'll just do it your way.

Page 255 of 302 FirstFirst ... 205 245 253 254 255 256 257 265 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45