|
Gearswap Support Thread
Lakshmi.Byrth
VIP
Serveur: Lakshmi
Game: FFXI
Posts: 6184
By Lakshmi.Byrth 2015-01-07 10:18:27
That's likely due to double-tapping a WS macro without any protection against it in your code.
precast -> midcast -> action is sent the first time
precast -> midcast -> action is sent the second time
Error for the first one -> aftercast
Action 2 is successful in the aftercast set -> aftercast 2
So you need to add an if not midaction() then check to your aftercast set.
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2015-01-07 20:42:04
Quetzalcoatl.Mckenzee said: »a couple quick questions
will spell.skill return weaponskill for weaponskills?
i wanna make sure that this syntax will work as well
gorget.Distortion = (Snow Gorget)
sets.precast.weaponskill.[ws_name] = (
head = "helmet",
neck = gorget[spell.WSA],
ear1 = "earring")
also, i'm planning on using //gs export to populate individual gearset include files. 1 want to double check that after initializing the gearset, simply calling the include and defining the gearset inside the exported file will cover it.
edit: also, does export provide support for naming the files/sets or does that need to be editted by hand?
spell.skill will return the combat skill ("Dagger" etc). spell.type will return "Weaponskill" for weaponskills.
Your gorget code will not work for a number of reasons, including many syntax errors. The most fundamental, though, is a logical error: the spell table does not exist until it is passed to the precast, midcast, or aftercast functions (it is a local variable because you do not know what the spell is until you are processing an action). If you wanted to determine the right gorget before hitting those functions, you would need to load the resources, then look up the various properties by name using the weaponskill table.
However, that is not very dynamic. It'd be far better to point the neck to a table, and during the precast function, set that table's name property to that of an appropriate gorget, such that Mote does. Stealing his code from libs, since I'm assuming you don't use his templates:
First, instantiate the variables we need (the include is for Mote's own maps (https://github.com/Kinematics/Mote-libs/blob/master/Mote-Mappings.lua), to be used for the skillchain elements, and the default is in case you leave your gorget in inaccessible inventory)
Code include('Mote-Mappings.lua')
gear = {}
gear.default = {}
gear.ElementalGorget = {name = ""}
gear.ElementalBelt = {name = ""}
gear.default.weaponskill_neck = "Justiciar's Torque"
then, in your WS set, point to the gorget table
Code sets.precast.weaponskill.Combo = {
neck = gear.ElementalGorget
}
then, in the precast function, call this function,
Code set_elemental_gorget_belt(spell)
which will dynamically generate the appropriate string at gear.ElementalGorget.name based on the elemental properties of the weaponskill and your current inventory (taken from Mote-Utility.lua)
Code -- Set the name field of the predefined gear vars for gorgets and belts, for the specified weaponskill.
function set_elemental_gorget_belt(spell)
if spell.type ~= 'WeaponSkill' then
return
end
-- Get the union of all the skillchain elements for the weaponskill
local weaponskill_elements = S{}:
union(skillchain_elements[spell.skillchain_a]):
union(skillchain_elements[spell.skillchain_b]):
union(skillchain_elements[spell.skillchain_c])
gear.ElementalGorget.name = get_elemental_item_name("gorget", weaponskill_elements) or gear.default.weaponskill_neck or ""
gear.ElementalBelt.name = get_elemental_item_name("belt", weaponskill_elements) or gear.default.weaponskill_waist or ""
end
function get_elemental_item_name(item_type, valid_elements, restricted_to_elements)
local potential_elements = restricted_to_elements or elements.list
local item_map = elements[item_type:lower()..'_of']
for element in (potential_elements.it or it)(potential_elements) do
if valid_elements:contains(element) and (player.inventory[item_map[element]] or player.wardrobe[item_map[element]]) then
return item_map[element]
end
end
end
I haven't tested it, so let me know any errors; it's likely I've overlooked something since I'm really just copy and pasting segments of Mote's code and not actually looking through it.
To address the syntax errors, since you specifically asked:
1. Parenthesis are for functions, braces are for tables
2. Although it's meaningless from inside get_sets() either way, spell.WSA would actually need to be spell.wsA because just about everything is case sensitive. Mote uses spell.skillchain_a though, so the GS documentation may be out of date? Best way to see what a variable returns, or if it even exists, is to just put print(spell.wsA) from inside an appropriate function
3. Snow Gorget would need to be "Snow Gorget" because it is a string, otherwise the compiler will try to resolve each word as a variable and would run an error because you can't just list two variables like that
4. This is actually a logical error, but even if you did make "Snow Gorget" a string, neck would point to the table, not the string itself, and GS will not understand that because when it receives a table as a piece of equipment, it looks for the element at index ["name"], and the only element you have is [1]="Snow Gorget"
5. Periods and brackets both indicate the index of a table, but you can't use them together as you do in sets.precast.weaponskill.[ws_name]
As for your questions about //gs export, I am not sure what you're asking.
A Rather crude method would be to add a gain/loss function to check when you lose haste it sets a toggle
Toggle 0 no haste
toggle 1 Haste 1
Toggle 2 Haste 2
Triggers for toggle 1 and 2 would be something like this ..this is not the right way to parse chat messages and is just an example for a work around, it may be easier to just use the Packet id's like Batlemod does and make the trigger work directly from Battlemod updating this data within an include for your gearswap file.
Packet manipulation is a little beyond my skill but if I nail the chat log function to check it (and that target is you) then this could work... subject to some issues obviously and this is just a preliminary idea.
Code windower.register_event('Chat Message',function(chat)
if string S{'Haste II','Haste 2'} then
HasteToggle == 2
elseif string S{'Haste'} then
HasteToggle == 1
end
end
Packet id's etc would be better in ways but then it's subject to Battlemod being maintained etc or rather that people who use this aspect if it were included report it if it breaks. But Packet ID parsing is for more robust than checking chat log messages (especially if you block those form your chat log).
P.S I'm learning how packets work and how to write the code for it, so if Flippant or Bryth don't beat me to it! I'll post somewhere, might even ask for it to be put into a repository or something
Someone once asked me about this before, in terms of parsing the chat. You don't want to change the toggle just because someone -initiates- the cast on you, for a couple reasons:
1. They could get interrupted
2. They could be casting Haste on you while you have Haste II and will get no effect; or, similarly, in situations you have a strong Slow on you
So you would need to focus on you -receiving- the haste. However, therein lies the issue since, when you gain the buff, it only says "haste" regardless of the level of haste. Can be done with a lot of hardcoding since it's not like the scenarios are infinite; it's just ugly.
As for solving it with packets, I'd have to actually log in to fiddle around and find out if and how and I am far too lazy for that v_v; All I know is you'd have to look somewhere further than just buff IDs, since they share the same number. That said, GEO Haste does have a different ID, so it'd be relatively easy to deal with that.
Bismarck.Stanislav said: »I was wondering how to add sets with certain buffs such as haste2/geo-haste. My current THF/NIN lua uses certain buff stages such as haste only, haste & march, etc. and I wanted to add in sets with Haste2 & Indi/Geo-Haste as well. Thanks in advanced!
Haste from GEO spells is also called Haste, but since it stacks with the normal Haste spell, you can use buffactive.Haste==2. The only issue is determining whether you have Haste II + one March, GEO Haste + one March, and any Haste + one SV March. I just have a manual toggle for special situations like that, but other than that, there's nothing you can do just using the basic GS functions.
It does this, can also have various acc sets so if you say I want Low Acc, you can define a low acc ws set (can have infinite sets controlled by a toggle or by an acc parse rule to auto adjust sets etc....) you would have 1 WS macro but a toggle (so 2 macros to control what could be 10 sets)
You dont need a macro for TP gear it equis it after your WS is complete / spells / ja
Also accounts for instant cast etc.
and Makes gearing easier (you can swap from 80 slots on WAR to 80 slots of gear for WHM in about 2~3minutes)
Oh, alright. I can definitely see why everyone suggests this addon then. Thanks for the information.
And I'll have to read up on the first part about having multiple sets because it sounds pretty cool.
Another question:
I plan on tinkering around with this while leveling DNC. Obviously, I won't have a bunch of different sets, maybe just a ws set and some sets for my JAs.
If I leave the level 99 gearsets / gear I don't have in the script, will anything go wrong? Obviously, I won't be able to use level 99 gear at level ~55.
Conagh kinda answers your question, but I want to make sure you understand that just downloading the addon doesn't do anything for you automatically: the addons simply provides a platform for you to automate processes based on game events, the most common of which being equip changes. It's like a macro that is dynamic (what happens when you press the macro changes depending on your environment). If you set up a rule to equip a set based on your WS, then yes, it will automatically equip the gear for you. If you don't, it won't.
As for leaving the gear in, it shouldn't be a problem. Pretty sure Byrth has a check that prevents trying to send the packets out if it determines that you can't actually equip the gear.
[+]
Quetzalcoatl.Valli
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1420
By Quetzalcoatl.Valli 2015-01-07 21:54:06
That's likely due to double-tapping a WS macro without any protection against it in your code.
precast -> midcast -> action is sent the first time
precast -> midcast -> action is sent the second time
Error for the first one -> aftercast
Action 2 is successful in the aftercast set -> aftercast 2
So you need to add an if not midaction() then check to your aftercast set.
I wish I could say it's something as simple as a "double-tap" persay, but it isn't. I can only assume it's due to the fact that 15 enemies are attacking and the packets just get jumbled.
Just to test it a couple times I would use the ws from the menu, to be certain it wasn't getting double pressed. Still occassionally fired in the wrong set. Makes me wonder, how many storms/smites/evis/etcetcetc were fired off in the wrong sets.
Serveur: Asura
Game: FFXI
By Asura.Limelol 2015-01-07 22:10:22
Ragnarok.Flippant said: »Conagh kinda answers your question, but I want to make sure you understand that just downloading the addon doesn't do anything for you automatically: the addons simply provides a platform for you to automate processes based on game events, the most common of which being equip changes. It's like a macro that is dynamic (what happens when you press the macro changes depending on your environment). If you set up a rule to equip a set based on your WS, then yes, it will automatically equip the gear for you. If you don't, it won't.
As for leaving the gear in, it shouldn't be a problem. Pretty sure Byrth has a check that prevents trying to send the packets out if it determines that you can't actually equip the gear.
I see. I think I get how it works now, at least for the most part. Thanks for your input as well.
I'll start tinkering around with it to see what happens the next time I'm able to log on.
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-07 22:12:01
Quetzalcoatl.Valli said: »What does one have to do to ensure gearswap always works? Cause I hate to break this, but it does not always get the gear on fast enough for the ws to process.
It's very obvious when using magical ws when the program fails to act quickly enough.
Fail vs success
1000 tp in the proper set minimum is 4k. meaning that first one was fired off in my melee set. Granted this only happens maybe 1 every 50 pulls, but 0 times is too many.
Based on your response above, any chance you could post your GS file and I can have a look see if it's something simple?
and Midaction() has it's own bugs. (ie 8 second cool down to cancel any packet data sent out that doesn't receive a return packet for example and locks your sets up.) so having it in could actually kill your WS swaps.
Quetzalcoatl.Valli
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1420
By Quetzalcoatl.Valli 2015-01-07 22:15:12
It's monts gs, I've just been changing the gear as I go, deleting unneeded things etc. Still working on it.
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', 'Party')
state.HybridMode:options('Normal', 'PDT')
state.RangedMode:options('Normal', 'Acc')
state.WeaponskillMode:options('Normal', 'Acc')
state.PhysicalDefenseMode:options('PDT')
-- 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 = {waist="Chaac Belt",
head="Felistris Mask",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Thaumas Coat",hands="Plunderer's Armlets +1",ring1="Epona's Ring",ring2="Rajas Ring",
back="Canny Cape",legs="Quiahuiz Trousers",feet="Raider's Poulaines +2"}
-- 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",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="Assassin's Culottes +2"}
sets.precast.JA['Lunge'] = {head="Highwing Helm",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Crematio Earring",
body="Sombra Harness",hands="Nilas Gloves",ring1="Acumen Ring",ring2="Demon's Ring",
back="Toro Cape",waist="Salire Belt",legs="Shneddick Tights +1",feet="Qaaxo Leggings"}
sets.precast.JA['Swipe'] = {head="Highwing Helm",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Crematio Earring",
body="Sombra Harness",hands="Nilas Gloves",ring1="Acumen Ring",ring2="Demon's Ring",
back="Toro Cape",waist="Salire Belt",legs="Shneddick Tights +1",feet="Qaaxo Leggings"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {Range="Sonia's Plectrum",
head="Whirlpool Mask",
body="Pillager's Vest +1",hands="Pillager's Armlets +1",ring1="Asklepian Ring",
back="Iximulew Cape",waist="Caudata Belt",legs="Pillager's Culottes +1",feet="Plunderer's Poulaines +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.RA = {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
sets.precast.WS = {Ammo="Jukukik Feather",
head="Whirlpool Mask",neck=gear.ElementalGorget,ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Dread Jupon",hands="Pillager's Armlets +1",ring1="Karieyh Ring",ring2="Ramuh Ring",
back="Bleating Mantle",waist=gear.ElementalBelt,legs="Pillager's Culottes +1",feet="Plunderer's Poulaines +1"}
sets.precast.WS['Aeolian Edge'] = {
head="Highwing Helm",neck="Stoicheion Medal",ear1="Friomisi Earring",ear2="Moonshade Earring",
body="Sombra Harness",hands="Nilas Gloves",ring1="Acumen Ring",ring2="Demon's Ring",
back="Toro Cape",waist="Salire Belt",legs="Shneddick Tights +1",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="Canny Cape",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="Canny Cape",legs="Kaabnax Trousers",feet="Iuitl Gaiters +1"}
-- Ranged gear
sets.midcast.RA = {
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.RA.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"}
--------------------------------------
-- Idle/resting/defense sets
--------------------------------------
-- Resting sets
sets.resting = {head="Ocelomeh Headpiece +1",neck="Wiglen Gorget",
ring1="Karieyh Ring",ring2="Sheltered Ring",}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle = {
head="Ocelomeh Headpiece +1",neck="Wiglen Gorget",ear1="Dawn Earring",ear2="Colossus's Earring",
body="Kheper Jacket",hands="Umuthi Gloves",ring1="Karieyh Ring",ring2="Sheltered Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Thaumas Kecks",feet="Skadi's Jambeaux +1"}
sets.idle.Town = {
head="Ocelomeh Headpiece +1",neck="Wiglen Gorget",ear1="Dawn Earring",ear2="Colossus's Earring",
body="Kheper Jacket",hands="Umuthi Gloves",ring1="Karieyh Ring",ring2="Sheltered Ring",
back="Shadow Mantle",waist="Flume Belt",legs="Thaumas Kecks",feet="Skadi's Jambeaux +1"}
-- Defense sets
sets.defense.PDT = {
head="Lithelimb Cap",neck="Twilight Torque",ear1="Sanare Earring",ear2="Colossus's Earring",
body="Emet Harness",hands="Umuthi Gloves",ring1="Patricius Ring",ring2="Defending Ring",
back="Mollusca Mantle",waist="Flume Belt",legs="Pillager's Culottes +1",feet="Plumb Boots"}
sets.defense.MDT = {
head="Pillager's Bonnet +1",neck="Twilight Torque",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Pillager's Vest +1",hands="Pillager's Armlets +1",ring1="Shadow Ring",ring2="Defending Ring",
back="Engulfer Cape +1",waist="Flume Belt",legs="Pillager's Culottes +1",feet="Iuitl Gaiters +1"}
--------------------------------------
-- Melee sets
--------------------------------------
-- Normal melee group
sets.engaged = {Range="Ginsen",
head="Felistris Mask",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Skadi's Cuirie +1",hands="Nilas Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
back="Bleating Mantle",waist="Patentia Sash",legs="Quiahuiz Trousers",feet="Plunderer's Poulaines +1"}
sets.engaged.Acc = {Ammo="Ginsen",
head="Whirlpool Mask",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Pillager's Vest +1",hands="Buremte Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
back="Letalis Mantle",waist="Anguinus Belt",legs="Quiahuiz Trousers",feet="Durgai Leggings"}
sets.engaged.PDT = {
head="Lithelimb Cap",neck="Twilight Torque",ear1="Brutal Earring",ear2="Colossus's Earring",
body="Dread Jupon",hands="Umuthi Gloves",ring1="Patricius Ring",ring2="Defending Ring",
back="Mollusca Mantle",waist="Flume Belt",legs="Pillager's Culottes +1",feet="Plumb Boots"}
sets.engaged.Party = {Ammo="Ginsen",
head="Felistris Mask",neck="Asperity Necklace",ear1="Suppanomimi",ear2="Brutal Earring",
body="Thaumas Coat",hands="Nilas Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
back="Bleating Mantle",waist="Patentia Sash",legs="Iuitl Tights +1",feet="Plunderer's Poulaines +1"}
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.precast.WS['Aeolian Edge'])
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', 'Range')
else
enable('range', 'Range')
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(10, 6)
elseif player.sub_job == 'WAR' then
set_macro_page(4, 6)
elseif player.sub_job == 'NIN' then
set_macro_page(1, 6)
else
set_macro_page(3, 6)
end
end
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-07 22:18:25
Line 326
Code if not midaction() then
handle_equipping_gear(player.status)
If you have attempted to send out a packet, and it never send a return packet (ie you did touple tap a spell or something). It wont handle equip.
try removing the If not Midaction() and have a try.
I had the same issue on my thf (I hate using motes gearswaps personally due to the vast code that I didn't read or make the logic for, makes it harder to bug test) and removing it, fixed this issue.
Quetzalcoatl.Valli
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1420
By Quetzalcoatl.Valli 2015-01-07 22:22:53
It is a little overcomplicated... Been trying to stream line it as much as possible, little tougher when you don't have a damn clue what half the ***is for lol.
I'll delete that part and see how it goes. (I don't THINK that's the issue, but it could be.)
How much of this: Code -------------------------------------------------------------------------------------------------------------------
-- 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
Do I delete? The whole thing, just the 2 lines?
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-07 22:26:23
Code -------------------------------------------------------------------------------------------------------------------
-- 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
handle_equipping_gear(player.status)
end
end
Should do the trick.
If not I have a Bugging Template I use for my own files (sets that specify and deal with on action i.e WS / Ja / Precast / mid cast / aftercast / change buff etc etc and I'll PM you the WS testing stuff to make sure it changes it.
Quetzalcoatl.Valli
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1420
By Quetzalcoatl.Valli 2015-01-08 00:17:28
That did not fix it;
Worked fine for about an hour, but still rarely, fails. If it's due to the nature of the cleave, having so many mobs attacking, that's understandable.
//showswaps shows that it is actually swapping the correct gear (obviously) it's just not always processing.
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2015-01-08 03:03:40
What the not midaction() check is doing in these cases is making sure that you don't change gear if you are in the process of doing an action. For example, your TP set changes if you gain or lose Feint (you want AF2 pants equipped when it's on), so that code will swap you into the new set. If you delete the midaction() check, it will equip you into the set when you gain or lose the buff, even if you're in the middle of a WS. That is bad for obvious reasons. You should not remove it, unless you want to make it more likely to mess up your WS gear.
I don't know what your issue is, but it's not the buff_change thing.
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-08 15:27:34
this should make it work? Code
function job_buff_change(buff, gain)
if not midaction() then
status_change(player.status)
handle_equipping_gear(player.status)
end
end
Activating a WS is a status change and shouldn't need to be forced.
It could (and I stress this part) be an in issue with the incoming packet chunk being broken? while having 40 mobs hitting you.
Only way to see if it's the gearswap or something else (If it was me, I'd just arse inc packets etc but) would be to use a standard GS file not using motes and see if it's something that's inherint in this,
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-08 15:29:25
Ragnarok.Flippant said: »What the not midaction() check is doing in these cases is making sure that you don't change gear if you are in the process of doing an action. For example, your TP set changes if you gain or lose Feint (you want AF2 pants equipped when it's on), so that code will swap you into the new set. If you delete the midaction() check, it will equip you into the set when you gain or lose the buff, even if you're in the middle of a WS. That is bad for obvious reasons. You should not remove it, unless you want to make it more likely to mess up your WS gear.
I don't know what your issue is, but it's not the buff_change thing.
Actually I used Vallis GS file and experienced the issue, but using a basic THF Template, I never saw this issue. (last night that ill today I forgot I tested it).
Worked fine for 2 hours (could be too small a sample)
Serveur: Asura
Game: FFXI
By Asura.Limelol 2015-01-08 16:06:54
If I leave the level 99 gearsets / gear I don't have in the script, will anything go wrong? Obviously, I won't be able to use level 99 gear at level ~55.
Providing an update on this because I was able to log on to test it.
I'm sure most people already knew or assumed this, but if you leave the gear in and you can't use it, it will still function properly.
For example, on my 60 DNC, I found the sets it would used. All of it was 99 gear. I changed 1 piece of gear to a low level piece of gear and it swapped into it flawlessly.
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 04:10:33
Something I've wondered (not seen it anywhere but hmmm).
Does GS have within it the ability to see if you behind a mob?
Leviathan.Arcon
VIP
Serveur: Leviathan
Game: FFXI
Posts: 666
By Leviathan.Arcon 2015-01-09 04:40:18
This is a piece of code I wrote on the Windower forums a while back. It aborts if you cannot see the mob:
Code require('vectors')
precast = function(spell)
if spell.target.type == 'MONSTER' then
local dir = V{spell.target.x, spell.target.y} - V{player.x, player.y}
local heading = V{}.from_radian(player.facing)
local angle = V{}.angle(dir, heading):degree():abs()
if angle > 90 then
print('Aborting...')
cancel_spell()
return
end
end
-- Other crap
end
This can be adjusted to check the mob's facing compared to yours. I haven't tested this yet, but it's a pretty minor change:
Code require('vectors')
check_mob_facing = function(mob)
local facing = vector.from_radian(mob.facing)
local direction = V{player.x, player.y} - V{mob.x, mob.y}
local angle = vector.angle(direction, facing):degree():abs()
return angle > 90
end
This will return true if the mob is looking away from you (more than 90 degrees). If you want to increase it, just increase the number in the return statement.
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 04:47:23
This is a piece of code I wrote on the Windower forums a while back. It aborts if you cannot see the mob:
Code require('vectors')
precast = function(spell)
if spell.target.type == 'MONSTER' then
local dir = V{spell.target.x, spell.target.y} - V{player.x, player.y}
local heading = V{}.from_radian(player.facing)
local angle = V{}.angle(dir, heading):degree():abs()
if angle > 90 then
print('Aborting...')
cancel_spell()
return
end
end
-- Other crap
end
This can be adjusted to check the mob's facing compared to yours. I haven't tested this yet, but it's a pretty minor change:
Code require('vectors')
check_mob_facing = function(mob)
local facing = vector.from_radian(mob.facing)
local direction = V{player.x, player.y} - V{mob.x, mob.y}
local angle = vector.angle(dir, heading):degree():abs()
return angle > 90
end
This will return true if the mob is looking away from you (more than 90 degrees). If you want to increase it, just increase the number in the return statement.
Nice can use this to update TP sets bodies.
Thanks
Quetzalcoatl.Valli
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1420
By Quetzalcoatl.Valli 2015-01-09 08:32:37
Where does one add this to the code?
*edited* instead of being intelligent and looking, I asked, THEN went to go look, and removed it.
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 08:33:26
Quetzalcoatl.Valli said: »Where does one add this to the code? Also, I assume you were asking in reference to ambush, and that this is an RQT, but anyway.
Does the TA+5% work regardless of the direction, so long as you have the merits. I know that the ACC only counts from the back.
Only applies if you are behind the mob
Quetzalcoatl.Valli
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1420
By Quetzalcoatl.Valli 2015-01-09 08:40:37
Any chance you could take the gs i posted back there, and show me specifically where to add that directional rule for the tp set?
As well as where an if buff active march rule would go for the tp sets, I get the general idea, just don't know how to apply it.
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 08:50:31
Quetzalcoatl.Valli said: »Any chance you could take the gs i posted back there, and show me specifically where to add that directional rule for the tp set?
As well as where an if buff active march rule would go for the tp sets, I get the general idea, just don't know how to apply it.
Er I don't use motes gearswaps to know if it works, because his includes *** block alot of other things....... I can have a look in a bit I guess
Quetzalcoatl.Valli
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1420
By Quetzalcoatl.Valli 2015-01-09 08:52:46
See I don't even know what that means. I'm only using his because it's easily available.
If there was a more streamlined version, that still did everything I need it to do (and the things it does that I have no idea how they work like Waltz calculations...).
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 08:54:14
Quetzalcoatl.Valli said: »See I don't even know what that means. I'm only using his because it's easily available.
If there was a more streamlined version, that still did everything I need it to do (and the things it does that I have no idea how they work like Waltz calculations...).
Well for example ~
Adding my own commands don't work~
Adding Automated WS's based on TP don't work~
just a couple of things, I'll post one with what you need later on, I'd need to build it I guess.
Valefor.Ophannus
Serveur: Valefor
Game: FFXI
Posts: 241
By Valefor.Ophannus 2015-01-09 12:47:00
Pastebin: http://pastebin.com/3TK5hNxg
I have a set called StunAlacrity
Code function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
if spell.english == 'Stun' and buffactive['Alacrity'] then
equip(sets.StunAlacrity)
When Alacrity is active and Stun is cast, it's supposed to use StunAlacrity set, not my regular stun set. For some reason it never uses my StunAlacrity set however.
Frequently when I cast stun, after the cast, I return to my idle set. But 50% of the time when returning to my idle set, everything is switched back to idle EXCEPT for Apamajas II and Sangoma Ring. When I cast stun AGAIN, it will swap all 16 slots back to idle. It's weird. 50% of stuns aftercast in full idle, 50% of stun casts aftercast in full idle but leave on the main and right_ring from my stun set. Can't figure it out. It's not a spelling or syntax issue because, like I said, I'll cast stun once, and return to idle gear, then cast stun again and return to all idle gear except my Apamajas II and Sangoma Ring remain on. It alternates between these two 50/50, every time.
Also when Aurorastorm is up, the lua never puts on my CureWithLightWeather set even though I have this code:
Code function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if world.weather_element == 'Light' then
return 'CureWithLightWeather'
end
Instead it just uses my regular cure set, every time(probably a similar issue is going on with my stuns not detecting if alacrity is up)
Please assist :(
If Mote's include is screwing ***up, can anyone just give me their workable SCH gearswap and I'll just migrate my sets over and use that? Need to be able to have a gearswap that uses specific gear for spells depending on strategems/weather/day.
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 12:50:30
Pastebin: http://pastebin.com/3TK5hNxg
I have a set called StunAlacrity
Code function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
if spell.english == 'Stun' and buffactive['Alacrity'] then
equip(sets.StunAlacrity)
When Alacrity is active and Stun is cast, it's supposed to use StunAlacrity set, not my regular stun set. For some reason it never uses my StunAlacrity set however.
Frequently when I cast stun, after the cast, I return to my idle set. But 50% of the time when returning to my idle set, everything is switched back to idle EXCEPT for Apamajas II and Sangoma Ring. When I cast stun AGAIN, it will swap all 16 slots back to idle. It's weird. 50% of stuns aftercast in full idle, 50% of stun casts aftercast in full idle but leave on the main and right_ring from my stun set. Can't figure it out...
Also when Aurorastorm is up, the lua never puts on my CureWithLightWeather set even though I have this code:
Code function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if world.weather_element == 'Light' then
return 'CureWithLightWeather'
end
Please assist :(
I use this really basic SCH one, I don't take the job seriously so I'm sure there's better but it has various stun sets. You could use this until either Motenten comes back explains, or someone else who uses Motes GS files explains.
Code function get_sets()
send_command('input /macro book 4;wait .1;input /macro set 1') -- Change Default Macro Book Here --
timer_reg = {}
perp_cycle = false
sets = {}
sets.aftercast_Idle_noSub = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
head="Nefer Khat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Heka's Kalasiris",hands="Serpentes Cuffs",ring1="Woltaris Ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Assiduity Pants +1",feet="Serpentes Sabots"}
sets.aftercast_Idle_Sub = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
head="Nefer Khat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Heka's Kalasiris",hands="Serpentes Cuffs",ring1="Woltaris Ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Assiduity Pants +1",feet="Serpentes Sabots"}
sets.aftercast_IdleStun = {main="Apamajas II",sub="Mephitis Grip",ammo="Inacantor Stone",
head="Nahtirah Hat",neck="Eddy Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hedera Cotehardie",hands="Acad. Bracers",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Swith Cape",waist="Witful belt",legs="Artsieq Hose",feet="Peda. Loafers"}
sets.ExtremeStun = {main="Lehbrailg +2",sub="Mephitis Grip",ammo="Inacantor Stone",
head="Peda. M.Board +1",neck="Eddy Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hedera Cotehardie",hands="Acad. Bracers",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Swith Cape",waist="Witful belt",legs="Artsieq Hose",feet="Peda. Loafers"}
sets.aftercast_IdleNight = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
head="Nefer Khat",neck="Twilight Torque",ear1="Merman's Earring",ear2="Coral Earring",
body="Heka's Kalasiris",hands="Serpentes Cuffs",ring1="Dark ring",ring2="Woltaris Ring",
back="Cheviot Cape",waist="Siegel Sash",legs="Assiduity Pants +1",feet="Theo. Duckbills +1"}
sets.aftercast_Idle119 = {main="Terra's Staff",ammo="Incantor Stone",
head="Gendewitha Caubeen",neck="Twilight Torque",ear1="Merman's Earring",ear2="Coral Earring",
body="Hagondes Coat",hands="Gendewitha Gages",ring1="Dark ring",ring2="Patricius Ring",
back="Cheviot Cape",waist="Siegel Sash",legs="Artsieq Hose",feet="Gendewitha Galoshes"}
sets.aftercast_IdleDay = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
head="Nefer Khat",neck="Twilight Torque",ear1="Merman's Earring",ear2="Coral Earring",
body="Heka's Kalasiris",hands="Lurid Mitts",ring1="Dark ring",ring2="Woltaris Ring",
back="Cheviot Cape",waist="Siegel Sash",legs="Assiduity Pants +1",feet="Serpentes Sabots"}
sets.aftercast_Move = {main="Bolelabunga",sub="Genbu's Shield",ammo="Incantor Stone",
head="Nefer Khat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Heka's Kalasiris",hands="Serpentes Cuffs",ring1="Woltaris Ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Assiduity Pants +1",feet="Desert boots"}
sets.aftercast_Idle = sets.aftercast_Idle_noSub
sets.precast_FastCast = {ammo="Incantor Stone",head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",back="Swith Cape",legs="Artsieq hose",feet="Peda. Loafers"}
sets.Resting = {main="Chatoyant Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Nares Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Assiduity Pants +1",feet="Chelona Boots"}
--MAB Sets--
sets.midcast_ElementalMagic = {}
sets.midcast_ElementalMagic.index = {'Standard','Accuracy'}
midcast_ElementalMagic_ind = 1
sets.midcast_ElementalMagic.Standard = {
main="Keraunos",
sub="Mephitis Grip",
ammo="Savant's Treatise",
head="Hagondes Hat",
body="Hagondes Coat",
hands="Hagondes Cuffs +1",
legs="Hagondes Pants +1",
feet="Umbani Boots",
neck="Eddy Necklace",
waist="Aswang Sash",
left_ear="Friomisi Earring",
right_ear="Hecate's Earring",
left_ring="Icesoul Ring",
right_ring="Sangoma Ring",
back="Toro Cape"}
sets.midcast_ElementalMagic.Accuracy = {
main="Lehbrailg +2",
sub="Mephitis Grip",
ammo="Savant's Treatise",
head="Hagondes Hat",
body="Hagondes Coat",
hands="Hagondes Cuffs +1",
legs="Artsieq Hose",
feet="Umbani Boots",
neck="Eddy Necklace",
waist="Aswang Sash",
left_ear="Lifestorm Earring",
right_ear="Psystorm Earring",
left_ring="Icesoul Ring",
right_ring="Sangoma Ring",
back="Toro Cape"}
sets.midcast_DarkMagic = {main="Lehbrailg +2",sub="Arbuda Grip",ammo="Hasty Pinion",
head="Appetence Crown",neck="Aesir Torque",ear1="Hirudinea Earring",ear2="Loquacious Earring",
body="Hedera Cotehardie",hands="Ayao's Gages",ring1="Balrahn's Ring",ring2="Excelsis Ring",
back="Merciful Cape",waist="Goading Belt",legs="Auspex Slops",feet="Umbani Boots"}
sets.midcast_EnfeeblingMagic = {main="Lehbrailg +2",sub="Mephitis Grip",ammo="Savant's Treatise",
head="Artsieq Hat",neck="Imbodla Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hagondes Coat",hands="Lurid Mitts",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Refraction Cape",waist="Ornate ROpe",legs="Artsieq hose",feet="Artsieq Boots"}
sets.midcast_Impact = {main="Lehbrailg +2",sub="Wizzan Grip",ammo="Witchstone",
neck="Eddy Necklace",ear1="Hecate's Earring",ear2="Novio Earring",
hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Icesoul Ring",body="Hagondes Coat",
back="Searing Cape",waist="Maniacus Sash",legs="Hagondes Pants",feet="Umbani Boots"}
sets.midcast_Embrava = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Savant's Treatise",
head="Svnt. Bonnet +2",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Savant's Bracers +2",
back="Merciful Cape",waist="Cascade Belt",legs="Shedir Seraweels",feet="Rubeus Boots"}
sets.midcast_Regen = {main="Bolelabunga",ammo="Savant's Treatise",
head="Svnt. Bonnet +2",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Savant's Bracers +2",
back="Merciful Cape",waist="Cascade Belt",legs="Shedir Seraweels",feet="Rubeus Boots"}
sets.midcast_EnhancingMagic = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Incantor Stone",
head="Svnt. Bonnet +2",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",
back="Swith Cape",waist="Ninurta's Sash",legs="Artsieq hose",feet="Peda. Loafers"}
sets.precast_Stun = {main="Apamajas II",sub="Mephitis Grip",ammo="Inacantor Stone",
head="Nahtirah Hat",neck="Eddy Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hedera Cotehardie",hands="Gendewitha Gages",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Swith Cape",waist="Goading Belt",legs="Artsieq Hose",feet="Peda. Loafers"}
sets.midcast_Cure = {main="Tamaxchi",sub="genbu's Shield",head="Hyksos Khat +1",neck="Healing Torque",
body="Heka's Kalasiris",hands="Bokwus Gloves",back="Oretanis's Cape",legs="Scholar's Pants",
feet="Peda. Loafers",ring1="Sirona's Ring",ring2="Ephedra Ring",ear1="Beatific Earring",
Ear2="Lifestorm Earring"}
sets.midcast_Helix = {main="Lehbrailg +2",sub="Wize Grip",ammo="Witchstone",
head="Hagondes Hat",neck="Stoicheion Medal",ear1="Hecate's Earring",ear2="Friomisi Earring",
body="Hagondes Coat",hands="Hagondes Cuffs +1",ring1="Maquette Ring",ring2="Dark Ring",
back="Toro Cape",waist="Maniacus Sash",legs="Hagondes Pants +1",feet="Umbani Boots"}
sets.midcast_Stoneskin = {main="Kirin's Pole",neck="Stone Gorget",waist="Siegel Sash",legs="Shedir Seraweels"}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape',lring='Zodiac Ring',main="Chatoyant Staff"}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.staves = {}
sets.staves.damage = {}
sets.staves.damage.Thunder = {main="Apamajas I"}
sets.staves.damage.Fire = {main="Atar I"}
sets.staves.accuracy = {}
sets.staves.damage.Thunder = {main="Apamajas II"}
sets.staves.damage.Ice = {main="Vourukasha II"}
stuntarg = 'Shantotto'
end
function precast(spell,action)
if spell.skill=='Elemental Magic' then
if buffactive.darkarts or buffactive.Addendumblack then
cast_delay(0.1)
set_combine(sets['precast_FastCast'],{
head="Peda. M.Board +1",})
else
cast_delay(0.1)
equip(sets['precast_FastCast'])
end
elseif spell.english == 'Stun' then
cast_delay(0.1)
equip(sets['precast_Stun'])
if not buffactive.thunderstorm then
add_to_chat(8,'--------- Thunderstorm is down ---------')
elseif not buffactive.klimaform then
add_to_chat(8,'----------- Klimaform is down -----------')
end
else
equip(sets['precast_FastCast'])
cast_delay(0.1)
end
end
function pretarget(spell)
if spell.name == 'Regen V' and spell.target.type and spell.target.type == 'PLAYER' and not buffactive.perpetuance and not spell.target.charmed and not pianissimo_cycle then
cancel_spell()
perp_cycle = true
send_command('input /ja "Perpetuance" <me>;wait 1.5;input /ma "'..spell.name..'" '..spell.target.name..';')
return
end
if spell.name ~= 'Perpetuance' then
perp_cycle = false
end
end
function midcast(spell,action)
if string.find(spell.english,'Cur') then
equip(sets.midcast_Cure)
if spell.element == world.weather_element or spell_element == world.day_element then
equip({main="Chatoyant Staff"},sets.Obi[spell.element])
end
if buffactive.rapture then
equip({head="Savant's Bonnet +2"})
end
elseif spell.english == 'Impact' then
local tempset = sets['midcast_Impact']
tempset['body'] = 'Twilight Cloak'
tempset['head'] = empty
equip(tempset)
elseif spell.skill=="Elemental Magic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
if buffactive.thunderstorm then
equip({waist="Rairin Obi"})
elseif buffactive.hailstorm then
equip({waist="Hyorin Obi"})
elseif buffactive.windstorm then
equip({waist="Furin Obi"})
elseif buffactive.rainstorm then
equip({waist="Suirin Obi"})
elseif buffactive.firestorm then
equip({waist="Karin Obi"})
elseif buffactive.sandstorm then
equip({waist="Dorin Obi"})
elseif buffactive.voidstorm then
equip({waist="Anrin Obi"})
elseif buffactive.aurorastorm then
equip({waist="Korin Obi"})
end
else
equip(sets.midcast_ElementalMagic[sets.midcast_ElementalMagic.index[midcast_ElementalMagic_ind]])
if buffactive.thunderstorm then
equip({waist="Rairin Obi"})
elseif buffactive.hailstorm then
equip({waist="Hyorin Obi"})
elseif buffactive.windstorm then
equip({waist="Furin Obi"})
elseif buffactive.rainstorm then
equip({waist="Suirin Obi"})
elseif buffactive.firestorm then
equip({waist="Karin Obi"})
elseif buffactive.sandstorm then
equip({waist="Dorin Obi"})
elseif buffactive.voidstorm then
equip({waist="Anrin Obi"})
elseif buffactive.aurorastorm then
equip({waist="Korin Obi"})
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.skill=="Enfeebling Magic" then
equip(sets.midcast_EnfeeblingMagic)
elseif spell.english == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
elseif spell.skill == 'Enhancing Magic' then
if spell.english == 'Embrava' then
equip(sets['midcast_Embrava'])
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
elseif spell.english == 'Regen V' then
equip(sets['midcast_Regen'])
add_to_chat(8,'--------- Regen Test---------')
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
elseif buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
elseif spell.english == 'Stun' then
windower.send_command('@wait 5;input /ja "Alacrity" <me>')
if buffactive.haste and buffactive.march then
equip(sets.ExtremeStun)
elseif Armor =="Lehbrailg" and buffactive.alacrity then
equip(sets.ExtremeStun)
elseif buffactive.haste and not buffactive.march then
equip(sets.aftercast_IdleStun)
send_command('input /p -------March is Down-------')
elseif buffactive.march and not buffactive.haste then
equip(sets.aftercast_IdleStun)
send_command('input /p -------Haste is Down-------')
else
equip(sets.aftercast_IdleStun)
send_command('input /p -------No Magic Haste [ GET IT SORTED ]------- Stunning Target is gunna suck')
end
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function aftercast(spell,action)
if Armor == '119' then
equip(sets.aftercast_Idle119)
elseif Armor == 'Stun' then
equip(sets.aftercast_IdleStun)
else
Idle()
end
if spell.english == 'Sleep' or spell.english == 'Sleepga' then
send_command('@wait 50;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
send_command('@wait 80;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Break' or spell.english == 'Breakga' then
send_command('@wait 20;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.enflish == 'Stun' then
send_command('@wait 4;input /ja "Alacrity" <me>')
end
end
function status_change(new,action)
if new=='Idle' then
if Armor == '119' then
equip(sets.aftercast_Idle119)
elseif Armor == 'Stun' then
equip(sets.aftercast_IdleStun)
elseif Armor == 'Lehbrailg' then
equip(sets.ExtremeStun)
else
Idle()
end
elseif new=='Resting' then
equip(sets.Resting)
end
if Armor == 'PDT' then
equip(sets.PDT)
end
end
function Idle()
if buffactive['Sandstorm'] then
send_command('@wait 1;input /echo ------- Sandstorm Move Wear Activated -------')
equip(sets.aftercast_Move)
elseif world.time >= (17*60) or world.time <= (7*60) then -- night time
equip(sets.aftercast_IdleNight)
else
equip(sets.aftercast_IdleDay)
end
end
function buff_change(buff,gain_or_loss)
if buff == "Sandstorm" then
Idle()
end
end
function pet_midcast(spell,action)
end
function pet_aftercast(spell,action)
end
function self_command(command)
if command == 'M2' then
midcast_ElementalMagic_ind = midcast_ElementalMagic_ind +1
if midcast_ElementalMagic_ind > #sets.midcast_ElementalMagic.index then midcast_ElementalMagic_ind = 1 end
send_command('@input /echo <----- TP Set changed to '..sets.midcast_ElementalMagic.index[midcast_ElementalMagic_ind]..' ----->')
equip(sets.midcast_ElementalMagic[sets.midcast_ElementalMagic.index[midcast_ElementalMagic_ind]])
elseif command == 'C7' then -- PDT Toggle --
if Armor == 'PDT' then
Armor = 'none'
add_to_chat(8,'PDT Set: [Unlocked]')
else
Armor = 'PDT'
add_to_chat(158,'PDT Set: [Locked]')
end
status_change(player.status)
elseif command == 'C15' then -- 119 Toggle --
if Armor == '119' then
Armor = 'None'
add_to_chat(8,'119 Set: [Unlocked]')
else
Armor = '119'
add_to_chat(158,'119 Set: [Locked]')
end
status_change(player.status)
elseif command == 'C30' then -- 119 Toggle --
if Armor == 'Lehbrailg' then
Armor = 'None'
add_to_chat(8,'Extreme Stun: [Off]')
else
Armor = 'Lehbrailg'
add_to_chat(158,'Extreme Stun: [On]')
end
status_change(player.status)
elseif command == 'Stun' then -- Stun Idle Toggle --
if Armor == 'Stun' then
Armor = 'None'
add_to_chat(8,'Stun Set: [Unlocked]')
else
Armor = 'Stun'
add_to_chat(158,'Stun Set: [Locked]')
end
status_change(player.status)
end
end
-- This function is user defined, but never called by GearSwap itself. It's just a user function that's only called from user functions. I wanted to check the weather and equip a weather-based set for some spells, so it made sense to make a function for it instead of replicating the conditional in multiple places.
function weathercheck(spell_element,set)
if spell_element == world.weather_element or spell_element == world.day_element then
equip(set,sets['Obi_'..spell_element])
else
equip(set)
end
end
This uses various ets based on buffs, screams at people for dropping haste / marches (cos people are *** stupid) or if you are dual boxing it's a nice little reminder.
Has like 3 stun sets?
Also uses alacrity after you cast stun if it's up, that could be an issue if you want rid so feel free to delete that part.
Valefor.Ophannus
Serveur: Valefor
Game: FFXI
Posts: 241
By Valefor.Ophannus 2015-01-09 12:53:45
Do you think the problem might be syntax/format?
his has
Code if string.find(spell.english,'Cur') then
if spell.element == world.weather_element
and mine has
Code if spell.action_type == 'Magic' then
if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if world.weather_element == 'Light'
Is mine a deprecated format?
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 13:07:13
Do you think the problem might be syntax/format?
his has
Code if string.find(spell.english,'Cur') then
if spell.element == world.weather_element
and mine has
Code if spell.action_type == 'Magic' then
if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if world.weather_element == 'Light'
Is mine a deprecated format?
No and his would equip ***on Cursna.
Code if spell.action_type == 'Magic' then
if spell.skill == 'Healing Magic' then
if spell.english:startswith('Cura') then
if spell.element == world.weather_element
return 'Weather'
else
return 'Cure'
end
end
end
end
Sets should be named~
Code sets.midcast['Healing Magic']['Cure']
sets.midcast['Healing Magic']['Weather']
Amended as the code was wrong.
Valefor.Ophannus
Serveur: Valefor
Game: FFXI
Posts: 241
By Valefor.Ophannus 2015-01-09 13:36:44
So should I copypasta that code and see if it works?
Cerberus.Conagh
Serveur: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2015-01-09 13:39:34
So should I copypasta that code and see if it works?
That was sorta the point :o
Just looking for someone to explain this addon a bit for me. It looks like it is an alternative to Spellcast.
Is it going to be replacing Spellcast? In which ways is it better or worse. I don't know any programming but I've slowly learned more and more about spellcast and the 'language' used in gearswap is confusing to me.
It says it uses packets so it potentially could be more detectable? but does that also eliminate any lag that spellcast may encounter?
I plan on redoing my PUP xml to include pet casting sets thanks to the new addon petschool. I'm just not sure if it's worth it to just wait until gearswap gets more popular or to go ahead and do it in spellcast.
If anyone could give me more info I'd greatly appreciate it.
|
|