Item Search
     
BG-Wiki Search
Page 141 of 302 FirstFirst ... 91 131 139 140 141 142 143 151 191 ... LastLast
Results 2801 to 2820 of 6036

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

  1. #2801
    Stalking you
    Join Date
    Dec 2007
    Posts
    402
    BG Level
    4
    FFXIV Character
    V' Mod
    FFXIV Server
    Atomos
    FFXI Server
    Quetzalcoatl

    the end is that i want to idle in a roller's ring when i have a cor roll on and idle in a dark ring when i don't. does that help?

  2. #2802
    Stalking you
    Join Date
    Dec 2007
    Posts
    402
    BG Level
    4
    FFXIV Character
    V' Mod
    FFXIV Server
    Atomos
    FFXI Server
    Quetzalcoatl

    Code:
    function customize_idle_set(idleSet)
    	if buffactive['Sanction'] then
            	idleSet = set_combine(idleSet, sets.sanction)
    	end
    
    	if player.mpp < 51 then
    		idleSet = set_combine(idleSet, sets.latent_refresh)
    	end
    	
    	if buffactive["Tactician's Roll"] or buffactive["Evoker's Roll"] or buffactive["Corsair's Roll"] then
    		idleSet = set_combine(idleSet, sets.roll)
    	end
    	
    	return idleSet
    end
    this works, but i need all the rolls to be defined somehow.

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

    Quote Originally Posted by vm0d
    i want something to return a true result with a cor roll effect active.

    the end is that i want to idle in a roller's ring when i have a cor roll on and idle in a dark ring when i don't. does that help?
    Ok, the code you wrote won't do anything. The auto-handling looks for actions that generate the same buff as the name of the state.Buff[~value~] variable, and "PhantomRoll" is neither the name of the action nor the name of the buff.

    In order to manage the state.Buff value, you have to track things manually. Because this is a multi-multi check, it has to be done with a for loop. This will involve the following:

    Code:
    function job_setup()
        PhantomRolls = S{"Fighter's Roll", "Monk's Roll", "Healer's Roll", "Wizard's Roll", "Warlock's Roll", "Rogue's Roll",
            "Gallant's Roll", "Chaos Roll", "Beast Roll", "Choral Roll", "Hunter's Roll", "Samurai Roll", "Ninja Roll",
            "Drachen Roll", "Evoker's Roll", "Magus's Roll", "Corsair's Roll", "Puppet Roll", "Dancer's Roll", "Scholar's Roll",
            "Bolter's Roll", "Caster's Roll", "Courser's Roll", "Blitzer's Roll", "Tactician's Roll", "Allies' Roll",
            "Miser's Roll", "Companion's Roll", "Avenger's Roll"}	
    
        state.Buff.PhantomRoll = has_phantom_roll()
    end
    
    function job_update(cmdParams, eventArgs)
        state.Buff.PhantomRoll = has_phantom_roll()
    end
    
    function job_buff_change(buff, gain)
        if PhantomRolls:contains(buff) then
    	state.Buff.PhantomRoll = has_phantom_roll()
            handle_equipping_gear(player.status)
        end
    end
    
    function has_phantom_roll()
        for buff,count in pairs(buffactive) do
            if type(buff) == 'string' and PhantomRolls:contains(buff) then
                return true
            end
        end
        
        return false
    end
    Note: The list defined in job_setup isn't strictly necessary; a rolls table is already defined in the cor file.

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

    Quote Originally Posted by Sechs View Post
    No, this code works kinda as an alternative to Midcast().
    It won't avoid the packet loss issue, but it will have reduced consequences when that happens, since the amount of time you get "locked" after a packet loss will be dynamic (depending on the spell's cast time) and not fixed.


    Oh btw, now that I think about it, dlsmd I think I had to modify some things in those lines to make it work, but forgot to tell you.
    First, I had to put the first part into precast and not midcast, or it wouldn't stop from equipping precast gear.
    Second, I had to modify something else because otherwise it would produce an error if you attempted to use a WS or a JA (they have no spell.cast_time in the related table).
    I don't remember what I changed... I think something making the rule work only for spell.prefix = "/magic" or something like that.
    I can watch my lua when I get back home.
    you always put the check in precast
    i.e.
    Code:
    function precast(spell)
    	if casting or petcasting then
    		cancel_spell()
    		return
    	end
    	...
    end
    function midcast (spell)
    	if not windower.wc_match(spell.type, 'JobAbility|WeaponSkill') then
    		casting = true
    		coroutine.schedule(function () casting = false end, (spell.cast_time/4+.5))
    	end
    	...
    end
    function aftercast (spell)
    	...
    	casting = false
    end
    function pet_midcast(spell)
    	petcasting = true
    	coroutine.schedule(function () petcasting = false end, (spell.cast_time/4+.5))
    	...
    end
    function pet_aftercast(spell)
    	...
    	petcasting = false
    end
    the ... means the rest of your code

    because it cancels the spell then stops any precast gearswaps
    and if you want here is a set of commands to unlock it if it gets locked


    Code:
    function self_command(command)
    	if command == "unlockmidcast" then
    		casting = false
    	end
    	if command == "unlockpetmidcast" then
    		petcasting = false
    	end
    end

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

    does any body have a way to split the command given in self_command(command) function in to multipul local variables dynamically
    i.e. if command received: "hi how are you today" to commanda = "hi", commandb = "how", etc. depending on how many space then commands there are

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

    @Sechs
    this should fix all issues
    Spoiler: show
    Code:
    function precast(spell)
    	if (casting or petcasting) and (midaction() or pet_midaction()) then
    		cancel_spell()
    		return
    	end
    	...
    end
    function midcast(spell)
    	if spell.cast_time then
    		casting = true
    		coroutine.schedule(function () casting = false end, (spell.cast_time/4+.9))
    	else
    		casting = true
    		coroutine.schedule(function () casting = false end, 1)
    	end
    	...
    end
    function pet_midcast(spell)
    	if spell.cast_time then
    		petcasting = true
    		coroutine.schedule(function () petcasting = false end, (spell.cast_time/4+.9))
    	else
    		petcasting = true
    		coroutine.schedule(function () petcasting = false end, 1)
    	end
    	...
    end
    function aftercast(spell)
    	...
    	casting = false
    end
    function pet_aftercast(spell)
    	...
    	petcasting = false
    end

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

    Quote Originally Posted by dlsmd View Post
    does any body have a way to split the command given in self_command(command) function in to multipul local variables dynamically
    i.e. if command received: "hi how are you today" to commanda = "hi", commandb = "how", etc. depending on how many space then commands there are
    Code:
    function self_command(commandArgs)
        local commandArgs = commandArgs
        if type(commandArgs) == 'string' then
            commandArgs = T(commandArgs:split(' '))
        end
    end
    Produces a T{} table of space-delimited arguments.

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

    Quote Originally Posted by Motenten View Post
    Code:
    function self_command(commandArgs)
        local commandArgs = commandArgs
        if type(commandArgs) == 'string' then
            commandArgs = T(commandArgs:split(' '))
        end
    end
    Produces a T{} table of space-delimited arguments.
    would you check them with commandArgs[1] == "", commandArgs[2] == ""

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

    Quote Originally Posted by dlsmd View Post
    would you check them with commandArgs[1] == "", commandArgs[2] == ""
    Correct.

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

    I remembered there was a link posted somewhere about a step-by-step gearswap tutorial, but I can't find it at all. Think it was an ffxiah blog or something, but I don't remember who. Anyone got link handy?

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

  12. #2812
    Hydra
    Join Date
    Jun 2008
    Posts
    98
    BG Level
    2
    FFXI Server
    Asura

    lua won't load shows the following error in the command window:

    User file problem: C:...mnk.lua:24: '=' expected near 'sets'

    I've gone through it for half an hour and don't see anything wrong with it. Please forgive shit gear I only came back a couple of weeks ago.

    Spoiler: show
    Code:
    function get_sets()                
        sets.precast = {}
        sets.precast.Boost = {hands="Temple Gloves"}
        sets.precast.Chakra = {ring2="Soil Ring",ammo="Tantra Tathlum",body="Anchorite's Cyclas",hands="Hesychast's Gloves",ring1="Soil ring"}
        sets.precast.Counterstance = {feet="Melee Gaiters"}
        sets.precast.Dodge = {feet="Anchorite's Gaiters"}
           
        sets.precast['Victory Smite'] = {main="Oatixur",ammo="Thew Bomblet",head="Espial Cap",neck="Light Gorget",
            ear1="Kemas Earring",ear2="Brutal Earring",body="Espial Gambison",hands="Heafoc mitts",
            ring1="Pyrosoul Ring",ring2="Epona's Ring",back="Atheling Mantle",waist="Warwolf Belt",legs="Espial Hose",
            feet="Espial Socks"}
       
            sets.precast['Shijin Spiral'] = {main="Oatixur",ammo="Jukukik feather",head="Espial Cap",neck="Light Gorget",
            ear1="Pixie Earring",ear2="Brutal Earring",body="Espial Gambison",hands="Espial Bracers",
            ring1="Thunder Ring",ring2="Rajas Ring",back="Atheling Mantle",waist="Light Belt",legs="Tantra Hose +2",
            feet="Espial Socks"}  
       
            sets.precast.WS = {main="Oatixur",ammo="Thew Bomblet",head="Espial Cap",neck="Agasaya's Collar",
            ear1="Aesir Ear Pendant",ear2="Brutal Earring",body="Espial Gambison",hands="Heafoc Mitts",
            ring1="Rajas Ring",ring2="Pyrosoul Ring",back="Atheling Mantle",waist="Black Belt",legs="Espial Hose",
            feet="Espial Socks"}
       
        sets.TP
            sets.TP.DD = {main="Oatixur",ammo="Thew Bomblet",head="Espial Cap",neck="Asperity Necklace",
            ear1="Moonshade Earring",ear2="Brutal Earring",body="Espial Gambison",hands="Hes. gloves",
            ring1="Rajas Ring",ring2="Epona's Ring",back="Atheling Mantle",waist="Black Belt",legs="Anchorite's hose",
            feet="Espial Socks"}
                   
        sets.PDT = {head="Arh. jinpachi +1",neck="Twilight Torque",ear1="Merman's Earring",body="Arhat's gi +1",
            hands="Espial Bracers",ring2="Dark Ring",back="Boxer's Mantle",waist="Black Belt",legs="Dst. Subligar +1",
            ring1="Dark Ring",feet="Dst. Leggings +1",ear2="Merman's Earring"}
       
        sets.aftercast = {}
        sets.aftercast.TP = sets.TP.DD
       
        sets.aftercast.Idle = {main="Oatixur",ammo="Thew Bomblet",head="Tantra Crown +2",neck="Faith Torque",
            ear1="Aesir Ear Pendant",ear2="Brutal Earring",body="Tantra Cyclas +2",hands="Tantra Gloves +2",
            ring1="Dark Ring",back="Atheling Mantle",waist="Black Belt",legs="Tantra Hose +2",ring2="Dark Ring",
            feet="Hermes' Sandals"}
        send_command('input /macro book 15;wait .1;input /macro set 1')
    end
     
    function precast(spell)
        if player.equipment.head == 'Reraise Hairpin' then disable('head')
        else enable('head') end
        if player.equipment.left_ear == 'Reraise Earring' then disable('ear1')
        else enable('ear1') end
        if sets.precast[spell.english] then
            equip(sets.precast[spell.english])
        elseif spell.type=="WeaponSkill" then
            equip(sets.precast.WS)
        end
    end
     
    function midcast(spell)
    end
     
    function aftercast(spell)
        if player.status =='Engaged' then
            equip(sets.aftercast.TP)
        else
            equip(sets.aftercast.Idle)
        end
    end
     
    function status_change(new,old)
        if T{'Idle','Resting'}:contains(new) then
            equip(sets.aftercast.Idle)
        elseif new == 'Engaged' then
            equip(sets.aftercast.TP)
        end
    end
     
    function self_command(command)
        if command == 'toggle TP set' then
            if sets.aftercast.TP == sets.TP.DD then
                sets.aftercast.TP = sets.TP.Solo
                send_command('@input /echo SOLO SET')
            elseif sets.aftercast.TP == sets.TP.Solo then
                sets.aftercast.TP = sets.TP.DD
                send_command('@input /echo DD SET')
            end
        elseif command == 'DT' then
            equip(sets.DT)
        end
    end

  13. #2813
    BG Content
    Join Date
    Jul 2007
    Posts
    22,352
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Line 24 is "sets.TP"

    You wanted:
    Code:
    sets.TP = {}

  14. #2814
    Hydra
    Join Date
    Jun 2008
    Posts
    98
    BG Level
    2
    FFXI Server
    Asura

    Quote Originally Posted by Byrthnoth View Post
    Line 24 is "sets.TP"

    You wanted:
    Code:
    sets.TP = {}
    simple as that? thanks Byrthnoth. I need to spend a little more time learning lua.

  15. #2815
    Blue Magic is Best Magic
    Join Date
    Jul 2007
    Posts
    8,215
    BG Level
    8

    Some reason the new UL spells are working with GS, I put crashing thunder in my usual spot for magical spells and it isn't recognized.

  16. #2816
    Sea Torques
    Join Date
    Aug 2006
    Posts
    518
    BG Level
    5
    FFXI Server
    Leviathan

    Edit, got the latter

    New UL spells are not working!

  17. #2817
    BG Content
    Join Date
    Jul 2007
    Posts
    22,352
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Yeah, I have to explicitly add new UL spells. I'll put it on -dev now, but I'll need to make sure that my version of gearswap is actually functional and synced before I push it live.

  18. #2818
    Nidhogg
    Join Date
    Jul 2008
    Posts
    3,746
    BG Level
    7
    FFXIV Character
    Seraphus Highwynn
    FFXIV Server
    Gilgamesh
    FFXI Server
    Diabolos

    Using a DRG gearswap, when I activate Restoring Breath, it swaps to my precast, then immediately to my aftercast, then as soon as the wyvern readies it, it swaps to midcast and then aftercast again...

    function pet_midcast(spell,action)
    if string.find(spell.english,'Healing Breath') then
    equip(sets.Pet["Restoring Breath"])
    end
    end

    function pet_aftercast(spell,action)
    status_change(player.status)
    end

    function pet_change(pet,gain)
    status_change(player.status)
    end


    I think its because it thinks the JA is 'finished' after being activated but then when it detects "Wyvern readies Healing Breath" it then updates to midcast and then aftercast.

    Is there no way to delay it?

  19. #2819
    Nidhogg
    Join Date
    Jul 2008
    Posts
    3,746
    BG Level
    7
    FFXIV Character
    Seraphus Highwynn
    FFXIV Server
    Gilgamesh
    FFXI Server
    Diabolos

    Additional info! I currently have the following:

    function aftercast(spell,action)
    if not string.find(spell.english,'Healing Breath') or 'Smiting Breath' then
    status_change(player.status)
    end
    end
    When I delete the above code, breath works flawlessly. I will precast in breath gear, it will change back to my TP set as soon as breath hits me or mob. Perfect! BUT, although breaths work fine, other JA won't swap back, meaning i'll stay in midcast for Jumps or WS, etc.

    So when the code is in, Jumps, Spirit Link etc will Aftercast gear fine, but Breaths are weird. When I delete this code, breaths are perfect but JA won't aftercast.


    Seems like the
    if not string.find(spell.english,'Healing Breath') or 'Smiting Breath' then
    isn't being recognized...

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

    Code:
    if not string.find(spell.english,'Healing Breath') or 'Smiting Breath' then
    That's because that's not logically sound code. It's checking for either:
    1) Are the words 'Healing Breath' (not) found in the spell being used?
    or
    2) Is the string 'Smiting Breath' not nil?

    #2 will always be true, therefore that condition will always be true no matter what you do.

    It seems that you want to check this condition:
    Code:
    if not (spell.english:startswith('Healing Breath') or spell.english == 'Smiting Breath') then

Page 141 of 302 FirstFirst ... 91 131 139 140 141 142 143 151 191 ... LastLast

Similar Threads

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