Item Search
     
BG-Wiki Search
Page 296 of 302 FirstFirst ... 246 286 294 295 296 297 298 ... LastLast
Results 5901 to 5920 of 6036

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

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

    Quote Originally Posted by Spicyryan View Post
    For some reason my "dont fuck yourself while you can't act" rule isn't fully working.

    When I am petrified, asleep, stunned, terrored, or amnesiaed, if I try to WS it rightfully does nothing rather than get my stuck in that gear which is a real problem while being hit and suddenly losing 50% DT until I act again which I can't while under most of those effects.

    However, for some reason if I try to cast then it still goes through and I sit there in fast cast gear (say, under the effect of the terror spam in this month's ambuscade). So, where in my rule is the problem?

    I know the has any buff rule works because if I am hit with those (sans silence or amnesia) it tosses on my DT set in a separate rule.
    that will stop the JA but it will still change gear and never work on MA
    here is a better way
    Code:
    ---rule(the first thing in your precast/pretarget/filtered_action function)---
        if pc_JA(spell) then
            cancel_spell()
            return
        end
    --replaced function to stop a spell or ability just return true--
    function pc_JA(spell, act)
        if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia'}) and (spell.type == 'WeaponSkill' or spell.type == 'Ability') then
            return true
        elseif has_any_buff_of({'Petrification','Sleep','Stun','Terror','Silence'}) and (spell.type == 'Magic' or spell.type == 'Ninjutsu') then
            return true
        end
    i do all this in my spell control's
    https://github.com/smd111/Gearswap/b...ll_control.lua

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

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

    Quote Originally Posted by dlsmd View Post
    that will stop the JA but it will still change gear and never work on MA
    here is a better way
    Code:
    ---rule(the first thing in your precast/pretarget/filtered_action function)---
        if pc_JA(spell) then
            cancel_spell()
            return
        end
    --replaced function to stop a spell or ability just return true--
    function pc_JA(spell, act)
        if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia'}) and (spell.type == 'WeaponSkill' or spell.type == 'Ability') then
            return true
        elseif has_any_buff_of({'Petrification','Sleep','Stun','Terror','Silence'}) and (spell.type == 'Magic' or spell.type == 'Ninjutsu') then
            return true
        end
    i do all this in my spell control's
    https://github.com/smd111/Gearswap/b...ll_control.lua
    I must have misunderstood something because I am just getting a stack overflow error when testing it with the following:
    Code:
    function pc_JA(spell, act)
    	if pc_JA(spell) then
    		cancel_spell()
    		return
    	end
        if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia'}) and (spell.type == 'WeaponSkill' or spell.type == 'Ability') then
            return true
        elseif has_any_buff_of({'Petrification','Sleep','Stun','Terror','Silence','Protect'}) and (spell.type == 'Magic' or spell.type == 'Ninjutsu') then
            return true
        end

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

    Quote Originally Posted by Spicyryan View Post
    I must have misunderstood something because I am just getting a stack overflow error when testing it with the following:
    here it is fully added to your code(will be gone in 24 hours)
    https://pastebin.com/M3fG3hS1

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

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

    Quote Originally Posted by dlsmd View Post
    here it is fully added to your code(will be gone in 24 hours)
    https://pastebin.com/M3fG3hS1
    Thank you very much.

    Loaded it back up, and added ,'Protect' to both of the any buff rules to test it, and it only stopped WSs still. Spells, and JAs went off still.

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

    Quote Originally Posted by Spicyryan View Post
    Thank you very much.

    Loaded it back up, and added ,'Protect' to both of the any buff rules to test it, and it only stopped WSs still. Spells, and JAs went off still.
    change the spell control section to this
    --checks (when spell is listed it means MA and JA):
    ---recast
    ---buff that stop you from performing any spell
    ---if you have the specific trust active
    ---tp
    ---mp
    ---finishing moves
    ---if your in a town you wont be able to use any spell except for teleportation type spells
    ---in mog house you cant use any spells
    ---removes sneak when you use Spectral Jig
    ---includes your 2 rules
    Code:
     
    -----------------------------
    --      Spell control      --
    -----------------------------
    cities = S{"Ru'Lude Gardens","Upper Jeuno","Lower Jeuno","Port Jeuno","Port Windurst","Windurst Waters","Windurst Woods","Windurst Walls","Heavens Tower",
        "Port San d'Oria","Northern San d'Oria","Southern San d'Oria","Chateau d'Oraguille","Port Bastok","Bastok Markets","Bastok Mines","Metalworks",
        "Aht Urhgan Whitegate","Tavnazian Safehold","Nashmau","Selbina","Mhaura","Norg","Eastern Adoulin","Western Adoulin","Kazham"}
    transportation_spells = S{'Escape','Recall-Jugner','Recall-Meriph','Recall-Pashh','Retrace','Teleport-Altep','Teleport-Dem','Teleport-Holla','Teleport-Mea',
        'Teleport-Vahzl','Teleport-Yhoat','Warp','Warp II'}
    unusable_buff = {spell={'Charm','Mute','Omerta','Petrification','Silence','Sleep','Stun','Terror'},
        ability={'Amnesia','Charm','Impairment','Petrification','Sleep','Stun','Terror'}}
      --check_recast('ability',spell.recast_id)  check_recast('spell',spell.recast_id)
    function check_recast(typ,id) --if spell can be cast(not in recast) return true
        local recasts = windower.ffxi['get_'..typ..'_recasts']()
        if id and recasts[id] and recasts[id] == 0 then
            return true
        else
            return false
        end
    end
     --return true if spell is unable to be cast at this time
    function spell_stopper(spell)
        --Stops spell if your in mog house
        if world.in_mog_house or world.mog_house then
            return true
        elseif spell.type == "Item" then
            return false
        --Stops spell if you do not have a target
        elseif spell.target.name == nil and not spell.target.raw:contains("st") then
            return true
        --Stops spell if a blocking buff is active
        elseif spell.action_type == 'Ability' and (has_any_buff_of(unusable_buff.ability) or not check_recast('ability',spell.recast_id)) then
            return true
        elseif spell.action_type == 'Magic' and (has_any_buff_of(unusable_buff.spell)
          or not check_recast('spell',spell.recast_id)) then
            return true
        --Stops spell if you do not have enuf mp/tp to use
        elseif spell.tp_cost and spell.tp_cost > player.tp then
            return true
        elseif spell.mp_cost and spell.mp_cost > player.mp and not has_any_buff_of({'Manawell','Manafont'}) then
            return true
        elseif spell.type == 'WeaponSkill' and player.tp < 1000 then
            return true
        --Stops all spells but teleport spells in cities
        elseif not transportation_spells:contains(spell.en) and cities:contains(world.area) then
            return true
        end
        --Calculate how many finishin moves your char has up to 6
        local fm_count = 0
        for i, v in pairs(buffactive) do
            if tostring(i):startswith('finishing move') or tostring(i):startswith('フィニシングムーブ') then
                fm_count = tonumber(string.match(i, '%d+')) or 1
            end
        end
        --Stops flourishes if you do not have enuf finishin moves
        local min_fm_for_flourishes = {['Animated Flourish']=1,['Desperate Flourish']=1,['Violent Flourish']=1,['Reverse Flourish']=1,['Building Flourish']=1,
                                       ['Wild Flourish']=2,['Climactic Flourish']=1,['Striking Flourish']=2,['Ternary Flourish']=3,}
        if min_fm_for_flourishes[spell.en] then
            if min_fm_for_flourishes[spell.en] > fm_count and not buffactive[507] then
                return true
            end
        end
        --Reomves Sneak when casting Spectral Jig
        if spell.en == 'Spectral Jig' then
            send_command('cancel 71')
        end
        if spell.name == 'Utsusemi: Ichi' and overwrite and buffactive['Copy Image (3)'] then
            return true
        end
        if spell.type == 'WeaponSkill' and (player.target and player.target.distance and player.target.distance > 8) then
            msg("Weapon Skill Canceled  Target Out of Range")
            return true
        end
    end
    also here is a good piece of advice
    always run your rules with the most important thing first and the least important thing last
    example:
    if player.tp >= 1000 and player.target and player.target.distance and player.target.distance > 8 and spell.type == 'WeaponSkill' then
    sence you only want this to work when its a weapon skill that should go first and sence we already have a check for TP we can drop that
    here is what it should look like
    if spell.type == 'WeaponSkill' and (player.target and player.target.distance and player.target.distance > 8) then

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

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

    So, read it over, copy pasted it, reloaded gearswap and tested it. Didn't work at all, so I reread it over tried changing a few lines to trouble shoot, here and there. Didn't work still.

    So I spent some time, wrote this up based on what you had sent in the last couple of posts:

    Code:
    function precast(spell, act)
        if spell_control(spell) then
            cancel_spell()
            return
    	elseif spell.action_type == 'Ability' then 
    		pc_JA(spell, act)
    	elseif spell.action_type == 'Magic' then
    		pc_Magic(spell, act)
    	else
    		pc_Item(spell, act)
    	end
    end
    
    function spell_control(spell)
    	if pc_JA(spell) then
    		cancel_spell()
    		return
    	end
    
    	if player.tp >= 1000 and spell.type == 'WeaponSkill' then
    		if player.target and player.target.distance and player.target.distance > 8 then
    			msg("Weapon Skill Canceled  Target Out of Range")
    		return true
    		elseif has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia','Protect'}) and (spell.type == 'WeaponSkill' or spell.type == 'Ability') then
    			msg("Weapon Skill Canceled, Can't")
    			return true
    		end
    	elseif spell.type == 'Ability' then
    		if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia','Protect'}) then
    			msg("Ability Canceled, Can't")
    			return true
    		end
    	elseif spell.type == 'Magic' or spell.type == 'Ninjutsu' then
    		if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia','Protect'}) then
    			msg("Spell Canceled, Cant")
    			return true
    		end
    	end
    	
    	if spell.name == 'Utsusemi: Ichi' and overwrite and buffactive['Copy Image (3)'] then
    		return true
    	end
    	
        return false
    end
    Added messages to see what is working, and I never get a message for abilities or magic, naturally.

    WS rule works, both the distance rule, and the stopping one under the effect of protect for testing, as well as both separate messages. However, unlike before where it stopped it completely, the gear comes on for the WS and then sits there until I do something else or have a status change like going idle.
    So, I am clearly missing something I should have either to make your code work or mine which mentally makes a lot more sense to me (although I could map the any buff status like you have then say contains: ) than a chunk of what you had in there.


    Side note, why do you have a rule to cancel sneak for jig, but not when casting the spell on yourself?

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

    Quote Originally Posted by Spicyryan View Post
    So, read it over, copy pasted it, reloaded gearswap and tested it. Didn't work at all, so I reread it over tried changing a few lines to trouble shoot, here and there. Didn't work still.

    So I spent some time, wrote this up based on what you had sent in the last couple of posts:

    Code:
    function precast(spell, act)
        if spell_control(spell) then
            cancel_spell()
            return
    	elseif spell.action_type == 'Ability' then 
    		pc_JA(spell, act)
    	elseif spell.action_type == 'Magic' then
    		pc_Magic(spell, act)
    	else
    		pc_Item(spell, act)
    	end
    end
    
    function spell_control(spell)
    	if pc_JA(spell) then
    		cancel_spell()
    		return
    	end
    
    	if player.tp >= 1000 and spell.type == 'WeaponSkill' then
    		if player.target and player.target.distance and player.target.distance > 8 then
    			msg("Weapon Skill Canceled  Target Out of Range")
    		return true
    		elseif has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia','Protect'}) and (spell.type == 'WeaponSkill' or spell.type == 'Ability') then
    			msg("Weapon Skill Canceled, Can't")
    			return true
    		end
    	elseif spell.type == 'Ability' then
    		if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia','Protect'}) then
    			msg("Ability Canceled, Can't")
    			return true
    		end
    	elseif spell.type == 'Magic' or spell.type == 'Ninjutsu' then
    		if has_any_buff_of({'Petrification','Sleep','Stun','Terror','Amnesia','Protect'}) then
    			msg("Spell Canceled, Cant")
    			return true
    		end
    	end
    	
    	if spell.name == 'Utsusemi: Ichi' and overwrite and buffactive['Copy Image (3)'] then
    		return true
    	end
    	
        return false
    end
    Added messages to see what is working, and I never get a message for abilities or magic, naturally.

    WS rule works, both the distance rule, and the stopping one under the effect of protect for testing, as well as both separate messages. However, unlike before where it stopped it completely, the gear comes on for the WS and then sits there until I do something else or have a status change like going idle.
    So, I am clearly missing something I should have either to make your code work or mine which mentally makes a lot more sense to me (although I could map the any buff status like you have then say contains: ) than a chunk of what you had in there.


    Side note, why do you have a rule to cancel sneak for jig, but not when casting the spell on yourself?
    1. you did it wrong
    here is your posted file updated correctly
    https://pastebin.com/M3fG3hS1
    2. sence you can only cast jig on your self you only need to clear sneak when you cast it

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

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

    Quote Originally Posted by dlsmd View Post
    1. you did it wrong
    here is your posted file updated correctly
    https://pastebin.com/M3fG3hS1
    2. sence you can only cast jig on your self you only need to clear sneak when you cast it
    Thanks :/


    Oddly enough it won't let me weaponskill at all now. I have 0 buffs on outside and it just cancels it. No message is given for being out of range either.

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

    Quote Originally Posted by Spicyryan View Post
    Thanks :/


    Oddly enough it won't let me weaponskill at all now. I have 0 buffs on outside and it just cancels it. No message is given for being out of range either.
    fixed
    use the same link as above

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

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

    Quote Originally Posted by dlsmd View Post
    fixed
    use the same link as above
    changed function spell_stopper to spell_control and added an elseif spell.type = 'Weaponskill' after the ability line, and tested it all. It seems to work now. Thank you very much.

  11. #5911
    New Merits
    Join Date
    Jul 2011
    Posts
    245
    BG Level
    4
    FFXIV Character
    Already Banned
    FFXIV Server
    Hyperion
    FFXI Server
    Quetzalcoatl

    Any idea why this isnt working?

    Code:
           sets.midcast['Healing Magic'] = set_combine(sets.midcast.Enmity, {})
            
            sets.midcast.Flash = set_combine(sets.midcast.Enmity, {})
            
            sets.precast.Provoke = set_combine(sets.midcast.Enmity, {})
    Code:
            sets.midcast.Enmity = {
    		head="Aegishjalmr",neck="Ritter Gorget",ear1="Hades Earring +1",ear2="Hades Earring +1",
    		body="Hydra Haubert",hands="Hydra Moufles",ring1="Hercule's Ring",ring2="Mermaids Ring",
    		back="Cerberus Mantle +1",waist="Trance Belt",legs="Hydra Brayettes",feet="Hydra Sollerets"}
    If i copy all the gear into there instead of sets)combine it does work other im not getting midcast swaps.

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

    Quote Originally Posted by Landsoul View Post
    Any idea why this isnt working?

    Code:
           sets.midcast['Healing Magic'] = set_combine(sets.midcast.Enmity, {})
            
            sets.midcast.Flash = set_combine(sets.midcast.Enmity, {})
            
            sets.precast.Provoke = set_combine(sets.midcast.Enmity, {})
    Code:
            sets.midcast.Enmity = {
    		head="Aegishjalmr",neck="Ritter Gorget",ear1="Hades Earring +1",ear2="Hades Earring +1",
    		body="Hydra Haubert",hands="Hydra Moufles",ring1="Hercule's Ring",ring2="Mermaids Ring",
    		back="Cerberus Mantle +1",waist="Trance Belt",legs="Hydra Brayettes",feet="Hydra Sollerets"}
    If i copy all the gear into there instead of sets)combine it does work other im not getting midcast swaps.
    please post all of your code

  13. #5913
    New Merits
    Join Date
    Jul 2011
    Posts
    245
    BG Level
    4
    FFXIV Character
    Already Banned
    FFXIV Server
    Hyperion
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by dlsmd View Post
    please post all of your code
    https://pastebin.com/30wBPg0g

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

    Quote Originally Posted by Landsoul View Post
    the reason it is not working is because you do not have any rules for midcast

    in motes include you need to have the function called job_midcast(spell, action, spellMap, eventArgs)

  15. #5915
    New Merits
    Join Date
    Jul 2011
    Posts
    245
    BG Level
    4
    FFXIV Character
    Already Banned
    FFXIV Server
    Hyperion
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by dlsmd View Post
    the reason it is not working is because you do not have any rules for midcast

    in motes include you need to have the function called job_midcast(spell, action, spellMap, eventArgs)
    where in the motes include do i put it? For precast i dont seem to need any rules.

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

    Quote Originally Posted by Landsoul View Post
    where in the motes include do i put it? For precast i dont seem to need any rules.
    im not that versed in motes include but as far as i know it need to be named in a specific way for that to work
    but what way that is im not sure
    and somethings require you to use job_midcast or something else but again im not sure how or what to do
    --i built my own include system because i just could not wrap my head around it

  17. #5917
    Radsourceful

    Join Date
    Jul 2007
    Posts
    1,964
    BG Level
    6
    FFXI Server
    Bismarck

    I wouldn't have thought this would matter, but I was able to get that sets.midcast.Enmity to work by moving your set.midcast.Enmity = {...} to a line above sets.midcast.Cure

    https://pastebin.com/v2z63Sdb

    ===================

    Aside - the deal w/ Mote's includes is the automatic event for "midcast" is handled by the include, so anything you want to do other than that should be a different function, job_midcast

    Code:
    function midcast(spell)
        handle_actions(spell, 'midcast')
    end
    The handle actions function looks like, in essence:

    Code:
    function handle_actions(spell, action)
    Do some things to prepare and get spell info
    if exists, run User_midcast(spell, action, spellMap, eventArgs) --Defined in a personal include? I don't use any of these to say for sure
    if exists, run Job_midcast(spell, action, spellMap, eventArgs) --Defined in your own job lua for specific actions to that job that you want to happen before the default swaps - for example, deciding which elemental obi is the best one for this spell
    run default_midcast(spell, spellMap) --action defined by mote's includes - equip the set defined as midcast for this spell or action. Some fancy things to see exactly which set that is, but all boils down to 'equip this set'
    if exists, run User_Post_midcast(spell, action, spellMap, eventArgs) --actions to take after the set is equipped on the user level. Again, haven't used this
    if exists, run Job_Post_midcast(spell, action, spellMap, eventArgs) --Defined by job lua, things that should happen after other rules - ie, equip sch hands over top of default for bonus duration if perpetuance is active
    end

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

    Quote Originally Posted by Radec View Post
    I wouldn't have thought this would matter, but I was able to get that sets.midcast.Enmity to work by moving your set.midcast.Enmity = {...} to a line above sets.midcast.Cure

    https://pastebin.com/v2z63Sdb
    i missed that
    why it works
    everything works from top to bottom so if you build something to use something in another space that use space must be below the the build space

    Quote Originally Posted by Landsoul View Post
    where in the motes include do i put it? For precast i dont seem to need any rules.
    here is a complete rebuild of your init_gear_sets
    https://pastebin.com/uEmQBp4X

  19. #5919
    Smells like Onions
    Join Date
    Oct 2017
    Posts
    1
    BG Level
    0

    Can someone help me with scripting so that once I use an item, I keep using the item until none are left in my inventory? For instance K-P's Memoirs, an item with an apostrophe. I tried doing a search but the results were hard to sift through.

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

    Quote Originally Posted by Chocobitties View Post
    Can someone help me with scripting so that once I use an item, I keep using the item until none are left in my inventory? For instance K-P's Memoirs, an item with an apostrophe. I tried doing a search but the results were hard to sift through.
    it should be something like
    Code:
    function aftercast(spell)
        if enable_auto_item then
            if spell.action_type == "Item" and have_item(spell.name) then
                send_command("wait 3.0;input /item "..spell.name.."")
            else
                enable_auto_item = false
                add_to_chat(8, 'Auto continuous item usage stoped no more '..spell.name..'.')
            end
        end
    end
    function have_item(name)
        local item = player[bag][name]
        if item then
            return true
        end
    end
    function self_command(com)
        if com:lower() == "tautoitem" then
            enable_auto_item = not enable_auto_item
            add_to_chat(8, 'Auto continuous item usage '..(enable_auto_item and 'ON' or 'OFF'))
        end
    end
    --adjust the wait time up or down as needed
    --use the gearswap command tautoitem to toggle auto item usage on and off
    --should auto stop when done

Page 296 of 302 FirstFirst ... 246 286 294 295 296 297 298 ... LastLast

Similar Threads

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