Item Search
     
BG-Wiki Search
Page 254 of 302 FirstFirst ... 204 244 252 253 254 255 256 264 ... LastLast
Results 5061 to 5080 of 6036

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

  1. #5061
    RIDE ARMOR
    Join Date
    Sep 2015
    Posts
    15
    BG Level
    1

    Question: I have changed the mappings.lua to include Helix II spells and Storm II spells. The Storm II spells now equip my storm set, but the Helix II spells equip elemental magic set. Helix I spells do equip the helix set in my sch.lua. Is there something that I am missing out on?

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

    Does anyone have some snazzy non-Motenten TreasureHunter code that will put on your TH gear until you tag the mob and then switch back to your normal sets? I can't get my non-Motenten blu.lua to work with include('Mote-TreasureHunter'). I wrote up some code of my own that, when I activate the TreasureHunter toggle that I included, A.) locks TH4 gear into my tp set, and B.) locks TH4 gear into my magical blue magic midcast set (for TH while cleaving). I don't like having the TH gear locked into my TP set, though; I want code that'll swap out of the TH gear once the mob is tagged.

    You can find the details on my attempt at getting Mote's TreasureHunter file to load on the previous page of this thread. The matter has already been discussed somewhat.

  3. #5063
    Sea Torques
    Join Date
    Aug 2008
    Posts
    699
    BG Level
    5
    FFXI Server
    Odin

    Quote Originally Posted by Roland_J View Post
    Put this, with the sets code replaced with w/e your fc set is named, within your precast and possibly also midcast. Precast alone will be enough if your lua doesn't have a default midcast for everything not defined that is something other than fastcast gear.

    Code:
    	elseif spell.type == "Trust" then
    		equip(sets.Precast.FastCast)
    You probably know this already but your iLvl upon casting isn't what affects your trusts strength; your current iLvl is what affects it. Their level will fluctuate up and down as you do your gear swaps during play and so all the only thing that proves efficient to be in the precast/midcast is fast cast gear, regardless of what iLvl your fast cast set is, pretty much; for the purpose of both cast and recast reduction.
    Thanks a bunch

  4. #5064
    BG Content
    Join Date
    Jul 2007
    Posts
    22,359
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    I thought I added /bstpet a while ago, but it didn't work. Now it's actually added.

  5. #5065
    RIDE ARMOR
    Join Date
    Dec 2012
    Posts
    11
    BG Level
    1
    FFXI Server
    Valefor

    Roland_J, I wrote a post on Gearswap BLU TH over on FFXIAH.com about a week ago so I'll just paste that below. It doesn't do anything for cleave spells though, just equips TH gear for the first hit after engaging an enemy.

    This is what I use for THF, edited to better suit BLU. It will swap into TH gear for the first hit of a fight then run aftercast to swap to regular gear. I included the blue text "function" lines to show where all this should be placed. You can toggle this function on and off with a macro reading "/console gs c TH". It defaults to being on. Note that I didn't test this after editing it for BLU but I don't think I broke anything, lol
    Code:
    function get_sets()
        -- For automatic TH gear during first hit of every fight.
        windower.register_event('tp change', function(new, old)
            if TH_ind == 1 then
                if EngagedTP > -1 and player.tp > (EngagedTP+80) and player.status == 'Engaged' then
                    windower.send_command('gs c TPchange')
                end
            end
        end)
        sets.TH = {}
        TH_ind = 1
    end
    
    -- For automatic TH gear during first hit of every fight.
    EngagedTP = -1
    
    function status_change(new,old)
        if new == 'Engaged' then
            if TH_ind == 1 then
                equip(sets.TH)
                EngagedTP = player.tp
            end
        end
    end
     
    function self_command(command)
        if command == "TPchange" then
            EngagedTP = -1
            aftercast()
        elseif command == "TH" then
            if TH_ind = 0 then TH_ind = 1 
                windower.add_to_chat(8,'----Auto TH swaps activated.----')
            else TH_ind = 0 
                windower.add_to_chat(8,'----Auto TH swaps disabled.----')
            end
        end
    end

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

    Quote Originally Posted by Modranto View Post
    Roland_J, I wrote a post on Gearswap BLU TH over on FFXIAH.com about a week ago so I'll just paste that below. It doesn't do anything for cleave spells though, just equips TH gear for the first hit after engaging an enemy.

    This is what I use for THF, edited to better suit BLU. It will swap into TH gear for the first hit of a fight then run aftercast to swap to regular gear. I included the blue text "function" lines to show where all this should be placed. You can toggle this function on and off with a macro reading "/console gs c TH". It defaults to being on. Note that I didn't test this after editing it for BLU but I don't think I broke anything, lol
    Neat, thanks for the code! It looks great. I'm getting an error once it gets to the aftercast function, though. It's calling an error on line 914 for me and my aftercast function starts on line 913. Do I need to put something special in my aftercast for this feature? Here is my aftercast.

    Code:
    function aftercast(spell,action)
        if spell.type == "WeaponSkill" and not spell.interrupted then
            send_command('wait 0.2;gs c TP') -- Print TP return --
        end
        status_change(player.status)
    end
    It is equipping the TP+TH gear when it is toggled on and it is equipping normal TP gear when it is toggled off. However, it never switches out of TP+TH gear because it prints an error as soon as I get some TP after I engage. I'm pretty sure that's where the aftercast error happens.

    This is the error that prints. "...ments\Windower4\/addons/GearSwap/data/Rolandj/th.lua:914: attempt to index local 'spell' (a nil value)"

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

    Ok, I changed the aftercast() within the "TPChange" self command to equip(sets.TP) and now it all works :D
    (acceptably performing) TH Functionality accomplished!

    Code:
    windower.register_event('tp change', function(new, old)
    if THTP then --Auto swap out of TH gear on TP gain--
    	if EngagedTP > -1 and player.tp > (EngagedTP+80) and player.status == 'Engaged' then
    		windower.send_command('gs c TPchange')
    	end
    end
    end)
    		
    function get_sets()
    	TreasureHunter = 'None'
    	THTP = false
    end
     
    function status_change(new,old)
        elseif new == 'Engaged' then
            equipSet = sets.TP
    		if TreasureHunter == 'Tag' or TreasureHunter =='Cleave' then
                equipSet = equipSet.TreasureHunter
                EngagedTP = player.tp
            end
    end
     
    function self_command(command)
    	elseif command == 'TH' then -- Treasure Hunter Toggle --
            if TreasureHunter == 'None' then
    			TreasureHunter = 'Tag'
    			THTP = true
    			add_to_chat(158, 'Treasure Hunter: Tag [Activated]')
    		elseif TreasureHunter == 'Tag' then
    			TreasureHunter = 'Cleave'
    			THTP = true
    			add_to_chat(158, 'Treasure Hunter: Tag & Cleave [Activated]')
    		elseif TreasureHunter == 'Cleave' then
    			TreasureHunter = 'None'
    			THTP = false
    			add_to_chat(123, 'Treasure Hunter: [Deactivated]')
    	elseif command == "TPchange" then --Treasure Hunter asset--
            EngagedTP = -1
            equip(sets.TP)
    end
    I left out the midcast function for equipping TH gear on cleaving. It'll vary quite a lot depending on how ppl mapped their spells plus ppl might not want it. If you are brave enough to try to add it to your .lua then hopefully you have the know-how to edit a midcast function, too >< (It's just reading the already-present midcast code structure and manipulating it for your purpose) If you don't want to cleave with TH just remove the cleaving part from the code. If you want to cleave with TH then you all of the code for the toggle there, you just need to work it into your midcast function.
    You might need to change the "equipSet = equipSet.TreasureHunter" code, though, depending on how your lua handles equipset code. My blu.lua is the only one that uses that "equipSet" structure, for example.

    Thank you very much, Modranto!! ^^

  8. #5068
    Smells like Onions
    Join Date
    Aug 2015
    Posts
    1
    BG Level
    0

    hey guys/girls.
    i HAD a problem
    but i had help from someone

    thx anyway

  9. #5069
    RIDE ARMOR
    Join Date
    May 2014
    Posts
    14
    BG Level
    1

    Hey is there a way to decide the order in which my gear equips? For instance, i want the head piece to swap last.

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

    Quote Originally Posted by Armz View Post
    Hey is there a way to decide the order in which my gear equips? For instance, i want the head piece to swap last.
    yes but im not sure why you want to do that

    the info is located in Windower\addons\GearSwap\beta_examples_and_informa tion\Advanced sets tables.txt
    -- Prioritizing gear changes --
    Currently equip swaps can be ordered by using advanced "sets" tables similar to the above:
    sets.nohead = {head={name="empty",priority=1},lring={name="Angha ring",priority=2}}

    Gear is changed in descending order from highest to lowest, so the above set would equip Angha ring and then
    unequip the head slot. All gear that is not defined is given a default priority of zero, and all positive and
    negative rational numbers are acceptable priorities. If two pieces of gear have the same priority value, they
    will be swapped in the default order (from 0 to 15 in ../windower/res/slots.lua).

    I do not recommend moving Sub in front of Main, Ammo in front of Range, etc. as these will cause silent equip
    failures.
    people need to read the included info

  11. #5071
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    prolly having an issue with cloaks not letting one equip a head peice or w/e

    I hadnt noticed the advanced sets file before. thanks for bringing it to my attention at least lol.

  12. #5072
    RIDE ARMOR
    Join Date
    Dec 2012
    Posts
    11
    BG Level
    1
    FFXI Server
    Valefor

    Glad it's working for you Roland_J. I think the reason you were getting an error is because your aftercast has a "if spell.type" in it. Since my code calls the aftercast function when a spell wasn't cast it's essentially trying to look up the spell type of nothing or a nil value. I'm not sure what the rest of your lua looks like but it might be more functional to replace your "equip(sets.TP)" with "status_change(player.status)". With just the "equip(sets.TP)" command it won't take into account any variables like an accuracy toggle if you have any of those. Whether "status_change(player.status)" would work or not depends on the code for that function, which I can't see.

  13. #5073
    Puppetmaster
    Join Date
    Mar 2006
    Posts
    73
    BG Level
    2
    FFXI Server
    Phoenix

    Is noone else experiencing problems since they added wardrobe 2? I'm assuming the correct ID needs to be added to gearswap.lua.

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

    those who work on windower and its addons/plugins do have a life other then FFXI so give them some time

  15. #5075
    I Am, Who I Am.
    Join Date
    Nov 2005
    Posts
    15,657
    BG Level
    9
    FFXIV Character
    Trixi Sephyuyx
    FFXIV Server
    Excalibur
    FFXI Server
    Ragnarok

    No issues on my end.
    I do not specify gear with certain augs, or specify specific inventories though.
    But if I put gear in the main inv, wardrobe1, or 2, it quips fine.

  16. #5076
    Puppetmaster
    Join Date
    Mar 2006
    Posts
    73
    BG Level
    2
    FFXI Server
    Phoenix

    Quote Originally Posted by dlsmd View Post
    those who work on windower and its addons/plugins do have a life other then FFXI so give them some time
    Yeah, I'm aware of that. I was more curious if others were experiencing any issues and how I could fix it myself.

  17. #5077
    Hydra
    Join Date
    Jun 2010
    Posts
    114
    BG Level
    3

    (deleted bad post)

  18. #5078
    BG Content
    Join Date
    Jul 2007
    Posts
    22,359
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    All clear, but you need to re-log.

  19. #5079
    Smells like Onions
    Join Date
    Jan 2016
    Posts
    5
    BG Level
    0

    Found this lua in the SCH sticky. Keep getting the Two-Handed weapon error when switching from club/shield to staff/grip.

    Spoiler: show
    Code:
    -------------------------------------------------------------------------------------------------------------------
    -- Setup functions for this job.  Generally should not be modified.
    -- Original LUA by Fenrir.Motenten; edited by Bismarck.Speedyjim
    -------------------------------------------------------------------------------------------------------------------
    
    --[[
            Custom commands:64
    
            Shorthand versions for each strategem type that uses the version appropriate for
            the current Arts.
    		In-game macro: /console gs c scholar xxx
    
                                            Light Arts              Dark Arts
    
            gs c scholar light              Light Arts/Addendum
            gs c scholar dark                                       Dark Arts/Addendum
            gs c scholar cost               Penury                  Parsimony
            gs c scholar speed              Celerity                Alacrity
            gs c scholar aoe                Accession               Manifestation
            gs c scholar power              Rapture                 Ebullience
            gs c scholar duration           Perpetuance
            gs c scholar accuracy           Altruism                Focalization
            gs c scholar enmity             Tranquility             Equanimity
            gs c scholar skillchain                                 Immanence
            gs c scholar addendum           Addendum: White         Addendum: Black
    --]]
    
    
    
    -- Initialization function for this job file.
    function get_sets()
        mote_include_version = 2
    
        -- Load and initialize the include file.
        include('Mote-Include.lua')
    	include('organizer-lib')
    end
    
    -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
    function job_setup()
        info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
            "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
    
        state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
        update_active_strategems()
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
    function user_setup()
        state.OffenseMode:options('None', 'Normal')
        state.CastingMode:options('Normal', 'Resistant')
        state.IdleMode:options('Normal', 'PDT')
    
        state.MagicBurst = M(false, 'Magic Burst')
    	
        info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder", 
    	                   "Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
    					   "Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
    					   "Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
    	                   "Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
        info.mid_nukes = S{}
        info.high_nukes = S{}
    
        send_command('bind ` input /ma Stun <t>; wait 0.5; input /p Casting STUN → «¶«<t>«¶«.')
    	send_command('bind ^` gs c toggle MagicBurst')
    	send_command('bind !` gs c scholar skillchain')
    	send_command('bind ^- gs c scholar light')
    	send_command('bind ^= gs c scholar dark')
    	send_command('bind delete gs c scholar speed')
    	send_command('bind Home gs c scholar duration')
    	send_command('bind End gs c scholar aoe')
    
        select_default_macro_book()
    end
    
    function user_unload()
    	send_command('unbind `')
    	send_command('unbind ^`')
    	send_command('unbind !`')
    	send_command('unbind ^-')
    	send_command('unbind ^=')
    	send_command('unbind delete')
    	send_command('unbind end')
    	send_command('unbind home')
    end
    
    -- Define sets and vars used by this job file.
    function init_gear_sets()
    	--------------------------------------
    	-- Start defining the sets
    	--------------------------------------
    
    	-- Precast Sets
    	-- Precast sets to enhance JAs
    
    	sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants"}
    	sets.precast.JA['Dark Arts'] = {"Academic's Gown"}
    	sets.precast.JA['Light Arts'] = {"Academic's Pants"}
    	
    	organizer_items = {agown="Academic's Gown"}
    
    
    	-- Fast cast sets for spells
        -- FC +66%, Quick Magic +10% (cap) 
    	sets.precast.FC = {main="Atinian Staff",sub="Vivid Strap",ammo="Incantor Stone",
    		head="Argute mortarboard +1",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
    		body="Helios jacket",hands="Helios gloves",ring1="Weatherspoon Ring",ring2="Prolix Ring",
    		back="Ogapepo Cape",waist="Witful Belt",legs="Orvail pants",feet="Academic's Loafers"}
    
    	sets.precast.FC.Cure = set_combine(sets.precast.FC, {main="Serenity",head="Paean Mitra",ear1="Mendicant's Earring",body="Vanya Robe",hands="Gendewitha Gages +1",back="Pahtli Cape",feet="Vanya Clogs"})
    	sets.precast.FC.Curaga = sets.precast.FC.Cure
    	sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
    	sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal",ear1="Barkarole Earring"})
    	sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
    	
    	-- Weaponskill sets
        -- Default set for any weaponskill that isn't any more specifically defined
        sets.precast.WS = {}
    
        -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    	
    	-- Total MP: 2221 (Outside Escha), ???? (Inside Escha)
        sets.precast.WS['Myrkr'] = {main="Akademos",sub="Niobid Strap",ammo="Ghastly Tathlum +1",
    	    head="Kaabnax Hat",neck="Sanctity Necklace",ear1="Moonshade Earring",ear2="Etiolation Earring",
    		body="Amalric Doublet",hands="Otomi Gloves",ring1="Mephitas's Ring +1",ring2="Mephitas's Ring",
    		back="Pahtli Cape",waist="Luminary Sash",legs="Amalric Slops",feet="Medium's Sabots"}
    
    
    	-- Midcast Sets
    
    	sets.midcast.FastRecast = {back="Swith Cape"}
    
    	-- Cure Sets
    	
    	-- Potency: +50%, Healing Skill: 615 total inc. Light Arts bonus, Enmity: -15, MND: +146, VIT: +135
    	sets.midcast.Cure = {main="Atinian Staff",sub="Curatio Grip",ammo="Incantor Stone",
    		head="Telchine cap",neck="Healing Torque",ear1="Influx Earring",ear2="Loquacious Earring",
    		body="Telchine Chasuble",hands="Telchine gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",
    		back="Tempered Cape +1",waist="Bishop's Sash",legs="Academic's Pants",feet="Argute Loafers"}
        
    	-- Potency: +50%, Healing Skill: 567 total inc. Light Arts Bonus, MND: +152, VIT+ 131
    	sets.midcast.CureWithLightWeather = set_combine(sets.midcast.Cure, {
    		main="Chatoyant Staff",ear2="Mendicant's Earring",body="Chironic Doublet",back="Twilight Cape",waist="Korin Obi"})
    
    	sets.midcast.Curaga = sets.midcast.Cure
    
    	sets.midcast.Regen = {main="Eminent Wand",sub="Genbu's Shield",ammo="Savant's Treatise",
    	    head="Arbatel Bonnet +1",neck="Incanter's Torque",ear1="Andoaa Earring",
    		body="Telchine Chasuble",hands="Telchine Gloves",
    		back="Bookworm's Cape",waist="Cascade Belt",legs="Telchine Braconi",feet="Telchine Pigaches"}
    	
    	-- Enhancing Magic Sets
    	
    	sets.midcast['Enhancing Magic'] = {main="Eminent Wand",sub="Genbu's Shield",ammo="Savant's Treatise",
    		head="Telchine Cap",body="Telchine Chasuble",hands="Telchine Gloves",legs="Telchine Braconi",feet="Telchine Pigaches",
    		ear1="Andoaa Earring",neck="Enhancing Torque",waist="Cascade Belt",}
    
    	sets.midcast.Cursna = {main="Gada",sub="Genbu's Shield",
    		neck="Malison Medallion",body="Vanya Robe",hands="Pedagogy Bracers +1",ring1="Haoma's Ring",ring2="Ephedra Ring",
    		back="Tempered Cape +1",waist="Bishop's Sash",legs="Academic's Pants +1",feet="Gendewitha Galoshes +1"}
    
    	sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash"})
    
    	sets.midcast.Protect = set_combine(sets.midcast['Enhancing Magic'], {ring1="Sheltered Ring"})
    	sets.midcast.Shell = set_combine(sets.midcast['Enhancing Magic'], {ring1="Sheltered Ring"})
    	sets.midcast.Haste = set_combine(sets.midcast.FastRecast, {head="Telchine Cap",body="Telchine Chasuble",hands="Telchine Gloves",legs="Telchine Braconi",feet="Telchine Pigaches"})
    	sets.midcast.Storm = sets.midcast.Haste
    	sets.midcast.Erase = sets.midcast.FastRecast
    	sets.midcast.Raise = sets.midcast.FastRecast
    	sets.midcast.Reraise = sets.midcast.FastRecast
    
    
    	-- Custom spell classes
    	sets.midcast.MndEnfeebles = {main="Atinian Staff",sub="Marcero Grip",ammo="Kalboron Stone",
    		head="Kaabnax Hat",neck="Enfeebling Torque",ear1="Influx Earring",ear2="Gwati Earring",
    		body="Haruspex coat",hands="Argute Bracers",ring1="Perception Ring",ring2="Angha Ring",
    		back="Ogapepo Cape",waist="Demonry Sash",legs="Orvail Pants",feet="Helios Boots"}
    
    	sets.midcast.IntEnfeebles = sets.midcast.MndEnfeebles
    	sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
    	sets.midcast.Kaustra = set_combine(sets.midcast['Elemental Magic'], {head="Pixie Hairpin +1"})
    
    	sets.midcast['Dark Magic'] = {main="Atinian Staff",sub="Elder's Grip +1",ammo="Kalboran Stone",
    		head="Kaabnax Hat",neck="Dark Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
    		body="Academic's Gown",hands="Wayfarer cuffs",ring1="Angha Ring",ring2="Perception Ring",
    		back="Bookworm's Cape",waist="Witful Belt",legs="Argute pants",feet="Wayfarer Clogs"}
    
    	sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {ammo="Incantor Stone",
    		head="Pixie Hairpin +1",ear1="Hirudinea Earring",ear2="Loquacious Earring",body="Chironic Doublet",hands="Helios Gloves",waist="Fucho-no-obi",feet=merl_feet_MAB})
    
    	sets.midcast.Aspir = sets.midcast.Drain
    
    	sets.midcast.Stun = {main="Atinian Staff",sub="Vivid Strap",ammo="Incantor Stone",
    		head="Pedagogy Mortarboard +1",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquac. Earring",
    		body="Merlinic Jubbah",hands="Helios Gloves",ring1="Sangoma Ring",ring2="Prolix Ring",
    		back="Swith Cape",waist="Witful Belt",legs="Orvail Pants",feet="Academic's Loafers"}
    
    	sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {})
    
    
    	-- Elemental Magic sets are default for handling all-tier nukes.
    	 sets.midcast['Elemental Magic'] = {main="Atinian Staff",sub="Elder's Grip +1",ammo="Kalboran Stone",
    	    head=merl_head_MB,neck="Saevus Pendant +1",ear1="Barkarole Earring",ear2="Friomisi Earring",
    		body="Helios band",hands="Helios gloves",ring1="Shiva Ring",ring2="Shiva Ring",
    		back="Toro Cape",waist="Belisama's Rope +1",legs="Merlinic Shalwar",feet=merl_feet_MAB}
    	--  sub="Zuuxowu Grip",head="Buremte Hat",body="Witching Robe",hands="Otomi Gloves",back="Bookworm's Cape",waist="Tengu-no-Obi",feet="Amalric Nails"
    
    	sets.midcast['Elemental Magic'].Resistant = set_combine(sets.midcast['Elemental Magic'], {neck="Sanctity Necklace",back="Bookworm's Cape"})
    
    	-- Custom refinements for certain nuke tiers (No longer used as of Jan/2016).
    	sets.midcast['Elemental Magic'].HighTierNuke = sets.midcast['Elemental Magic']
    	sets.midcast['Elemental Magic'].HighTierNuke.Resistant = sets.midcast['Elemental Magic'].Resistant
    	
    	sets.midcast.Helix = set_combine(sets.midcast['Elemental Magic'], {neck="Sanctity Necklace",back="Bookworm's Cape"})
    	sets.midcast.Noctohelix = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})
    	sets.midcast.Luminohelix = set_combine(sets.midcast.Helix, {ring1="Weatherspoon Ring"})
    
    	sets.midcast.Impact = {main="Akademos",sub="Mephitis Grip",ammo="Hydrocera",
    		head=empty,neck="Sanctity Necklace",ear1="Barkarole Earring",ear2="Gwati Earring",
    		body="Twilight Cloak",hands=chiro_hands_MAB,ring1="Weatherspoon Ring",ring2="Sangoma Ring",
    		back="Refraction Cape",waist="Luminary Sash",legs="Chironic Hose",feet="Medium's Sabots"}
    
    
    	-- Sets to return to when not performing an action.
    
    	-- Resting sets
    	sets.resting = {main="Chatoyant Staff",sub="Mephitis Grip",
    		head="Wayfarer Circlet",neck="Rep. Silver Medal",
            body="Wayfarer robe",hands="Wayfarer Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
            waist="Cheviot Cape",legs="Wayfarer Slops",feet="Wayfarer Clogs"}
    
    	-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
    
    	sets.idle.Town = {main="Eminent Wand",sub="Genbu's Shield",ammo="Incantor Stone",
            head="Argute mortarboard +1",neck="Wiglen Gorget",ear1="Influx Earring",ear2="Loquacious Earring",
            body="Helios jacket",hands="Helios gloves",ring1="Sheltered Ring",ring2="Paguroidea Ring",
            back="Cheviot Cape",waist="Flume Belt",legs="Telchine braconi",feet="Herald's Gaiters"}
    
    	sets.idle.Field = {main="Atinian Staff",sub="Elder's Grip +1",ammo="Incantor Stone",
    		head="Helios band",neck="Wiglen Gorget",ear1="Influx Earring",ear2="Loquacious Earring",
    		body="Academic's Gown",hands=chiro_hands_MAB,ring1="Defending Ring",ring2=gear.DarkRing.physical,
    		back="Cheviot Cape",waist="Flume Belt",legs="Telchine braconi",feet="Herald's Gaiters"}	
    		
    	sets.idle.PDT = {main="Eminent wand",sub="Genbu's Shield",ammo="Incantor Stone",
            head="Wayfarer Circlet",neck="Wiglen Gorget",ear1="Influx Earring",ear2="Loquacious Earring",
            body="Wayfarer robe",hands="Wayfarer Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
            back="Cheviot Cape",waist="Flume Belt",legs="Wayfarer Slops",feet="Wayfarer Clogs"}	
    
    	sets.idle.Weak = sets.idle.Field
    	
    	-- Defense sets
    
    	sets.defense.PDT = {main="Earth staff",sub="Achaq Grip",ammo="Incantor Stone",
            head="Helios band",neck="Wiglen gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
            body="Helios jacket",hands="Helios gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
            back="Umbra Cape",waist="Flume Belt",legs="Telchine braconi",feet="Helios boots"}
    
    	sets.defense.MDT = {
    		{main="Earth staff",sub="Achaq Grip",ammo="Incantor Stone",
            head="Helios band",neck="Wiglen gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
            body="Helios jacket",hands="Helios gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
            back="Umbra Cape",waist="Flume Belt",legs="Telchine braconi",feet="Helios boots"}
    
    	sets.Kiting = {feet="Herald's Gaiters"}
    	sets.latent_refresh = {waist="Fucho-no-obi"}
    
    	-- Engaged sets
    
    	-- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
    	-- sets if more refined versions aren't defined.
    	-- If you create a set with both offense and defense modes, the offense mode should be first.
    	-- EG: sets.engaged.Dagger.Accuracy.Evasion
    
    	-- Normal melee group
    	sets.engaged = {}
    
    
    	-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
    	sets.buff['Ebullience'] = {}
    	sets.buff['Rapture'] = {head="Arbatel Bonnet +1"}
    	sets.buff['Perpetuance'] = {hands="Arbatel Bracers +1"}
    	sets.buff['Immanence'] = {hands="Arbatel Bracers +1"}
    	sets.buff['Penury'] = {legs="Arbatel Pants +1"}
    	sets.buff['Parsimony'] = {legs="Arbatel Pants +1"}
    	sets.buff['Celerity'] = {feet="Pedagogy Loafers +1"}
    	sets.buff['Alacrity'] = {head=merl_head_MB,feet="Pedagogy Loafers +1"}
    	sets.buff['Stormsurge'] = {feet="Pedagogy Loafers +1"}
    	sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
    
    	sets.buff.FullSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring",body="Pedagogy Gown +1",neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
    	sets.buff.PDTSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring",body="Pedagogy Gown +1"}
    	
    	sets.magic_burst = {main="Akademos",sub="Niobid Strap",
    	    head=merl_head_MB,neck="Mizukage-no-Kubikazari",hands="Amalric Gages",
    		ring1="Mujin Band",back="Seshaw Cape",feet=merl_feet_MB}
    	-- Cap: 40%
        -- Akademos: 10%, Merlinic Hood: 4%, Mizukage: 10%, Seshaw: 5%, Merlinic Boots: 11% = 40%
    
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- Job-specific hooks for standard casting events.
    -------------------------------------------------------------------------------------------------------------------
    function refine_various_spells(spell, action, spellMap, eventArgs)
        aspirs = S{'Aspir','Aspir II'}
        sleeps = S{'Sleep','Sleep II'}
        sleepgas = S{'Sleepga'}
       
        if not sleepgas:contains(spell.english) and not sleeps:contains(spell.english) and not aspirs:contains(spell.english) then
            return
        end
       
        local newSpell = spell.english
        local spell_recasts = windower.ffxi.get_spell_recasts()
        local cancelling = 'All '..spell.english..' spells are on cooldown. Cancelling spell casting.'
        
        if spell_recasts[spell.recast_id] > 0 then
            if aspirs:contains(spell.english) then
                if spell.english == 'Aspir' then
                    add_to_chat(122,cancelling)
                    eventArgs.cancel = true
                    return
                elseif spell.english == 'Aspir II' then
                    newSpell = 'Aspir'
                end         
            elseif sleeps:contains(spell.english) then
                if spell.english == 'Sleep' then
                    add_to_chat(122,cancelling)
                    eventArgs.cancel = true
                    return
                elseif spell.english == 'Sleep II' then
                    newSpell = 'Sleep'
                end
            elseif sleepgas:contains(spell.english) then
                if spell.english == 'Sleepga' then
                    add_to_chat(122,cancelling)
                    eventArgs.cancel = true
                    return
                end
            end
        end
        
        if newSpell ~= spell.english then
            send_command('@input /ma "'..newSpell..'" '..tostring(spell.target.raw))
            eventArgs.cancel = true
            return
        end
    end
    
    function job_precast(spell, action, spellMap, eventArgs)	
        refine_various_spells(spell, action, spellMap, eventArgs)
        if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") then
    	   if buffactive.Silence then
    		cancel_spell()
    		send_command('input /item "Echo Drops" <me>')
           end
        end	
    end	
    	
    -- Run after the general midcast() is done.
    function job_post_midcast(spell, action, spellMap, eventArgs)
        if spell.action_type == 'Magic' then
            apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
        end
    	if spell.skill == 'Elemental Magic' then
            if state.MagicBurst.value then
            equip(sets.magic_burst)
            end
    	end
    end
    
    function job_aftercast(spell)
        if spell.english == 'Sleep' or spell.english == 'Sleepga' then
    		send_command('@wait 50;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
    	elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
    		send_command('@wait 80;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
    	elseif spell.english == 'Break' or spell.english == 'Breakga' then
    		send_command('@wait 20;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
    	end
    end	
    
    -------------------------------------------------------------------------------------------------------------------
    -- Job-specific hooks for non-casting events.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Called when a player gains or loses a buff.
    -- buff == buff gained or lost
    -- gain == true if the buff was gained, false if it was lost.
    function job_buff_change(buff, gain)
        if buff == "Sublimation: Activated" then
            handle_equipping_gear(player.status)
        end
    end
    
    -- Handle notifications of general user state change.
    function job_state_change(stateField, newValue, oldValue)
        if stateField == 'Offense Mode' then
            if newValue == 'Normal' then
                disable('main','sub','range')
            else
                enable('main','sub','range')
            end
        end
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- User code that supplements standard library decisions.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Custom spell mapping.
    function job_get_spell_map(spell, default_spell_map)
        if spell.action_type == 'Magic' then
            if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
                if world.weather_element == 'Light' then
                    return 'CureWithLightWeather'
                end
            elseif spell.skill == 'Enfeebling Magic' then
                if spell.type == 'WhiteMagic' then
                    return 'MndEnfeebles'
                else
                    return 'IntEnfeebles'
                end
            elseif spell.skill == 'Elemental Magic' then
                if info.low_nukes:contains(spell.english) then
                    return 'LowTierNuke'
                elseif info.mid_nukes:contains(spell.english) then
                    return 'MidTierNuke'
                elseif info.high_nukes:contains(spell.english) then
                    return 'HighTierNuke'
                end
            end
        end
    end
    
    function customize_idle_set(idleSet)
        if state.Buff['Sublimation: Activated'] then
            if state.IdleMode.value == 'Normal' then
                idleSet = set_combine(idleSet, sets.buff.FullSublimation)
            elseif state.IdleMode.value == 'PDT' then
                idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
            end
        end
    
        if player.mpp < 51 then
            idleSet = set_combine(idleSet, sets.latent_refresh)
        end
    
        return idleSet
    end
    
    -- Called by the 'update' self-command.
    function job_update(cmdParams, eventArgs)
        if cmdParams[1] == 'user' and not (buffactive['light arts']      or buffactive['dark arts'] or
                           buffactive['addendum: white'] or buffactive['addendum: black']) then
            if state.IdleMode.value == 'Stun' then
                send_command('@input /ja "Dark Arts" <me>')
            else
                send_command('@input /ja "Light Arts" <me>')
            end
        end
    
        update_active_strategems()
        update_sublimation()
    end
    
    -- Function to display the current relevant user state when doing an update.
    -- Return true if display was handled, and you don't want the default info shown.
    function display_current_job_state(eventArgs)
        display_current_caster_state()
        eventArgs.handled = true
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- User code that supplements self-commands.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Called for direct player commands.
    function job_self_command(cmdParams, eventArgs)
        if cmdParams[1]:lower() == 'scholar' then
            handle_strategems(cmdParams)
            eventArgs.handled = true
        end
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- Utility functions specific to this job.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Reset the state vars tracking strategems.
    function update_active_strategems()
        state.Buff['Ebullience'] = buffactive['Ebullience'] or false
        state.Buff['Rapture'] = buffactive['Rapture'] or false
        state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
        state.Buff['Immanence'] = buffactive['Immanence'] or false
        state.Buff['Penury'] = buffactive['Penury'] or false
        state.Buff['Parsimony'] = buffactive['Parsimony'] or false
        state.Buff['Celerity'] = buffactive['Celerity'] or false
        state.Buff['Alacrity'] = buffactive['Alacrity'] or false
    
        state.Buff['Klimaform'] = buffactive['Klimaform'] or false
    end
    
    function update_sublimation()
        state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
    end
    
    -- Equip sets appropriate to the active buffs, relative to the spell being cast.
    function apply_grimoire_bonuses(spell, action, spellMap)
        if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
            equip(sets.buff['Perpetuance'])
        end
        if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
            equip(sets.buff['Rapture'])
        end
        if spell.skill == 'Elemental Magic' then --or spellMap ~= 'ElementalEnfeeble'
            if state.Buff.Ebullience and spell.english ~= 'Impact' then
                equip(sets.buff['Ebullience'])
            end
            if state.Buff.Immanence then
                equip(sets.buff['Immanence'])
            end
            if state.Buff.Klimaform and spell.element == world.weather_element then
                equip(sets.buff['Klimaform'])
            end
        end
    
        if state.Buff.Penury then equip(sets.buff['Penury']) end
        if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
        if state.Buff.Celerity then equip(sets.buff['Celerity']) end
        if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
    end
    
    
    function display_current_caster_state()
    	local msg = ''
    
    	if state.OffenseMode.value ~= 'None' then
    		msg = msg .. 'Melee'
    
    		if state.CombatForm.has_value then
    			msg = msg .. ' (' .. state.CombatForm.value .. ')'
    		end
            
    		msg = msg .. ', '
    	end
    
    	msg = msg .. 'Idle ['..state.IdleMode.value..'], Casting ['..state.CastingMode.value..']'
    
    	add_to_chat(122, msg)
    	local currentStrats = get_current_strategem_count()
    	local arts
    	if buffactive['Light Arts'] or buffactive['Addendum: White'] then
    		arts = 'Light Arts'
    	elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
    		arts = 'Dark Arts'
    	else
    		arts = 'No Arts Activated'
    	end
    	add_to_chat(122, 'Current Available Strategems: ['..currentStrats..'], '..arts..'')
    end
    
    -- General handling of strategems in an Arts-agnostic way.
    -- Format: gs c scholar <strategem>
    function handle_strategems(cmdParams)
        -- cmdParams[1] == 'scholar'
        -- cmdParams[2] == strategem to use
    	if not cmdParams[2] then
    		add_to_chat(123,'Error: No strategem command given.')
    		return
    	end
    
    	local currentStrats = get_current_strategem_count()
    	local newStratCount = currentStrats - 1
    	local strategem = cmdParams[2]:lower()
    	
    	if currentStrats > 0 and strategem ~= 'light' and strategem ~= 'dark' then
    		add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
    	elseif currentStrats == 0 then
    		add_to_chat(122, '***Out of strategems! Canceling...***')
    		return
    	end
    
    	if strategem == 'light' then
    		if buffactive['light arts'] then
    			send_command('input /ja "Addendum: White" <me>')
    			add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
    		elseif buffactive['addendum: white'] then
    			add_to_chat(122,'Error: Addendum: White is already active.')
    		elseif buffactive['dark arts']  or buffactive['addendum: black'] then
    			send_command('input /ja "Light Arts" <me>')
    			add_to_chat(122, '***Changing Arts! Current Charges Available: ['..currentStrats..']***')
    		else
    			send_command('input /ja "Light Arts" <me>')
    		end
    	elseif strategem == 'dark' then
    		if buffactive['dark arts'] then
    			send_command('input /ja "Addendum: Black" <me>')
    			add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
            elseif buffactive['addendum: black'] then
    			add_to_chat(122,'Error: Addendum: Black is already active.')
    		elseif buffactive['light arts'] or buffactive['addendum: white'] then
    			send_command('input /ja "Dark Arts" <me>')
    			add_to_chat(122, '***Changing Arts! Current Charges Available: ['..currentStrats..']***')
    		else
    			send_command('input /ja "Dark Arts" <me>')
    		end
    	elseif buffactive['light arts'] or buffactive['addendum: white'] then
    		if strategem == 'cost' then
    			send_command('@input /ja Penury <me>')
    		elseif strategem == 'speed' then
    			send_command('@input /ja Celerity <me>')
    		elseif strategem == 'aoe' then
    			send_command('@input /ja Accession <me>')
    		elseif strategem == 'power' then
    			send_command('@input /ja Rapture <me>')
    		elseif strategem == 'duration' then
    			send_command('@input /ja Perpetuance <me>')
    		elseif strategem == 'accuracy' then
    			send_command('@input /ja Altruism <me>')
    		elseif strategem == 'enmity' then
    			send_command('@input /ja Tranquility <me>')
    		elseif strategem == 'skillchain' then
    			add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
    		elseif strategem == 'addendum' then
    			send_command('@input /ja "Addendum: White" <me>')
    		else
    			add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
    		end
    	elseif buffactive['dark arts']  or buffactive['addendum: black'] then
    		if strategem == 'cost' then
    			send_command('@input /ja Parsimony <me>')
    		elseif strategem == 'speed' then
    			send_command('@input /ja Alacrity <me>')
    		elseif strategem == 'aoe' then
    			send_command('@input /ja Manifestation <me>')
    		elseif strategem == 'power' then
    			send_command('@input /ja Ebullience <me>')
    		elseif strategem == 'duration' then
    			add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
    		elseif strategem == 'accuracy' then
    			send_command('@input /ja Focalization <me>')
    		elseif strategem == 'enmity' then
    			send_command('@input /ja Equanimity <me>')
    		elseif strategem == 'skillchain' then
    			send_command('@input /ja Immanence <me>')
    		elseif strategem == 'addendum' then
    			send_command('@input /ja "Addendum: Black" <me>')
    		else
    			add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
    		end
    	else
    		add_to_chat(123,'No arts has been activated yet.')
    	end
    end
    
    function get_current_strategem_count()
    	local allRecasts = windower.ffxi.get_ability_recasts()
    	local stratsRecast = allRecasts[231]
    
    	local maxStrategems = math.floor(player.main_job_level + 10) / 20
    
    	local fullRechargeTime = 5*33
    
    	local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
    	
    	return currentCharges
    end
    
    
    -- Select default macro book on initial load or subjob change.
    function select_default_macro_book()
        if player.sub_job == 'RDM' then
            set_macro_page(1, 8)
        elseif player.sub_job == 'BLM' then
            set_macro_page(1, 8)	
        elseif player.sub_job == 'WHM' then
            set_macro_page(2, 8)
    	end	
    end

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

    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.

Page 254 of 302 FirstFirst ... 204 244 252 253 254 255 256 264 ... LastLast

Similar Threads

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