Gearswap Support Thread

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 44 45 46 ... 181 182 183
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2014-12-22 12:48:52
Link | Quote | Reply
 
Ragnarok.Worldslost said: »
Cons I never got that cure rule to work for blu I'm still tinkering but I have a new question?! I've seen people make a rule to have a event reoccur constantly so is it possible to have a dart spam rule so it recast whenever possible and only stops to rebuff haste atk boost and if I could do it can I included a off switch, sort of like have rng have a addon that let's them auto shoot exactly how ppl auto swing.. (I almost out parsed a rng, I lost by 8% on D avatar fights. My fingers where hurting from the spam and I kept losing time trying to watch buffs)

Just alter the AutoRA programme from /ra <t> to /ma "Dart" <t>.

~
Offline
Posts: 516
By Kooljack 2014-12-23 02:03:30
Link | Quote | Reply
 
Hello,

same armor swaps based on different augments work for my armor slots but for some reason I recently tried to do the same thing for my main weapon slot; my staffs. lehbrailg +2 specifically. is it normal for the weapons to not work like the armors do? these are the lines that are not working. one for enfeebles, one for nukes.

{main={ name="Lehbrailg +2", augments={'DMG:+15','"Mag.Atk.Bns."+24','"Conserve MP"+3',}},

{main={ name="Lehbrailg +2", augments={'DMG:+16','Mag. Acc.+22','Magic crit. hit +3',}},
 Carbuncle.Sisko
Offline
Server: Carbuncle
Game: FFXI
user: siskotaru
Posts: 192
By Carbuncle.Sisko 2014-12-23 02:06:32
Link | Quote | Reply
 
I'm not lua expert, but you have 3 opened brackets and only 2 closed for each lines.
Offline
Posts: 516
By Kooljack 2014-12-23 02:09:50
Link | Quote | Reply
 
ty but that's not it. the last bracket is at the end of all the armor slots. format is the same as if it were an armor slot. i didnt include the rest of the armors but can if need
 Carbuncle.Sisko
Offline
Server: Carbuncle
Game: FFXI
user: siskotaru
Posts: 192
By Carbuncle.Sisko 2014-12-23 02:18:19
Link | Quote | Reply
 
ok.

mag.atk.bns. & conserve mp are in quotation marks but not mag.acc. & magic crit. hit in the second line

(You probably saw it already, i'm just trying to help)

Someone with more lua power will probably answer it hopefuly :)
Offline
Posts: 516
By Kooljack 2014-12-23 02:23:57
Link | Quote | Reply
 
ty, but nope. need the quotes if it's in the augments
 Asura.Darvamos
VIP
Offline
Server: Asura
Game: FFXI
user: Demmis
Posts: 234
By Asura.Darvamos 2014-12-23 04:03:22
Link | Quote | Reply
 
Kooljack said: »
Hello,

same armor swaps based on different augments work for my armor slots but for some reason I recently tried to do the same thing for my main weapon slot; my staffs. lehbrailg +2 specifically. is it normal for the weapons to not work like the armors do? these are the lines that are not working. one for enfeebles, one for nukes.

{main={ name="Lehbrailg +2", augments={'DMG:+15','"Mag.Atk.Bns."+24','"Conserve MP"+3',}},

{main={ name="Lehbrailg +2", augments={'DMG:+16','Mag. Acc.+22','Magic crit. hit +3',}},
I presuming the first { is just the start of your whole equip set if not get rid of it.
Also have you try'd using the //gs export feature. My guess is you're typing that conserve mp and magic crit rate slightly wrong. Otherwise it looks solid but I don't have any gear with those 2 augs to see how they should be typed for sure.

Closest I had was a melee crit aug: 'Crit.hit rate+4'
 Carbuncle.Sisko
Offline
Server: Carbuncle
Game: FFXI
user: siskotaru
Posts: 192
By Carbuncle.Sisko 2014-12-23 04:10:45
Link | Quote | Reply
 
last thing before I stop bothering you :) :

I looked into some lua files for some exemples.

hagondes_head_atk = {name='Hagondes Hat +1', augments={'Phys. dmg. taken -4%', 'Pet: Attack+23 Pet: Rng.Atk.+23'}}

There's a space before the first bracket but not before "name"

Your lines are probably pasted from the working armor one, so, yeah.
 Bahamut.Alexcennah
Offline
Server: Bahamut
Game: FFXI
user: digoserra
Posts: 269
By Bahamut.Alexcennah 2014-12-23 04:24:06
Link | Quote | Reply
 
Type gs export in windower console. It'll generate a lua file with your currently equipped gear, including the correct syntax for augmented pieces.
 Asura.Darvamos
VIP
Offline
Server: Asura
Game: FFXI
user: Demmis
Posts: 234
By Asura.Darvamos 2014-12-23 04:29:18
Link | Quote | Reply
 
Carbuncle.Sisko said: »
last thing before I stop bothering you :) :

I looked into some lua files for some exemples.

hagondes_head_atk = {name='Hagondes Hat +1', augments={'Phys. dmg. taken -4%', 'Pet: Attack+23 Pet: Rng.Atk.+23'}}

There's a space before the first bracket but not before "name"

Your lines are probably pasted from the working armor one, so, yeah.
That doesn't matter.
Offline
Posts: 516
By Kooljack 2014-12-23 11:53:41
Link | Quote | Reply
 
ok got it working i suppose, thanks guys. i think i screwed up and didn't have the mab staff in the midcast set and then I used the gs export thing and put it in verbatum into the enfeebling set and that worked also, only difference being augments numbers 2 & 3 were in different places heh. blehhh it works, im happy.
 Ragnarok.Worldslost
Offline
Server: Ragnarok
Game: FFXI
Posts: 82
By Ragnarok.Worldslost 2014-12-23 13:11:28
Link | Quote | Reply
 
Byrth if I wanted to add the rules from autoRA to my blu lua for just dart is it possible so it's not looking for the Addon? Also I opened the ARA lua and only replaced all instances of /ra <t> with /ma "dart" but it only fires once and stops with or with out 100TP and I'm not sure why that is.
Offline
Posts: 117
By Cleric 2014-12-23 20:01:34
Link | Quote | Reply
 
Cleric said: »
Is there a gearswap lua/script that you can use to cycle use a WS right at 100%?

Thinking it would be beneficial to have when skilling up on Uragnites... Unlock trial weaponskills/nyzul weaponskills overnight..
 Asura.Darvamos
VIP
Offline
Server: Asura
Game: FFXI
user: Demmis
Posts: 234
By Asura.Darvamos 2014-12-23 22:29:30
Link | Quote | Reply
 
Ragnarok.Worldslost said: »
Byrth if I wanted to add the rules from autoRA to my blu lua for just dart is it possible so it's not looking for the Addon? Also I opened the ARA lua and only replaced all instances of /ra <t> with /ma "dart" but it only fires once and stops with or with out 100TP and I'm not sure why that is.
Are you engaged? That addon by default is written only to ra while engaged otherwise its set to stop. There are much easier ways to setup loops for spells then editing AutoRA though... Maybe look for the lua skill up script as a start. This is in the grey area of "botting" so I won't go into anymore detail but skill up scripts seem to be ok around here.

Cleric said: »
Cleric said: »
Is there a gearswap lua/script that you can use to cycle use a WS right at 100%?

Thinking it would be beneficial to have when skilling up on Uragnites... Unlock trial weaponskills/nyzul weaponskills overnight..
Super easy to do but I doubt anyone around here will tell you how to do it. Hence why your first post was ignored.
 Ragnarok.Worldslost
Offline
Server: Ragnarok
Game: FFXI
Posts: 82
By Ragnarok.Worldslost 2014-12-24 01:57:22
Link | Quote | Reply
 
Darvamos yes I am engaged which is why I'm unsure why it's not working with the one small change, also I figured I was near the botting edge as well which is why I was trying to incorporate what's available. In truth I'm just trying to build the ultimate Blu GS profile since it's more fun than watching the moogle spin between events.
 Quetzalcoatl.Valli
Offline
Server: Quetzalcoatl
Game: FFXI
user: valli
Posts: 1420
By Quetzalcoatl.Valli 2014-12-24 10:46:51
Link | Quote | Reply
 
I've got a BASIC grasp of this ***now, but I need some help with a couple more/new things.

Can I make a ws rule if 3000%, or does that have to be done manually?
How does one make day/night/day of the week ws rules? (gavialis/tripidety/obi)
How do I add really specific ***to ws like: if madrigal, then use kuwunga earring? As in does it have to be "blade madrigal/sword madrigal"?
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2014-12-24 16:18:10
Link | Quote | Reply
 
Quetzalcoatl.Valli said: »
+

WS 3k
Code
if player.tp >2999 then
      equip sets.something


Night/daytime
Code
	if world.time >= (17*60) or world.time <= (7*60) then
		equip(sets.aftercast.night)
	else
		equip(sets.aftercast.day)
	end


Day of the week~

Create a table (not inside a rule and not in your sets)
Code
fudoDays 	= S{'Lightsday','Windsday','Lightningday','Firesday','Iceday','Watersday'}


I use this for Fudo days etc~

Rule to equip ~
Code
if fudoDays:contains(world.day) then
				add_to_chat(8, 'Weapon Day Bonus')
				equipSet = set_combine(equipSet,{head="Gavailas Helm"})


The above codes needs an "else" added in or a return depends on how you define however.

Madrigal (Checks general Buff)
Code
if buffactive.Madrigal then
		equip(sets.TP.Seigan)


as an example ~
[+]
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2014-12-24 16:22:30
Link | Quote | Reply
 
Asura.Darvamos said: »
Ragnarok.Worldslost said: »
Byrth if I wanted to add the rules from autoRA to my blu lua for just dart is it possible so it's not looking for the Addon? Also I opened the ARA lua and only replaced all instances of /ra <t> with /ma "dart" but it only fires once and stops with or with out 100TP and I'm not sure why that is.
Are you engaged? That addon by default is written only to ra while engaged otherwise its set to stop. There are much easier ways to setup loops for spells then editing AutoRA though... Maybe look for the lua skill up script as a start. This is in the grey area of "botting" so I won't go into anymore detail but skill up scripts seem to be ok around here.

Cleric said: »
Cleric said: »
Is there a gearswap lua/script that you can use to cycle use a WS right at 100%?

Thinking it would be beneficial to have when skilling up on Uragnites... Unlock trial weaponskills/nyzul weaponskills overnight..
Super easy to do but I doubt anyone around here will tell you how to do it. Hence why your first post was ignored.
Code
windower.register_event('tp change', function(tp)
	if AutoFudo == 1 then
		if not buffactive['amnesia'] then
			if player.tp > 999 and   player.status == 'Engaged' then
				windower.send_command('input /ws "Tachi: Rana" <t>')
			end
		end
	end
end


You set the toggle for AutoFudo in your sets (can make a toggle to define on/off or 1 / 0 in this instance). This is a tad greay area though on the whole automation (as you plan to do this overnight). If you're doing it overnight I assume you mean using a 3rd party tool, I'd imagine those have WS rules as they're be easy enough to impliment.


This should work, useful for dual boxing I guess.
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2014-12-24 16:24:58
Link | Quote | Reply
 
Ragnarok.Worldslost said: »
Darvamos yes I am engaged which is why I'm unsure why it's not working with the one small change, also I figured I was near the botting edge as well which is why I was trying to incorporate what's available. In truth I'm just trying to build the ultimate Blu GS profile since it's more fun than watching the moogle spin between events.

You can just copy the entire AutoRA Lua into your BLU gearswap file, and change the rules from /ra to /ma spell name <t>.
Offline
Posts: 117
By Cleric 2014-12-24 20:32:10
Link | Quote | Reply
 
Cerberus.Conagh said: »
Code
windower.register_event('tp change', function(tp)
	if AutoFudo == 1 then
		if not buffactive['amnesia'] then
			if player.tp > 999 and   player.status == 'Engaged' then
				windower.send_command('input /ws "Tachi: Rana" <t>')
			end
		end
	end
end


You set the toggle for AutoFudo in your sets (can make a toggle to define on/off or 1 / 0 in this instance). This is a tad greay area though on the whole automation (as you plan to do this overnight). If you're doing it overnight I assume you mean using a 3rd party tool, I'd imagine those have WS rules as they're be easy enough to impliment.


This should work, useful for dual boxing I guess.

Well, not really third party tool or anything.. Just planned on grabbing a trial weapon and engaging an Uragnite with 3 trusts up (Kind of like skilling up, but instead of going for the skillup, doing ws points)
 Sylph.Murex
Offline
Server: Sylph
Game: FFXI
Posts: 81
By Sylph.Murex 2014-12-27 02:02:28
Link | Quote | Reply
 
I got a real annoying problem with my GS when I cast Utsu idk if it's just when i'm in BC's or what but idk how to fix it... when I've got my gear set for ACC after casting Utsu it switches into my regular TP gear... Here is the GS(I haven't bothered filling out everything yet):

-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

--[[
Custom commands:

gs c cycle treasuremode (set on ctrl-= by default): Cycles through the available treasure hunter modes.

Treasure hunter modes:
None - Will never equip TH gear
Tag - Will equip TH gear sufficient for initial contact with a mob (either melee, ranged hit, or Aeolian Edge AOE)
SATA - Will equip TH gear sufficient for initial contact with a mob, and when using SATA
Fulltime - Will keep TH gear equipped fulltime
--]]

-- Initialization function for this job file.

function get_sets()

mote_include_version = 2

-- Load and initialize the include file.

include('Mote-Include.lua')

end


-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.

function job_setup()

state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
state.Buff['Trick Attack'] = buffactive['trick attack'] or false
state.Buff['Feint'] = buffactive['feint'] or false

include('Mote-TreasureHunter')

-- For th_action_check():

-- JA IDs for actions that always have TH: Provoke, Animated Flourish

info.default_ja_ids = S{35, 204}

-- Unblinkable JA IDs for actions that always have TH: Quick/Box/Stutter Step, Desperate/Violent Flourish

info.default_u_ja_ids = S{201, 202, 203, 205, 207}

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('Normal', 'Acc', 'Mod')
state.HybridMode:options('Normal', 'Evasion', 'PDT')
state.RangedMode:options('Normal', 'Acc')
state.WeaponskillMode:options('Normal', 'Acc', 'Mod')
state.PhysicalDefenseMode:options('Evasion', 'PDT')


gear.default.weaponskill_neck = gear.ElementalGorget
gear.default.weaponskill_waist = gear.ElementalBelt
gear.AugQuiahuiz = {name="Quiahuiz Trousers", augments={'STR+8','Phys. dmg. taken -2%','Magic dmg. taken -2%'}}

-- Additional local binds

send_command('bind ^` input /ja "Flee" <me>')
send_command('bind ^= gs c cycle treasuremode')
send_command('bind !- gs c cycle targetmode')

select_default_macro_book()

end


-- Called when this job file is unloaded (eg: job change)

function user_unload()

send_command('unbind ^`')
send_command('unbind !-')

end


-- Define sets and vars used by this job file.

function init_gear_sets()

--------------------------------------
-- Special sets (required by rules)
--------------------------------------

sets.TreasureHunter = {
hands="Plunderer's Armlets +1",
waist="Chaac Belt",
feet="Raider's Poulaines +2"}

sets.ExtraRegen = {
head="Ocelomeh Headpiece +1"}

sets.Kiting = {
feet="Skadi's Jambeaux +1"}

sets.buff['Sneak Attack'] = {
head="Pill. Bonnet +1",
neck="Moepapa Medal",
ear1="Jupiter's Pearl",
ear2="Jupiter's Pearl",
body="Pill. Vest +1",
hands="Raid. Armlets +2",
ring1="Zilant Ring",
ring2="Rajas Ring",
back="Cavaros Mantle",
waist="Artful Belt +1",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"}

sets.buff['Trick Attack'] = {
head="Pill. Bonnet +1",
neck="Moepapa Medal",
ear1="Auster's Pearl",
ear2="Auster's Pearl",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Garuda Ring +1",
ring2="Rajas Ring",
back="Canny Cape",
waist="Elanid Belt",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"}

-- Actions we want to use to tag TH.

sets.precast.Step = sets.TreasureHunter
sets.precast.Flourish1 = sets.TreasureHunter
sets.precast.JA.Provoke = sets.TreasureHunter

--------------------------------------
-- Precast sets
--------------------------------------

-- Precast sets to enhance JAs

sets.precast.JA['Collaborator'] = {
head="Raider's Bonnet +2"}

sets.precast.JA['Accomplice'] = {
head="Raider's Bonnet +2"}

sets.precast.JA['Flee'] = {
feet="Pillager's Poulaines +1"}

sets.precast.JA['Hide'] = {
body="Pillager's Vest +1"}

sets.precast.JA['Conspirator'] = {
body="Raider's Vest +2"}

sets.precast.JA['Steal'] = {
head="Plunderer's Bonnet +1",
hands="Pillager's Armlets +1",
legs="Pillager's Culottes +1",
feet="Pillager's Poulaines +1"}

sets.precast.JA['Despoil'] = {
legs="Raider's Culottes +2",
feet="Raider's Poulaines +2"}

sets.precast.JA['Perfect Dodge'] = {
hands="Plunderer's Armlets +1"}

sets.precast.JA['Feint'] = {
legs="Plun. Culottes +1"}

sets.precast.JA['Sneak Attack'] = sets.buff['Sneak Attack']

sets.precast.JA['Trick Attack'] = sets.buff['Trick Attack']


-- Waltz set (chr and vit)

sets.precast.Waltz = {
main="",
sub="",
range="",
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="Asklepian Ring",
ring2="Valseur's Ring",
back="",
waist="",
legs="",
feet=""}

-- Don't need any special gear for Healing Waltz.

sets.precast.Waltz['Healing Waltz'] = {}

-- Fast cast sets for spells

sets.precast.FC = {
head="Haruspex Hat +1",
neck="Orunmila's Torque",
ear1="Enchntr. Earring +1",
ear2="Loquac. Earring",
hands="Thaumas Gloves",
ring1="Veneficium Ring",
ring2="Prolix Ring",
legs="Enif Cosciales"}

sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})

-- Ranged snapshot gear

sets.precast.RA = {
main="",
sub="",
range="",
ammo="",
head="Zha'Go's Barbut",
neck="",
ear1="",
ear2="",
body="",
hands="Iuitl Wristbands +1",
ring1="",
ring2="",
back="",
waist="",
legs="Nahtirah Trousers",
feet="Wurrukatte Boots"}

-- Weaponskill sets

-- Default set for any weaponskill that isn't any more specifically defined

sets.precast.WS = {
head="Uk'uxkaj Cap",
neck="Shadow Gorget",
ear1="Moonshade Earring",
ear2="Jupiter's Pearl",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Zilant Ring",
ring2="Rajas Ring",
back="Vespid Mantle",
waist="Prosilio Belt +1",
legs="Manibozho Brais",
feet="Plun. Poulaines +1"}

sets.precast.WS.Acc = set_combine(sets.precast.WS, {})

-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.

sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {})

sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {})

sets.precast.WS['Exenterator'].Mod = set_combine(sets.precast.WS['Exenterator'], {})

sets.precast.WS['Exenterator'].SA = set_combine(sets.precast.WS['Exenterator'].Mod, {})

sets.precast.WS['Exenterator'].TA = set_combine(sets.precast.WS['Exenterator'].Mod, {})

sets.precast.WS['Exenterator'].SATA = set_combine(sets.precast.WS['Exenterator'].Mod, {})

sets.precast.WS['Dancing Edge'] = set_combine(sets.precast.WS, {})

sets.precast.WS['Dancing Edge'].Acc = set_combine(sets.precast.WS['Dancing Edge'], {})

sets.precast.WS['Dancing Edge'].Mod = set_combine(sets.precast.WS['Dancing Edge'], {})

sets.precast.WS['Dancing Edge'].SA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {})

sets.precast.WS['Dancing Edge'].TA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {})

sets.precast.WS['Dancing Edge'].SATA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {})

sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {})

sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {})

sets.precast.WS['Evisceration'].Mod = set_combine(sets.precast.WS['Evisceration'], {})

sets.precast.WS['Evisceration'].SA = set_combine(sets.precast.WS['Evisceration'].Mod, {})

sets.precast.WS['Evisceration'].TA = set_combine(sets.precast.WS['Evisceration'].Mod, {})

sets.precast.WS['Evisceration'].SATA = set_combine(sets.precast.WS['Evisceration'].Mod, {})

sets.precast.WS["Rudra's Storm"] = set_combine(sets.precast.WS, {
head="Uk'uxkaj Cap",
neck="Shadow Gorget",
ear1="Moonshade Earring",
ear2="Jupiter's Pearl",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Zilant Ring",
ring2="Rajas Ring",
back="Vespid Mantle",
waist="Prosilio Belt +1",
legs="Manibozho Brais",
feet="Plun. Poulaines +1"})

sets.precast.WS["Rudra's Storm"].Acc = set_combine(sets.precast.WS["Rudra's Storm"], {
head="Uk'uxkaj Cap",
neck="Shadow Gorget",
ear1="Moonshade Earring",
ear2="Jupiter's Pearl",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Zilant Ring",
ring2="Rajas Ring",
back="Vespid Mantle",
waist="Prosilio Belt +1",
legs="Manibozho Brais",
feet="Plun. Poulaines +1"})

sets.precast.WS["Rudra's Storm"].Mod = set_combine(sets.precast.WS["Rudra's Storm"], {
head="Uk'uxkaj Cap",
neck="Shadow Gorget",
ear1="Moonshade Earring",
ear2="Jupiter's Pearl",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Zilant Ring",
ring2="Rajas Ring",
back="Vespid Mantle",
waist="Prosilio Belt +1",
legs="Manibozho Brais",
feet="Plun. Poulaines +1"})

sets.precast.WS["Rudra's Storm"].SA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, {
head="Pill. Bonnet +1",
neck="Shadow Gorget",
ear1="Moonshade Earring",
ear2="Jupiter's Pearl",
body="Pill. Vest +1",
hands="Pill. Armlets +1",
ring1="Zilant Ring",
ring2="Rajas Ring",
back="Kayapa Cape",
waist="Shadow Belt",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"})

sets.precast.WS["Rudra's Storm"].TA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, {
head="Pill. Bonnet +1",
neck="Shadow Gorget",
ear1="Moonshade Earring",
ear2="Auster's Pearl",
body="Pill. Vest +1",
hands="Pill. Armlets +1",
ring1="Garuda Ring +1",
ring2="Rajas Ring",
back="Vespid Mantle",
waist="Shadow Belt",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"})

sets.precast.WS["Rudra's Storm"].SATA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, {
head="Uk'uxkaj Cap",
neck="Shadow Gorget",
ear1="Moonshade Earring",
ear2="Jupiter's Pearl",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Zilant Ring",
ring2="Rajas Ring",
back="Vespid Mantle",
waist="Prosilio Belt +1",
legs="Manibozho Brais",
feet="Plun. Poulaines +1"})

sets.precast.WS["Shark Bite"] = set_combine(sets.precast.WS, {})

sets.precast.WS['Shark Bite'].Acc = set_combine(sets.precast.WS['Shark Bite'], {})

sets.precast.WS['Shark Bite'].Mod = set_combine(sets.precast.WS['Shark Bite'], {})

sets.precast.WS['Shark Bite'].SA = set_combine(sets.precast.WS['Shark Bite'].Mod, {})

sets.precast.WS['Shark Bite'].TA = set_combine(sets.precast.WS['Shark Bite'].Mod, {})

sets.precast.WS['Shark Bite'].SATA = set_combine(sets.precast.WS['Shark Bite'].Mod, {})

sets.precast.WS['Mandalic Stab'] = set_combine(sets.precast.WS, {})

sets.precast.WS['Mandalic Stab'].Acc = set_combine(sets.precast.WS['Mandalic Stab'], {})

sets.precast.WS['Mandalic Stab'].Mod = set_combine(sets.precast.WS['Mandalic Stab'], {})

sets.precast.WS['Mandalic Stab'].SA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, {})

sets.precast.WS['Mandalic Stab'].TA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, {})

sets.precast.WS['Mandalic Stab'].SATA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, {})

sets.precast.WS['Aeolian Edge'] = {}

sets.precast.WS['Aeolian Edge'].TH = set_combine(sets.precast.WS['Aeolian Edge'], sets.TreasureHunter)

--------------------------------------
-- Midcast sets
--------------------------------------

sets.midcast.FastRecast = {
main="",
sub="",
range="",
ammo="",
head="Felistris Mask",
neck="Orunmila's Torque",
ear1="Enchntr. Earring +1",
ear2="Loquac. Earring",
body="Emet Harness +1",
hands="Thaumas Gloves",
ring1="",
ring2="Prolix Ring",
back="Mujin Mantle",
waist="Ninurta's Sssh",
legs="Enif Cosciales",
feet="Plun. Poulaines +1"}

-- Specific spells

sets.midcast.Utsusemi = {
main="",
sub="",
range="",
ammo="",
head="Felistris Mask",
neck="Orunmila's Torque",
ear1="Enchntr. Earring +1",
ear2="Loquac. Earring",
body="Emet Harness +1",
hands="Thaumas Gloves",
ring1="",
ring2="Prolix Ring",
back="Mujin Mantle",
waist="Ninurta's Sssh",
legs="Enif Cosciales",
feet="Plun. Poulaines +1"}

-- Ranged gear

sets.midcast.RA = {
main="",
sub="",
range="",
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}

sets.midcast.RA.Acc = {
main="",
sub="",
range="",
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}

--------------------------------------
-- Idle/resting/defense sets
--------------------------------------

-- Resting sets

sets.resting = {
head="Ocelomeh Headpiece +1",
neck="Wiglen Gorget",
ear1="Dawn Earring",
ring1="Sheltered Ring",
ring2="Paguroidea Ring",
waist="Lycopodium Sash",}

-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)

sets.idle = {
range="Raider's Boomerang",
head="Ocelomeh Headpiece +1",
neck="Wiglen Gorget",
ear1="Dawn Earring",
ear2="Hearty Earring",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Sheltered Ring",
ring2="Paguroidea Ring",
back="Shadow Mantle",
waist="Lycopodium Sash",
legs="Pillager's Culottes +1",
feet="Skadi's Jambeaux +1"}

sets.idle.Town = {
range="Raider's Boomerang",
head="Ocelomeh Headpiece +1",
neck="Wiglen Gorget",
ear1="Dawn Earring",
ear2="Hearty Earring",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Sheltered Ring",
ring2="Paguroidea Ring",
back="Shadow Mantle",
waist="Lycopodium Sash",
legs="Pillager's Culottes +1",
feet="Skadi's Jambeaux +1"}

sets.idle.Weak = {
range="Raider's Boomerang",
head="Ocelomeh Headpiece +1",
neck="Wiglen Gorget",
ear1="Dawn Earring",
ear2="Hearty Earring",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Sheltered Ring",
ring2="Paguroidea Ring",
back="Shadow Mantle",
waist="Lycopodium Sash",
legs="Pillager's Culottes +1",
feet="Skadi's Jambeaux +1"}

-- Defense sets

sets.defense.Evasion = {
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}

sets.defense.PDT = {
head="Lithelimb Cap",
neck="Twilight Torque",
ear1="Dudgeon Earring",
ear2="Heartseeker Earring",
body="Plunderer's Vest +1",
hands="Umuthi Gloves",
ring1="Patricius Ring",
ring2="Defending Ring",
back="Mollusca Mantle",
waist="Flume Belt +1",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"}

sets.defense.MDT = set_combine(sets.defense.PDT,{
ear1="Sanare Earring",
ear2="Merman's Earring",
ring1="Succor Ring",
ring2="Defending Ring",
back="Engulfer Cape +1",
waist="Flax Sash"})

--------------------------------------
-- Melee sets
--------------------------------------

-- Normal melee group

sets.engaged = {
main="Izhiikoh",
sub="Atoyac",
range="Raider's Boomerang",
head="Felistris Mask",
neck="Asperity Necklace",
ear1="Dudgeon Earring",
ear2="Heartseeker Earring",
body="Plunderer's Vest +1",
hands="Pill. Armlets +1",
ring1="Epona's Ring",
ring2="Rajas Ring",
back="Canny Cape",
waist="Patentia Sash",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"}

sets.engaged.Acc = {
main="Izhiikoh",
sub="Atoyac",
range="Raider's Boomerang",
head="Whirlpool Mask",
neck="Ej Necklace +1",
ear1="Dudgeon Earring",
ear2="Heartseeker Earring",
body="Mekosuchinae Harness",
hands="Plun. Armlets +1",
ring1="Mars's Ring",
ring2="Rajas Ring",
back="Canny Cape",
waist="Olseni Belt",
legs="Pill. Culottes +1",
feet="Pill. Poulaines +1"}

-- Mod set for trivial mobs (Skadi+1)

sets.engaged.Mod = {
main="Izhiikoh",
sub="Atoyac",
range="Raider's Boomerang",
head="Felistris Mask",
neck="Asperity Necklace",
ear1="Dudgeon Earring",
ear2="Heartseeker Earring",
body="Skadi's Cuirie +1",
hands="Pill. Armlets +1",
ring1="Epona's Ring",
ring2="Rajas Ring",
back="Canny Cape",
waist="Patentia Sash",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"}

-- Mod set for trivial mobs (Thaumas)

sets.engaged.Mod2 = {
main="Izhiikoh",
sub="Atoyac",
range="Raider's Boomerang",
head="Felistris Mask",
neck="Asperity Necklace",
ear1="Dudgeon Earring",
ear2="Heartseeker Earring",
body="Thaumas Coat",
hands="Pill. Armlets +1",
ring1="Epona's Ring",
ring2="Rajas Ring",
back="Canny Cape",
waist="Patentia Sash",
legs="Pill. Culottes +1",
feet="Plun. Poulaines +1"}

sets.engaged.Evasion = {
main="",
sub="",
range="",
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}

sets.engaged.Acc.Evasion = {
main="",
sub="",
range="",
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}

sets.engaged.PDT = {
main="",
sub="",
range="",
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}

sets.engaged.Acc.PDT = {
main="",
sub="",
range="",
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}

end


-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------

-- Run after the general precast() is done.

function job_post_precast(spell, action, spellMap, eventArgs)

if spell.english == 'Aeolian Edge' and state.TreasureMode.value ~= 'None' then
equip(sets.TreasureHunter)
elseif spell.english=='Sneak Attack' or spell.english=='Trick Attack' or spell.type == 'WeaponSkill' then
if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
equip(sets.TreasureHunter)

end
end
end


-- Run after the general midcast() set is constructed.

function job_post_midcast(spell, action, spellMap, eventArgs)

if state.TreasureMode.value ~= 'None' and spell.action_type == 'Ranged Attack' then
equip(sets.TreasureHunter)

end
end


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.

function job_aftercast(spell, action, spellMap, eventArgs)

-- Weaponskills wipe SATA/Feint. Turn those state vars off before default gearing is attempted.

if spell.type == 'WeaponSkill' and not spell.interrupted then
state.Buff['Sneak Attack'] = false
state.Buff['Trick Attack'] = false
state.Buff['Feint'] = false

end
end


-- Called after the default aftercast handling is complete.

function job_post_aftercast(spell, action, spellMap, eventArgs)

-- If Feint is active, put that gear set on on top of regular gear.

-- This includes overlaying SATA gear.

check_buff('Feint', eventArgs)

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 state.Buff[buff] ~= nil then
if not midaction() then
handle_equipping_gear(player.status)

end
end
end


-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------

function get_custom_wsmode(spell, spellMap, defaut_wsmode)

local wsmode

if state.Buff['Sneak Attack'] then
wsmode = 'SA'

end


if state.Buff['Trick Attack'] then
wsmode = (wsmode or '') .. 'TA'

end


return wsmode

end


-- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).

function job_handle_equipping_gear(playerStatus, eventArgs)

-- Check that ranged slot is locked, if necessary

check_range_lock()

-- Check for SATA when equipping gear. If either is active, equip
-- that gear specifically, and block equipping default gear.

check_buff('Sneak Attack', eventArgs)
check_buff('Trick Attack', eventArgs)

end


function customize_idle_set(idleSet)

if player.hpp < 80 then
idleSet = set_combine(idleSet, sets.ExtraRegen)

end


return idleSet

end


function customize_melee_set(meleeSet)

if state.TreasureMode.value == 'Fulltime' then
meleeSet = set_combine(meleeSet, sets.TreasureHunter)

end


return meleeSet

end


-- Called by the 'update' self-command.

function job_update(cmdParams, eventArgs)

th_update(cmdParams, eventArgs)

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 msg = 'Melee'

if state.CombatForm.has_value then
msg = msg .. ' (' .. state.CombatForm.value .. ')'

end


msg = msg .. ': '

msg = msg .. state.OffenseMode.value
if state.HybridMode.value ~= 'Normal' then
msg = msg .. '/' .. state.HybridMode.value

end


msg = msg .. ', WS: ' .. state.WeaponskillMode.value

if state.DefenseMode.value ~= 'None' then
msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'

end


if state.Kiting.value == true then
msg = msg .. ', Kiting'

end


if state.PCTargetMode.value ~= 'default' then
msg = msg .. ', Target PC: '..state.PCTargetMode.value

end


if state.SelectNPCTargets.value == true then
msg = msg .. ', Target NPCs'

end


msg = msg .. ', TH: ' .. state.TreasureMode.value

add_to_chat(122, msg)

eventArgs.handled = true

end


-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

-- State buff checks that will equip buff gear and mark the event as handled.

function check_buff(buff_name, eventArgs)

if state.Buff[buff_name] then
equip(sets.buff[buff_name] or {})
if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
equip(sets.TreasureHunter)
end
eventArgs.handled = true

end
end


-- Check for various actions that we've specified in user code as being used with TH gear.

-- This will only ever be called if TreasureMode is not 'None'.

-- Category and Param are as specified in the action event packet.

function th_action_check(category, param)

if category == 2 or -- any ranged attack
--category == 4 or -- any magic action
(category == 3 and param == 30) or -- Aeolian Edge
(category == 6 and info.default_ja_ids:contains(param)) or -- Provoke, Animated Flourish
(category == 14 and info.default_u_ja_ids:contains(param)) -- Quick/Box/Stutter Step, Desperate/Violent Flourish
then return true

end
end


-- Function to lock the ranged slot if we have a ranged weapon equipped.

function check_range_lock()

if player.equipment.range ~= 'empty' then
disable('range', 'ammo')
else
enable('range', 'ammo')

end
end


-- Select default macro book on initial load or subjob change.

function select_default_macro_book()

-- Default macro set/book

if player.sub_job == 'DNC' then
set_macro_page(1, 18)
elseif player.sub_job == 'WAR' then
set_macro_page(1, 18)
elseif player.sub_job == 'NIN' then
set_macro_page(1, 18)
else
set_macro_page(1, 18)

end
end
 Ragnarok.Worldslost
Offline
Server: Ragnarok
Game: FFXI
Posts: 82
By Ragnarok.Worldslost 2014-12-27 04:15:47
Link | Quote | Reply
 
Cerberus.Conagh said: »
Ragnarok.Worldslost said: »
Darvamos yes I am engaged which is why I'm unsure why it's not working with the one small change, also I figured I was near the botting edge as well which is why I was trying to incorporate what's available. In truth I'm just trying to build the ultimate Blu GS profile since it's more fun than watching the moogle spin between events.

You can just copy the entire AutoRA Lua into your BLU gearswap file, and change the rules from /ra to /ma spell name <t>.

I tried this and it broke the LUA and other suggestions i might try to incorporate the 2 lua's into one?
 Ragnarok.Nep
Offline
Server: Ragnarok
Game: FFXI
user: Neptune
Posts: 18
By Ragnarok.Nep 2014-12-27 04:37:04
Link | Quote | Reply
 
Hi! I'm just about done making the transition to Gearswap from Spellcast after returning to the game a couple of months ago, but there's one thing I can't seem to figure out.

For BRD, I had it set up so that my in-game song macros were all like this: /ma "Valor Minuet V" <t>, and that I would auto-target myself when casting buffs. In Spellcast, the code looked like this:
Code
        <if type="BardSong">
            <if NotBuffActive="Pianissimo" advanced='"$Pianissimo"="No"'>
                <if NotSpellTargetType="SELF" ValidTarget="SELF">
                    <changetarget target="<me>" />
                </if>
            </if>

The benefit of this was that I could be targeting another player, NPC or monster and not lose the target even if I needed to cast buffs on myself. And with this code and my <t> macros, I could target other players with my buffs after using Pianissimo manually.

I have not been able to recreate this in Gearswap on my own. Does anyone have an idea of how I could make it work?
 Leviathan.Arcon
VIP
Offline
Server: Leviathan
Game: FFXI
user: Zaphor
Posts: 660
By Leviathan.Arcon 2014-12-27 05:45:00
Link | Quote | Reply
 
I didn't test this:
Code
pretarget = function(spell)
    if spell.type == 'BardSong' and spell.targets == S{'Self'} and spell.target.raw == '<t>' and not buffactive.pianissimo then
        change_target('<me>')
    end
end
 Ragnarok.Nep
Offline
Server: Ragnarok
Game: FFXI
user: Neptune
Posts: 18
By Ragnarok.Nep 2014-12-27 09:55:43
Link | Quote | Reply
 
I copied your suggestion and pasted it into my file and gave it a try, but unfortunately it didn't work - thanks for trying, though!

It's annoying because it's just songs that are being uncooperative. I have healing macros that use Shortcuts and are just /cure4, for example - if I don't target anything, I cast Cure IV on myself, and if I target another player, it casts Cure IV on them. Doing the same with songs and a macro like /valorminuet5 works in the sense that I can sing without having to target myself, but if I then use Pianissimo and target someone else, I still cast on myself.
 Lakshmi.Byrth
VIP
Offline
Server: Lakshmi
Game: FFXI
user: Byrthnoth
Posts: 6137
By Lakshmi.Byrth 2014-12-27 09:59:18
Link | Quote | Reply
 
That's an issue with shortcuts rather than anything you're doing, probably. It is supposed to handle changes to the valid targets via buffs internally, although obviously you have to gain the buff before it can do so (so Pianissimo -> instantly cast aoe song will never work).

I'll open an issue on my tracker for both Pianissimo and Entrust. It's possible that the code I had used for that is no longer working.
 Sylph.Reain
Offline
Server: Sylph
Game: FFXI
user: dmregm
Posts: 396
By Sylph.Reain 2014-12-27 10:22:17
Link | Quote | Reply
 
I can confirm that was shortcuts behavior until a few weeks ago. The day you pushed updates to gearswap/shortcuts and shortcuts was acting weird with songs was when it stopped I believe.
 Cerberus.Conagh
Offline
Server: Cerberus
Game: FFXI
user: onagh
Posts: 3189
By Cerberus.Conagh 2014-12-27 11:52:25
Link | Quote | Reply
 
Sylph.Murex said: »
I got a real annoying problem with my GS when I cast Utsu idk if it's just when i'm in BC's or what but idk how to fix it... when I've got my gear set for ACC after casting Utsu it switches into my regular TP gear... Here is the GS(I haven't bothered filling out everything yet):
Code
-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job.  Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

--[[
    Custom commands:

    gs c cycle treasuremode (set on ctrl-= by default): Cycles through the available treasure hunter modes.
    
    Treasure hunter modes:
        None - Will never equip TH gear
        Tag - Will equip TH gear sufficient for initial contact with a mob (either melee, ranged hit, or Aeolian Edge AOE)
        SATA - Will equip TH gear sufficient for initial contact with a mob, and when using SATA
        Fulltime - Will keep TH gear equipped fulltime
--]]

-- Initialization function for this job file.

function get_sets()

    mote_include_version = 2
    
    -- Load and initialize the include file.
	
    include('Mote-Include.lua')
	
end


-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.

function job_setup()

    state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
    state.Buff['Trick Attack'] = buffactive['trick attack'] or false
    state.Buff['Feint'] = buffactive['feint'] or false
    
    include('Mote-TreasureHunter')

    -- For th_action_check():
	
    -- JA IDs for actions that always have TH: Provoke, Animated Flourish
	
    info.default_ja_ids = S{35, 204}
	
    -- Unblinkable JA IDs for actions that always have TH: Quick/Box/Stutter Step, Desperate/Violent Flourish
	
    info.default_u_ja_ids = S{201, 202, 203, 205, 207}
	
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('Normal', 'Acc', 'Mod')
    state.HybridMode:options('Normal', 'Evasion', 'PDT')
    state.RangedMode:options('Normal', 'Acc')
    state.WeaponskillMode:options('Normal', 'Acc', 'Mod')
    state.PhysicalDefenseMode:options('Evasion', 'PDT')


    gear.default.weaponskill_neck = gear.ElementalGorget
    gear.default.weaponskill_waist = gear.ElementalBelt
    gear.AugQuiahuiz = {name="Quiahuiz Trousers", augments={'STR+8','Phys. dmg. taken -2%','Magic dmg. taken -2%'}}

    -- Additional local binds
	
    send_command('bind ^` input /ja "Flee" <me>')
    send_command('bind ^= gs c cycle treasuremode')
    send_command('bind !- gs c cycle targetmode')

    select_default_macro_book()
	
end


-- Called when this job file is unloaded (eg: job change)

function user_unload()

    send_command('unbind ^`')
    send_command('unbind !-')
	
end


-- Define sets and vars used by this job file.

function init_gear_sets()

    --------------------------------------
    -- Special sets (required by rules)
    --------------------------------------

    sets.TreasureHunter = {
			hands="Plunderer's Armlets +1", 
			waist="Chaac Belt", 
			feet="Raider's Poulaines +2"}
	
    sets.ExtraRegen = {
			head="Ocelomeh Headpiece +1"}
	
    sets.Kiting = {
			feet="Skadi's Jambeaux +1"}

    sets.buff['Sneak Attack'] = {
			head="Pill. Bonnet +1",
			neck="Moepapa Medal",
			ear1="Jupiter's Pearl",
			ear2="Jupiter's Pearl",
			body="Pill. Vest +1",
			hands="Raid. Armlets +2",
			ring1="Zilant Ring",
			ring2="Rajas Ring",
			back="Cavaros Mantle",
			waist="Artful Belt +1",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"}

    sets.buff['Trick Attack'] = {
			head="Pill. Bonnet +1",
			neck="Moepapa Medal",
			ear1="Auster's Pearl",
			ear2="Auster's Pearl",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Garuda Ring +1",
			ring2="Rajas Ring",
			back="Canny Cape",
			waist="Elanid Belt",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"}

    -- Actions we want to use to tag TH.
	
    sets.precast.Step = sets.TreasureHunter
    sets.precast.Flourish1 = sets.TreasureHunter
    sets.precast.JA.Provoke = sets.TreasureHunter

    --------------------------------------
    -- Precast sets
    --------------------------------------

    -- Precast sets to enhance JAs
	
    sets.precast.JA['Collaborator'] = {
			head="Raider's Bonnet +2"}
			
    sets.precast.JA['Accomplice'] = {
			head="Raider's Bonnet +2"}
	
    sets.precast.JA['Flee'] = {
			feet="Pillager's Poulaines +1"}
	
    sets.precast.JA['Hide'] = {
			body="Pillager's Vest +1"}
	
    sets.precast.JA['Conspirator'] = {
			body="Raider's Vest +2"}
	
    sets.precast.JA['Steal'] = {
			head="Plunderer's Bonnet +1",
			hands="Pillager's Armlets +1",
			legs="Pillager's Culottes +1",
			feet="Pillager's Poulaines +1"}
	
    sets.precast.JA['Despoil'] = {
			legs="Raider's Culottes +2",
			feet="Raider's Poulaines +2"}
	
    sets.precast.JA['Perfect Dodge'] = {
			hands="Plunderer's Armlets +1"}
	
    sets.precast.JA['Feint'] = {
			legs="Plun. Culottes +1"}

    sets.precast.JA['Sneak Attack'] = sets.buff['Sneak Attack']
	
    sets.precast.JA['Trick Attack'] = sets.buff['Trick Attack']


    -- Waltz set (chr and vit)
	
    sets.precast.Waltz = {
			main="",
			sub="",
			range="",
			ammo="",
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="Asklepian Ring",
			ring2="Valseur's Ring",
			back="",
			waist="",
			legs="",
			feet=""}

    -- Don't need any special gear for Healing Waltz.
	
    sets.precast.Waltz['Healing Waltz'] = {}

    -- Fast cast sets for spells
	
    sets.precast.FC = {
			head="Haruspex Hat +1",
			neck="Orunmila's Torque",
			ear1="Enchntr. Earring +1",
			ear2="Loquac. Earring",
			hands="Thaumas Gloves",
			ring1="Veneficium Ring",
			ring2="Prolix Ring",
			legs="Enif Cosciales"}

    sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})

    -- Ranged snapshot gear
	
    sets.precast.RA = {
			main="",
			sub="",
			range="",
			ammo="",
			head="Zha'Go's Barbut",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="Iuitl Wristbands +1",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="Nahtirah Trousers",
			feet="Wurrukatte Boots"}

    -- Weaponskill sets

    -- Default set for any weaponskill that isn't any more specifically defined
	
    sets.precast.WS = {
			head="Uk'uxkaj Cap",
			neck="Shadow Gorget",
			ear1="Moonshade Earring",
			ear2="Jupiter's Pearl",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Zilant Ring",
			ring2="Rajas Ring",
			back="Vespid Mantle",
			waist="Prosilio Belt +1",
			legs="Manibozho Brais",
			feet="Plun. Poulaines +1"}
			
    sets.precast.WS.Acc = set_combine(sets.precast.WS, {})

    -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
	
    sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {})
	
    sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {})
	
    sets.precast.WS['Exenterator'].Mod = set_combine(sets.precast.WS['Exenterator'], {})
	
    sets.precast.WS['Exenterator'].SA = set_combine(sets.precast.WS['Exenterator'].Mod, {})
	
    sets.precast.WS['Exenterator'].TA = set_combine(sets.precast.WS['Exenterator'].Mod, {})
	
    sets.precast.WS['Exenterator'].SATA = set_combine(sets.precast.WS['Exenterator'].Mod, {})

    sets.precast.WS['Dancing Edge'] = set_combine(sets.precast.WS, {})
	
    sets.precast.WS['Dancing Edge'].Acc = set_combine(sets.precast.WS['Dancing Edge'], {})
	
    sets.precast.WS['Dancing Edge'].Mod = set_combine(sets.precast.WS['Dancing Edge'], {})
	
    sets.precast.WS['Dancing Edge'].SA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {})
	
    sets.precast.WS['Dancing Edge'].TA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {})
	
    sets.precast.WS['Dancing Edge'].SATA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {})

    sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {})
		
    sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {})
	
    sets.precast.WS['Evisceration'].Mod = set_combine(sets.precast.WS['Evisceration'], {})
	
    sets.precast.WS['Evisceration'].SA = set_combine(sets.precast.WS['Evisceration'].Mod, {})
	
    sets.precast.WS['Evisceration'].TA = set_combine(sets.precast.WS['Evisceration'].Mod, {})
	
    sets.precast.WS['Evisceration'].SATA = set_combine(sets.precast.WS['Evisceration'].Mod, {})

    sets.precast.WS["Rudra's Storm"] = set_combine(sets.precast.WS, {
			head="Uk'uxkaj Cap",
			neck="Shadow Gorget",
			ear1="Moonshade Earring",
			ear2="Jupiter's Pearl",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Zilant Ring",
			ring2="Rajas Ring",
			back="Vespid Mantle",
			waist="Prosilio Belt +1",
			legs="Manibozho Brais",
			feet="Plun. Poulaines +1"})
	
    sets.precast.WS["Rudra's Storm"].Acc = set_combine(sets.precast.WS["Rudra's Storm"], {
			head="Uk'uxkaj Cap",
			neck="Shadow Gorget",
			ear1="Moonshade Earring",
			ear2="Jupiter's Pearl",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Zilant Ring",
			ring2="Rajas Ring",
			back="Vespid Mantle",
			waist="Prosilio Belt +1",
			legs="Manibozho Brais",
			feet="Plun. Poulaines +1"})
	
    sets.precast.WS["Rudra's Storm"].Mod = set_combine(sets.precast.WS["Rudra's Storm"], {
			head="Uk'uxkaj Cap",
			neck="Shadow Gorget",
			ear1="Moonshade Earring",
			ear2="Jupiter's Pearl",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Zilant Ring",
			ring2="Rajas Ring",
			back="Vespid Mantle",
			waist="Prosilio Belt +1",
			legs="Manibozho Brais",
			feet="Plun. Poulaines +1"})
	
    sets.precast.WS["Rudra's Storm"].SA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, {
			head="Pill. Bonnet +1",
			neck="Shadow Gorget",
			ear1="Moonshade Earring",
			ear2="Jupiter's Pearl",
			body="Pill. Vest +1",
			hands="Pill. Armlets +1",
			ring1="Zilant Ring",
			ring2="Rajas Ring",
			back="Kayapa Cape",
			waist="Shadow Belt",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"})
		
    sets.precast.WS["Rudra's Storm"].TA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, {
			head="Pill. Bonnet +1",
			neck="Shadow Gorget",
			ear1="Moonshade Earring",
			ear2="Auster's Pearl",
			body="Pill. Vest +1",
			hands="Pill. Armlets +1",
			ring1="Garuda Ring +1",
			ring2="Rajas Ring",
			back="Vespid Mantle",
			waist="Shadow Belt",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"})
		
    sets.precast.WS["Rudra's Storm"].SATA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, {
			head="Uk'uxkaj Cap",
			neck="Shadow Gorget",
			ear1="Moonshade Earring",
			ear2="Jupiter's Pearl",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Zilant Ring",
			ring2="Rajas Ring",
			back="Vespid Mantle",
			waist="Prosilio Belt +1",
			legs="Manibozho Brais",
			feet="Plun. Poulaines +1"})

    sets.precast.WS["Shark Bite"] = set_combine(sets.precast.WS, {})
	
    sets.precast.WS['Shark Bite'].Acc = set_combine(sets.precast.WS['Shark Bite'], {})
	
    sets.precast.WS['Shark Bite'].Mod = set_combine(sets.precast.WS['Shark Bite'], {})
	
    sets.precast.WS['Shark Bite'].SA = set_combine(sets.precast.WS['Shark Bite'].Mod, {})
		
    sets.precast.WS['Shark Bite'].TA = set_combine(sets.precast.WS['Shark Bite'].Mod, {})
		
    sets.precast.WS['Shark Bite'].SATA = set_combine(sets.precast.WS['Shark Bite'].Mod, {})

    sets.precast.WS['Mandalic Stab'] = set_combine(sets.precast.WS, {})
	
    sets.precast.WS['Mandalic Stab'].Acc = set_combine(sets.precast.WS['Mandalic Stab'], {})
	
    sets.precast.WS['Mandalic Stab'].Mod = set_combine(sets.precast.WS['Mandalic Stab'], {})
	
    sets.precast.WS['Mandalic Stab'].SA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, {})
		
    sets.precast.WS['Mandalic Stab'].TA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, {})
		
    sets.precast.WS['Mandalic Stab'].SATA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, {})

    sets.precast.WS['Aeolian Edge'] = {}

    sets.precast.WS['Aeolian Edge'].TH = set_combine(sets.precast.WS['Aeolian Edge'], sets.TreasureHunter)

    --------------------------------------
    -- Midcast sets
    --------------------------------------

    sets.midcast.FastRecast = {
			main="",
			sub="",
			range="",
			ammo="",
			head="Felistris Mask",
			neck="Orunmila's Torque",
			ear1="Enchntr. Earring +1",
			ear2="Loquac. Earring",
			body="Emet Harness +1",
			hands="Thaumas Gloves",
			ring1="",
			ring2="Prolix Ring",
			back="Mujin Mantle",
			waist="Ninurta's Sssh",
			legs="Enif Cosciales",
			feet="Plun. Poulaines +1"}

    -- Specific spells
	
    sets.midcast.Utsusemi = {
			main="",
			sub="",
			range="",
			ammo="",
			head="Felistris Mask",
			neck="Orunmila's Torque",
			ear1="Enchntr. Earring +1",
			ear2="Loquac. Earring",
			body="Emet Harness +1",
			hands="Thaumas Gloves",
			ring1="",
			ring2="Prolix Ring",
			back="Mujin Mantle",
			waist="Ninurta's Sssh",
			legs="Enif Cosciales",
			feet="Plun. Poulaines +1"}

    -- Ranged gear
	
    sets.midcast.RA = {
			main="",
			sub="",
			range="",
			ammo="",
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="",
			feet=""}

    sets.midcast.RA.Acc = {
			main="",
			sub="",
			range="",
			ammo="",
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="",
			feet=""}

    --------------------------------------
    -- Idle/resting/defense sets
    --------------------------------------

    -- Resting sets
	
    sets.resting = {
			head="Ocelomeh Headpiece +1",
			neck="Wiglen Gorget",
			ear1="Dawn Earring",
			ring1="Sheltered Ring",
			ring2="Paguroidea Ring",
			waist="Lycopodium Sash",}

    -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)

    sets.idle = {
			range="Raider's Boomerang",
			head="Ocelomeh Headpiece +1",
			neck="Wiglen Gorget",
			ear1="Dawn Earring",
			ear2="Hearty Earring",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Sheltered Ring",
			ring2="Paguroidea Ring",
			back="Shadow Mantle",
			waist="Lycopodium Sash",
			legs="Pillager's Culottes +1",
			feet="Skadi's Jambeaux +1"}

    sets.idle.Town = {
			range="Raider's Boomerang",
			head="Ocelomeh Headpiece +1",
			neck="Wiglen Gorget",
			ear1="Dawn Earring",
			ear2="Hearty Earring",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Sheltered Ring",
			ring2="Paguroidea Ring",
			back="Shadow Mantle",
			waist="Lycopodium Sash",
			legs="Pillager's Culottes +1",
			feet="Skadi's Jambeaux +1"}

    sets.idle.Weak = {
			range="Raider's Boomerang",
			head="Ocelomeh Headpiece +1",
			neck="Wiglen Gorget",
			ear1="Dawn Earring",
			ear2="Hearty Earring",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Sheltered Ring",
			ring2="Paguroidea Ring",
			back="Shadow Mantle",
			waist="Lycopodium Sash",
			legs="Pillager's Culottes +1",
			feet="Skadi's Jambeaux +1"}

    -- Defense sets

    sets.defense.Evasion = {
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="",
			feet=""}

    sets.defense.PDT = {
			head="Lithelimb Cap",
			neck="Twilight Torque",
			ear1="Dudgeon Earring",
			ear2="Heartseeker Earring",
			body="Plunderer's Vest +1",
			hands="Umuthi Gloves",
			ring1="Patricius Ring",
			ring2="Defending Ring",
			back="Mollusca Mantle",
			waist="Flume Belt +1",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"}

    sets.defense.MDT = set_combine(sets.defense.PDT,{
			ear1="Sanare Earring",
			ear2="Merman's Earring",
			ring1="Succor Ring",
			ring2="Defending Ring",
			back="Engulfer Cape +1",
			waist="Flax Sash"})

    --------------------------------------
    -- Melee sets
    --------------------------------------

    -- Normal melee group
	
    sets.engaged = {
			main="Izhiikoh", 
			sub="Atoyac",
			range="Raider's Boomerang",
			head="Felistris Mask",
			neck="Asperity Necklace",
			ear1="Dudgeon Earring",
			ear2="Heartseeker Earring",
			body="Plunderer's Vest +1",
			hands="Pill. Armlets +1",
			ring1="Epona's Ring",
			ring2="Rajas Ring",
			back="Canny Cape",
			waist="Patentia Sash",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"}
			
    sets.engaged.Acc = {
			main="Izhiikoh", 
			sub="Atoyac",
			range="Raider's Boomerang",
			head="Whirlpool Mask",
			neck="Ej Necklace +1",
			ear1="Dudgeon Earring",
			ear2="Heartseeker Earring",
			body="Mekosuchinae Harness",
			hands="Plun. Armlets +1",
			ring1="Mars's Ring",
			ring2="Rajas Ring",
			back="Canny Cape",
			waist="Olseni Belt",
			legs="Pill. Culottes +1",
			feet="Pill. Poulaines +1"}
        
    -- Mod set for trivial mobs (Skadi+1)
	
    sets.engaged.Mod = {
			main="Izhiikoh", 
			sub="Atoyac",
			range="Raider's Boomerang",
			head="Felistris Mask",
			neck="Asperity Necklace",
			ear1="Dudgeon Earring",
			ear2="Heartseeker Earring",
			body="Skadi's Cuirie +1",
			hands="Pill. Armlets +1",
			ring1="Epona's Ring",
			ring2="Rajas Ring",
			back="Canny Cape",
			waist="Patentia Sash",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"}

    -- Mod set for trivial mobs (Thaumas)
	
    sets.engaged.Mod2 = {
			main="Izhiikoh", 
			sub="Atoyac",
			range="Raider's Boomerang",
			head="Felistris Mask",
			neck="Asperity Necklace",
			ear1="Dudgeon Earring",
			ear2="Heartseeker Earring",
			body="Thaumas Coat",
			hands="Pill. Armlets +1",
			ring1="Epona's Ring",
			ring2="Rajas Ring",
			back="Canny Cape",
			waist="Patentia Sash",
			legs="Pill. Culottes +1",
			feet="Plun. Poulaines +1"}

    sets.engaged.Evasion = {
			main="",
			sub="",
			range="",
			ammo="",
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="",
			feet=""}
			
    sets.engaged.Acc.Evasion = {
			main="",
			sub="",
			range="",
			ammo="",
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="",
			feet=""}

    sets.engaged.PDT = {
			main="",
			sub="",
			range="",
			ammo="",
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="",
			feet=""}
			
    sets.engaged.Acc.PDT = {
			main="",
			sub="",
			range="",
			ammo="",
			head="",
			neck="",
			ear1="",
			ear2="",
			body="",
			hands="",
			ring1="",
			ring2="",
			back="",
			waist="",
			legs="",
			feet=""}

end


-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------

-- Run after the general precast() is done.

function job_post_precast(spell, action, spellMap, eventArgs)

    if spell.english == 'Aeolian Edge' and state.TreasureMode.value ~= 'None' then
        equip(sets.TreasureHunter)
    elseif spell.english=='Sneak Attack' or spell.english=='Trick Attack' or spell.type == 'WeaponSkill' then
        if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
            equip(sets.TreasureHunter)
			
        end
    end
end


-- Run after the general midcast() set is constructed.

function job_post_midcast(spell, action, spellMap, eventArgs)

    if state.TreasureMode.value ~= 'None' and spell.action_type == 'Ranged Attack' then
        equip(sets.TreasureHunter)
		
    end
end


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.

function job_aftercast(spell, action, spellMap, eventArgs)

    -- Weaponskills wipe SATA/Feint.  Turn those state vars off before default gearing is attempted.
	
    if spell.type == 'WeaponSkill' and not spell.interrupted then
        state.Buff['Sneak Attack'] = false
        state.Buff['Trick Attack'] = false
        state.Buff['Feint'] = false
		
    end
end


-- Called after the default aftercast handling is complete.

function job_post_aftercast(spell, action, spellMap, eventArgs)

    -- If Feint is active, put that gear set on on top of regular gear.
	
    -- This includes overlaying SATA gear.
	
    check_buff('Feint', eventArgs)
	
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 state.Buff[buff] ~= nil then
        if not midaction() then
            handle_equipping_gear(player.status)
			
        end
    end
end


-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------

function get_custom_wsmode(spell, spellMap, defaut_wsmode)

    local wsmode

    if state.Buff['Sneak Attack'] then
        wsmode = 'SA'
		
    end
	
	
    if state.Buff['Trick Attack'] then
        wsmode = (wsmode or '') .. 'TA'
		
    end

	
    return wsmode
	
end


-- Called any time we attempt to handle automatic gear equips (ie: engaged or idle gear).

function job_handle_equipping_gear(playerStatus, eventArgs)

    -- Check that ranged slot is locked, if necessary
	
    check_range_lock()

    -- Check for SATA when equipping gear.  If either is active, equip
    -- that gear specifically, and block equipping default gear.
	
    check_buff('Sneak Attack', eventArgs)
    check_buff('Trick Attack', eventArgs)
	
end


function customize_idle_set(idleSet)

    if player.hpp < 80 then
        idleSet = set_combine(idleSet, sets.ExtraRegen)
		
    end

	
    return idleSet
	
end


function customize_melee_set(meleeSet)

    if state.TreasureMode.value == 'Fulltime' then
        meleeSet = set_combine(meleeSet, sets.TreasureHunter)
		
    end

	
    return meleeSet
	
end


-- Called by the 'update' self-command.

function job_update(cmdParams, eventArgs)

    th_update(cmdParams, eventArgs)
	
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 msg = 'Melee'
    
    if state.CombatForm.has_value then
        msg = msg .. ' (' .. state.CombatForm.value .. ')'
		
    end
    
	
    msg = msg .. ': '
    
    msg = msg .. state.OffenseMode.value
    if state.HybridMode.value ~= 'Normal' then
        msg = msg .. '/' .. state.HybridMode.value
		
    end
	
	
    msg = msg .. ', WS: ' .. state.WeaponskillMode.value
    
    if state.DefenseMode.value ~= 'None' then
        msg = msg .. ', ' .. 'Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
		
    end
    
	
    if state.Kiting.value == true then
        msg = msg .. ', Kiting'
		
    end

	
    if state.PCTargetMode.value ~= 'default' then
        msg = msg .. ', Target PC: '..state.PCTargetMode.value
		
    end

	
    if state.SelectNPCTargets.value == true then
        msg = msg .. ', Target NPCs'
		
    end
    
	
    msg = msg .. ', TH: ' .. state.TreasureMode.value

    add_to_chat(122, msg)

    eventArgs.handled = true
	
end


-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

-- State buff checks that will equip buff gear and mark the event as handled.

function check_buff(buff_name, eventArgs)

    if state.Buff[buff_name] then
        equip(sets.buff[buff_name] or {})
        if state.TreasureMode.value == 'SATA' or state.TreasureMode.value == 'Fulltime' then
            equip(sets.TreasureHunter)
        end
        eventArgs.handled = true
		
    end
end


-- Check for various actions that we've specified in user code as being used with TH gear.

-- This will only ever be called if TreasureMode is not 'None'.

-- Category and Param are as specified in the action event packet.

function th_action_check(category, param)

    if category == 2 or -- any ranged attack
        --category == 4 or -- any magic action
        (category == 3 and param == 30) or -- Aeolian Edge
        (category == 6 and info.default_ja_ids:contains(param)) or -- Provoke, Animated Flourish
        (category == 14 and info.default_u_ja_ids:contains(param)) -- Quick/Box/Stutter Step, Desperate/Violent Flourish
        then return true
		
    end
end


-- Function to lock the ranged slot if we have a ranged weapon equipped.

function check_range_lock()

    if player.equipment.range ~= 'empty' then
        disable('range', 'ammo')
    else
        enable('range', 'ammo')
		
    end
end


-- Select default macro book on initial load or subjob change.

function select_default_macro_book()

    -- Default macro set/book
	
    if player.sub_job == 'DNC' then
        set_macro_page(1, 18)
    elseif player.sub_job == 'WAR' then
        set_macro_page(1, 18)
    elseif player.sub_job == 'NIN' then
        set_macro_page(1, 18)
    else
        set_macro_page(1, 18)
		
    end
end


Dear god use the code button lol,

Anyway it appears to be something in your include or you haven't included a return rule somewhere.

Here's mine using Motes and it works 100%
Yes my thief gear is a joke
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.

-- Initialization function for this job file.
function get_sets()
Autows = 0
	-- Load and initialize the include file.
	include('Mote-Include.lua')
end



-- Setup vars that are user-independent.
function job_setup()
	state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
	state.Buff['Trick Attack'] = buffactive['trick attack'] or false
	state.Buff['Feint'] = buffactive['feint'] or false
	
	-- TH mode handling
	options.TreasureModes = {'None','Tag','SATA','Fulltime'}
	state.TreasureMode = 'Tag'

	tag_with_th = false	
	tp_on_engage = 0
end


-- Setup vars that are user-dependent.  Can override this function in a sidecar file.
function user_setup()
	-- Options: Override default values
	options.OffenseModes = {'Normal', 'Acc', 'iLvl'}
	options.DefenseModes = {'Normal', 'Evasion', 'PDT'}
	options.RangedModes = {'Normal', 'TH', 'Acc'}
	options.WeaponskillModes = {'Normal', 'Acc', 'Att', 'Mod'}
	options.IdleModes = {'Normal'}
	options.RestingModes = {'Normal'}
	options.PhysicalDefenseModes = {'Evasion', 'PDT'}
	options.MagicalDefenseModes = {'MDT'}

	state.RangedMode = 'TH'
	state.Defense.PhysicalMode = 'Evasion'

	-- Additional local binds
	send_command('bind ^` input /ja "Flee" <me>')
	send_command('bind ^= gs c cycle treasuremode')
	send_command('bind !- gs c cycle targetmode')

	select_default_macro_book()
end


-- Called when this job file is unloaded (eg: job change)
function file_unload()
	if binds_on_unload then
		binds_on_unload()
	end

	send_command('unbind ^`')
	send_command('unbind !-')
end

-- Define sets and vars used by this job file.
function init_gear_sets()

	
	--------------------------------------
	-- Start defining the sets
	--------------------------------------
	
	sets.TreasureHunter = {hands="Plun. Armlets", feet="Qaaxo Leggings", waist="Chaac Belt"}
	
	-- Precast Sets
	
	-- Precast sets to enhance JAs
	sets.precast.JA['Collaborator'] = {head="Raider's Bonnet +2"}
	sets.precast.JA['Accomplice'] = {head="Raider's Bonnet +2"}
	sets.precast.JA['Flee'] = {feet="Pillager's Poulaines +1"}
	sets.precast.JA['Hide'] = {body="Pillager's Vest +1"}
	sets.precast.JA['Conspirator'] = {} -- {body="Raider's Vest +2"}
	sets.precast.JA['Steal'] = {head="Plunderer's Bonnet",hands="Pillager's Armlets +1",legs="Pillager's Culottes +1",feet="Pillager's Poulaines +1"}
	sets.precast.JA['Despoil'] = {legs="Raider's Culottes +2",feet="Qaaxo Leggings"}
	sets.precast.JA['Perfect Dodge'] = {hands="Plun. Armlets"}
	sets.precast.JA['Feint'] = {} -- {legs="Assassin's Culottes +2"}
	

	sets.precast.JA['Sneak Attack'] = {
		head="Whirlpool Mask",neck="Rancor's Collar",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Manibozho Jerkin",hands="Plun. Armlets",ring1="Rajas Ring",ring2="Epona's Ring",
		back="Atheling Mantle",waist="",legs="Manibozho brais",feet="Qaaxo Leggings"}

	sets.precast.JA['Trick Attack'] = {
		head="Whirlpool Mask",neck="Rancor's Collar",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Manibozho Jerkin",hands="Plun. Armlets",ring1="Rajas Ring",ring2="Epona's Ring",
		back="Atheling Mantle",waist="",legs="Manibozho brais",feet="Qaaxo Leggings"}


	-- Waltz set (chr and vit)
	sets.precast.Waltz = {ammo="Sonia's Plectrum",
		head="Whirlpool Mask",
		body="Pillager's Vest +1",hands="Pillager's Armlets +1",
		back="Iximulew Cape",legs="Pillager's Culottes +1",feet="Iuitl Gaiters +1"}
		
	-- Don't need any special gear for Healing Waltz.
	sets.precast.Waltz['Healing Waltz'] = {}
	
	-- Fast cast sets for spells
	
	sets.precast.FC = {head="Haruspex Hat",ear2="Loquacious Earring",hands="Thaumas Gloves",ring1="Prolix Ring",legs="Enif Cosciales"}

	sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})


	-- Ranged snapshot gear
	sets.precast.RangedAttack = {head="Aurore Beret",hands="Iuitl Wristbands",legs="Nahtirah Trousers",feet="Wurrukatte Boots"}

       
	-- Weaponskill sets
	-- Default set for any weaponskill that isn't any more specifically defined
	gear.default.weaponskill_neck = "Asperity Necklace"
	gear.default.weaponskill_waist = "Caudata Belt"
	sets.precast.WS = {ammo="Thew Bomblet",
		head="Uk'uxkaj cap",neck="Breeze gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
		body="Qaaxo Harness",hands="Aeto. Gloves +1",ring1="Rajas Ring",ring2="Epona's Ring",
		back="Rancorous Mantle",waist="windbuffet Belt",legs="Manibozho Brais",feet="Qaaxo Leggings"}
	sets.precast.WS.Acc = set_combine(sets.precast.WS, {  back="Letalis Mantle"})

	-- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
	sets.precast.WS['Exenterator'] = set_combine(sets.precast.WS, {ring1="Stormsoul Ring",legs="Nahtirah Trousers"})
	sets.precast.WS['Exenterator'].Acc = set_combine(sets.precast.WS['Exenterator'], {back="Letalis Mantle"})
	sets.precast.WS['Exenterator'].Mod = set_combine(sets.precast.WS['Exenterator'], {head="Felistris Mask",waist=gear.ElementalBelt})
	sets.precast.WS['Exenterator'].SA = set_combine(sets.precast.WS['Exenterator'].Mod, {ammo="Qirmiz Tathlum"})
	sets.precast.WS['Exenterator'].TA = set_combine(sets.precast.WS['Exenterator'].Mod, {ammo="Qirmiz Tathlum"})
	sets.precast.WS['Exenterator'].SATA = set_combine(sets.precast.WS['Exenterator'].Mod, {ammo="Qirmiz Tathlum"})

	sets.precast.WS['Dancing Edge'] = set_combine(sets.precast.WS, {})
	sets.precast.WS['Dancing Edge'].Acc = set_combine(sets.precast.WS['Dancing Edge'], {back="Letalis Mantle"})
	sets.precast.WS['Dancing Edge'].Mod = set_combine(sets.precast.WS['Dancing Edge'], {waist=gear.ElementalBelt})
	sets.precast.WS['Dancing Edge'].SA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {ammo="Qirmiz Tathlum"})
	sets.precast.WS['Dancing Edge'].TA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {ammo="Qirmiz Tathlum"})
	sets.precast.WS['Dancing Edge'].SATA = set_combine(sets.precast.WS['Dancing Edge'].Mod, {ammo="Qirmiz Tathlum"})

	sets.precast.WS['Evisceration'] = set_combine(sets.precast.WS, {
		ear1="Brutal Earring",ear2="Moonshade Earring"})
	sets.precast.WS['Evisceration'].Acc = set_combine(sets.precast.WS['Evisceration'], {  back="Letalis Mantle"})
	sets.precast.WS['Evisceration'].Mod = set_combine(sets.precast.WS['Evisceration'], {waist=gear.ElementalBelt})
	sets.precast.WS['Evisceration'].SA = set_combine(sets.precast.WS['Evisceration'].Mod, {})
	sets.precast.WS['Evisceration'].TA = set_combine(sets.precast.WS['Evisceration'].Mod, {})
	sets.precast.WS['Evisceration'].SATA = set_combine(sets.precast.WS['Evisceration'].Mod, {})

	sets.precast.WS["Rudra's Storm"] = set_combine(sets.precast.WS, {head="Pillager's Bonnet +1",ear1="Brutal Earring",ear2="Moonshade Earring"})
	sets.precast.WS["Rudra's Storm"].Acc = set_combine(sets.precast.WS["Rudra's Storm"], {  back="Letalis Mantle"})
	sets.precast.WS["Rudra's Storm"].Mod = set_combine(sets.precast.WS["Rudra's Storm"], {waist=gear.ElementalBelt})
	sets.precast.WS["Rudra's Storm"].SA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})
	sets.precast.WS["Rudra's Storm"].TA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})
	sets.precast.WS["Rudra's Storm"].SATA = set_combine(sets.precast.WS["Rudra's Storm"].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})

	sets.precast.WS["Shark Bite"] = set_combine(sets.precast.WS, {head="Pillager's Bonnet +1",ear1="Brutal Earring",ear2="Moonshade Earring"})
	sets.precast.WS['Shark Bite'].Acc = set_combine(sets.precast.WS['Shark Bite'], {  back="Letalis Mantle"})
	sets.precast.WS['Shark Bite'].Mod = set_combine(sets.precast.WS['Shark Bite'], {waist=gear.ElementalBelt})
	sets.precast.WS['Shark Bite'].SA = set_combine(sets.precast.WS['Shark Bite'].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})
	sets.precast.WS['Shark Bite'].TA = set_combine(sets.precast.WS['Shark Bite'].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})
	sets.precast.WS['Shark Bite'].SATA = set_combine(sets.precast.WS['Shark Bite'].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})

	sets.precast.WS['Mandalic Stab'] = set_combine(sets.precast.WS, {head="Pillager's Bonnet +1",ear1="Brutal Earring",ear2="Moonshade Earring"})
	sets.precast.WS['Mandalic Stab'].Acc = set_combine(sets.precast.WS['Mandalic Stab'], {  back="Letalis Mantle"})
	sets.precast.WS['Mandalic Stab'].Mod = set_combine(sets.precast.WS['Mandalic Stab'], {waist=gear.ElementalBelt})
	sets.precast.WS['Mandalic Stab'].SA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})
	sets.precast.WS['Mandalic Stab'].TA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})
	sets.precast.WS['Mandalic Stab'].SATA = set_combine(sets.precast.WS['Mandalic Stab'].Mod, { 
		body="Pillager's Vest +1",legs="Pillager's Culottes +1"})

	sets.precast.WS['Aeolian Edge'] = {ammo="Jukukik Feather",
		head="Thaumas Hat",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Hecate's Earring",
		body="Pillager's Vest +1",hands="Plun. Armlets",ring1="Rajas Ring",ring2="Demon's Ring",
		back="Toro Cape",waist="Thunder Belt",legs="Iuitl Tights",feet="Qaaxo Leggings"}
	
	
	-- Midcast Sets
	
	sets.midcast.FastRecast = {
		head="Whirlpool Mask",ear2="Loquacious Earring",
		body="Pillager's Vest +1",hands="Pillager's Armlets +1",
		back="Fravashi Mantle",legs="Kaabnax Trousers",feet="Iuitl Gaiters +1"}
		
	-- Specific spells
	sets.midcast.Utsusemi = {
		head="Whirlpool Mask",neck="Ej Necklace",ear2="Loquacious Earring",
		body="Pillager's Vest +1",hands="Pillager's Armlets +1",ring1="Beeline Ring",
		back="Fravashi Mantle",legs="Kaabnax Trousers",feet="Iuitl Gaiters +1"}

	-- Ranged gear -- acc + TH
	sets.midcast.RangedAttack = {
		head="Whirlpool Mask",neck="Ej Necklace",ear1="Clearview Earring",ear2="Volley Earring",
		body="Iuitl Vest",hands="Iuitl Wristbands",ring1="Beeline Ring",ring2="Hajduk Ring",
		back="Libeccio Mantle",waist="Aquiline Belt",legs="Nahtirah Trousers",feet="Iuitl Gaiters +1"}

	sets.midcast.RangedAttack.TH = {
		head="Pillager's Bonnet +1",neck="Ej Necklace",ear1="Clearview Earring",ear2="Volley Earring",
		body="Iuitl Vest",hands="Plun. Armlets",ring1="Beeline Ring",ring2="Hajduk Ring",
		back="Libeccio Mantle",waist="Aquiline Belt",legs="Nahtirah Trousers",feet="Qaaxo Leggings"}

	sets.midcast.RangedAttack.Acc = {
		head="Pillager's Bonnet +1",neck="Ej Necklace",ear1="Clearview Earring",ear2="Volley Earring",
		body="Iuitl Vest",hands="Buremte Gloves",ring1="Beeline Ring",ring2="Hajduk Ring",
		back="Libeccio Mantle",waist="Aquiline Belt",legs="Thurandaut Tights +1",feet="Pillager's Poulaines +1"}
	
	-- Sets to return to when not performing an action.
	
	-- Resting sets
	sets.resting = {head="Ocelomeh Headpiece +1",neck="Wiglen Gorget",
		ring1="Sheltered Ring",ring2="Paguroidea Ring"}
	

	-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)

	sets.idle = {
		head="Whirlpool Mask",neck="Twilight Torque",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Qaaxo Harness",hands="Iuitl Wristbands",ring1="Sheltered Ring",ring2="Patricius Ring",
		back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Fajin Boots"}

	sets.idle.Town = {
		head="Whirlpool Mask",neck="Twilight Torque",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Qaaxo Harness",hands="Iuitl Wristbands",ring1="Sheltered Ring",ring2="Patricius Ring",
		back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Fajin Boots"}
	
	sets.idle.Weak = {
		head="Whirlpool Mask",neck="Twilight Torque",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Qaaxo Harness",hands="Iuitl Wristbands",ring1="Sheltered Ring",ring2="Patricius Ring",
		back="Shadow Mantle",waist="Flume Belt",legs="Nahtirah Trousers",feet="Fajin Boots"}
	
	sets.ExtraRegen = {head="Ocelomeh Headpiece +1"}

	-- Defense sets

	sets.defense.Evasion = {
		head="Pillager's Bonnet +1",neck="Ej Necklace",
		body="Qaaxo Harness",hands="Pillager's Armlets +1",ring1="Beeline Ring",ring2="Dark Ring",
		back="Fravashi Mantle",waist="Flume Belt",legs="Kaabnax Trousers",feet="Iuitl Gaiters +1"}

	sets.defense.PDT = {ammo="Iron Gobbet",
		head="Pillager's Bonnet +1",neck="Twilight Torque",
		body="Iuitl Vest",hands="Pillager's Armlets +1",ring1="Beeline Ring",ring2="Dark Ring",
		back="Iximulew Cape",waist="Flume Belt",legs="Pillager's Culottes +1",feet="Iuitl Gaiters +1"}

	sets.defense.MDT = {ammo="Demonry Stone",
		head="Pillager's Bonnet +1",neck="Twilight Torque",
		body="Pillager's Vest +1",hands="Pillager's Armlets +1",ring1="Dark Ring",ring2="Shadow Ring",
		back="Engulfer Cape",waist="Flume Belt",legs="Pillager's Culottes +1",feet="Iuitl Gaiters +1"}

	sets.Kiting = {feet="Skadi's Jambeaux +1"}

	-- 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 = {ammo="Raider's Bmrng.",
		head="Thur. Chapeau +1",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Qaaxo Harness",hands="Plun. Armlets",ring1="Rajas Ring",ring2="Epona's Ring",
		back="Atheling Mantle",waist="Twilight Belt",legs="Quiahuiz Trousers",feet="Qaaxo Leggings"}
	sets.engaged.Acc = { 
		head="Whirlpool Mask",neck="Iqabi Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Manibozho Jerkin",hands="Buremte Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
		back="Letalis Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Qaaxo Leggings"}
	sets.engaged.Evasion = {ammo="Thew Bomblet",
		head="Thur. Chapeau +1",neck="Iqabi Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Manibozho Jerkin",hands="Pillager's Armlets +1",ring1="Beeline Ring",ring2="Epona's Ring",
		back="Boxer's Mantle",waist="Hurch'lan Sash",legs="Quiahuiz Trousers",feet="Qaaxo Leggings"}
	sets.engaged.Acc.Evasion = { 
		head="Whirlpool Mask",neck="Iqabi Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Pillager's Vest +1",hands="Pillager's Armlets +1",ring1="Beeline Ring",ring2="Epona's Ring",
		back="Letalis Mantle",waist="Hurch'lan Sash",legs="Kaabnax Trousers",feet="Qaaxo Leggings"}
	sets.engaged.PDT = {ammo="Thew Bomblet",
		head="Lithelimb Cap",neck="Twilight Torque",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Iuitl Vest",hands="Pillager's Armlets +1",ring1="Dark Ring",ring2="Epona's Ring",
		back="Iximulew Cape",waist="Patentia Sash",legs="Iuitl Tights",feet="Qaaxo Leggings"}
	sets.engaged.Acc.PDT = { 
		head="Lithelimb Cap",neck="Twilight Torque",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
		body="Manibozho Jerkin",hands="Pillager's Armlets +1",ring1="Dark Ring",ring2="Epona's Ring",
		back="Letalis Mantle",waist="Hurch'lan Sash",legs="Iuitl Tights",feet="Qaaxo Leggings"}
	sets.misc = {min="Sandung"}

end


-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks that are called to process player actions at specific points in time.
-------------------------------------------------------------------------------------------------------------------

function job_precast(spell, action, spellMap, eventArgs)
	if spell.type == 'Waltz' then
		refine_waltz(spell, action, spellMap, eventArgs)
	end
end


-- Run after the general precast() is done.
function job_post_precast(spell, action, spellMap, eventArgs)
	if spell.type == 'Step' or spell.type == 'Flourish1' then
		if state.TreasureMode ~= 'None' then
			equip(sets.TreasureHunter)
		end
	elseif spell.english=='Sneak Attack' or spell.english=='Trick Attack' then
		if state.TreasureMode == 'SATA' or state.TreasureMode == 'Fulltime' or tag_with_th then
			equip(sets.TreasureHunter)
		end
	end
end


-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_aftercast(spell, action, spellMap, eventArgs)
	-- Update the state of certain buff JAs if the action wasn't interrupted.
	if not spell.interrupted then
		if state.Buff[spell.name] ~= nil then
			state.Buff[spell.name] = true
		end
		
		-- Don't let aftercast revert gear set for SA/TA/Feint
		if S{'Sneak Attack', 'Trick Attack', 'Feint'}:contains(spell.english) then
			eventArgs.handled = true
		end
		
		-- If this wasn't an action that would have used up SATA/Feint, make sure to put gear back on.
		if spell.type:lower() ~= 'weaponskill' and spell.type:lower() ~= 'step' then
			-- If SA/TA/Feint are active, put appropriate gear back on (including TH gear).
			if state.Buff['Sneak Attack'] then
				equip(sets.precast.JA['Sneak Attack'])
				if state.TreasureMode == 'SATA' or state.TreasureMode == 'Fulltime' or tag_with_th then
					equip(sets.TreasureHunter)
				end
				eventArgs.handled = true
			elseif state.Buff['Trick Attack'] then
				equip(sets.precast.JA['Trick Attack'])
				if state.TreasureMode == 'SATA' or state.TreasureMode == 'Fulltime' or tag_with_th then
					equip(sets.TreasureHunter)
				end
				eventArgs.handled = true
			elseif state.Buff['Feint'] then
				equip(sets.precast.JA['Feint'])
				if state.TreasureMode == 'SATA' or state.TreasureMode == 'Fulltime' or tag_with_th then
					equip(sets.TreasureHunter)
				end
				eventArgs.handled = true
			end
		end
		
		if spell.target and spell.target.type == 'Enemy' then
			tag_with_th = false
			tp_on_engage = 0
		elseif (spell.type == 'Waltz' or spell.type == 'Samba') and tag_with_th then
			-- Update current TP if we spend TP before we actually hit the mob
			tp_on_engage = player.tp
		end
	end
end


-------------------------------------------------------------------------------------------------------------------
-- Customization hooks for idle and melee sets construction.
-------------------------------------------------------------------------------------------------------------------

function get_custom_wsmode(spell, action, spellMap)
	local wsmode = ''
	if state.Buff['Sneak Attack'] then
		wsmode = 'SA'
	end
	if state.Buff['Trick Attack'] then
		wsmode = wsmode .. 'TA'
	end
	
	if wsmode ~= '' then
		return wsmode
	end
end

function customize_idle_set(idleSet)
	if player.hpp < 80 then
		idleSet = set_combine(idleSet, sets.ExtraRegen)
	end
	
	return idleSet
end

function customize_melee_set(meleeSet)
	if state.TreasureMode == 'Fulltime' or tag_with_th then
		meleeSet = set_combine(meleeSet, sets.TreasureHunter)
	end
	
	return meleeSet
end

-------------------------------------------------------------------------------------------------------------------
-- General hooks for other events.
-------------------------------------------------------------------------------------------------------------------

-- Called when the player's status changes.
function job_status_change(newStatus, oldStatus, eventArgs)
	check_range_lock()
	
	-- If engaging, put on TH gear.
	-- If disengaging, turn off TH tagging.
	if newStatus == 'Engaged' and state.TreasureMode ~= 'None' then
		equip(sets.TreasureHunter)
		tag_with_th = true
		tp_on_engage = player.tp
		send_command('wait 3;gs c update th')
	elseif oldStatus == 'Engaged' then
		tag_with_th = false
		tp_on_engage = 0
	end

	-- If SA/TA/Feint are active, don't change gear sets
	if satafeint_active() then
		eventArgs.handled = true
	end
end

-- 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

		if not satafeint_active() then
			handle_equipping_gear(player.status)
		end
	end
end

windower.register_event('tp change', function(new, old)
if Autows == 1 then
		if player.tp > 999 then
			send_command('/ws "Evisceration" <t>')
			end
		end
end)

-- Called when the player's subjob changes.
function sub_job_change(newSubjob, oldSubjob)
	select_default_macro_book()
end

-------------------------------------------------------------------------------------------------------------------
-- Hooks for TH mode handling.
-------------------------------------------------------------------------------------------------------------------

-- Request job-specific mode tables.
-- Return true on the third returned value to indicate an error: that we didn't recognize the requested field.
function job_get_mode_list(field)
	if field == 'Treasure' then
		return options.TreasureModes, state.TreasureMode
	end
end

-- Set job-specific mode values.
-- Return true if we recognize and set the requested field.
function job_set_mode(field, val)
	if field == 'Treasure' then
		state.TreasureMode = val
		return true
	end
end


-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------

-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
	check_range_lock()

	if state.TreasureMode == 'None' then
		tag_with_th = false
		tp_on_engage = 0
	elseif tag_with_th and player.tp ~= tp_on_engage then
		tag_with_th = false
		tp_on_engage = 0
	elseif cmdParams[1] == 'th' and player.status == 'Engaged' then
		send_command('wait 3;gs c update th')
	end
	
	-- Update the current state of state.Buff, in case buff_change failed
	-- to update the value.
	state.Buff['Sneak Attack'] = buffactive['sneak attack'] or false
	state.Buff['Trick Attack'] = buffactive['trick attack'] or false
	state.Buff['Feint'] = buffactive['feint'] or false

	-- Don't allow normal gear equips if SA/TA/Feint is active.
	if satafeint_active() then
		eventArgs.handled = true
	end
end


-- Handle notifications of general user state change.
function job_state_change(stateField, newValue)
	if stateField == 'TreasureMode' then
		local prevRangedMode = state.RangedMode
		
		if newValue == 'Tag' or newValue == 'SATA' then
			state.RangedMode = 'TH'
		elseif state.OffenseMode == 'Acc' then
			state.RangedMode = 'Acc'
		else
			state.RangedMode = 'Normal'
		end
		
		if state.RangedMode ~= prevRangedMode then
			add_to_chat(121,'Ranged mode is now '..state.RangedMode)
		end
	elseif stateField == 'OffenseMode' then
		if state.TreasureMode == 'None' or state.TreasureMode == 'Fulltime' then
			local prevRangedMode = state.RangedMode

			if newValue == 'Acc' then
				state.RangedMode = 'Acc'
			else
				state.RangedMode = 'Normal'
			end
			
			if state.RangedMode ~= prevRangedMode then
				add_to_chat(121,'Ranged mode is now '..state.RangedMode)
			end
		end
	elseif stateField == 'Reset' then
		state.RangedMode = 'TH'
	end
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
	
	add_to_chat(122,'Melee: '..state.OffenseMode..'/'..state.DefenseMode..'  WS: '..state.WeaponskillMode..'  '..
		defenseString..'Kiting: '..on_off_names[state.Kiting]..'  TH: '..state.TreasureMode)

	eventArgs.handled = true
end

-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

-- Function to lock the ranged slot if we have a ranged weapon equipped.
function check_range_lock()
	if player.equipment.range ~= 'empty' then
		disable('range', 'ammo')
	else
		enable('range', 'ammo')
	end
end

-- Function to indicate if any buffs have been activated that we don't want to equip gear over.
function satafeint_active()
	return state.Buff['Sneak Attack'] or state.Buff['Trick Attack'] or state.Buff['Feint']
end

-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
	-- Default macro set/book
	if player.sub_job == 'DNC' then
		set_macro_page(2, 5)
	elseif player.sub_job == 'WAR' then
		set_macro_page(3, 5)
	elseif player.sub_job == 'NIN' then
		set_macro_page(4, 5)
	else
		set_macro_page(2, 5)
	end
end

function self_command(command)

	if command == 'A10' then -- Twilight Toggle --
		if Autows == 1 then
			Autows = 0
			add_to_chat(8,'Automated WS [Off]')
		else
			Autows = 1
			add_to_chat(158,'Automated WS [ON]')
		end
		status_change(player.status)

end
end
 Phoenix.Segagamer
Offline
Server: Phoenix
Game: FFXI
user: Segagamer
Posts: 9
By Phoenix.Segagamer 2014-12-28 06:50:38
Link | Quote | Reply
 
This lua isn't equipping my FC set whenever I have an avatar out, but has no problem with midcast. Anyone know how to sort that?
Code
beforecall = 0
sumskill = 417 + 16 + 115

PetName = S{"Garuda", "Carbuncle", "Diabolos", "Fenrir", "Caith Sith", "Leviathan", "Ifrit", "Titan", "Shiva"}
SpiritName = S{'Fire Spirit', 'Earth Spirit', 'Water Spirit', 'Air Spirit', 'Ice Spirit', 'Thunder Spirit', 'Light Spirit', 'Dark Spirit'}
SpecialAvatar = S{"Alexander", "Odin", "Atomos"}
 
-- a finir
Storm = {['Firestorm']='Fire',['Windstorm']='Air', ['Sandstorm']='Earth', ['Voidstorm']='Dark', ['Aurorastorm']='Light', ['Hailstorm']='Ice',['Rainstorm']='Water',['Thunderstorm']='Thunder'}
StormList = {'Firestorm','Windstorm', 'Sandstorm', 'Voidstorm', 'Aurorastorm', 'Hailstorm','Rainstorm','Thunderstorm'}
 
AvatarElement = {["Garuda"] = "Wind", ["Carbuncle"]="Light", ["Diabolos"]="Dark", ["Fenrir"]="Dark", ["Caith Sith"]="Light", ["Leviathan"]="Water", ["Ifrit"]="Fire", ["Titan"]="Earth", ["Shiva"]="Ice", ["Ramuh"]="Thunder"}
 
spirit_element = {['Fire']='Fire Spirit', ['Earth']='Earth Spirit', ['Water']='Water Spirit', ['Wind']='Air Spirit', ['Ice']='Ice Spirit', ['Lightning']='Thunder Spirit', ['Light']='Light Spirit', ['Dark']='Dark Spirit'}
spirit_conflict = {['Fire']='Ice', ['Earth']='Lightning', ['Water']='Fire', ['Wind']='Earth', ['Ice']='Wind', ['Lightning']='Water', ['Light']='Dark', ['Dark']='Light'}
 
 
bp_physical = {['Regal Scratch']=true, ['Punch']=true, ['Rock Throw']=true, ['Barracuda Dive']=true, ['Claw']=true, ['Axe Kick']=true, ['Shock Strike']=true, ['Camisado']=true, ['Poison Nails']=true, ['Moonlit Charge']=true, ['Crescent Fang']=true, ['Rock Buster']=true, ['Tail Whip']=true, ['Double Punch']=true, ['Megalith Throw']=true, ['Double Slap']=true, ['Eclipse Bite']=true, ['Mountain Buster']=true, ['Spinning Dive']=true, ['Predator Claws']=true, ['Rush']=true, ['Chaotic Strike']=true, ['Volt Strike']=true, ['Crag Throw']=true}
bp_hybrid = {['Burning Strike']=true, ['Flaming Crush']=true}
bp_magic = {['Inferno']=true, ['Earthen Fury']=true, ['Tidal Wave']=true, ['Aerial Blast']=true, ['Diamond Dust']=true, ['Judgment Bolt']=true, ['Searing Light']=true, ['Howling Moon']=true, ['Ruinous Omen']=true, ['Zantetsuken']=true, ['Somnolence']=true, ['Nether Blast']=true}
bp_magic_tp = {['Meteor Strike']=true, ['Geocrush']=true, ['Grand Fall']=true, ['Wind Blade']=true, ['Heavenly Strike']=true, ['Thunderstorm']=true, ['Fire II']=true, ['Stone II']=true, ['Water II']=true, ['Aero II']=true, ['Blizzard II']=true, ['Thunder II']=true, ['Fire IV']=true, ['Stone IV']=true, ['Water IV']=true, ['Aero IV']=true, ['Blizzard IV']=true, ['Thunder IV']=true, ['Thunderspark']=true, ['Meteorite']=true, ['Holy Mist']=true, ['Lunar Bay']=true, ['Night Terror']=true, ['Level ? Holy']=true, ['Conflag Strike']=true}
bp_accuracy = {['Mewing Lullaby']=true, ['Eerie Eye']=true, ['Lunar Cry']=true, ['Nightmare']=true, ['Lunar Roar']=true, ['Slowga']=true, ['Ultimate Terror']=true, ['Sleepga']=true, ['Tidal Roar']=true, ['Diamond Storm']=true, ['Shock Squall']=true, ['Pavor Nocturnus']=true}
-- Double table, for duration calculation
bp_duration = {
        ['Glittering Ruby']=90,
        ['Shining Ruby']=180,
        ['Frost Armor']=90,
        ['Rolling Thunder']=60,
        ['Crimson Howl']=30,
        ['Lightning Armor']=90,
        ['Ecliptic Growl']=180,
        ['Hastega II']=385,
        ['Noctoshield']=180,
        ['Ecliptic Howl']=180,
        ['Dream Shroud']=180,
        ['Earthen Armor']=95,
        ['Fleet Wind']=120,
        ['Heavenward Howl']=60,
		['Crystal Blessing']= 385,
		['Soothing Current'] =385}
 
icons = {
            ['Earthen Armor']    = 'spells/00299.png', -- 00299 for Titan
            ['Shining Ruby']     = 'spells/00043.png', -- 00043 for Protect
            ['Dream Shroud']     = 'spells/00304.png', -- 00304 for Diabolos
            ['Noctoshield']      = 'spells/00106.png', -- 00106 for Phalanx
            ['Crimson Howl']     = 'spells/00298.png', -- 00298 for Ifrit
            ['Hastega II']       = 'spells/00358.png', -- 00358 for Hastega
            ['Rolling Thunder']  = 'spells/00104.png', -- 00358 for Enthunder
            ['Frost Armor']      = 'spells/00250.png', -- 00250 for Ice Spikes
            ['Lightning Armor']  = 'spells/00251.png', -- 00251 for Shock Spikes
            ['Reraise II']       = 'spells/00135.png', -- 00135 for Reraise
            ['Fleet Wind']       = 'abilities/00074.png', --
			['Crystal Blessing'] = 'spells/00250.png', -- 00250 for TP Bonus
			['Soothing Current'] = 'spells/00300.png', -- 00300 for Soothing Current
        }      
       
       
bp_boon = {['Earthen Ward']=true, ['Aerial Armor']=true, ['Raise II']=true, ['Reraise II']=true, ['Healing Ruby']=true, ['Whispering Wind']=true, ['Spring Water']=true, ['Healing Ruby II']=true}
bp_skill = {['Perfect Defense']=true, ['Inferno Howl']=true, ['Soothing Ruby']=true}
 
 
MAB = S{"Stone", "Stone II", "Water", "Water II", "Aero", "Aero II", "Fire", "Fire II", "Thunder", "Thunder II", "Blizzard", "Blizzard II", "Geohelix", "Hydrohelix", "Anemohelix", "Pyrohelix", "Cryohelix", "Ionohelix", "Luminohelix", "Noctohelix"}
ENF = S{"Sleepga", "Drain", "Aspir", "Dispel", "Sleep", "Sleep II", "Paralyze", "Slow", "Poison", "Poison II", "Gravity", "Dia II", "Bio II", "Silence"}
CUR = S{"Cure", "Cure II", "Cure III", "Cure IV", "Curaga", "Curaga II"}
 
 
--[[Hagondes Body differentiation
HBodPerp = {name="Hagondes Coat +1"}
 Keraunos differentiation
KerACC = {name="Keraunos", augments={'Pet:"Regen"+2', 'Pet:"Mag.Atk.Bns"+11'}}
KerMAB = {name="Keraunos", augments={'Mag.Acc.+11', '"Mag.Atk.Bns."+11', '"Fast Cast"+2'}}
]]

 
function get_sets()
       
        -- IDLE
        sets.idle = {
                main='Bolelabunga',
                sub="Genbu's shield",
                head="Con. Horn +1",
                rear='Psystorm Earring',
				lear="Sanare Earring",
                body=HBodPerp,
                legs='Assid. Pants +1',
                neck='Twilight Torque',
                hands='Serpentes cuffs',
				ring1="Paguroidea Ring",
				ring2="Sheltered Ring",
                feet='Serpentes Sabots',
                waist='Fucho-no-obi',
                ammo="Dosis Tathlum",
                back="Iximulew Cape"}
 
        --  Perp : -13/tick + refresh +5 from gears
    sets.perpetuation = {
    main="Gridarvor",
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Glyphic Horn +1", augments={'Enhances "Astral Flow" effect',}},
    body= { name="Hagondes Coat +1", augments={'Phys. dmg. taken -2%','Pet: Mag. Acc.+14',}},
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Assid. Pants +1",
    feet="Con. Pigaches +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Andoaa Earring",
    right_ear="Summoning Earring",
    left_ring="Thurandaut Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
               
    sets.favor = {
    main="Gridarvor",
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Glyphic Horn +1", augments={'Enhances "Astral Flow" effect',}},
    body={ name="Hagondes Coat +1", augments={'Phys. dmg. taken -2%','Pet: Mag. Acc.+14',}},
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Assid. Pants +1",
    feet="Con. Pigaches +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Thurandaut Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape"}

       
    sets.spirit = {
   main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands="Glyphic Bracers +1",
    legs="Mdk. Shalwar +1",
    feet="Caller's Pgch. +2",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Evoker's Ring",
    right_ring="Fervor Ring",
    back="Conveyance Cape",
                }
       
    sets.resting = {
                head="Con. Horn +1",
                rear='Moonshade Earring',
                body='Hagondes Coat +1',
                legs='Assid. Pants +1',
                neck='Twilight Torque',
                main='Bolelabunga',
                hands='Serpentes cuffs',
                feet='Serpentes Sabots',
                waist='Fucho-no-obi'}
   
    sets.speed = {legs='Tatsu. Sitagoromo'}
       
        sets.ssp = {
                main='Gridarvor',
                ammo='Seraphicaller',
                head="Con. Horn +1",
                neck="Caller's Pendant",
                lear='Andoaa Earring',
                rear='Moonshade Earring',
                body='Hagondes Coat +1',
                hands='Glyphic Bracers +1',
                rring="Evoker's Ring",
                lring='Fervor Ring',
                back='Conveyance Cape',
                waist='Isa Belt',
                legs='Assid. Pants +1',
                feet="Desert Boots",
                sub="Vox Grip"}
               
    sets.ssi = {
                head="Con. Horn +1",
                rear='Moonshade Earring',
                body='Hagondes Coat +1',
                legs='Assid. Pants +1',
                neck='Twilight Torque',
                main='Bolelabunga',
                hands='Serpentes cuffs',
                feet='Desert Boots',
                waist='Fucho-no-obi',
                sub="Genbu's shield",
                ammo="Dosis Tathlum",
                back="Cheviot Cape"}   
 
    sets.precast = {}
       
    sets.precast.delay = {
        main="Gridarvor",
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Glyphic Horn +1", augments={'Enhances "Astral Flow" effect',}},
    body={ name="Glyphic Doublet", augments={'Reduces Sp. "Blood Pact" MP cost',}},
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs={ name="Glyphic Spats", augments={'Increases Sp. "Blood Pact" accuracy',}},
    feet="Con. Pigaches +1",
    neck="Caller's Pendant",
    waist="Mujin Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Perception Ring",
    right_ring="Acumen Ring",
    back="Samanisi Cape",}
               
    sets.precast.cede = {
	main="Bolelabunga",
    sub={ name="Genbu's Shield", augments={'"Cure" potency +1%','"Cure" spellcasting time -5%',}},
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body= { name="Hagondes Coat +1", augments={'Phys. dmg. taken -2%','Pet: Mag. Acc.+14',}},
    hands="Call. Bracers +2",
    legs="Assid. Pants +1",
    feet="Serpentes Sabots",
    neck="Twilight Torque",
    waist="Fucho-no-Obi",
    left_ear="Sanare Earring",
    right_ear="Psystorm Earring",
    left_ring="Paguroidea Ring",
    right_ring="Sheltered Ring",
    back="Iximulew Cape",
	}
       
    sets.precast.siphon = {
   main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands="Glyphic Bracers +1",
    legs="Mdk. Shalwar +1",
    feet="Caller's Pgch. +2",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Evoker's Ring",
    right_ring="Fervor Ring",
    back="Conveyance Cape",}
               
    sets.precast.FC = {
    main={ name="Keraunos", augments={'Mag. Acc.+11 "Mag.Atk.Bns."+11','"Fast Cast"+2',}},
    sub="Vivid Strap",
    ammo="Seraphicaller",
    head="Nahtirah Hat",
    body="Marduk's Jubbah +1",
    hands="Repartie Gloves",
    legs={ name="Artsieq Hose", augments={'MP+18','Mag. Acc.+14','MND+4',}},
    feet="Regal Pumps",
    neck="Eddy Necklace",
    waist="Witful Belt",
    left_ear="Loquac. Earring",
    right_ear="Novio Earring",
    left_ring="Strendu Ring",
    right_ring="Acumen Ring",
    back="Swith Cape",}
               
        sets.precast.cure = set_combine(sets.precast.FC, { legs="Nabu's Shalwar" })
   
        sets.midcast = {}
       
    sets.midcast.cure = {
                body="Heka's Kalasiris",
                head="Nahtirah Hat",
                hands="Bokwus Gloves",
                neck="Phalaina Locket",
                legs="Artsieq Hose",
                feet="Umbani Boots",
                back="Pahtli Cape",
                main="Tamaxchi",
                sub="Genbu's shield"}
               
    sets.midcast.stoneskin = {
                neck='Stone Gorget',
                lear='Magnetic Earring',
                rear='Loquacious Earring',
                back='Swith Cape',
                waist='Siegel Sash',
                legs='Artsieq Hose',
                head="Umuthi Hat",
                hands="Gende. Gloves +1",
                body="Anhur Robe"}
               
    sets.midcast.regen = {
                head="Umuthi Hat",
                main="Bolelabunga",
                body="Anhur Robe",
                waist="Siegel Sash",
                back="Swith cape"}
       
    sets.midcast.Enf = {
    main={ name="Keraunos", augments={'Mag. Acc.+11 "Mag.Atk.Bns."+11','"Fast Cast"+2',}},
    sub="Mephitis Grip",
    ammo="Seraphicaller",
    head={ name="Buremte Hat", augments={'Phys. dmg. taken -2%','Magic dmg. taken -2%','Magic Damage +4',}},
    body={ name="Artsieq Jubbah", augments={'MP+30','"Mag.Atk.Bns."+20','INT+7',}},
    hands="Lurid Mitts",
    legs="Mes'yohi Slacks",
    feet="Umbani Boots",
    neck="Eddy Necklace",
    waist="Fucho-no-Obi",
    left_ear="Lifestorm Earring",
    right_ear="Psystorm Earring",
    left_ring="Perception Ring",
    right_ring="Strendu Ring",
    back="Twilight Cape",}
               
    sets.midcast.Mab = {
       main={ name="Keraunos", augments={'Mag. Acc.+11 "Mag.Atk.Bns."+11','"Fast Cast"+2',}},
    sub="Vivid Strap",
    ammo="Seraphicaller",
    head="Buremte Hat",
    body={ name="Artsieq Jubbah", augments={'MP+30','"Mag.Atk.Bns."+20','INT+7',}},
    hands="Otomi Gloves",
    legs="Hagondes Pants +1",
    feet="Umbani Boots",
    neck="Eddy Necklace",
    waist="Sekhmet Corset",
    left_ear="Hecate's Earring",
    right_ear="Novio Earring",
    left_ring="Strendu Ring",
    right_ring="Acumen Ring",
    back="Searing Cape",
                }
				
	sets.midcast.MabSav = set_combine(sets.midcast.Mab, {
		back = "Savior Mantle"
	})
               
    sets.pet_midcast = {}
       
    sets.pet_midcast.physical = {
                main="Gridarvor",
                sub="Vox Grip",
                ammo="Seraphicaller",
                head="Hagondes Hat +1",
                ear1="Andoaa Earring",
                ear2="Smn. Earring",
        body="Convoker's Doublet +1",
                hands="Glyphic Bracers +1",
                ring1="Evoker's Ring",
                ring2="Thurandaut Ring",
        legs="Ngen Seraweels",
                feet="Convoker's Pigaches +1",
                neck="Caller's Pendant",
                back="Samanisi Cape",
                waist="Mujin Obi"}
               
    sets.pet_midcast.magic = {
                main='Frazil Staff',
                sub='Vox Grip',
                ammo='Seraphicaller',
                head='Glyphic Horn +1',
                neck='Eidolon Pendant +1',
                lear='Smn. Earring',
                rear='Andoaa Earring',
                body="Convoker's Doublet +1",
                hands='Hagondes Cuffs',
                lring='Fervor Ring',
                rring="Evoker's Ring",
                back='Samanisi Cape',
                waist="Caller's Sash",
                legs="Ngen Seraweels",
                feet='Hagondes Sabots +1'}
               
               
    sets.pet_midcast.magic.tp = set_combine(sets.pet_midcast.magic,
        {legs="Caller's Spats +2" })
               
    sets.pet_midcast.accuracy = {
    main={ name="Keraunos", augments={'Pet: Mag. Acc.+14','Pet: "Regen"+2',}},
    sub="Vox Grip",
	ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands="Regimen Mittens",
    legs={ name="Glyphic Spats", augments={'Increases Sp. "Blood Pact" accuracy',}},
    feet="Caller's Pgch. +2",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear="Psystorm Earring",
    left_ring="Fervor Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
               
    sets.pet_midcast.boon = {
                rear='Gifted Earring',
                waist="Jaq'ij Sash",
                legs="Caller's Spats +2"}
   
        sets.pet_midcast.skill = {     --105 total
    main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Mdk. Shalwar +1",
    feet="Mdk. Crackows +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Smn. Earring",
    right_ear="Andoaa Earring",
    left_ring="Fervor Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
   
        sets.pet_midcast.duration = {
    main={ name="Kirin's Pole", augments={'DMG:+23','Summoning magic skill +10',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Call. Doublet +2",
    hands={ name="Glyphic Bracers +1", augments={'Inc. Sp. "Blood Pact" magic burst dmg.',}},
    legs="Mdk. Shalwar +1",
    feet="Mdk. Crackows +1",
    neck="Caller's Pendant",
    waist="Isa Belt",
    left_ear="Smn. Earring",
    right_ear="Andoaa Earring",
    left_ring="Fervor Ring",
    right_ring="Evoker's Ring",
    back="Conveyance Cape",}
               
        sets.pet_midcast.hybrid = {
                main='Frazil Staff',
                sub='Vox Grip',
                ammo='Seraphicaller',
                head="Glyphic Horn +1",
                neck='Eidolon Pendant +1',
                lear='Smn. Earring',
                rear='Andoaa Earring',
                body="Convoker's Doublet +1",
                hands='Hagondes Cuffs',
                lring='Fervor Ring',
                rring="Evoker's Ring",
                back='Samanisi Cape',
                waist="Mujin Obi",
                legs="Ngen Seraweels",
                feet="Convoker's Pigaches +1"}
 
   
 
        sets.perpetuation['Alexander'] = sets.pet_midcast.skill
        sets.perpetuation['Odin'] = sets.pet_midcast.magic
		sets.perpetuation['Atomos'] = sets.pet_midcast.accuracy
       
   
end
 
 
 
function buff_change(name, gain)
    if name == "Sandstorm" then
        if gain then
            equip({feet="Desert Boots"})
        else
            idle()
        end
    end
   
end
 
       
     
 
function pet_change(pets, gain)
        beforecall = 0
    if pet.isvalid then
                --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Called ] *-*-*-*-*-*-*-*-*')
                if pet.name then
                        if pet.name:find('Spirit') then
                                equip(sets.spirit)
                        elseif pet.name == "Alexander" then
                                equip(sets.pet_midcast.skill)
                        elseif pet.name == "Odin" then
                                equip(sets.pet_midcast.magic)
						elseif pet.name == "Atomos" then
                                equip(sets.pet_midcast.accuracy)						
                        else
                                equip(sets.perpetuation[pet.name] or sets.perpetuation)
                        end
        else
            equip(sets.perpetuation[pet.name] or sets.perpetuation)
        end
    else
        equip(sets.idle)
    end
       
         
end
 
 
function status_change(new, old)
    if pet.isvalid == false then
        elseif new == 'Idle' then
           idle()
        elseif new == 'Resting' then
              idle()
    end
end
 
 
function precast(spell)
    if pet.isvalid then
		if buffactive['Astral Conduit'] then
			if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
				if bp_physical[spell.name] then
					equip(sets.pet_midcast.physical)
				elseif bp_magic_tp[spell.name] then
					if pet.tp < 220 then
						equip(sets.pet_midcast.magic.tp)
					else
						equip(sets.pet_midcast.magic)
					end
				elseif bp_magic[spell.name] then
					equip(sets.pet_midcast.magic)
                elseif bp_hybrid[spell.name] then
                    equip(sets.pet_midcast.hybrid)
				elseif bp_accuracy[spell.name] then
					equip(sets.pet_midcast.accuracy)
				elseif bp_duration[spell.name] then
                        duration = bp_duration[spell.name] + sumskill - 300
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Duration of '..spell.name..' = '..duration..' seconds ] *-*-*-*-*-*-*-*-*')
					equip(sets.pet_midcast.skill)
                        duration_pact_timer(spell.name)
				elseif bp_boon[spell.name] then
					equip(sets.pet_midcast.skill)
				elseif bp_skill[spell.name] then
					equip(sets.pet_midcast.skill)
				end
			
		else
			if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
				equip(sets.precast.delay)
			elseif spell.name == 'Elemental Siphon' then
				equip(sets.precast.siphon)
			elseif spell.name == 'Mana Cede' then
				equip(sets.precast.cede)
			elseif CUR:contains(spell.name) then
                equip(sets.precast.cure)       
            elseif spell.action_type == 'Magic' then
				equip(sets.precast.FC)                  
			end
		end
	end	
    elseif spell.action_type == 'Magic' then
               equip(sets.precast.FC)
    end
    if spell.name:find('Spirit') and beforecall == 1 then
                beforecall = 0
                b = 0
                -- A FINIR
                -- First : check storm, then check weather, then check day
                for i=1, 8 do
                        elem = StormList[i]
                        if buffactive[elem] then
                                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..elem..' active - '..Storm[elem]..' ] *-*-*-*-*-*-*-*-*')
                                cancel_spell()
                                send_command('input /ma "'..Storm[elem]..' Spirit" <me>')
                                b=1
                        end
                        i=i+1
                end
                if b == 0 then
                        if world.weather_element ~= "None" then
                                cancel_spell()
                                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..world.weather_element..' weather ] *-*-*-*-*-*-*-*-*')
                                windower.send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
                        else
                                cancel_spell()
                                windower.send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
                                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..world.day_element..' day ] *-*-*-*-*-*-*-*-*')
                        end
                end
    elseif spell.name == 'Sneak' then
        windower.ffxi.cancel_buff(71)
    elseif spell.name == 'Stoneskin' then
        windower.ffxi.cancel_buff(37)
               
         
       
       
    end
end
 
function midcast(spell)
       
        if spell.type == 'BloodPactRage'  or spell.type == 'BloodPactWard' then
                equip(sets.precast.delay)
        elseif spell.action_type == 'Magic' then
       
               
                if ENF:contains(spell.name) then
                        equip(sets.midcast.Enf)
                elseif spell.name  =='Stoneskin' then
                        equip(sets.midcast.stoneskin)
                elseif CUR:contains(spell.name) then
                        equip(sets.midcast.cure)
                elseif MAB:contains(spell.name) then
					if player.mpp > 50 then
                        equip(sets.midcast.Mab)
					else
						equip(sets.midcast.MabSav)
					end
       
                end
       
       
    end
 
end
 
 
function pet_midcast(spell)
        if SpecialAvatar:contains(pet.name) then
                return
        else
    if spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard' then
        if bp_physical[spell.name] then
            equip(sets.pet_midcast.physical)
        elseif bp_magic_tp[spell.name] then
			if pet.name =="Garuda" and pet.tp <170 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Titan" and pet.tp <170 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Leviathan" and pet.tp <210 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Ifrit" and pet.tp <250 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Shiva" and pet.tp <170 then
			   equip (sets.pet_midcast.magic.tp)
			elseif pet.name =="Ramuh" and pet.tp <210 then
			   equip (sets.pet_midcast.magic.tp)
			else   
                equip(sets.pet_midcast.magic)
            end
        elseif bp_magic[spell.name] then
            equip(sets.pet_midcast.magic)
                elseif bp_hybrid[spell.name] then
                    equip(sets.pet_midcast.hybrid)
        elseif bp_accuracy[spell.name] then
            equip(sets.pet_midcast.accuracy)
        elseif bp_duration[spell.name] then
                        duration = bp_duration[spell.name] + sumskill - 300
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Duration of '..spell.name..' = '..duration..' seconds ] *-*-*-*-*-*-*-*-*')
            equip(sets.pet_midcast.skill)
                        duration_pact_timer(spell.name)
        elseif bp_boon[spell.name] then
            equip(sets.pet_midcast.skill)
        elseif bp_skill[spell.name] then
            equip(sets.pet_midcast.skill)
        end
    end
        end
end
 
 
function aftercast(spell)
    idle()
end
 
function status_change(new,old)
        if new=="resting" then
        idle()
        elseif new=="engaged" then
        return
        else
        idle()
        end
end
 
 
       
function self_command(command)
    if command == 'Idle' then
        idle()
    end
end
 
 
function pet_aftercast(spell)
  idle()
end
 
 
 
function idle()
    if pet.isvalid then
        if string.find(pet.name,'Spirit') then
            equip(sets.spirit)
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - SpiritPerp Set ] *-*-*-*-*-*-*-*-*')
                       
        elseif buffactive["Avatar's Favor"] then
            equip(sets.favor)
                        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Avatar Favor Set ] *-*-*-*-*-*-*-*-*')
        else
          equip(sets.perpetuation[pet.name] or sets.perpetuation)
                  add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..pet.name..' - Perp Set ] *-*-*-*-*-*-*-*-*')
     
         
           
        end
                else
         equip(sets.idle)
        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ NO Pet - Idle Set ] *-*-*-*-*-*-*-*-*')
       
         end
end
 
-- FĂ©vrier et Mars DB
 
 
function duration_pact_timer(spell_name)
        -- Create custom timers for ward pacts.
    if bp_duration[spell_name] then
        local duration = bp_duration[spell_name]
        if duration < 181 then
            local skill = player.skills.summoning_magic
            if skill > 300 then
                skill = skill - 300
                if skill > 200 then skill = 200 end
                duration = duration + skill
            end
        end
       
                local timer_cmd = 'timers c "'..spell_name..'" '..tostring(duration)..' down'
               
                if icons[spell_name] then
                        timer_cmd = timer_cmd..' '..icons[spell_name]
                end
 
                send_command(timer_cmd)
    end
end

-- MAKE A MACRO : /tell <me> check
function open_coffer()
        CofferType = "Velkk Coffer"
        if player.inventory[CofferType] then
        NCoffer = player.inventory[CofferType].count
        bag = windower.ffxi.get_bag_info(0).count
        max = windower.ffxi.get_bag_info(0).max
        spots = max-bag
        if spots > 0 then
        add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..NCoffer..'x '..CofferType..' to open - Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
        local nextcommand = ""
        for i=1, spots do
                nextcommand = nextcommand .. 'input /item "'..CofferType..'" <me>; wait 2;'
        end
        nextcommand = nextcommand .. 'input /tell '..player.name..' check'
        send_command(nextcommand)
        else
                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
        end
        else
                add_to_chat(204, '*-*-*-*-*-*-*-*-* [ No '..CofferType..' in inventory ] *-*-*-*-*-*-*-*-*')
        end
end
 
 
windower.register_event('chat message', function(original, sender, mode, gm)
    local match
 
                                if sender == player.name then
                                        if original == "check" then
                                                open_coffer()
                                        end
                                end
 
    return sender, mode, gm
end)
-- Select default macro book on initial load or subjob change.
function select_default_macro_book(reset)
    if reset == 'reset' then
        -- lost pet, or tried to use pact when pet is gone
    end
    
    -- Default macro set/book
    set_macro_page(1, 3)
end
Offline
Posts: 516
By Kooljack 2014-12-28 23:23:11
Link | Quote | Reply
 
Cerberus.Conagh said: »

Better rule for Auto WS and Am3 managment however though is..
Code
windower.register_event('tp change', function(tp)
		if Autows == 1 then
		if not buffactive['amnesia'] then
			if buffactive["Aftermath: Lv.3"] then
				if player.tp > 999 and   player.status == 'Engaged' then
					windower.send_command('input /ws "Tachi: Fudo" <t>')
				end
			elseif player.tp > 2999 then
				windower.send_command('input /ws "Tachi: Rana" <t>')
			end
		end
	end	
end)

Can you provide the code that sets up for, ' autows = 1 '? I have autoweaponskill setup through autoexec; had no idea gs was able to do this also, but if i knew what the coding looked like to do this, it would be most helpful. thanks! Also where in the lua should i place these two bits exactly?
--tryna setup carnwenhan and possibly my yagrush for melee modes
First Page 2 3 ... 44 45 46 ... 181 182 183
Log in to post.