Item Search
     
BG-Wiki Search
Page 253 of 302 FirstFirst ... 203 243 251 252 253 254 255 263 ... LastLast
Results 5041 to 5060 of 6036

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

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

    They are not part of the framework. I convinced him to submit it to the gearswap repository as a gearswap library so he could control the version people were using and ensure everyone was kept up to date.

    That said, the lib system is just a tool to do that. It doesn't mean the file is supported and updated with the rest of gearswap

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

    Quote Originally Posted by Byrthnoth View Post
    They are not part of the framework. I convinced him to submit it to the gearswap repository as a gearswap library so he could control the version people were using and ensure everyone was kept up to date.

    That said, the lib system is just a tool to do that. It doesn't mean the file is supported and updated with the rest of gearswap
    yup ill have to step back on that one your right

    i thought about adding mine to it as well but i think several things mine can do will violate windowers acceptance policy(it has several botting type abilitys built in)

  3. #5043
    E. Body
    Join Date
    Sep 2008
    Posts
    2,055
    BG Level
    7

    Thanks for the help, solved two of the issues. Can't believe I didn't know about that show swaps option. Helps a lot.

    1. Deleted the "main=" part and my Idle sets work now. Dumb mistake.
    2. Combined the two functions into one and magic bursts work now.
    3. I do have Hachirin-no-Obi and Twilight Cape. I tried casting cure on myself on lightsday and I did not swap into them. Tried casting Comet on Darksday and that didn't work either. Put up various weather using /SCH and it did not work.
    4. When I try entering the function Shadowmeld wrote into the lua, it will fail to load the file, pointing to the line of the function saying "attempt to index global 'state' (a nil value)"

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

    Quote Originally Posted by Kincard View Post
    3. I do have Hachirin-no-Obi and Twilight Cape. I tried casting cure on myself on lightsday and I did not swap into them. Tried casting Comet on Darksday and that didn't work either. Put up various weather using /SCH and it did not work.
    4. When I try entering the function Shadowmeld wrote into the lua, it will fail to load the file, pointing to the line of the function saying "attempt to index global 'state' (a nil value)"
    3. the only reason i can think of why cure wont equip your Hachirin-no-Obi and Twilight Cape is because you have more the 1000 TP(this is what causes it)
    Code:
        if player.tp > 1000 then
            disable('main','sub')
        elseif (spellMap == 'Cure' or spellMap == 'Curaga') then
    also no need to have this(because you dot have anything els to check with it)
    (spellMap == 'Cure' or spellMap == 'Curaga')
    use
    spellMap == 'Cure' or spellMap == 'Curaga'
    and for the elemental magic part try changing
    equip(sets.midcast.Bonus)
    to
    equip({waist="Hachirin-no-Obi",back="Twilight Cape"})
    4. i wish i knew more about motes includes

  5. #5045
    E. Body
    Join Date
    Sep 2008
    Posts
    2,055
    BG Level
    7

    Managed to solve the Obi thing by doing what I was told about earlier again, placing them under the same function as magic bursts and Spaekona Coat. (Also not sure why whoever wrote the lua initially had obis being put on precast rather than midcast for cures) Now I just need to fix the Capacity Toggle thing.

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

    In the Job_state_change function add the code for the capacity back.

    Code:
    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
        elseif stateField == 'Capacity' then
            if newValue == true then
                equip({back="Capcity Cape Name"})
                disable('back')
            else
                enable('back')
            end
        end
    end

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

    Please forgive me if this has been answered before or if I am oblivious of the obvious, but...

    My issue is that binds are not unbinding with the send_command('unbind [modifier][key]') code within a function file_unload() function. I have googled "ffxi gearswap unbind" and I didn't find any talk on this when filtering results within the last year and so I figured it'd be safe to ask this question without running the risk that it has been answered already. I figure that the fact that I'm the only one asking this probably means that I'm overlooking something silly that I've done that has broken this function for me specifically.

    Here is the code I am using.
    Code:
    send_command('bind @t input /echo testing unbind code')
    		
    function file_unload()
        if binds_on_unload then
            binds_on_unload()
        end
    	send_command('unbind @t')
    	
    end
    That is in my whm.lua. My debug method is to type //gs l whm.lua ingame to update the lua, then I type //gs l sch.lua to unload the whm.lua (//gs u and //gs u whm.lua both give me "GearSwap: Command not found"), and then I press windowskey+t (@ refers to the windowskey) to see if the unbind worked. The result is that "input /echo testing unbind code" executes; which tells me that the unbind failed horribly.

    Has this function stopped working recently or am I just doing something silly that has broken it for me?

    Thanks!

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

    Quote Originally Posted by Roland_J View Post
    Please forgive me if this has been answered before or if I am oblivious of the obvious, but...

    My issue is that binds are not unbinding with the send_command('unbind [modifier][key]') code within a function file_unload() function. I have googled "ffxi gearswap unbind" and I didn't find any talk on this when filtering results within the last year and so I figured it'd be safe to ask this question without running the risk that it has been answered already. I figure that the fact that I'm the only one asking this probably means that I'm overlooking something silly that I've done that has broken this function for me specifically.

    Here is the code I am using.
    Code:
    send_command('bind @t input /echo testing unbind code')
    		
    function file_unload()
        if binds_on_unload then
            binds_on_unload()
        end
    	send_command('unbind @t')
    	
    end
    That is in my whm.lua. My debug method is to type //gs l whm.lua ingame to update the lua, then I type //gs l sch.lua to unload the whm.lua (//gs u and //gs u whm.lua both give me "GearSwap: Command not found"), and then I press windowskey+t (@ refers to the windowskey) to see if the unbind worked. The result is that "input /echo testing unbind code" executes; which tells me that the unbind failed horribly.

    Has this function stopped working recently or am I just doing something silly that has broken it for me?

    Thanks!
    are you using motes include??
    if so you should put that in
    user_unload() not file_unload()
    other wise i have no idea why it does not work

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

    Quote Originally Posted by dlsmd View Post
    are you using motes include??
    if so you should put that in
    user_unload() not file_unload()
    other wise i have no idea why it does not work
    Hmm, that's not working for me either I'll put below the two functions I've tried. I simplified the code as far as making the results easily visible ingame. If the unloads work an /echo will display; it never displays.

    Code:
    send_command('input /echo Test loading code')  --works, doesn't need to be tested but whatever--
    		
    function file_unload()
    	send_command('input /echo Test unload code') --broken--
    end
    Code:
    send_command('input /echo Test loading code') --works, doesn't need to be tested but whatever--
    		
    function user_unload()
    	send_command('input /echo Test unload code') --broken--
    end
    Here is my whm.lua. Hopefully it helps figure out what's going wrong.

    Spoiler: show
    Code:
    -------------------------------------------------------------------------------------------------------------------
    -- Initialization function that defines sets and variables to be used.
    -------------------------------------------------------------------------------------------------------------------
    
    -- IMPORTANT: Make sure to also get the Mote-Include.lua file (and its supplementary files) to go with this.
    
    -- An F12 keypress, while out of town, will activate Light Arts and Afflatus Solace --
    
    --[[
            Custom commands for WHM/SCH:
    
            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 addendum           Addendum: White         Addendum: Black
    --]]
    
    send_command('wait 6;input /lockstyleset 03')
    
    -- Keybinds
    
    send_command('input /echo Test loading code') --works, doesn't need to be tested but whatever--
    		
    function user_unload()
    	send_command('input /echo Test unload code') --broken--
    end
    
    -- Initialization function for this job file.
    function get_sets()
    	-- Load and initialize the include file.
    	include('Mote-Include.lua')
    end
    
    -- Setup vars that are user-independent.
    function job_setup()
    	state.Buff['Afflatus Solace'] = buffactive['Afflatus Solace'] or false
    	state.Buff['Afflatus Misery'] = buffactive['Afflatus Misery'] or false
    end
    
    -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
    function user_setup()
    	-- Options: Override default values
    	options.OffenseModes = {'None', 'Normal'}
    	options.DefenseModes = {'Normal'}
    	options.WeaponskillModes = {'Normal'}
    	options.CastingModes = {'Normal', 'Resistant', 'Dire'}
    	options.IdleModes = {'Normal', 'PDT'}
    	options.RestingModes = {'Normal'}
    	options.PhysicalDefenseModes = {'PDT'}
    	options.MagicalDefenseModes = {'MDT'}
    	
    	state.Defense.PhysicalMode = 'PDT'
    	state.OffenseMode = 'None'
    
    
    	-- Default macro set/book
    	set_macro_page(4, 16)
    end
    
    
    -- Define sets and vars used by this job file.
    function init_gear_sets()
    	--------------------------------------
    	-- Start defining the sets
    	--------------------------------------
    	
    	-- Precast Sets
    
    	-- Fast cast sets for spells
    	sets.precast.FC = {main="Queller rod",ammo="Sapience orb",
    		head="Nahtirah Hat",neck="Voltsurge torque",ear1="Enchntr. earring +1",ear2="Loquacious Earring",
    		body="Anhur Robe",hands="Gende. gages +1",ring1="Weather. ring",ring2="Prolix Ring",
    		back="Swith Cape +1",waist="Witful Belt",legs="Artsieq hose",feet="Regal pumps +1"}
    		
    	sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {})
    
    	sets.precast.FC.Stoneskin = set_combine(sets.precast.FC['Enhancing Magic'], {})
    	
    	sets.precast.FC.Arise = set_combine(sets.precast.FC, {legs="Ebers pant. +1"})
    	sets.precast.FC.Raise = set_combine(sets.precast.FC, {legs="Ebers pant. +1"})
    	
    	sets.precast.FC['Healing Magic'] = set_combine(sets.precast.FC, {legs="Ebers Pant. +1"})
    
    	sets.precast.FC.StatusRemoval = set_combine(sets.precast.FC, {legs="Ebers pant. +1"})
    
    	sets.precast.FC.Cure = set_combine(sets.precast.FC['Healing Magic'], {main="Queller rod",ear2="Nourish. earring +1",legs="Ebers pant. +1"})
    
    	sets.precast.FC.Curaga = sets.precast.FC.Cure
    	
    	-- Precast sets to enhance JAs
    	sets.precast.JA.Benediction = {body="Piety Briault +1"}
    	sets.precast.JA.Devotion = {}
    	
    	-- Waltz set (chr and vit)
    	sets.precast.Waltz = {}
    	
    	
    	-- Weaponskill sets
    
    	-- Default set for any weaponskill that isn't any more specifically defined
    	gear.default.weaponskill_neck = "Asperity Necklace"
    	gear.default.weaponskill_waist = ""
    	sets.precast.WS = {}
    	
    	sets.precast.WS['Flash Nova'] = {}
    	
    
    	-- Midcast Sets
    	
    	sets.midcast.FastRecast = {head="Nahtirah Hat",neck="Voltsurge torque",ear1="Enchntr. earring +1",ear2="Loquacious Earring",
    		body="Anhur Robe",hands="Gende. gages +1",ring1="Weatherspoon ring",ring2="Prolix Ring",
    		back="Swith Cape +1",waist="Witful Belt",legs="Artsieq hose",feet="Regal pumps +1"}
    	
    	-- Cure sets
    	gear.default.obi_waist = "Pythia sash"
    	gear.default.obi_weapon = "Queller rod"
    	gear.default.grip = "Genbu's shield" -- not functioning --
    	gear.default.obi_back = "Mending Cape"
    
    	sets.midcast.CureSolace = {		
    		main=gear.ElementalWeapon,
    		sub=gear.ElementalGrip,
    		ammo="Esper stone +1",
    		head="Gende. caubeen +1",
    		neck="Incanter's torque",
    		ear1="Glorious earring",
    		ear2="Nourish. earring +1",
    		body="Ebers bliaud +1",
    		hands="Kaykaus cuffs",
    		ring1="Kuchekula ring",
    		ring2="Sirona's ring",
    		back=gear.ElementalCape,
    		waist=gear.ElementalObi,
    		legs="Ebers pant. +1",
    		feet="Kaykaus boots"}
    		
    	sets.midcast.Cure = {		
    		main=gear.ElementalWeapon,
    		sub=gear.ElementalGrip,
    		ammo="Esper stone +1",
    		head="Gende. caubeen +1",
    		neck="Incanter's torque",
    		ear1="Glorious earring",
    		ear2="Nourish. earring +1",
    		body="Ebers bliaud +1",
    		hands="Kaykaus cuffs",
    		ring1="Kuchekula ring",
    		ring2="Sirona's ring",
    		back=gear.ElementalCape,
    		waist=gear.ElementalObi,
    		legs="Ebers pant. +1",
    		feet="Kaykaus boots"}	
    
    	sets.midcast.Curaga = {		
    		main=gear.ElementalWeapon,
    		sub=gear.ElementalGrip,
    		ammo="Esper stone +1",
    		head="Gende. caubeen +1",
    		neck="Incanter's torque",
    		ear1="Glorious earring",
    		ear2="Nourish. earring +1",
    		body="Ebers bliaud +1",
    		hands="Kaykaus cuffs",
    		ring1="Kuchekula ring",
    		ring2="Sirona's ring",
    		back=gear.ElementalCape,
    		waist=gear.ElementalObi,
    		legs="Ebers pant. +1",
    		feet="Kaykaus boots"}
    
    	sets.midcast.CureMelee = {main="Queller rod",
    		head="Gende. caubeen +1",neck="Nodens gorget",ear1="Glorious earring",ear2="Nourishing earring +1",
    		body="Ebers bliaud +1",hands="Kaykaus cuffs",ring1="Kuchekula ring",ring2="Sirona's ring",
    		back="Mending Cape",waist=gear.ElementalObi,legs="Ebers pant. +1",feet="Kaykaus boots"}
    
    	sets.midcast.Cursna = {main="Beneficus",ammo="Homiliary",
    		head="Ebers cap +1",neck="Debilis Medallion",
    		body="Ebers bliaud +1",hands="fanatic gloves",ring1="Haoma's Ring",ring2="Haoma's Ring",
    		back="Mending Cape",legs="Theo. pant. +1",feet="Gende. galosh. +1"}
    
    	sets.midcast.StatusRemoval = {
    		head="Ebers cap +1",legs="Ebers Pant. +1"}
    
    	-- 110 total Enhancing Magic Skill; caps even without Light Arts
    	sets.midcast['Enhancing Magic'] = {	main="Beneficus",ammo="Homiliary",
    		head="Telchine cap",neck="Incanter's torque",
    		body="Telchine chas.",
    		legs="Telchine braconi",feet="Telchine pigaches",back="Mending Cape"}
    
    	sets.midcast.Stoneskin = {head="Befouled crown",neck="Nodens gorget",body="Telchine chas.",legs="piety pantaln. +1",feet="Ebers duckbills"}
    		
    	sets.midcast.Aquaveil = {main="Beneficus",head="Befouled crown",body="Anhur robe",back="Mending Cape",legs="piety pantaln. +1",feet="Ebers duckbills"}
    
    	sets.midcast.Auspice = {main="Beneficus",head="Befouled crown",body="Anhur robe",back="Mending Cape",legs="piety pantaln. +1",feet="Ebers duckbills"}
    	sets.midcast.Aurorastorm = {main="Beneficus",head="Befouled crown",body="Anhur robe",back="Mending Cape",legs="piety pantaln. +1",feet="Ebers duckbills"}
    	
    	sets.midcast.BarElement = {		
    		main="Beneficus",
    		sub="Genbu's Shield",
    		ammo="Homiliary",
    		head="Ebers cap +1",
    		neck="Incanter's torque",
    		body="ebers bliaud +1",
    		hands="ebers mitts +1",
    		back="Mending Cape",
    		legs="Piety pantaln. +1",
    		feet="Kaykaus boots"}
    	
    	sets.midcast.Regen = set_combine(sets.midcast['Enhancing Magic'], {main="Bolelabunga",
    		body="Piety briault +1",hands="Ebers mitts +1",legs="Theo. pant. +1"})
    
    	sets.midcast.Protectra = set_combine(sets.midcast['Enhancing Magic'], {})
    
    	sets.midcast.Shellra = set_combine(sets.midcast['Enhancing Magic'], {"Piety pantaln. +1"})
    
    	sets.midcast['Divine Magic'] = {}
    		
    	sets.midcast['Repose'] = {}
    		
    	sets.midcast['Elemental Magic'] = {main="Serenity",sub="Niobid strap",ammo="Ghastly tathlum",
    		head="Helios band",neck="Mizu. Kubikazari",ear1="Friomisi earring",ear2="Static earring",
    		body="Witching robe",hands="Fanatic gloves",ring1="Locus ring",ring2="Mujin band",
    		back="Seshaw cape",waist="Hachirin-no-obi",legs="Gyve trousers",feet="Helios boots"}
    
    	sets.midcast['Dark Magic'] = {}
    
    	-- Custom spell classes
    	sets.midcast.MndEnfeebles = {}
    
    	sets.midcast.IntEnfeebles = {}
    
    	
    	-- Sets to return to when not performing an action.
    	
    	-- Resting sets
    	sets.resting = {		
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Befouled crown",
    		neck="Loricate torque +1",
    		ear1="Moonshade Earring",
    		ear2="Nourishing earring +1",
    		body="Ebers bliaud +1", --temp--
    		hands="Serpentes Cuffs",
    		ring1="Gelatinous ring +1",
    		ring2="Defending Ring",
    		back="Umbra cape",
    		waist="Fucho-no-Obi",
    		legs="Assid. Pants +1",
    		feet="Serpentes Sabots"}
    	
    
    	-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
    	sets.idle = {		
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Befouled crown",
    		neck="Loricate torque +1",
    		ear1="Glorious Earring",
    		ear2="Moonshade Earring",
    		body="Witching robe",
    		hands="Gende. gages +1",
    		ring2="Defending ring",
    		ring1="Gelatinous ring +1",
    		back="Umbra cape",
    		waist="Fucho-no-Obi",
    		legs="Assid. Pants +1",
    		feet="Gende. galosh. +1"}
    
    	sets.idle.PDT = {		--50 PDT, 8 Refresh--
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Gende. caubeen +1",neck="Loricate torque +1",ear1="Glorious Earring",ear2="Moonshade Earring",
    		body="Witching robe",hands="Gende. gages +1",ring2="Defending ring",ring1="Gelatinous ring +1",
    		back="Umbra cape",waist="Fucho-no-Obi",legs="Assid. Pants +1",feet="Gende. galosh. +1"}
    
    	sets.idle.Town = {		
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Befouled crown",
    		neck="Loricate torque +1",
    		ear1="Glorious Earring",
    		ear2="Moonshade Earring",
    		body="Councilor's garb",
    		hands="Serpentes Cuffs",
    		ring2="Defending ring",
    		ring1="Gelatinous ring +1",
    		back="Umbra cape",
    		waist="Fucho-no-Obi",
    		legs="Assid. Pants +1",
    		feet="Herald's Gaiters"}
    	
    	sets.idle.Weak = {		
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Befouled crown",
    		neck="Loricate torque +1",
    		ear1="Glorious Earring",
    		ear2="Moonshade Earring",
    		body="Ebers bliaud +1", --temp--
    		hands="Serpentes Cuffs",
    		ring2="Defending ring",
    		ring1="Gelatinous ring +1",
    		back="Umbra cape",
    		waist="Fucho-no-Obi",
    		legs="Assid. Pants +1",
    		feet="Serpentes Sabots"}
    		
    	-- Defense sets
    
    	sets.defense.PDT = {		
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Befouled crown",
    		neck="Loricate torque +1",
    		ear1="Moonshade Earring",
    		ear2="Nourishing earring +1",
    		body="Witching robe",
    		hands="Serpentes Cuffs",
    		ring2="Defending ring",
    		ring1="Haoma's Ring",
    		back="Umbra cape",
    		waist="Fucho-no-Obi",
    		legs="Assid. Pants +1",
    		feet="Serpentes Sabots"}
    
    	sets.defense.MDT = {		
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Befouled crown",
    		neck="Loricate torque +1",
    		ear1="Moonshade Earring",
    		ear2="Nourishing earring +1",
    		body="Ebers bliaud +1", --temp--
    		hands="Serpentes Cuffs",
    		ring2="Defending ring",
    		ring1="Haoma's Ring",
    		back="Umbra cape",
    		waist="Fucho-no-Obi",
    		legs="Assid. Pants +1",
    		feet="Serpentes Sabots"}
    
    	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
    	
    	-- Basic set for if no TP weapon is defined.
    	sets.engaged = {		
    		main="Queller rod",
    		sub="Genbu's shield",
    		ammo="Homiliary",
    		head="Befouled crown",
    		neck="Loricate torque +1",
    		ear1="Glorious Earring",
    		ear2="Moonshade Earring",
    		body="Ebers bliaud +1", --temp--
    		hands="Gende. gages +1",
    		ring2="Defending ring",
    		ring1="Gelatinous ring +1",
    		back="Umbra cape",
    		waist="Fucho-no-Obi",
    		legs="Assid. Pants +1",
    		feet="Gende. galosh. +1"}
    
    
    	-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
    	sets.buff['Divine Caress'] = {hands="Ebers mitts +1",back="Mending Cape"}
    	
    	-- Miscellaneous --
    	sets.warpring = {ring2="Warp ring"}
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- Job-specific hooks that are called to process player actions at specific points in time.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
    -- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
    function job_precast(spell, action, spellMap, eventArgs)
    	
    	
    	local map = spell_maps[spell.en]
     
        if map == 'Cure' and player.sub_job == "SCH" and not buffactive.Aurorastorm then
            add_to_chat(123,'Aurorastorm not active.')
    		windower.play_sound('C:\\Users\\Shirley\\Documents\\Windower4\\addons\\GearSwap\\data\\wav\\Chime.wav')
        end
    	
    	if map == 'Curaga' and player.sub_job == "SCH" and not buffactive.Aurorastorm then
            add_to_chat(123,'Aurorastorm not active.')
    		windower.play_sound('C:\\Users\\Shirley\\Documents\\Windower4\\addons\\GearSwap\\data\\wav\\Chime.wav')
        end
    	
    	if spell.skill == 'Healing Magic' then
    		gear.default.obi_back = "Mending Cape"
    		gear.default.obi_waist = "Pythia sash"
    	else
    		gear.default.obi_waist = "Eschan stone"
    		gear.default.obi_back = "Toro Cape"
    	end
    
    	if state.Buff[spell.english] ~= nil then
    		state.Buff[spell.english] = true
    	end
    end
    
    function job_post_midcast(spell, action, spellMap, eventArgs)
    	-- Apply Divine Caress boosting items as highest priority over other gear, if applicable.
    	if spellMap == 'StatusRemoval' and buffactive['Divine Caress'] then
    		equip(sets.buff['Divine Caress'])
    	end
    end
    
    
    -- Return true if we handled the aftercast work.  Otherwise it will fall back
    -- to the general aftercast() code in Mote-Include.
    function job_aftercast(spell, action, spellMap, eventArgs)
    	if state.Buff[spell.english] ~= nil then
    		state.Buff[spell.english] = not spell.interrupted or buffactive[spell.english]
    	end
    end
    
    
    -------------------------------------------------------------------------------------------------------------------
    -- Customization hooks for idle and melee sets, after they've been automatically constructed.
    -------------------------------------------------------------------------------------------------------------------
    
    -- 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') and player.status == 'Engaged' then
    			return "CureMelee"
    		elseif default_spell_map == 'Cure' and state.Buff['Afflatus Solace'] then
    			return "CureSolace"
    		elseif spell.skill == "Enfeebling Magic" then
    			if spell.type == "WhiteMagic" then
    				return "MndEnfeebles"
    			else
    				return "IntEnfeebles"
    			end
    		end
    	end
    end
    
    
    function customize_idle_set(idleSet)
        if player.mpp < 51 then
            idleSet = set_combine(idleSet, sets.latent_refresh)
        end
    	return idleSet
    end
    
    
    -------------------------------------------------------------------------------------------------------------------
    -- General hooks for other 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 state.Buff[buff] ~= nil then
    		state.Buff[buff] = gain
    	end
    end
    
    
    -------------------------------------------------------------------------------------------------------------------
    -- User code that supplements self-commands.
    -------------------------------------------------------------------------------------------------------------------
    
    -- Called by the 'update' self-command.
    function job_update(cmdParams, eventArgs)
    	if cmdParams[1] == 'user' then
    		local needsArts = 
    			player.sub_job:lower() == 'sch' and
    			not buffactive['Light Arts'] and
    			not buffactive['Addendum: White'] and
    			not buffactive['Dark Arts'] and
    			not buffactive['Addendum: Black']
    			
    		if not buffactive['Afflatus Solace'] and not buffactive['Afflatus Misery'] then
    			if needsArts then
    				send_command('@input /ja "Afflatus Solace" <me>;wait 1.2;input /ja "Light Arts" <me>')
    			else
    				send_command('@input /ja "Afflatus Solace" <me>')
    			end
    		end
    	end
    end
    
    -- 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
    
    -- Handle notifications of general user state change.
    function job_state_change(stateField, newValue, oldValue)
    	if stateField == 'OffenseMode' then
    		if newValue == 'Normal' then
    			disable('main','sub')
    		else
    			enable('main','sub')
    		end
    	elseif stateField == 'Reset' then
    		if state.OffenseMode == 'None' then
    			enable('main','sub')
    		end
    	end
    end
    
    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 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
    
    -- Gets the current number of available strategems based on the recast remaining
    -- and the level of the sch.
    function get_current_strategem_count()
        -- returns recast in seconds.
        local allRecasts = windower.ffxi.get_ability_recasts()
        local stratsRecast = allRecasts[231]
    
        local maxStrategems = 2
    
        local fullRechargeTime = 2*110
    
        local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
    
        return currentCharges
    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)
    	local defenseString = ''
    	if state.Defense.Active then
    		local defMode = state.Defense.PhysicalMode
    		if state.Defense.Type == 'Magical' then
    			defMode = state.Defense.MagicalMode
    		end
    
    		defenseString = 'Defense: '..state.Defense.Type..' '..defMode..', '
    	end
    	
    	local meleeString = ''
    	if state.OffenseMode == 'Normal' then
    		meleeString = 'Melee: Weapons locked, '
    	end
    
    	add_to_chat(122,'Casting ['..state.CastingMode..'], '..meleeString..'Idle ['..state.IdleMode..'], '..defenseString..
    		'Kiting: '..on_off_names[state.Kiting])
    
    	eventArgs.handled = true
    end
    
    -------------------------------------------------------------------------------------------------------------------
    -- Utility functions specific to this job.
    -------------------------------------------------------------------------------------------------------------------


    Hmmm, I've taken a look at the unload function in my blu.lua, which doesn't use mote include. I know the function works because the itemizer code executes that puts away my gear. The unbinds, however, are not working! Here is the relevant code. I'm getting more and more lost as to what my problem is; "//unbind @t" works ingame but something's going wrong here.

    Code:
    send_command('bind @t input /echo Test code for windowskey + t')
    
    function file_unload()
        if binds_on_unload then
            binds_on_unload()
        end
    	send_command('unbind @t')
    	send_command('unbind !%numpad.')
    	send_command('unbind ^%numpad.')
    --<itemizer>--
    -- Satchel --
    send_command('input //put "Hippo. socks +1" satchel')
    -- Sack
    send_command('input //put "Tempered cape +1" sack')
    -- Case --
    send_command('input //put "Tanmogayi +1" case')
    send_command('input //put "Vampirism" case')
    send_command('input //put "Colada" case')
    --</itemizer--
    end

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

    Quote Originally Posted by Roland_J View Post
    Hmm, that's not working for me either I'll put below the two functions I've tried. I simplified the code as far as making the results easily visible ingame. If the unloads work an /echo will display; it never displays.
    i wonder if gearswaps send_command is broken???

    varify that the function is running with(print directly to windower console)
    print("Test")
    then try the windower command directly
    windower.send_command('input /echo Test unload code')

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

    I believe that gearswap's send_command is fine as I use it for assigning all of my binds. The binds get assigned and function fine. I just can't unbind them at the moment.

    Is the "if binds_on_unload then binds_on_unload()" code any good? I don't remember where I found that code but I think it was intact in one of the job.luas that I found and so I've always included it in the function ever since. I'm not sure what it even does.

    I'd run that print test for you but I don't know how to activate that test mode. Please check my post previous to this one; I added a portion on how the unload code in my blu.lua is functioning in a strange way.

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

    Quote Originally Posted by Roland_J View Post
    I believe that gearswap's send_command is fine as I use it for assigning all of my binds. The binds get assigned and function fine. I just can't unbind them at the moment.

    Is the "if binds_on_unload then binds_on_unload()" code any good? I don't remember where I found that code but I think it was intact in one of the job.luas that I found and so I've always included it in the function ever since. I'm not sure what it even does.

    I'd run that print test for you but I don't know how to activate that test mode. Please check my post previous to this one; I added a portion on how the unload code in my blu.lua is functioning in a strange way.
    yes this code is correct
    Code:
    if binds_on_unload then
        binds_on_unload()
    end
    but if you want to varify that it goes past that run a test like
    Code:
    function file_unload()
        print("file_unload function start")
        if binds_on_unload then
            print("binds_on_unload start")
            binds_on_unload()
            print("binds_on_unload end")
        end
        print("file_unload function end")
    end
    if you do not see eather test1 or test2 then the functions is not running
    if you see test1 but not test2 in the windower console then that would be ware its getting stuck(should also show an geaswap error in the console)
    if you see both test1 and test2 then its fine

    this is a basic way to find logic bugs in every language

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

    I see what was probably causing most of my problem. "//gs l otherjob.lua" does not count as an unload of the currentjob.lua D: Testing these unload functions while changing jobs in my MH is providing successful unload code. lol, I figured from the start that I was just doing something silly >< I just had to figure out what it was

    Thanks for all the help dlsmd ^^

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

    Quote Originally Posted by Roland_J View Post
    I see what was probably causing most of my problem. "//gs l otherjob.lua" does not count as an unload of the currentjob.lua D: Testing these unload functions while changing jobs in my MH is providing successful unload code. lol, I figured from the start that I was just doing something silly >< I just had to figure out what it was

    Thanks for all the help dlsmd ^^
    im glad it works
    and np

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

    I'm trying to include Mote-TreasureHunter.lua in my blu.lua. In the help text at the top of that .lua mote states "Place this in ... get_sets() function if your job file isn't based on my includes." My blu.lua isn't based at all on mote's files and so I'm putting it in my get_sets().

    What happens when I try to load the blu.lua with "include('Mote-TreasureHunter')" in the get_sets() is that the following error message appears.

    "...dower4\/addons/GearSwap/libs/Mote-TreasureHunter.lua:45: attempt to call global 'M' (a nil value)"

    Hmmm.... idk lol. I deleted the M and then it moved on to call an error on line 52 of the TH lua. I can't keep deleting stuff else I'll prob break the lua. (deleting the M probably broke it too lol)

    Also, does the length of my job.lua and everything "include('ed in it')" contribute very greatly to the stability and/or strain put on my computer by ffxi? My blu.lua is 1200 lines, 54,999 characters, but that's prob comparable to other luas once you add up all the lines and characters added to a .lua by include('Mote-Include.lua'). My laptop is pretty weak and sometimes ffxi gets pretty unstable. I wonder if it's sometimes because of gearswap.

  16. #5056
    trv
    trv is offline
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    Code:
    include 'Modes'

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

    Quote Originally Posted by Roland_J View Post
    I'm trying to include Mote-TreasureHunter.lua in my blu.lua. In the help text at the top of that .lua mote states "Place this in ... get_sets() function if your job file isn't based on my includes." My blu.lua isn't based at all on mote's files and so I'm putting it in my get_sets().

    What happens when I try to load the blu.lua with "include('Mote-TreasureHunter')" in the get_sets() is that the following error message appears.

    "...dower4\/addons/GearSwap/libs/Mote-TreasureHunter.lua:45: attempt to call global 'M' (a nil value)"

    Hmmm.... idk lol. I deleted the M and then it moved on to call an error on line 52 of the TH lua. I can't keep deleting stuff else I'll prob break the lua. (deleting the M probably broke it too lol)
    use include('Mote-SelfCommands')
    and change your selfcommand to job_self_command(commandArgs, eventArgs

    ofcorse you need to put TreasureHunter back to normal

    Quote Originally Posted by Roland_J View Post
    Also, does the length of my job.lua and everything "include('ed in it')" contribute very greatly to the stability and/or strain put on my computer by ffxi? My blu.lua is 1200 lines, 54,999 characters, but that's prob comparable to other luas once you add up all the lines and characters added to a .lua by include('Mote-Include.lua'). My laptop is pretty weak and sometimes ffxi gets pretty unstable. I wonder if it's sometimes because of gearswap.
    my include has everything below not including job file(the one that holds your gear per job) so i dont think you should have an issue (it will just use more memory)
    my comp is a dual core 2.9 ghz with 6 gigs of ram and can over heat fast(stupid HP)

    characters: 105879

    lines: 2325

    files: 19 +/- (this is because you can turn on and off parts at will and it removes them from memory)

    size: 116 KB

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

    I've tried adding both

    include('Modes')
    include('Mote-SelfCommands')
    include('Mote-TreasureHunter')

    and

    include('Modes.lua')
    include('Mote-SelfCommands.lua')
    include('Mote-TreasureHunter.lua')

    and I changed my

    function self_commands() to function job_self_command(commandArgs, eventArgs)

    and it still gives me the error "...dower4\/addons/GearSwap/libs/Mote-TreasureHunter.lua:45: attempt to call global 'M' (a nil value)"

    I've discussed this with dlsmd in PMs and we're out of ideas. Does anyone else know what I need to do? Thanks!

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

    Can anyone tell me what to add to my gearswaps to make Trust magic work with my precast/midcast rules? Appreciate it.

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

    Quote Originally Posted by Skeelo View Post
    Can anyone tell me what to add to my gearswaps to make Trust magic work with my precast/midcast rules? Appreciate it.
    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.

Page 253 of 302 FirstFirst ... 203 243 251 252 253 254 255 263 ... LastLast

Similar Threads

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