LUA Syntax

Langues: JP EN DE FR
users online
Forum » Windower » Support » LUA Syntax
LUA Syntax
Offline
Posts: 281
By Galkapryme 2019-07-11 08:32:37
Link | Citer | R
 
Generally speaking, lua files have OffenseMode, DefenceMode, HybridMode, IdleMode...those appear to be staple across all files. But I'm starting to play RDM, and it has the ability to be frontline or backline (swords or Staff). Can I change the syntax from OffenseMode/DefenseMode to FrontlineMode/BacklineMode? Or will the game only recognize Offense and Defense?
 Asura.Sechs
Offline
Serveur: Asura
Game: FFXI
user: Akumasama
Posts: 9876
By Asura.Sechs 2019-07-11 09:13:17
Link | Citer | R
 
I suspect what you're talking about has very little to do with "LUA syntax" in general, and more specifically to Motenten (and derived) lua files.
[+]
 Shiva.Arislan
Offline
Serveur: Shiva
Game: FFXI
user: Arislan
Posts: 1052
By Shiva.Arislan 2019-07-11 09:52:25
Link | Citer | R
 
Mote default mode labels are hard-coded and should not be modified.

Also, you need to explain what you're trying to achieve here. OffenseMode in mote's just modifies melee accuracy states. As long as you don't specify weapons in your melee sets (or lock your weapons), the acc swaps will work no matter if you're using swords or staves or whatever.
 Quetzalcoatl.Orestes
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Orestes78
Posts: 430
By Quetzalcoatl.Orestes 2019-07-11 09:58:30
Link | Citer | R
 
I think you should consider how these play styles differ, and what you are trying to achieve. When using a sword you'll be making use of sets.engaged, and the various OffenseModes will be applicable.

When you're performing a back line role, using a staff, etc. You likely will not be engaged, so you'll be relying on sets.idle, sets.precast.FC, and various midcast sets for your spells.

The lua should be setup fine to handle both roles without changing anything, but if you do want to differentiate between them I would suggest simplifying OffenseMode to "Normal" and "Melee". I do this with RNG and COR, but the only reason I do this is because ranged jobs typically engage their target from a distance. I like to have defensive stats in sets.engaged for this.
Offline
Posts: 281
By Galkapryme 2019-07-11 09:59:44
Link | Citer | R
 
What I am trying to do in a nutshell is to be able to swap out frontline acc/attk gear for backline MAB gear at the touch of a macro. That would include main and sub weapons. For example, even when using backline weapons, my regen spell swaps my staff for the Bolebunga club (or however it's spelled).

Shiva.Arislan said: »
Mote default mode labels are hard-coded and should not be modified.

Also, you need to explain what you're trying to achieve here. OffenseMode in mote's just modifies melee accuracy states. As long as you don't specify weapons in your melee sets (or lock your weapons), the acc swaps will work no matter if you're using swords or staves or whatever.
Offline
Posts: 281
By Galkapryme 2019-07-11 10:01:08
Link | Citer | R
 
Also, would these work since they are spells and not JAs?
Code
-- Precast Sets
    
    -- Precast sets to enhance JAs and Spells
    sets.precast.JA['Chainspell'] = body={ name="Viti. Tabard +1", augments={'Enhances "Chainspell" effect',}}
	sets.precast['Phalanx II'] = hands={ name="Viti. Gloves +1", augments={'Enhances "Phalanx II" effect',}}
	sets.precast['Paralyze II'] = feet={ name="Vitiation Boots +1", augments={'Enhances "Paralyze II" effect',}},
    sets.precast['Dia III'] = head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}}
	sets.precast['Slow II'] = head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}}
	sets.precast['Bio III'] = legs={ name="Viti. Tights +1", augments={'Enhances "Bio III" effect','Enhances "Blind II" effect',}}
	sets.precast['Blind II'] = legs={ name="Viti. Tights +1", augments={'Enhances "Bio III" effect','Enhances "Blind II" effect',}}
 Quetzalcoatl.Orestes
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Orestes78
Posts: 430
By Quetzalcoatl.Orestes 2019-07-11 10:05:35
Link | Citer | R
 
Galkapryme said: »
What I am trying to do in a nutshell is to be able to swap out frontline acc/attk gear for backline MAB gear at the touch of a macro. That would include main and sub weapons. For example, even when using backline weapons, my regen spell swaps my staff for the Bolebunga club (or however it's spelled).

Shiva.Arislan said: »
Mote default mode labels are hard-coded and should not be modified.

Also, you need to explain what you're trying to achieve here. OffenseMode in mote's just modifies melee accuracy states. As long as you don't specify weapons in your melee sets (or lock your weapons), the acc swaps will work no matter if you're using swords or staves or whatever.

Ah, ok I see. You are misunderstanding how MAB and MACC are applied. When you cast a spell, you'll equip sets.precast.FC (a set with all your fast cast gear), and gearswap will equip a "midcast" set very quickly for your offensive, and accuracy stats to be applied when the spell lands. The thing to understand here, is that after the spell is cast, you will go right back into your idle set.

There is no reason to wear MAB or MACC gears for more than the split second gearswap equips them. You'll understand this much better if you go outside of town and cast a few spells with //gs showswaps
 Quetzalcoatl.Orestes
Offline
Serveur: Quetzalcoatl
Game: FFXI
user: Orestes78
Posts: 430
By Quetzalcoatl.Orestes 2019-07-11 10:06:36
Link | Citer | R
 
Galkapryme said: »
Also, would these work since they are spells and not JAs?
Code
-- Precast Sets
    
    -- Precast sets to enhance JAs and Spells
    sets.precast.JA['Chainspell'] = body={ name="Viti. Tabard +1", augments={'Enhances "Chainspell" effect',}}
	sets.precast['Phalanx II'] = hands={ name="Viti. Gloves +1", augments={'Enhances "Phalanx II" effect',}}
	sets.precast['Paralyze II'] = feet={ name="Vitiation Boots +1", augments={'Enhances "Paralyze II" effect',}},
    sets.precast['Dia III'] = head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}}
	sets.precast['Slow II'] = head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}}
	sets.precast['Bio III'] = legs={ name="Viti. Tights +1", augments={'Enhances "Bio III" effect','Enhances "Blind II" effect',}}
	sets.precast['Blind II'] = legs={ name="Viti. Tights +1", augments={'Enhances "Bio III" effect','Enhances "Blind II" effect',}}

Precast is not where you put stats that enhance spells. This is how JA's are handled, but not spells. sets.precast is for fast cast only for the most part. Hopefully my previous post clarifies this enough.
Offline
Posts: 281
By Galkapryme 2019-07-11 10:32:06
Link | Citer | R
 
Oh yes...I get that part. However, my melee set for RDM includes swords whereas my magic set would include staves and clubs. Obviously, if I am meleeing, I don't want to swap out my main weapons as I would be building TP. However, if I get in a party that needs me for backline support, I would be using staves and clubs. I think the best thing for me to do is to not include main and sub in my lua files. The only time they really change is when I am either casting Regen (which is rare for a RDM when a WHM/SCH can do it better), or when I am resting using the Boonwell staff (which I don't HAVE to do).

Quetzalcoatl.Orestes said: »
Galkapryme said: »
What I am trying to do in a nutshell is to be able to swap out frontline acc/attk gear for backline MAB gear at the touch of a macro. That would include main and sub weapons. For example, even when using backline weapons, my regen spell swaps my staff for the Bolebunga club (or however it's spelled).

Shiva.Arislan said: »
Mote default mode labels are hard-coded and should not be modified.

Also, you need to explain what you're trying to achieve here. OffenseMode in mote's just modifies melee accuracy states. As long as you don't specify weapons in your melee sets (or lock your weapons), the acc swaps will work no matter if you're using swords or staves or whatever.

Ah, ok I see. You are misunderstanding how MAB and MACC are applied. When you cast a spell, you'll equip sets.precast.FC (a set with all your fast cast gear), and gearswap will equip a "midcast" set very quickly for your offensive, and accuracy stats to be applied when the spell lands. The thing to understand here, is that after the spell is cast, you will go right back into your idle set.

There is no reason to wear MAB or MACC gears for more than the split second gearswap equips them. You'll understand this much better if you go outside of town and cast a few spells with //gs showswaps
Offline
Posts: 1186
By Boshi 2019-07-11 10:39:50
Link | Citer | R
 
just have a weapon lock toggle
[+]
Offline
Posts: 281
By Galkapryme 2019-07-11 10:49:43
Link | Citer | R
 
Kindly review for accuracy or improvements. I have only modified based on the gear I have (just starting out playing RDM after Abyssea). I'm more or less looking to make sure I have everything configured such that they will activate correctly. The file loads correctly in game.
Code
-- Define sets and vars used by this job file.
function init_gear_sets()
    --------------------------------------
    -- Start defining the sets
    --------------------------------------
    
    -- Precast Sets
    
    -- Precast sets to enhance JAs and Spells
    sets.precast.JA['Chainspell'] = {body="Viti. Tabard +1"}


    -- Waltz set (chr and vit)
    sets.precast.Waltz = {
        head="Atrophy Chapeau +1",
        body="Atrophy Tabard +1",hands="Yaoyotl Gloves",
        back="Refraction Cape",legs="Hagondes Pants",feet="Hagondes Sabots"}
        
    -- Don't need any special gear for Healing Waltz.
    sets.precast.Waltz['Healing Waltz'] = {}

    -- Fast cast sets for spells
    
    -- 80% Fast Cast (including trait) for all spells, plus 5% quick cast
    -- No other FC sets necessary.
    sets.precast.FC = {
	ammo="Impatiens",
    head={ name="Amalric Coif", augments={'INT+10','Mag. Acc.+20','Enmity-5',}}, -- FC 10%
    body={ name="Viti. Tabard +1", augments={'Enhances "Chainspell" effect',}}, -- FC 13%
    hands={ name="Chironic Gloves", augments={'Mag. Acc.+21 "Mag.Atk.Bns."+21','"Cure" spellcasting time -8%','Mag. Acc.+14',}},
    legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Mag. crit. hit dmg. +2%','CHR+4','Mag. Acc.+8','"Mag.Atk.Bns."+13',}},
    feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}}, -- FC 5%
    neck="Dls. Torque +2",
    waist="Witful Belt",
    left_ear="Loquac. Earring",
    right_ear="Enchntr. Earring +1", -- FC 2%
    left_ring="Kishar Ring", -- FC 4%
    right_ring="Lebeche Ring",
    back={ name="Sucellos's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Fast Cast"+10',}}, -- FC 10%
	}

    sets.precast.FC.Impact = set_combine(sets.precast.FC, {head=empty,body="Twilight Cloak"})
       
    -- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {
	ammo="Ginsen",
    head="Jhakri Coronal +1",
    body="Jhakri Robe +2",
    hands={ name="Chironic Gloves", augments={'Accuracy+25','Weapon Skill Acc.+9','STR+10',}},
    legs="Jhakri Slops +2",
    feet="Jhakri Pigaches +1",
    neck="Fotia Gorget",
    waist="Fotia Belt",
    left_ear="Cessance Earring",
    right_ear="Ishvara Earring",
    left_ring="Rufescent Ring",
    right_ring="Chirich Ring +1",
    back="Vespid Mantle",
}

    -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
    sets.precast.WS['Requiescat'] = sets.precast.ws

    sets.precast.WS['Sanguine Blade'] = sets.precast.ws

    
    -- Midcast Sets
    
    sets.midcast.FastRecast = {
	ammo="Impatiens",
    head={ name="Amalric Coif", augments={'INT+10','Mag. Acc.+20','Enmity-5',}}, -- FC 10%
    body={ name="Viti. Tabard +1", augments={'Enhances "Chainspell" effect',}}, -- FC 13%
    hands={ name="Chironic Gloves", augments={'Mag. Acc.+21 "Mag.Atk.Bns."+21','"Cure" spellcasting time -8%','Mag. Acc.+14',}},
    legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Mag. crit. hit dmg. +2%','CHR+4','Mag. Acc.+8','"Mag.Atk.Bns."+13',}},
    feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}}, -- FC 5%
    neck="Dls. Torque +2",
    waist="Witful Belt",
    left_ear="Loquac. Earring",
    right_ear="Enchntr. Earring +1", -- FC 2%
    left_ring="Kishar Ring", -- FC 4%
    right_ring="Lebeche Ring",
    back={ name="Sucellos's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Fast Cast"+10',}}, -- FC 10%
}

    sets.midcast.Cure = {
	ammo="Dosis Tathlum",
    head={ name="Kaykaus Mitra", augments={'MP+60','Spell interruption rate down +10%','"Cure" spellcasting time -5%',}},
    body={ name="Kaykaus Bliaut +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
    hands={ name="Kaykaus Cuffs", augments={'MP+60','MND+10','Mag. Acc.+15',}},
    legs={ name="Carmine Cuisses", augments={'MP+60','INT+10','MND+10',}},
    feet={ name="Kaykaus Boots", augments={'MP+56','Spell interruption rate down +10%','"Cure" spellcasting time -5%',}},
    neck="Dls. Torque +2",
    waist="Ovate Rope",
    left_ear="Beatific Earring",
    right_ear="Roundel Earring",
    left_ring="Janniston Ring",
    right_ring="Menelaus's Ring",
    back="Pahtli Cape",}
        
    sets.midcast.Curaga = sets.midcast.Cure
    

    sets.midcast['Enhancing Magic'] = {
	ammo="Staunch Tathlum",
    head="Umuthi Hat",
    body={ name="Viti. Tabard +1", augments={'Enhances "Chainspell" effect',}},
    hands={ name="Viti. Gloves +1", augments={'Enhances "Phalanx II" effect',}},
    legs="Carmine Cuisses",
    feet={ name="Kaykaus Boots", augments={'MP+56','Spell interruption rate down +10%','"Cure" spellcasting time -5%',}},
    neck="Dls. Torque +2",
    waist="Siegel Sash",
    left_ear="Lifestorm Earring",
    right_ear="Psystorm Earring",
    left_ring="Stikini Ring +1",
    right_ring="Stikini Ring +1",
    back={ name="Sucellos's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Fast Cast"+10',}},}

    sets.midcast.Refresh = set_combine(sets.midcast['Enhancing Magic'], {head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}},body="Jhakri Robe +2",legs="Lengo Pants"})
	sets.midcast.Aquaveil = set_combine(sets.midcast['Enhancing Magic'], {head={ name="Amalric Coif", augments={'INT+10','Mag. Acc.+20','Enmity-5',}},})

    sets.midcast.Regen = set_combine(sets.midcast['Enhancing Magic'], {back="Kumbira Cape"})
    
    sets.midcast['Enfeebling Magic'] = {
	ammo="Quartz Tathlum +1",
    head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}},
    body={ name="Amalric Doublet +1", augments={'MP+80','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
    hands={ name="Kaykaus Cuffs", augments={'MP+60','MND+10','Mag. Acc.+15',}},
    legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Mag. crit. hit dmg. +2%','CHR+4','Mag. Acc.+8','"Mag.Atk.Bns."+13',}},
    feet={ name="Vitivation Boots +1", augments={'Enhances "Paralyze II" effect'}},
    neck="Dls. Torque +2",
    waist="Rumination Sash",
    left_ear="Crematio Earring",
    right_ear="Friomisi Earring",
    left_ring="Kishar Ring",
    right_ring="Stikini Ring +1",
    back={ name="Sucellos's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Fast Cast"+10',}},}

    sets.midcast['Dia III'] = set_combine(sets.midcast['Enfeebling Magic'], {head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}},})

    sets.midcast['Slow II'] = set_combine(sets.midcast['Enfeebling Magic'], {head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}},})
	
	sets.midcast["Paralyze II"] = set_combine(sets.midcast['Enfeebling Magic'], {feet={ name="Vitivation Boots +1", augments={'Enhances "Paralyze II" effect'}},})
    
    sets.midcast['Elemental Magic'] = {
	main="Naegling",
	sub={ name="Emissary", augments={'Mag. Acc.+15','"Mag.Atk.Bns."+20','"Refresh"+1',}},
	ammo="Dosis Tathlum",
    head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+25','"Drain" and "Aspir" potency +4','CHR+14','Mag. Acc.+6',}},
    body={ name="Amalric Doublet +1", augments={'MP+80','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
    hands={ name="Amalric Gages +1", augments={'MP+80','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
    legs={ name="Merlinic Shalwar", augments={'Mag. Acc.+24 "Mag.Atk.Bns."+24','Mag. crit. hit dmg. +2%','CHR+4','Mag. Acc.+8','"Mag.Atk.Bns."+13',}},
    feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
    neck="Dls. Torque +2",
    waist="Refoccilation Stone",
    left_ear="Crematio Earring",
    right_ear="Friomisi Earring",
    left_ring="Stikini Ring +1",
    right_ring="Jhakri Ring",
    back={ name="Sucellos's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Fast Cast"+10',}},	
}

	sets.midcast['Dark Magic'] = {
	main="Naegling",
	sub={ name="Emissary", augments={'Mag. Acc.+15','"Mag.Atk.Bns."+20','"Refresh"+1',}},
    ammo="Impatiens",
    head={ name="Merlinic Hood", augments={'"Mag.Atk.Bns."+25','"Drain" and "Aspir" potency +4','CHR+14','Mag. Acc.+6',}},
    body={ name="Merlinic Jubbah", augments={'"Mag.Atk.Bns."+19','"Drain" and "Aspir" potency +7','CHR+3','Mag. Acc.+14',}},
    hands={ name="Chironic Gloves", augments={'"Drain" and "Aspir" potency +4','CHR+1','Mag. Acc.+9 "Mag.Atk.Bns."+9',}},
    legs={ name="Amalric Slops +1", augments={'INT+12','Elem. magic skill +20','Dark magic skill +20',}},
    feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
    neck="Erra Pendant",
    waist="Austerity Belt +1",
    left_ear="Crematio Earring",
    right_ear="Friomisi Earring",
    left_ring="Fenrir Ring +1",
    right_ring="Fenrir Ring +1",
    back="Perimede Cape",
	}
        
    sets.midcast.Impact = set_combine(sets.midcast['Elemental Magic'], {head=empty,body="Twilight Cloak"})

    sets.midcast['Bio III'] = set_combine(sets.midcast['Elemental Magic'], {legs={ name="Viti. Tights +1", augments={'Enhances "Bio III" effect','Enhances "Blind II" effect',}},})
	
	sets.midcast['Blind II'] = set_combine(sets.midcast['Enfeebling Magic'], {legs={ name="Viti. Tights +1", augments={'Enhances "Bio III" effect','Enhances "Blind II" effect',}},})

    --sets.midcast.Stun = set_combine(sets.midcast['Dark Magic'], {})

    sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {main={ name="Rubicundity", augments={'Mag. Acc.+8','"Mag.Atk.Bns."+9','Dark magic skill +8','"Conserve MP"+6',}},
    sub="Ammurapi Shield"})

    sets.midcast.Aspir = sets.midcast.Drain


    -- Sets for special buff conditions on spells.

    sets.midcast.EnhancingDuration = {hands="Atrophy Gloves +1",back="Estoqueur's Cape",feet="Estoqueur's Houseaux +2"}
	sets.midcast.RegenDuration = set_combine(sets.midcast.Regen, {body="Telchine Chasuble"})
        
    sets.buff.ComposureOther = {head="Estoqueur's Chappel +2",
        body="Estoqueur's Sayon +2",hands="Estoqueur's Gantherots +2",
        legs="Estoqueur's Fuseau +2",feet="Estoqueur's Houseaux +2"}

    sets.buff.Saboteur = {hands="Estoqueur's Gantherots +2"}
    

    -- Sets to return to when not performing an action.
    
    -- Resting sets
    sets.resting = {
	ammo="Mana Ampulla",
    head={ name="Viti. Chapeau +1", augments={'Enhances "Dia III" effect','Enhances "Slow II" effect',}},
    body="Jhakri Robe +2",
    hands={ name="Amalric Gages +1", augments={'MP+80','Mag. Acc.+20','"Mag.Atk.Bns."+20',}},
    legs={ name="Lengo Pants", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15','"Refresh"+1',}},
    feet={ name="Amalric Nails", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
    neck="Eidolon Pendant +1",
    waist="Austerity Belt +1",
    left_ear="Sylph Earring",
    right_ear="Brachyura Earring",
    left_ring="Stikini Ring +1",
    right_ring="Stikini Ring +1",
    back="Felicitas Cape +1",
}
    

    -- Idle sets
    sets.idle = {}

    sets.idle.Town = {body="Councilor's Garb",legs="Carmine Cuisses"}
    
    sets.idle.Weak = {}

    sets.idle.PDT = {}

    sets.idle.MDT = {}
    
Offline
Posts: 233
By cuddlyhamster 2019-07-11 12:32:57
Link | Citer | R
 
your refresh and regen sets are incorrect. Refresh +# gives refresh on tick, Refresh Potency +# affects how much your spell Refresh gives when cast on a player. Same deal with Regen. dunno how much regen gear rdm gets, but focus on potency over duration.
Offline
Posts: 281
By Galkapryme 2019-07-11 13:55:37
Link | Citer | R
 
I'm not too concerned about Regen, as I pretty much never use it. Please provide a better setup for Refresh, and if I have the gear, I'll work it into the set. Currently, I do not have iLevel Empy gear; working on that.
 Bismarck.Xurion
Offline
Serveur: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2019-07-12 02:03:06
Link | Citer | R
 
Galkapryme said: »
Please provide a better setup for Refresh, and if I have the gear, I'll work it into the set.
I'd suggest you visit the other forums for job-specific gear advice.
Log in to post.