Item Search
     
BG-Wiki Search
Page 135 of 302 FirstFirst ... 85 125 133 134 135 136 137 145 185 ... LastLast
Results 2681 to 2700 of 6036

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

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

    Quote Originally Posted by Sechs View Post
    In particular, this is what I consider the relevant part of that addon I was talking of:

    Code:
    windower.register_event('prerender', function()
        local me = windower.ffxi.get_mob_by_target('me')
        if me then
            speed:text('%+.0f %%':format(100*(me.movement_speed / 5 - 1)))
            speed:show()
        else
            speed:hide()
        end
    end)
    Would just need a different value inside that speed:text line, would be actually simpler than that since you would just have to put the variable name in there, with no calculation needed.
    actualy you would need
    Code:
    texts = require('texts')
    speed = texts.new(settings)
    speed:show()
    
    windower.register_event('prerender', function()
        local me = windower.ffxi.get_mob_by_target('me')
        if me then
            speed:text('%+.0f %%':format(100*(me.movement_speed / 5 - 1)))
            speed:show()
        else
            speed:hide()
        end
    end)
    but im not sure how every thing is done

  2. #2682
    Sea Torques
    Join Date
    Nov 2007
    Posts
    694
    BG Level
    5
    FFXI Server
    Asura

    Quote Originally Posted by Motenten View Post
    Put in an add_to_chat() command in the user_post_precast() function to make sure it's being run? And that it's passing your if check? I don't see anything obviously wrong with the code you have.
    Like this, right?
    Code:
    function user_post_precast(spell, action, spellMap, eventArgs)
        if buffactive['Reive Mark'] and spell.type == 'WeaponSkill' then
            equip(sets.reive)
    	add_to_chat(104, 'Firing main cannon.')
        end
    end
    Because if that's right, it's not going off.

  3. #2683
    Salvage Bans
    Join Date
    Oct 2007
    Posts
    771
    BG Level
    5

    Any way to check if a spell been interrupted and where would be the best place to check it? Guess could just check for recast on most but not instant casts.

  4. #2684
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    If spell.interrupted then... End
    Inside aftercast function

  5. #2685
    Salvage Bans
    Join Date
    Oct 2007
    Posts
    771
    BG Level
    5

    Quote Originally Posted by JSHidaka View Post
    If spell.interrupted then... End
    Inside aftercast function
    Cool Thanks

  6. #2686
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Suteru View Post
    Like this, right?
    Code:
    function user_post_precast(spell, action, spellMap, eventArgs)
        if buffactive['Reive Mark'] and spell.type == 'WeaponSkill' then
            equip(sets.reive)
    	add_to_chat(104, 'Firing main cannon.')
        end
    end
    Because if that's right, it's not going off.
    Code:
    function user_post_precast(spell, action, spellMap, eventArgs)
        add_to_chat(104, 'calling user_post_precast')
        if buffactive['Reive Mark'] and spell.type == 'WeaponSkill' then
            equip(sets.reive)
            add_to_chat(104, 'weaponskill in reive')
        end
    end

  7. #2687
    Sea Torques
    Join Date
    Nov 2007
    Posts
    694
    BG Level
    5
    FFXI Server
    Asura

    Doesn't seem to be calling user_post_precast.

    Is there a newer version of Includes I might not be using?


    e: grabbed the latest I could find on Github (19 days old) and still nothing.

  8. #2688
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Since this probably wouldn't belong into normal Timers, I want to track RUN's runes with the custom window of Timers.
    What would I have to do in Gearswap? Anybody already has such a rule?
    It should follow these rules:

    1) Up to three runes are tracked. No specific names, just Rune 1, Rune 2, Rune 3.
    2) If 3 runes are already up and a fourth is used, Rune 1 = Rune 2, Rune 2 = Rune 3, and Rune 3 = 5 mins (that's the duration of a rune)
    3) If Swipe is used, The Last Rune (which can be 1, 2, or 3 according to how many runes are up) needs to be cancelled from the tracking window
    4) If Lunge is used, all 3 runes need to disappear from the tracking
    5) If rune 1 expires (>5 mins occurr) then Rune 1 = Rune 2, Rune 2 = Rune 3 and Rune 3 stops being tracked

    Can't think of anything else. They should always be sorted and sorting should change dynamically according to use and hmm, what else. Oh yeah of course timers need to go down (from 5 mins to 0)



    If nobody already made such a thing, I think I might be able to do it myself but I need someone to teach me how to handle stuff in the Custom window of Timers.

  9. #2689
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Byrth's code for custom timers for songs might give you an idea, at least 1,2 are doable coz is most likely tracking the songs(3-4 songs) 3,4 is just to clear timers.. so easy, 5, guess that is done auto in 1,2

  10. #2690
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Where do I find that? In Byrth's BRD example Lua?
    I think I'm gonna need at least 4 variables for this
    Rune1, Rune2, Rune3 and RuneN, last one tracking the number of currently active runes.
    RuneN would be used to apply the different behaviour since it seems to me that's the key condition that needs to be checked.

  11. #2691
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by Sechs View Post
    Where do I find that? In Byrth's BRD example Lua?
    Yes I think it's in there, but I cannot grasp much out of it.
    I kinda need to know what's the syntax command to create a custom timer, the syntax command to modify an already existing one and the syntax command to delete an existing one.


    Also I noticed something I never saw before in Byrth's Lua
    Code:
    ear2={name="Gifted Earring",order=7}
    What is this for? It was inside a set, he used that in a lot of slots for many sets, with different values of course.

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

    Quote Originally Posted by Sechs View Post
    Also I noticed something I never saw before in Byrth's Lua
    Code:
    ear2={name="Gifted Earring",order=7}
    What is this for? It was inside a set, he used that in a lot of slots for many sets, with different values of course.
    it sets the order of equiping items
    you can find data on this in Advanced sets tables.txt in the GearSwap\beta_examples_and_information folder

  13. #2693
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    I'll have a look. But what would the purpose of altering the equip order be? What do you gain from that?

  14. #2694
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Maintaining maximum HP/MP.

  15. #2695
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Oh that's cool. I used to do it long time ago on my SCH when MP was a much bigger issue for me (Galka). I also remember that very often I was choosing slightly worse items (as long as the difference wasn't huge) just because they had +mp on them and was trying to take into consideration those aspects and the order while swapping gear in my sets.

    Kinda stopped bothering after the ilevel patch, but it's a nice addition, think I will sort my mage jobs sets in sight of this new thing.
    What's the syntax?

    slot=(name="item name", order=number) ?

  16. #2696
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by Sechs View Post
    Where do I find that? In Byrth's BRD example Lua?
    I think I'm gonna need at least 4 variables for this
    Rune1, Rune2, Rune3 and RuneN, last one tracking the number of currently active runes.
    RuneN would be used to apply the different behaviour since it seems to me that's the key condition that needs to be checked.
    from what I did understand, all runes have the timer of the last rune, if so, check this

    Code:
    function aftercast(spell,action)
    	 if spell.type and spell.type == 'Rune' and spell.target and spell.target.type:upper() == 'SELF' then
            local t = os.time()
    		local timer_reg = {}
            local tempreg = {}
            for i,v in pairs(timer_reg) do
                if v < t then tempreg[i] = true end
            end
            for i,v in pairs(tempreg) do
                timer_reg[i] = nil
            end
            
            local dur = 300 --5 mins by default? --calculate_duration(spell.name)
            if timer_reg[spell.type] then
                    send_command('timers delete "'..spell.type..'"')
                    timer_reg[spell.type] = t + dur
                    send_command('timers create "'..spell.type..'" '..dur..' down')
            else
                local maxsongs = 3 -- did remove everything else since max runes are 3.. At lvl 99... so this consider you are able to have 3
                
                if maxsongs < table.length(timer_reg) then
                    maxsongs = table.length(timer_reg)
                end
                
                if table.length(timer_reg) < maxsongs then
                    timer_reg[spell.type] = t+dur
                    send_command('timers create "'..spell.type..'" '..dur..' down')
                else
                    local rep,repsong
                    for i,v in pairs(timer_reg) do
                        if t+dur > v then
                            if not rep or rep > v then
                                rep = v
                                repsong = i
                            end
                        end
                    end
                    if repsong then
                        timer_reg[repsong] = nil
                        send_command('timers delete "'..repsong..'"')
                        timer_reg[spell.type] = t+dur
                        send_command('timers create "'..spell.type..'" '..dur..' down')
                    end
                end
            end
        end	
    end
    just did this before work(so didnt work it alot.. was a quick "fix"), was trying to figure how to count how many runes I have actived, so could change the timer to looks like the Custom aftermath, and show for ex, if you have 3 runes with 4 mins 40 sec left: "Rune (3): 4:40 " (but no time or idea how to do it atm lol)

    and to reset/delete the timers, this function when you use swipe and the other Ja...
    Code:
    function reset_timers()
    		for i,v in pairs(timer_reg) do
    			send_command('timers delete "'..i..'"')
    		end
    	timer_reg = {}
    end
    edit: the code was to work with spell.name, but since same name JA will overwrite same JA in timers (didnt stop to look where was that code), I did change it to spell.type so it show a single "Rune" timers, so the reset timers function with the current code... is kind of overworked since you can just delete the single custom timer named "Rune" after the JA's, when I get home will try to play a little more with it, but probably this give some idea how to make it better

  17. #2697
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    No each rune has its own independent time, and the duration is 5 mins.
    Still you gave quite some nice ideas, gonna work on it. And also gonna peek into nitrous's pup add-on, autocontrol. It does almost the same thing but for pup maneuvers.
    Thing is that aside different durations they're pretty much the same thing, with runes being a bit more complex since you can "spend" them with the two jas I mentioned and two more I forgot about (rayke and gambit)

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

    @Sechs
    if your still looking for a way to build a display in your gearswap here is the code i am using
    Spoiler: show
    Code:
    texts = require('texts')
    box = {}
    box.pos = {}
    box.pos.x = 0
    box.pos.y = 0
    box.text = {}
    box.text.font = 'Dotum'
    box.text.size = 9
    box.bg = {}
    box.bg.alpha = 175
    if gearswap.pathsearch({'Data/'..player.main_job..'box.lua'}) then --reloads pos settings
    	include('Data/'..player.main_job..'box.lua')
    end
    window = texts.new(box)
    function initialize(text, settings)
        local properties = L{}
    	if player.sub_job == 'DNC' then
    		properties:append('\\cs(255,0,0)Max Step = \\cs(255,255,0)${stepm}')
    		properties:append('\\cs(255,0,0)Steps\n  \\cs(255,255,0)Will ${ssteps|Not }Stop')
    	end
    	if windower.wc_match(player.main_job, "WHM|BLM|RDM|BRD|SMN|SCH|GEO") then
    		properties:append('\\cs(255,0,0)Staves\n  \\cs(255,255,0)Will ${cstaff|Not }Change')
    		properties:append('\\cs(255,0,0)Staves Set To \\cs(255,255,0)${ustaff}')
    	end
    	properties:append('\\cs(255,0,0)Conquest Neck\n  \\cs(255,255,0)Will ${cneckc|Not }Change')
    	properties:append('\\cs(255,0,0)Conquest Ring\n  \\cs(255,255,0)Will ${cringc|Not }Change')
    	properties:append('\\cs(255,0,0)Conquest\n  \\cs(0,255,0)Neck Type = \\cs(255,255,0)${cneck}\n  \\cs(0,255,0)Ring Type = \\cs(255,255,0)${cring}')
    
        text:clear()
        text:append(properties:concat('\n'))
    end
    initialize(window, box)
    function updatedisplay()--call function any time you want to update the screen
    	local info = {}
    	info.stepm = Stepmax
    	info.ssteps = Stopsteps and '' or 'Not '
    	info.cstaff = Changestaff and '' or 'Not '
    	info.ustaff = Usestaff
    	info.cneckc = Conquest.neck.change and '' or 'Not '
    	info.cringc = Conquest.ring.change and '' or 'Not '
    	info.cneck = Conquest.neck.case[Conquest.neck.case_id]
    	info.cring = Conquest.ring.case[Conquest.ring.case_id]
    	window:update(info)
    	window:show()
    end
    function file_unload()
        window:destroy() --kills display when gs is reset
    end

    you will need to eather set your x/y pos manually or add a way to save that data

    this is how i did mine (this saves both my varables i want to keep and the pos of my display)
    Spoiler: show
    Code:
    function file_write() --call function any time you want to save data
    	--save desired varables
    	file = io.open(lua_base_path..'data/'..player.name..'/Data/'..player.main_job..'var.lua',"w")
    	local info = {}
    	save('Stepmax', Stepmax)
    	save('Stopsteps', Stopsteps, saved)
    	if windower.wc_match(player.main_job, "WHM|BLM|RDM|BRD|SMN|SCH|GEO") then
    		save('Changestaff', Changestaff, saved)
    		save('Usestaff', Usestaff, saved)
    	end
    	save('Conquest.neck.change', Conquest.neck.change, saved)
    	save('Conquest.neck.case_id', Conquest.neck.case_id, saved)
    	save('Conquest.ring.change', Conquest.ring.change, saved)
    	save('Conquest.ring.case_id', Conquest.neck.case_id, saved)
    	save('specialweaponwscount', specialweaponwscount, saved)
    	file:close()
    	file = nil
    	--save display pos
    	local file2 = io.open(lua_base_path..'data/'..player.name..'/Data/'..player.main_job..'box.lua',"w")
    	file2:write(
    		'\nbox.pos.x = '..tostring(box.pos.x)..
    		'\nbox.pos.y = '..tostring(box.pos.y)..
    		'')
    	file2:close() 
    end
    function basicSerialize (o)
    	if type(o) == "number" or type(o) == "boolean" then
    		return tostring(o)
    	else   -- assume it is a string
    		return string.format("%q", o)
    	end
    end
    function save (name, value, saved)
    	saved = saved or {}       -- initial value
    	file:write(name, " = ")
    	if type(value) == "number" or type(value) == "string" or type(value) == "boolean" then
    		file:write(basicSerialize(value), "\n")
    	elseif type(value) == "table" then
    		if saved[value] then    -- value already saved?
    			file:write(saved[value], "\n")  -- use its previous name
    		else
    			saved[value] = name   -- save name for next time
    			file:write("{}\n")     -- create a new table
    			for k,v in pairs(value) do      -- save its fields
    				local fieldname = string.format("%s[%s]", name,
    				basicSerialize(k))
    				save(fieldname, v, saved)
    			end
    		end
    	else
    		error("cannot save a " .. type(value))
    	end
    end

  19. #2699
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by Sechs View Post
    No each rune has its own independent time, and the duration is 5 mins.
    Still you gave quite some nice ideas, gonna work on it. And also gonna peek into nitrous's pup add-on, autocontrol. It does almost the same thing but for pup maneuvers.
    Thing is that aside different durations they're pretty much the same thing, with runes being a bit more complex since you can "spend" them with the two jas I mentioned and two more I forgot about (rayke and gambit)
    Hmmm well just change .type for .name and it will track different runes, btw what was the way to know how many buff you have on? Tried buffactive[buff] but didn't work,

    If I Can figure out that, it fix "everything"

  20. #2700
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    To track how many I have I was thinking to use a fourth variable, and somehow use a line like this:

    RuneN = RuneN+1.
    When they expire I would use RuneN = RuneN-1
    When I use Swipe it would be RuneN = RuneN-1
    And when I consume them, and at the beginning of my Lua, I would put RuneN = 0

    There are some strange things to handle. Like for instance if a rune expires it's Rune1 that gets deleted (first one I used), but if I use Swipe it's Rune3 (the last one).
    Meh, I'll work on it when I get some time.
    For the time being I can only thank you for the ideas :D



    @dlsmd
    Yes still looking for that, thanks for sharing, gonna test it asap
    With that variable "casting" displayed for a while I'm gonna get an idea of how many packets I lose on average.

Page 135 of 302 FirstFirst ... 85 125 133 134 135 136 137 145 185 ... LastLast

Similar Threads

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