|
Gearswap Support Thread
Asura.Gesetz
Serveur: Asura
Game: FFXI
Posts: 40
By Asura.Gesetz 2015-07-20 19:58:27
Couldn't find this anywhere, maybe I'm just not looking correctly. Using Mote's blu lua. When I use unbridled wisdom, I get the message: effect already active or something to that effect. Actually, now that I deleted everything that had to do with unbridled learning, it works. Maybe I fixed it, maybe I didn't. What would normally cause an error like this, and is deleting everything like I did the real solution? In his base BLU lua (which I assume is what you're referencing) this is the segment responsible: Code -------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if unbridled_spells:contains(spell.english) and not state.Buff['Unbridled Learning'] then
eventArgs.cancel = true
windower.send_command('@input /ja "Unbridled Learning" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
end
end The key line here is Code windower.send_command('@input /ja "Unbridled Learning" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name) What this does is pause the spell, inputs Unbridled Learning then casts the spell. This is designed for you to macro or type out the spell name without using the JA first. What appears to be happening, however, is that it's not detecting Unbridled Learning being active already and is still executing this function. A fix for this is one of two things: 1) don't use the JA before casting the spell or 2) delete the entire function altogether, so it would just look like this in your lua: Code -------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
-- Add enhancement gear for Chain Affinity, etc.
if spell.skill == 'Blue Magic' then
for buff,active in pairs(state.Buff) do
if active and sets.buff[buff] then
equip(sets.buff[buff])
end
end
if spellMap == 'Healing' and spell.target.type == 'SELF' and sets.self_healing then
equip(sets.self_healing)
end
end
-- If in learning mode, keep on gear intended to help with that, regardless of action.
if state.OffenseMode.value == 'Learning' then
equip(sets.Learning)
end
end Looks like I stumbled into option 2 then. Thanks for the answer ^.^
Bismarck.Speedyjim
Serveur: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2015-07-20 20:38:06
Hey there, using Mote's BLM.lua, how do I set a F-key bind to lock my main/sub/range/ammo slots from changing? Currently, I use the disable/enable commands, but would rather not. Thank you!
Serveur: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2015-07-20 23:40:44
Bismarck.Speedyjim said: »Hey there, using Mote's BLM.lua, how do I set a F-key bind to lock my main/sub/range/ammo slots from changing? Currently, I use the disable/enable commands, but would rather not. Thank you! You will need to insert two things into your file and ensure there are not two of two of the same functions I am going to provide.
First: Code function job_setup()
state.WeaponLock = M{['description'] = 'Weapon Lock', 'Off', 'On'}
-- Alt + =
send_command('bind != gs c cycle WeaponLock')
end Second: Code function job_state_change(stateField, newValue, oldValue)
if stateField == 'Weapon Lock' then
if newValue == 'On' then
disable('main','sub','ranged','ammo')
else
enable('main','sub','ranged','ammo')
end
end
end
Bismarck.Speedyjim
Serveur: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2015-07-21 01:35:56
Bismarck.Speedyjim said: »Hey there, using Mote's BLM.lua, how do I set a F-key bind to lock my main/sub/range/ammo slots from changing? Currently, I use the disable/enable commands, but would rather not. Thank you! You will need to insert two things into your file and ensure there are not two of two of the same functions I am going to provide.
First: Code function job_setup()
state.WeaponLock = M{['description'] = 'Weapon Lock', 'Off', 'On'}
-- Alt + =
send_command('bind != gs c cycle WeaponLock')
end Second: Code function job_state_change(stateField, newValue, oldValue)
if stateField == 'Weapon Lock' then
if newValue == 'On' then
disable('main','sub','ranged','ammo')
else
enable('main','sub','ranged','ammo')
end
end
end I entered the first part in the job_setup section, line 16. The second part in the job_state_change section, line 152. Didn't work.
https://drive.google.com/open?id=0ByGS22kY0-SpQ3UwM3JNa3pNYjg
By geigei 2015-07-21 01:51:43
Kudos to Vafruvant and others for sticking with us btw.
Serveur: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2015-07-21 02:18:14
Bismarck.Speedyjim said: » The second part in the job_state_change section, line 152. Didn't work. First, I realized now an error I made, I said ranged, not range. So that's part of it. Try changing that in your file and check it again.
Bismarck.Speedyjim
Serveur: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2015-07-21 02:34:08
Kudos to Vafruvant and others for sticking with us btw. Kudos indeed! :)
Bismarck.Speedyjim said: » The second part in the job_state_change section, line 152. Didn't work. First, I realized now an error I made, I said ranged, not range. So that's part of it. Try changing that in your file and check it again. Corrected it, semi-works now. Firstly, the bind key doesn't send the command but typing it out does. Secondly, once locked, it won't cycle off.
Edit: Someone just told me Mote's lua has this already, it's called "Offense Mode". Hitting F9, in my case, will lock everything I asked. Sorry for the trouble and thank you for your great help.
Serveur: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2015-07-21 03:09:20
Bismarck.Speedyjim said: »Edit: Someone just told me Mote's lua has this already, it's called "Offense Mode". Hitting F9, in my case, will lock everything I asked. I didn't even think about that when you asked. I guess that's what happens when I don't read completely being so tired, lol.
Cerberus.Tidis
Serveur: Cerberus
Game: FFXI
Posts: 3927
By Cerberus.Tidis 2015-07-21 03:11:55
Bismarck.Speedyjim said: »Kudos to Vafruvant and others for sticking with us btw. Kudos indeed! :)
Bismarck.Speedyjim said: » The second part in the job_state_change section, line 152. Didn't work. First, I realized now an error I made, I said ranged, not range. So that's part of it. Try changing that in your file and check it again. Corrected it, semi-works now. Firstly, the bind key doesn't send the command but typing it out does. Secondly, once locked, it won't cycle off.
Edit: Someone just told me Mote's lua has this already, it's called "Offense Mode". Hitting F9, in my case, will lock everything I asked. Sorry for the trouble and thank you for your great help. Yep, I was curious if yours had that myself as my mule's WHM is based on Mote's files and has it in there by default so I checked yours and it does have that function automatically in there.
Since you were made aware of it I guess you've already realised it now.
Serveur: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2015-07-21 07:55:03
So everyone knows, I will be away for the next week and will not be checking this thread or my inbox. If I'm already working with you on a project, I'll continue that to completion but will not be taking new requests. See you all in a week.
-Vaf
[+]
By Takisan 2015-07-21 10:17:58
Hello again. I am still trying to figure out why my gearswap has been causing a glitch when I try to cast a spell on something within target range and it says "too far away" or "cannot see [Target]".
So far I have reinstalled windower4, deleted the entire gearswap folder and had windower download a new folder. I mentioned in a previous post some strange errors that pop up when I zone or something enters/leaves my inventory. That issue is still occuring.
I saw this first on my blu and recently have been testing on my rdm and I have found when I empty or delete the Data folder with all my lua scripts in it, the error doesn't happen so I think it occurs when the job lua interacts with some other code file (maybe the gearswap file). The next thing I will try is seeing if my notepad++ needs an update.
This picture link below shows me trying to cast something on myself and the error.
http://www.ffxiah.com/screenshots/76850
Lakshmi.Byrth
VIP
Serveur: Lakshmi
Game: FFXI
Posts: 6184
By Lakshmi.Byrth 2015-07-21 10:28:24
I suspect this is an issue with one of your includes. Specifically, if you have one that prevents casting interruption.
If not, you'll need to post your entire gearswap file.
By Takisan 2015-07-21 11:36:30
Hey Byrth, thank you for your help. I am not familiar of ur usage of includes, can you specify or give an example? Do you mean another addon or a casting condition? I have only changed gear from the original luas and have not included anything more complex than that.
Would you have me send you the gearswap lua file (and/or anyother related files)? Or just post it here? I mean, I downloaded a fresh new everything Today, July 21, 2015, 10:14:30 AM so it should be where ever windower pulled it from and I promise I haven't edited a thing.
Lakshmi.Byrth
VIP
Serveur: Lakshmi
Game: FFXI
Posts: 6184
By Lakshmi.Byrth 2015-07-21 13:42:54
Is it literally a file from the beta_examples_and_information folder?
If so, then the extra messages you're seeing are just action responses based on where you're standing.
By Takisan 2015-07-21 15:55:46
Ok, so I deleted my BLM lua and copied yours and changed the name to BLM and I got the same error. Here is the code of both the gearswap lua and the BLM lua.
Gearswap lua Code --Copyright (c) 2013, Byrthnoth
--All rights reserved.
--Redistribution and use in source and binary forms, with or without
--modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of <addon name> nor the
-- names of its contributors may be used to endorse or promote products
-- derived from this software without specific prior written permission.
--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
--ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
--WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
--DISCLAIMED. IN NO EVENT SHALL <your name> BE LIABLE FOR ANY
--DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
--(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
--LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
--ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
--(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
_addon.name = 'GearSwap'
_addon.version = '0.901'
_addon.author = 'Byrth'
_addon.commands = {'gs','gearswap'}
if windower.file_exists(windower.addon_path..'data/bootstrap.lua') then
debugging = {windower_debug = true,command_registry = false,general=false,logging=false}
else
debugging = {}
end
__raw = {lower = string.lower, upper = string.upper, debug=windower.debug,text={create=windower.text.create,
delete=windower.text.delete,registry = {}},prim={create=windower.prim.create,delete=windower.prim.delete,registry={}}}
language = 'english'
file = require 'files'
require 'strings'
require 'tables'
require 'lists'
require 'sets'
windower.text.create = function (str)
if __raw.text.registry[str] then
msg.addon_msg(123,'Text object cannot be created because it already exists.')
else
__raw.text.registry[str] = true
__raw.text.create(str)
end
end
windower.text.delete = function (str)
if __raw.text.registry[str] then
local deleted = false
if windower.text.saved_texts then
for i,v in pairs(windower.text.saved_texts) do
if v._name == str then
__raw.text.registry[str] = nil
windower.text.saved_texts[i]:destroy()
deleted = true
break
end
end
end
if not deleted then
__raw.text.registry[str] = nil
__raw.text.delete(str)
end
else
__raw.text.delete(str)
end
end
windower.prim.create = function (str)
if __raw.prim.registry[str] then
msg.addon_msg(123,'Primitive cannot be created because it already exists.')
else
__raw.prim.registry[str] = true
__raw.prim.create(str)
end
end
windower.prim.delete = function (str)
if __raw.prim.registry[str] then
__raw.prim.registry[str] = nil
__raw.prim.delete(str)
else
__raw.prim.delete(str)
end
end
texts = require 'texts'
require 'pack'
bit = require 'bit'
socket = require 'socket'
mime = require 'mime'
res = require 'resources'
extdata = require 'extdata'
require 'helper_functions'
require 'actions'
-- Resources Checks
if res.items and res.bags and res.slots and res.statuses and res.jobs and res.elements and res.skills and res.buffs and res.spells and res.job_abilities and res.weapon_skills and res.monster_abilities and res.action_messages and res.skills and res.monstrosity and res.weather and res.moon_phases and res.races then
else
error('Missing resources!')
end
require 'statics'
require 'equip_processing'
require 'targets'
require 'user_functions'
require 'refresh'
require 'export'
require 'validate'
require 'flow'
require 'triggers'
windower.register_event('load',function()
windower.debug('load')
refresh_globals()
if world.logged_in then
refresh_user_env()
if debugging.general then windower.send_command('@unload spellcast;') end
end
end)
windower.register_event('unload',function ()
windower.debug('unload')
user_pcall('file_unload')
if logging then logfile:close() end
end)
windower.register_event('addon command',function (...)
windower.debug('addon command')
logit('\n\n'..tostring(os.clock)..table.concat({...},' '))
local splitup = {...}
if not splitup[1] then return end -- handles //gs
for i,v in pairs(splitup) do splitup[i] = windower.from_shift_jis(windower.convert_auto_trans(v)) end
local cmd = table.remove(splitup,1):lower()
if cmd == 'c' then
if gearswap_disabled then return end
if splitup[1] then
refresh_globals()
equip_sets('self_command',nil,_raw.table.concat(splitup,' '))
else
msg.addon_msg(123,'No self command passed.')
end
elseif cmd == 'equip' then
if gearswap_disabled then return end
local key_list = parse_set_to_keys(splitup)
local set = get_set_from_keys(key_list)
if set then
refresh_globals()
equip_sets('equip_command',nil,set)
else
msg.addon_msg(123,'Equip command cannot be completed. That set does not exist.')
end
elseif cmd == 'export' then
export_set(splitup)
elseif cmd == 'validate' then
if user_env and user_env.sets then
refresh_globals()
validate(splitup)
else
msg.addon_msg(123,'There is nothing to validate because there is no file loaded.')
end
elseif cmd == 'l' or cmd == 'load' then
if splitup[1] then
local f_name = table.concat(splitup,' ')
if pathsearch({f_name}) then
refresh_globals()
command_registry = Command_Registry.new()
load_user_files(false,f_name)
else
msg.addon_msg(123,'File not found.')
end
else
msg.addon_msg(123,'No file name was provided.')
end
elseif cmd == 'enable' then
disenable(splitup,command_enable,'enable',false)
elseif cmd == 'disable' then
disenable(splitup,disable,'disable',true)
elseif cmd == 'reload' or cmd == 'r' then
refresh_user_env()
elseif strip(cmd) == 'debugmode' then
_settings.debug_mode = not _settings.debug_mode
print('GearSwap: Debug Mode set to '..tostring(_settings.debug_mode)..'.')
elseif strip(cmd) == 'demomode' then
_settings.demo_mode = not _settings.demo_mode
print('GearSwap: Demo Mode set to '..tostring(_settings.demo_mode)..'.')
elseif strip(cmd) == 'showswaps' then
_settings.show_swaps = not _settings.show_swaps
print('GearSwap: Show Swaps set to '..tostring(_settings.show_swaps)..'.')
elseif _settings.debug_mode and strip(cmd) == 'eval' then
assert(loadstring(table.concat(splitup,' ')))()
else
local handled = false
if not gearswap_disabled then
for i,v in ipairs(unhandled_command_events) do
handled = equip_sets(v,nil,cmd,unpack(splitup))
if handled then break end
end
end
if not handled then
print('GearSwap: Command not found')
end
end
end)
function disenable(tab,funct,functname,pol)
local slot_name = ''
local ltab = L{}
for i,v in pairs(tab) do
ltab:append(v:gsub('[^%a_%d]',''):lower())
end
if ltab:contains('all') then
funct('main','sub','range','ammo','head','neck','lear','rear','body','hands','lring','rring','back','waist','legs','feet')
print('GearSwap: All slots '..functname..'d.')
elseif ltab.n > 0 then
local found = L{}
local not_found = L{}
for slot_name in ltab:it() do
if slot_map[slot_name] then
funct(slot_name)
found:append(slot_name)
else
not_found:append(slot_name)
end
end
if found.n > 0 then
print('GearSwap: '..found:tostring()..' slot'..(found.n>1 and 's' or '')..' '..functname..'d.')
end
if not_found.n > 0 then
print('GearSwap: Unable to find slot'..(not_found.n>1 and 's' or '')..' '..not_found:tostring()..'.')
end
elseif gearswap_disabled ~= pol and not tab[2] then
print('GearSwap: User file '..functname..'d')
gearswap_disabled = pol
end
end
windower.register_event('incoming chunk',function(id,data,modified,injected,blocked)
windower.debug('incoming chunk '..id)
if next_packet_events and next_packet_events.sequence_id ~= data:unpack('H',3) then
if not next_packet_events.globals_update or next_packet_events.globals_update ~= data:unpack('H',3) then
refresh_globals()
next_packet_events.globals_update = data:unpack('H',3)
end
if next_packet_events.pet_status_change then
if pet.isvalid then
equip_sets('pet_status_change',nil,next_packet_events.pet_status_change.newstatus,next_packet_events.pet_status_change.oldstatus)
end
next_packet_events.pet_status_change = nil
end
if next_packet_events.pet_change then
if next_packet_events.pet_change.pet then -- Losing a pet
equip_sets('pet_change',nil,next_packet_events.pet_change.pet,false)
next_packet_events.pet_change = nil
elseif pet.isvalid then -- Gaining a pet
equip_sets('pet_change',nil,pet,true)
next_packet_events.pet_change = nil
end
end
if not next_packet_events.pet_status_change and not next_packet_events.pet_change then
next_packet_events = nil
end
end
if injected then
elseif id == 0x00A then
windower.debug('zone change')
command_registry = Command_Registry.new()
table.clear(not_sent_out_equip)
player.id = data:unpack('I',0x05)
player.index = data:unpack('H',0x09)
if player.main_job_id and player.main_job_id ~= data:byte(0xB5) and player.name and player.name == data:unpack('z',0x85) then
windower.debug('job change on zone')
load_user_files(data:byte(0xB5))
else
player.name = data:unpack('z',0x85)
end
player.main_job_id = data:byte(0xB5)
player.sub_job_id = data:byte(0xB8)
player.vitals.max_hp = data:unpack('I',0xE9)
player.vitals.max_mp = data:unpack('I',0xED)
player.max_hp = data:unpack('I',0xE9)
player.max_mp = data:unpack('I',0xED)
update_job_names()
world.zone_id = data:unpack('H',0x31)
_ExtraData.world.conquest = false
for i,v in pairs(region_to_zone_map) do
if v:contains(world.zone_id) then
_ExtraData.world.conquest = {
region_id = i,
region_name = res.regions[i][language],
}
break
end
end
weather_update(data:byte(0x69))
world.logged_in = true
_ExtraData.world.in_mog_house = data:byte(0x81) == 1
refresh_ffxi_info()
elseif id == 0x00B then
-- Blank temporary items when zoning.
items.temporary = make_inventory_table()
elseif id == 0x0E and pet.index and pet.index == data:unpack('H',9) and math.floor((data:byte(11)%8)/4)== 1 then
local oldstatus = pet.status
local status_id = data:byte(32)
-- Filter all statuses aside from Idle/Engaged/Dead/Engaged dead.
if status_id < 4 or status_id == 33 or status_id == 47 then
local newstatus = copy_entry(res.statuses[status_id])
if newstatus and newstatus[language] then
newstatus = newstatus[language]
if oldstatus ~= newstatus then
if not next_packet_events then next_packet_events = {sequence_id = data:byte(4)*256+data:byte(3)} end
next_packet_events.pet_status_change = {newstatus=newstatus,oldstatus=oldstatus}
end
end
end
elseif id == 0x01B then
for job_id = 1,23 do
player.jobs[to_windower_api(res.jobs[job_id].english)] = data:byte(job_id + 72)
end
local enc = data:unpack('H',0x61)
local tab = {}
for slot_id,slot_name in pairs(default_slot_map) do
local tf = (((enc%(2^(slot_id+1))) / 2^slot_id) >= 1)
if encumbrance_table[slot_id] and not tf and not_sent_out_equip[slot_name] and not disable_table[i] then
tab[slot_name] = not_sent_out_equip[slot_name]
not_sent_out_equip[slot_name] = nil
end
if encumbrance_table[slot_id] and not tf then
msg.debugging("Your "..slot_name.." slot is now unlocked.")
end
encumbrance_table[slot_id] = tf
end
if table.length(tab) > 0 then
refresh_globals()
equip_sets('equip_command',nil,tab)
end
elseif id == 0x01E then
local bag = to_windower_api(res.bags[data:byte(0x09)].english)
local slot = data:byte(0x0A)
local count = data:unpack('I',5)
if not items[bag][slot] then items[bag][slot] = make_empty_item_table(slot) end
items[bag][slot].count = count
if count == 0 then
items[bag][slot].id = 0
items[bag][slot].bazaar = 0
items[bag][slot].status = 0
end
elseif id == 0x01F then
local bag = to_windower_api(res.bags[data:byte(0x0B)].english)
local slot = data:byte(0x0C)
if not items[bag][slot] then items[bag][slot] = make_empty_item_table(slot) end
items[bag][slot].id = data:unpack('H',9)
items[bag][slot].count = data:unpack('I',5)
items[bag][slot].status = data:byte(0x0D)
elseif id == 0x020 then
local bag = to_windower_api(res.bags[data:byte(0x0F)].english)
local slot = data:byte(0x10)
if not items[bag][slot] then items[bag][slot] = make_empty_item_table(slot) end
items[bag][slot].id = data:unpack('H',0x0D)
items[bag][slot].count = data:unpack('I',5)
items[bag][slot].bazaar = data:unpack('I',9)
items[bag][slot].status = data:byte(0x11)
items[bag][slot].extdata = data:sub(0x12,0x29)
-- Did not mess with linkshell stuff
elseif id == 0x28 then
inc_action(windower.packets.parse_action(data))
elseif id == 0x29 then
if gearswap_disabled then return end
local arr = {}
arr.actor_id = data:unpack('I',0x05)
arr.target_id = data:unpack('I',0x09)
arr.param_1 = data:unpack('I',0x0D)
arr.param_2 = data:unpack('I',0x11)%64 -- First 6 bits
arr.param_3 = math.floor(data:unpack('I',0x11)/64) -- Rest
arr.actor_index = data:unpack('H',0x15)
arr.target_index = data:unpack('H',0x17)
arr.message_id = data:unpack('H',0x19)%32768
inc_action_message(arr)
elseif id == 0x037 then
player.status_id = data:byte(0x31)
local bitmask = data:sub(0x4D,0x54)
for i = 1,32 do
local bitmask_position = 2*((i-1)%4)
player.buffs[i] = data:byte(4+i) + 256*math.floor(bitmask:byte(1+math.floor((i-1)/4))%(2^(bitmask_position+2))/(2^bitmask_position))
end
local indi_byte = data:byte(0x59)
if indi_byte%128/64 >= 1 then
local temp_indi = _ExtraData.player.indi
_ExtraData.player.indi = {
element = res.elements[indi_byte%8][language],
element_id = indi_byte%8,
size = math.floor((indi_byte%64)/16) + 1, -- Size range of 1~4
}
if (indi_byte%16)/8 >= 1 then
_ExtraData.player.indi.target = 'Enemy'
else
_ExtraData.player.indi.target = 'Ally'
end
if not temp_indi then
-- There was not an indi spell up
refresh_globals()
equip_sets('indi_change',nil,_ExtraData.player.indi,true)
elseif temp_indi.element_id ~= _ExtraData.player.indi.element_id or temp_indi.target ~= _ExtraData.player.indi.target or temp_indi.size ~= _ExtraData.player.indi.size then
-- There was already an indi spell up, so check if it changed
refresh_globals()
equip_sets('indi_change',nil,temp_indi,false)
equip_sets('indi_change',nil,_ExtraData.player.indi,true)
end
elseif _ExtraData.player.indi then
-- An indi effect has been lost.
local temp_indi = _ExtraData.player.indi
_ExtraData.player.indi = nil
refresh_globals()
equip_sets('indi_change',nil,temp_indi,false)
end
local subj_ind = data:unpack('H', 0x35) / 8
if subj_ind == 0 and pet.isvalid then
if not next_packet_events then next_packet_events = {sequence_id = data:unpack('H',3)} end
refresh_globals()
pet.isvalid = false
next_packet_events.pet_change = {pet = table.reassign({},pet)}
elseif subj_ind ~= 0 and not pet.isvalid then
if not next_packet_events then next_packet_events = {sequence_id = data:unpack('H',3)} end
next_packet_events.pet_change = {subj_ind = subj_ind}
end
elseif id == 0x044 then
-- No idea what this is doing
elseif id == 0x050 then
local inv = items[to_windower_api(res.bags[data:byte(7)].english)]
if data:byte(5) ~= 0 then
items.equipment[toslotname(data:byte(6))] = {slot=data:byte(5),bag_id = data:byte(7)}
if not inv[data:byte(5)] then inv[data:byte(5)] = make_empty_item_table(data:byte(5)) end
items[to_windower_api(res.bags[data:byte(7)].english)][data:byte(5)].status = 5 -- Set the status to "equipped"
else
items.equipment[toslotname(data:byte(6))] = {slot=empty,bag_id=0}
if not inv[data:byte(5)] then inv[data:byte(5)] = make_empty_item_table(data:byte(5)) end
items[to_windower_api(res.bags[data:byte(7)].english)][data:byte(5)].status = 0 -- Set the status to "unequipped"
end
elseif id == 0x05E then -- Conquest ID
if _ExtraData.world.conquest then
local offset = _ExtraData.world.conquest.region_id*4 + 11
if offset == 99 then
offset = 95
elseif offset == 107 then
offset = 99
end
local strength_map = {[0]='Minimal',[1]='Minor',[2]='Major',[3]='Dominant'}
local nation_map = {[0]={english='Neutral',japanese='Neutral'},[1]=res.regions[0],[2]=res.regions[1],
[3]=res.regions[2],[4]={english='Beastman',japanese='Beastman'},[0xFF]=res.regions[3]}
_ExtraData.world.conquest.strengths = {
sandoria=strength_map[data:byte(offset+2)%4],
bastok=strength_map[math.floor(data:byte(offset+2)%16/4)],
windurst=strength_map[math.floor(data:byte(offset+2)%64/16)],
beastmen=strength_map[math.floor(data:byte(offset+2)/64)],}
_ExtraData.world.conquest.nation = nation_map[data:byte(offset+3)][language]
_ExtraData.world.conquest.sandoria = data:byte(0x87)
_ExtraData.world.conquest.bastok = data:byte(0x88)
_ExtraData.world.conquest.windurst = data:byte(0x89)
_ExtraData.world.conquest.beastmen = 100-data:byte(0x87)-data:byte(0x88)-data:byte(0x89)
end
elseif id == 0x061 then
player.vitals.max_hp = data:unpack('I',5)
player.vitals.max_mp = data:unpack('I',9)
player.max_hp = data:unpack('I',5)
player.max_mp = data:unpack('I',9)
player.main_job_id = data:byte(13)
player.main_job_level = data:byte(14)
_ExtraData.player.nation_id = data:byte(0x51)
_ExtraData.player.nation = res.regions[_ExtraData.player.nation_id][language] or 'None'
if player.sub_job_id ~= data:byte(15) then
-- Subjob change event
local temp_sub = player.sub_job
player.sub_job_id = data:byte(15)
player.sub_job_level = data:byte(16)
update_job_names()
refresh_globals()
equip_sets('sub_job_change',nil,player.sub_job,temp_sub)
end
update_job_names()
elseif id == 0x062 then
for i = 1,0x71,2 do
local skill = data:unpack('H',i + 0x82)%32768
local current_skill = res.skills[math.floor(i/2)+1]
if current_skill then
player.skills[to_windower_api(current_skill.english)] = skill
end
end
elseif id == 0x0DF and data:unpack('I',5) == player.id then
player.vitals.hp = data:unpack('I',9)
player.vitals.mp = data:unpack('I',13)
player.vitals.tp = data:unpack('I',0x11)
player.vitals.hpp = data:byte(0x17)
player.vitals.mpp = data:byte(0x18)
player.hp = data:unpack('I',9)
player.mp = data:unpack('I',13)
player.tp = data:unpack('I',0x11)
player.hpp = data:byte(0x17)
player.mpp = data:byte(0x18)
elseif id == 0x0E2 and data:unpack('I',5)==player.id then
player.vitals.hp = data:unpack('I',9)
player.vitals.mp = data:unpack('I',0xB)
player.vitals.tp = data:unpack('I',0x11)
player.vitals.hpp = data:byte(0x1E)
player.vitals.mpp = data:byte(0x1F)
player.hp = data:unpack('I',9)
player.mp = data:unpack('I',0xB)
player.tp = data:unpack('I',0x11)
player.hpp = data:byte(0x1E)
player.mpp = data:byte(0x1F)
elseif id == 0x117 then
for i=0x49,0x85,4 do
local arr = data:sub(i,i+3)
local inv = items[to_windower_api(res.bags[arr:byte(3)].english)]
if arr:byte(1) ~= 0 then
items.equipment[toslotname(arr:byte(2))] = {slot=arr:byte(1),bag_id = arr:byte(3)}
if not inv[arr:byte(1)] then inv[arr:byte(1)] = make_empty_item_table(arr:byte(1)) end
items[to_windower_api(res.bags[arr:byte(3)].english)][arr:byte(1)].status = 5 -- Set the status to "equipped"
else
items.equipment[toslotname(arr:byte(2))] = {slot=empty,bag_id=0}
if not inv[arr:byte(1)] then inv[arr:byte(1)] = make_empty_item_table(arr:byte(1)) end
items[to_windower_api(res.bags[arr:byte(3)].english)][arr:byte(1)].status = 0 -- Set the status to "unequipped"
end
end
end
end)
windower.register_event('status change',function(new,old)
windower.debug('status change '..new)
if gearswap_disabled or T{2,3,4}:contains(old) or T{2,3,4}:contains(new) then return end
refresh_globals()
equip_sets('status_change',nil,res.statuses[new].english,res.statuses[old].english)
end)
windower.register_event('gain buff',function(buff_id)
if not res.buffs[buff_id] then
error('GearSwap: No known status for buff id #'..tostring(buff_id))
end
local buff_name = res.buffs[buff_id][language]
windower.debug('gain buff '..buff_name..' ('..tostring(buff_id)..')')
if gearswap_disabled then return end
-- Need to figure out what I'm going to do with this:
if T{'terror','sleep','stun','petrification','charm','weakness'}:contains(buff_name:lower()) then
for ts,v in pairs(command_registry) do
if v.midaction then
command_registry:delete_entry(ts)
end
end
end
refresh_globals()
equip_sets('buff_change',nil,buff_name,true,copy_entry(res.buffs[buff_id]))
end)
windower.register_event('lose buff',function(buff_id)
if not res.buffs[buff_id] then
error('GearSwap: No known status for buff id #'..tostring(buff_id))
end
local buff_name = res.buffs[buff_id][language]
windower.debug('lose buff '..buff_name..' ('..tostring(buff_id)..')')
if gearswap_disabled then return end
refresh_globals()
equip_sets('buff_change',nil,buff_name,false,copy_entry(res.buffs[buff_id]))
end)
windower.register_event('login',function(name)
windower.debug('login '..name)
initialize_globals()
windower.send_command('@wait 2;lua i gearswap refresh_user_env;')
end)
BLM lua from Beta Examples and information folder Code function get_sets()
MP_efficiency = 0
macc_level = 0
sets.precast = {}
-- sets.precast.Stun[1] = {main="Laevateinn",sub="Arbuda Grip",--ranged="Aureole",
-- head="Nahtirah Hat",neck="Aesir Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
-- body="Hedera Cotehardie",hands={name="Archmage's Gloves +1",stats={INT=26,MAcc=19,Enmity=-5,Haste=3,MBdmg=16}},lring="Sangoma Ring",rring="Angha Ring",
-- back="Swith Cape +1",waist="Goading Belt",legs={name="Spaekona's Tonban +1",stats={INT=34,MAB=20,Haste=5,Enmity=-4}},feet="Bokwus Boots"}
sets.precast.FastCast = {}
sets.precast.FastCast.Default = {ammo="Impatiens",
head="Nahtirah Hat",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
body="Anhur Robe",hands={ name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','"Fast Cast"+5',}},lring="Prolix Ring",rring="Veneficium Ring",
back="Swith Cape +1",waist="Witful Belt",legs="Artsieq Hose",feet="Chelona Boots +1"}
sets.precast.FastCast['Elemental Magic'] = set_combine(sets.precast.FastCast.Default,{body="Dalmatica +1",head="Goetia Petasos +2",back="Ogapepo Cape +1"})
sets.precast.FastCast['Enhancing Magic'] = set_combine(sets.precast.FastCast.Default,{waist="Siegel Sash"})
sets.precast.AMII = set_combine(sets.precast.FastCast['Elemental Magic'],{hands = {name="Archmage's Gloves +1",stats={INT=36,MAcc=20,Enmity=-10,Haste=3}}})
sets.precast.Manafont = {body={name="Archmage's Coat +1",stats={INT=36,MAcc=20,Enmity=-10,Haste=3}}}
sets.Impact = {head=empty,body="Twilight Cloak"}
sets.midcast = {}
sets.midcast.Stun = {main="Apamajas II",sub="Arbuda Grip",ammo="Hasty Pinion +1",
head="Nahtirah Hat",neck="Aesir Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
body="Hedera Cotehardie",hands={name="Archmage's Gloves +1",stats={INT=26,MAcc=19,Enmity=-5,Haste=3,MBdmg=16}},lring="Sangoma Ring",rring="Angha Ring",
back="Swith Cape +1",waist="Goading Belt",legs={name="Spaekona's Tonban +1",stats={INT=34,MAB=20,Haste=5,Enmity=-4}},feet="Chelona Boots +1"}
sets.midcast['Elemental Magic'] = {
[0] = {},
[1] = {}
}
sets.ElementalMagicMAB = {
Earth={neck={name="Quanpur Necklace", stats={MAB=7,EarthStaffBns=5}}},
Dark={head={ name="Pixie Hairpin +1", stats={INT=17,DarkAffinity=28}}, rring={ name="Archon Ring", stats={DarkAffinity=5}} }
}
-- MAcc level 0 (Macc and Enmity irrelevant)
sets.midcast['Elemental Magic'][0][0] = {main={name="Laevateinn", stats={MAB=60,MDmg=248,MAcc=220, ESDmg=10}},
sub={name="Zuuxowu Grip", stats={MDmg=10}},
ammo={name="Dosis Tathlum", stats={MDmg=13}},
head={ name="Hagondes Hat +1", stats={INT=21,MAB=39,Haste=6}, augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','"Mag.Atk.Bns."+26',}},
neck={name="Eddy Necklace", stats={MAB=11, MAcc=5}},
ear1={name="Friomisi Earring", stats={MAB=10, Enmity=2}},
ear2={name="Novio Earring", stats={MAB=7}},
body={ name="Hagondes Coat +1",stats={INT=33,MAB=38,Haste=3}, augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','"Mag.Atk.Bns."+28',}},
hands={name="Otomi Gloves", stats={INT=24,MAB=13,MAcc=13,MDmg=10,Enmity=-5,Haste=5}},
ring1={name="Shiva Ring +1", stats={INT=9,MAB=3}},
ring2={name="Shiva Ring +1", stats={INT=9,MAB=3}},
back={name="Toro Cape", stats={INT=8, MAB=10}},
--waist={name="Sekhmet Corset", stats={MDmg=15,CMP=3}},
waist={name="Yamabuki-no-Obi", stats={INT=8}},
legs={ name="Hagondes Pants +1", stats={INT=32,MAB=53,Haste=5,MDmg=10}, augments={'Phys. dmg. taken -3%','"Mag.Atk.Bns."+28',}},
feet={name="Umbani Boots", stats={INT=22, MAB=20, MDmg=10, Haste=3, CMP=5}}}
sets.midcast['Elemental Magic'][0][1] = set_combine(sets.midcast['Elemental Magic'][0][0],{body={name="Spaekona's Coat +1",stats={INT=29,Haste=3,Enmity=-7,MdmgToMP=2}}})
-- MAcc level 1 (MAcc and Enmity relevant)
sets.midcast['Elemental Magic'][1][0] = {main={name="Laevateinn", stats={MAB=60,MDmg=248,MAcc=220, ESDmg=10}},
sub={name="Zuuxowu Grip", stats={MDmg=10}},
ammo={name="Dosis Tathlum", stats={MDmg=13}},
head={name="Hagondes Hat +1",stats={INT=21,MAB=13,MAcc=25,Haste=6}, augments={'Phys. dmg. taken -3','Mag. Acc.+25',}},
body={ name="Hagondes Coat +1",stats={INT=33,MAB=38,Haste=3}, augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','"Mag.Atk.Bns."+28',}},
hands={ name="Hagondes Cuffs +1", stats={INT=17,MAcc=43,Haste=3,Enmity=-8}, augments={'Phys. dmg. taken -3%','Mag. Acc.+23',}},
legs={ name="Hagondes Pants +1", stats={INT=32,MAB=48,Haste=4,MDmg=10}, augments={'Phys. dmg. taken -3','Magic dmg. taken -3','Mag. Acc.+24',}},
feet={ name="Arch. Sabots +1", stats={INT=20,MAcc=25, Enmity=-4}, augments={'Reduces Ancient Magic II MP cost',}},
neck={name="Eddy Necklace", stats={MAB=11, MAcc=5}},
waist={name="Yamabuki-no-Obi", stats={INT=8}},
ear1={name="Novia Earring", stats={Enmity=-7}},
ear2={name="Novio Earring", stats={MAB=7}},
ring1={name="Shiva Ring +1", stats={INT=9,MAB=3}},
ring2={name="Shiva Ring +1", stats={INT=9,MAB=3}},
back={name="Toro Cape", stats={INT=8, MAB=10}}}
sets.midcast['Elemental Magic'][1][1] = set_combine(sets.midcast['Elemental Magic'][1][0],{body={name="Spaekona's Coat +1",stats={INT=29,Haste=3,Enmity=-7,MdmgToMP=2}}})
sets.midcast.AMII = {
head={ name="Arch. Petasos +1", stats={INT=24, MAB=12, MAcc=29, Enmity=-5}, augments={'Increases Ancient Magic II damage',}},
feet={ name="Arch. Sabots +1", stats={INT=20,MAcc=25, Enmity=-4}, augments={'Reduces Ancient Magic II MP cost',}},
}
sets.midcast['Dark Magic'] = {main={name="Laevateinn", stats={MAB=60,MDmg=248,MAcc=220, ESDmg=10}},sub="Mephitis Grip",ammo="Hasty Pinion +1",
head={ name="Pixie Hairpin +1", stats={INT=17,DarkAffinity=28} },neck="Aesir Torque",ear1="Hirudinea Earring",ear2="Loquacious Earring",
body={name="Spaekona's Coat +1",stats={INT=29,Haste=3,Enmity=-7,MdmgToMP=2}},hands={name="Archmage's Gloves +1",stats={INT=26,MAcc=19,Enmity=-5,Haste=3,MBdmg=16}},lring="Excelsis Ring",rring="Archon Ring",
back="Ogapepo Cape +1",waist="Austerity Belt +1",legs={name="Spaekona's Tonban +1",stats={INT=34,MAB=20,Haste=5,Enmity=-4}},feet="Archmage's Sabots +1"}
sets.midcast['Enfeebling Magic'] = {main={name="Laevateinn", stats={MAB=60,MDmg=248,MAcc=220, ESDmg=10}},sub="Mephitis Grip",--range='Aureole',
head={name="Hagondes Hat +1",stats={INT=21,MAB=13,MAcc=25,Haste=6}, augments={'Phys. dmg. taken -3','Mag. Acc.+25',}},neck={name="Eddy Necklace", stats={MAB=11, MAcc=5}},ear1="Enchanter Earring +1",ear2="Gwati Earring",
body="Ischemia Chasu.",hands={ name="Hagondes Cuffs +1", augments={'Phys. dmg. taken -3%','Mag. Acc.+23',}},ring1="Sangoma Ring",ring2="Angha Ring",
back={name="Bane Cape", stats={MDmg=10, MAcc=10}},waist="Ovate Rope",legs={name="Spaekona's Tonban +1",stats={INT=34,MAB=20,Haste=5,Enmity=-4}},feet={name="Artsieq Boots", augments={'Mag. Acc.+20','MND+7','MP+30',}}}
sets.midcast.Vidohunir = {ammo={name="Ombre Tathlum +1",stats={INT=6,MAcc=3}},
head={ name="Pixie Hairpin +1", stats={INT=17,DarkAffinity=28} },neck={name="Saevus Pendant +1",stats={MAB=18,MAcc=-6}},ear1={name="Friomisi Earring", stats={MAB=10, Enmity=2}},ear2={name="Novio Earring", stats={MAB=7}},
body={ name="Hagondes Coat +1",stats={INT=33,MAB=38,Haste=3}, augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','"Mag.Atk.Bns."+28',}},hands={name="Yaoyotl Gloves", stats={INT=19,MAB=15,MAcc=15,Enmity=-6}},lring={name="Shiva Ring +1", stats={INT=9,MAB=3}},rring={ name="Archon Ring", stats={DarkAffinity=5}},
back={name="Toro Cape", stat={INT=8, MAB=10}},waist="Aqua Belt",legs={ name="Hagondes Pants +1", stats={INT=32,MAB=53,Haste=5,MDmg=10}, augments={'Phys. dmg. taken -3%','"Mag.Atk.Bns."+28',}},feet={name="Umbani Boots", stats={INT=22, MAB=10, MDmg=10, Haste=3, CMP=5}}}
sets.midcast.Myrkr = {ammo="Mana Ampulla",
head={ name="Pixie Hairpin +1", stats={INT=17,DarkAffinity=28} },neck="Orunmila's Torque",ear1="Gifted earring",ear2="Loquacious Earring",
body="Archmage's Coat +1",hands="Otomi Gloves",lring="Sangoma Ring",rring="Zodiac Ring",
back="Bane Cape",waist="Yamabuki-no-Obi",legs="Spaekona's Tonban +1",feet="Chelona Boots +1"
}
sets.midcast['Healing Magic'] = {}
sets.midcast['Divine Magic'] = {}
sets.midcast['Enhancing Magic'] = {}
sets.midcast.Cure = {main="Chatoyant Staff",neck="Phalaina Locket",body="Heka's Kalasiris",hands={ name="Bokwus Gloves", augments={'Mag. Acc.+13','MND+10','INT+10',}},legs="Nares Trews"}
sets.midcast.Stoneskin = {main="Kirin's Pole",neck="Stone Gorget",waist="Siegel Sash",legs="Shedir Seraweels"}
sets.midcast.Aquaveil = {legs="Shedir Seraweels"}
sets.aftercast = {}
sets.aftercast.Idle = {}
sets.aftercast.Idle.keys = {[0]="Refresh",[1]="PDT"}
sets.aftercast.Idle.ind = 0
sets.aftercast.Idle[0] = {main="Terra's Staff",sub="Arbuda Grip",ammo="Mana ampulla",
head="Spurrina Coif",neck="Twilight Torque",ear1="Gifted earring",ear2="Sorcerer's Earring",
body="Hagondes Coat +1",hands="Serpentes Cuffs",ring1="Dark Ring",ring2="Defending Ring",
back="Umbra Cape",waist="Yamabuki-no-Obi",legs="Nares Trews",feet="Herald's Gaiters"}
sets.aftercast.Idle[1] = {main="Terra's Staff",sub="Arbuda Grip",ammo="Mana ampulla",
head={ name="Hagondes Hat +1", stats={INT=21,MAB=39,Haste=6}, augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','"Mag.Atk.Bns."+26',}},neck="Twilight Torque",ear1="Brutal Earring",ear2="Merman's Earring",
body="Hagondes Coat +1",hands={ name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','"Fast Cast"+5',}},ring1="Dark Ring",ring2="Defending Ring",
back="Umbra Cape",waist="Goading Belt",legs={ name="Hagondes Pants +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -4%','Magic burst mdg.+10%',}},feet="Battlecast Gaiters"}
sets.aftercast.Idle['Mana Wall'] = {feet = "Goetia Sabots +2"}
sets.aftercast.Resting = {main="Numen Staff",sub="Ariesian Grip",ammo="Mana ampulla",
head="Spurrina Coif",neck="Eidolon Pendant",ear1="Relaxing Earring",ear2="Antivenom Earring",
body="Hagondes Coat +1",hands="Nares Cuffs",ring1="Celestial Ring",ring2="Angha Ring",
back="Felicitas Cape +1",waist="Austerity Belt +1",legs="Nares Trews",feet="Chelona Boots +1"}
sets.aftercast.Engaged = {
head={ name="Hagondes Hat +1", stats={INT=21,MAB=39,Haste=6}, augments={'Phys. dmg. taken -3%','Magic dmg. taken -2%','"Mag.Atk.Bns."+26',}},neck="Twilight Torque",ear1="Brutal Earring",ear2="Merman's Earring",
body="Hagondes Coat +1",hands={ name="Hagondes Cuffs", augments={'Phys. dmg. taken -3%','"Fast Cast"+5',}},ring1="Dark Ring",ring2="Defending Ring",
back="Umbra Cape",waist="Goading Belt",legs={ name="Hagondes Pants +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -4%','Magic burst mdg.+10%',}},feet="Battlecast Gaiters"}
sets.Obis = {}
sets.Obis.Fire = {waist='Karin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.Obis.Earth = {waist='Dorin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.Obis.Water = {waist='Suirin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.Obis.Wind = {waist='Furin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.Obis.Ice = {waist='Hyorin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.Obis.Lightning = {waist='Rairin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.Obis.Light = {waist='Korin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.Obis.Dark = {waist='Anrin Obi',back={name='Twilight Cape',stats={Day_Weather=5}},lring={name='Zodiac Ring', stats={Day_Weather=3}}}
sets.FC = {staves={
Fire = {main='Atar I'},
Lightning = {main='Apamajas I'},
}}
sets.aftercast.empty = {}
sets.aftercast.Chry = {neck="Chrysopoeia Torque"}
tp_level = 'empty'
stuntarg = 'Shantotto'
send_command('input /macro book 2;wait .1;input /macro set 1')
AMII = {['Freeze II']=true,['Burst II']=true,['Quake II'] = true, ['Tornado II'] = true,['Flood II']=true,['Flare II']=true}
end
windower.register_event('tp change',function(new,old)
if new > 2950 then
tp_level = 'Chry'
else
tp_level = 'empty'
end
if not midaction() then
if sets.aftercast[player.status] then
equip(sets.aftercast[player.status],sets.aftercast[tp_level])
else
equip(sets.aftercast.Idle,sets.aftercast[tp_level])
end
end
end)
function precast(spell)
if sets.precast[spell.english] then
equip(sets.precast[spell.english][macc_level] or sets.precast[spell.english])
elseif spell.english == 'Impact' then
equip(sets.precast.FastCast['Elemental Magic'],sets.Impact)
if not buffactive['Elemental Seal'] then
add_to_chat(8,'--------- Elemental Seal is down ---------')
end
elseif spell.action_type == 'Magic' then
if spell.skill == 'Elemental Magic' then
if AMII[spell.english] and player.merits[to_windower_api(spell.english)] > 1 then
equip(sets.precast.AMII)
else
equip(sets.precast.FastCast['Elemental Magic'])
end
elseif spell.skill == 'Enhancing Magic' then
equip(sets.precast.FastCast['Enhancing Magic'])
else
equip(sets.precast.FastCast.Default)
end
end
if spell.english == 'Stun' and stuntarg ~= 'Shantotto' then
send_command('@input /t '..stuntarg..' ---- Byrth Stunned!!! ---- ')
end
if sets.FC.staves[spell.element] then
equip(sets.FC.staves[spell.element])
end
end
function midcast(spell)
equip_idle_set()
if buffactive.manawell or spell.mppaftercast > 50 then mp_efficiency = 0 else
mp_efficiency = 1
end
if string.find(spell.english,'Cur') then
weathercheck(spell.element,sets.midcast.Cure)
elseif spell.english == 'Impact' then
weathercheck(spell.element,set_combine(sets.midcast['Elemental Magic'][macc_level][mp_efficiency],sets.Impact))
elseif sets.midcast[spell.name] then
weathercheck(spell.element,sets.midcast[spell.name])
elseif spell.skill == 'Elemental Magic' then
weathercheck(spell.element,sets.midcast['Elemental Magic'][macc_level][mp_efficiency])
if AMII[spell.english] and player.merits[to_windower_api(spell.english)] > 2 then
equip(sets.midcast.AMII)
end
if sets.ElementalMagicMAB[spell.element] then
equip(sets.ElementalMagicMAB[spell.element])
end
elseif spell.skill then
equip(sets.aftercast.Idle,sets.aftercast[tp_level])
weathercheck(spell.element,sets.midcast[spell.skill])
end
if spell.english == 'Sneak' then
send_command('cancel 71;')
end
end
function aftercast(spell)
if player.status == 'Idle' then
equip_idle_set()
elseif sets.aftercast[player.status] then
equip(sets.aftercast[player.status],sets.aftercast[tp_level])
else
equip(sets.aftercast.Idle,sets.aftercast[tp_level])
end
if not spell.interrupted then
if spell.english == 'Sleep' or spell.english == 'Sleepga' then
send_command('@wait 55;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
send_command('@wait 85;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
elseif spell.english == 'Break' or spell.english == 'Breakga' then
send_command('@wait 25;input /echo ------- '..spell.english..' is wearing off in 5 seconds -------')
end
end
end
function status_change(new,old)
if new == 'Resting' then
equip(sets.aftercast.Resting)
elseif new == 'Engaged' then
if not midaction() then
equip(sets.aftercast.Engaged,sets.aftercast[tp_level])
end
disable('main','sub')
else
equip_idle_set()
equip(sets.aftercast[tp_level])
end
end
function self_command(command)
if command == 'stuntarg' then
stuntarg = player.target.name
elseif command:lower() == 'macc' then
macc_level = (macc_level+1)%2
equip(sets.midcast['Elemental Magic'][macc_level][mp_efficiency])
if macc_level == 1 then windower.add_to_chat(8,'MMMMMMActivated!')
else windower.add_to_chat(8,'MDamaged') end
elseif command:lower() == 'idle' then
sets.aftercast.Idle.ind = (sets.aftercast.Idle.ind+1)%2
windower.add_to_chat(8,'------------------------ '..sets.aftercast.Idle.keys[sets.aftercast.Idle.ind]..' Set is now the default Idle set -----------------------')
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 not set then return end
if spell_element == world.weather_element or spell_element == world.day_element then
equip(set,sets.Obis[spell_element])
else
equip(set)
end
if set[spell_element] then equip(set[spell_element]) end
end
function equip_idle_set()
if buffactive['Mana Wall'] then
equip(sets.aftercast.Idle[sets.aftercast.Idle.ind],sets.aftercast.Idle['Mana Wall'])
else
equip(sets.aftercast.Idle[sets.aftercast.Idle.ind])
end
if player.tp == 3000 then equip(sets.aftercast.Chry) end
end
function to_windower_api(str)
return str:lower():gsub(' ','_')
end
A picture of the error I just took.
Note sometimes it says it can't see me, othertimes I'm out of range, and sometimes I'm too far away.
http://www.ffxiah.com/screenshots/76851
So these are action responses based off where I am standing? I feel like somewhere in the code it is confusing my distance and reporting it to the game. This error happens also randomly when I try casting on another PC or NPC like a mob. I have never had it happen so far with weaponskills or job abilities, only magic. Regardless of zone or job. It only stops when I don't use gear lua or turn off gearswap.
2 other issues are sometimes when I zone I get many errors Lua runtime error: gearswap/gearswap.lua:379: attempt to index field '?' (a nil value) and if something enters my inventory via shop or treasure pool drop or w/e, I get the same error but the line number is 362. I have never edited the script gearswap but looked at both line 362 and 379 and I don't see any syntax errors.
I have uninstalled and reinstalled windower4, deleted the gearswap folder and had windower download a new one, ran a equipment lua directly from beta examples unedited, and updated my Notepad++. Is nobody else having an issue like this?
Lakshmi.Rooks
Administrator
Serveur: Lakshmi
Game: FFXI
Posts: 1566
By Lakshmi.Rooks 2015-07-21 16:02:13
Are you by chance still on Windows XP? An LS member had this the other day.
By Takisan 2015-07-21 16:46:52
I sure am. This is an XP machine and very old. I was starting to come to this conclusion that maybe I was just reaching the limits to what this PC could do but this problem started maybe a year ago or within the last 3 to 4 updates. Before then I have never had any of the errors I have listed above.
Was this LS mate able to fix it?
Lakshmi.Byrth
VIP
Serveur: Lakshmi
Game: FFXI
Posts: 6184
By Lakshmi.Byrth 2015-07-21 17:21:51
Windows XP is no longer supported by Windower (or Microsoft?) It's entirely possible that something isn't working right.
By Takisan 2015-07-21 17:55:46
Ok then, if you have searched through the codes and found no errors and it seems XP users are the only ones having this problem then I trust your judgement. The other programs like scoreboard, azuresets, setbgm, ect don't seem to have any issue, thankfully. Aside from that GS works wonderfully well and thank you for such a great program.
If anywone finds a way around this issue please let me know. Someday I will upgrade but I hear windows 8 isn't that good compared to 7 and 7 is hard to find. Thank you!
Lakshmi.Rooks
Administrator
Serveur: Lakshmi
Game: FFXI
Posts: 1566
By Lakshmi.Rooks 2015-07-21 17:58:11
LS mate fixed it by going to Windows 7. So, yeah, he fixed it, but not in the way you probably wanted to hear :)
Bismarck.Snprphnx
Serveur: Bismarck
Game: FFXI
Posts: 2707
By Bismarck.Snprphnx 2015-07-22 13:00:49
Posted this to BG, and received no reply.
Quote: Using Motes files, can anyone provide advice on getting the Waist slot to equip properly. I just noticed mine is not equipping the normal nuking waist. When I have a weather active, and nuke to the matching weather, it will equip Hachirin-no-obi just fine. It is currently coded as
In the Mote-Globals file, I have Maniacus Sash set as my gear.default.obi_waist, if that information is pertinent to this issue.
Serveur: Asura
Game: FFXI
Posts: 415
By Asura.Cambion 2015-07-22 13:39:02
I tested this, it works for all steps, in and out of menu (pretarget only works for macros/typed in commands, but precast will work for everything) Code function job_precast(spell, action, spellMap, eventArgs)
local allRecasts = windower.ffxi.get_ability_recasts()
local prestoCooldown = allRecasts[236]
local FinishingMoves
if buffactive['Finishing Move 1'] then
FinishingMoves = 1
elseif buffactive['Finishing Move 2'] then
FinishingMoves = 2
elseif buffactive['Finishing Move 3'] then
FinishingMoves = 3
elseif buffactive['Finishing Move 4'] then
FinishingMoves = 4
elseif buffactive['Finishing Move 5'] then
FinishingMoves = 5
elseif buffactive['Finishing Move 6'] then
FinishingMoves = 6
elseif buffactive['Finishing Move 7'] then
FinishingMoves = 7
else
FinishingMoves = 0
end
if spell.english == "Climactic Flourish" and FinishingMoves < 1 then
send_command('input /ja "Box Step" <t>;wait 3;input /ja "Climactic Flourish" <me>')
eventArgs.cancel = true
end
if spell.type == 'Step' then
if player.main_job_level >= 77 and prestoCooldown < 1 and not buffactive.Presto and FinishingMoves < 5 then
send_command('input /ja "Presto" <me>;wait 1.1;input /ja '..spell.english..' <t>')
eventArgs.cancel = true
end
end
end
I know you're MIA for a bit, so no rush, or maybe it's a simple fix someone else can see.
I'm getting:
>> /ja "Box Step" <t>
'...A command error occured'
from the FFXI side of things, not in the windower log.
And because of that, the command isn't being executed.
I'll try to Step, presto will activate, but the step won't occur. I figured it was a timing issue here:
send_command('input /ja "Presto" <me>;wait 1.1;input /ja '..spell.english..' <t>')
so I tried changing the wait to fractions all the way up to 3 and still no luck, so I assume it's something else?
Also tried breaking the commands into separate parts just in case:
send_command('input /ja "Presto" <me>')
cast_delay(1.1) or send_command(wait 2)
send_command('input /ja '..spell.english..' <t>')
but again, no luck.
Not really a big issue, as my original script works, via macro's, but as you mentioned, not from the menus.
HUMP DAY!
Serveur: Fenrir
Game: FFXI
Posts: 183
By Fenrir.Brimstonefox 2015-07-23 11:51:35
Hi, I'm using this file as my base:
https://github.com/Kinematics/GearSwap-Jobs/blob/master/BST.lua
What I'm attempting to do is create an alias so I can call familiars from the cmd line (I have a separate file called alias.txt) with the commands in it something like (sorry at work, if this syntax isn't right my real one is):
alias crab gs c set Familiar CrabFamiliar; /ja "Call Beast" <me>
My job setup function looks like this (i heavily truncated a couple of the long lists): Code
function job_setup()
state.WeaponMode = M{['description']='Weapon Mode', 'Axe', 'Scythe', 'Sword', 'Staff', 'Club', 'Dagger'}
state.SubMode = M{['description']='Sub Mode', 'DW', 'Shield', 'Grip', 'DWpet'}
state.Stance = M{['description']='Stance', 'Off', 'None', 'Offensive', 'Defensive'}
state.Broth = M{['description']='Broth' }
-- state.Familiar = M{['description']='Familiar', 'CrabFamiliar' }
state.Familiar = M{['description']='Familiar' }
--Call Beast items
call_beast_items = {
AntlionFamiliar="Antica Broth",
CrabFamiliar="Fish Broth",
AlluringHoney="Bug-Ridden Broth"
}
klist = ""
vlist = ""
for k, v in pairs(call_beast_items) do
-- add_to_chat(122,v)
table.insert(state.Broth, v)
table.insert(state.Familiar, k)
-- klist = klist .. "'" .. k .. "', "
-- vlist = vlist .. "'" .. v .. "', "
end
for k,v in pairs(state.Familiar) do
print(k, v)
end
klist = string.gsub(klist, ', $', '')
vlist = string.gsub(vlist, ', $', '')
-- add_to_chat(122,vlist)
-- state.Broth = M{['description']='Broth', vlist }
-- state.Familiar = M{['description']='Familiar', klist }
-- add_to_chat(122,"v"..state.Familiar.value)
add_to_chat(122,"b "..state.Familiar.value)
set_combat_form()
pick_tp_weapon()
state.RewardMode = M{['description']='Reward Mode', 'Theta', 'Eta', 'Zeta', 'Epsilon', 'Delta', 'Gamma', 'Beta', 'Alpha'}
RewardFood = {name="Pet Food Theta"}
Broth = call_beast_items[state.Familiar.value]
-- cntl F8
send_command('bind ^f8 gs c cycle RewardMode')
-- Set up Monster Correlation Modes and keybind Alt-F8
state.CorrelationMode = M{['description']='Correlation Mode', 'Neutral','Favorable'}
send_command('bind !f8 gs c cycle CorrelationMode')
-- Custom pet modes for engaged gear
state.PetMode = M{['description']='Pet Mode', 'Normal', 'PetStance', 'PetTank'}
ready_moves_to_check = S{pruned}
end
I'm not understanding something about the table spaces for lua, I've tried to build state.Familiar with both inserts and concating a string of what would be inserted into it (can be seen in the commented out section).
I just keep getting "unknown mode value crab familiar" in the console, when I type //crab
If I hard code state.Familiar = M{['description']='Familiar', 'CrabFamiliar'} it works, why can't I dynamically build the list?
I'm trying to maintain one list not 2 or 3 with all the jug items - because I also want to reuse the call_beast_items hash inside the organizer_items hash, my 2nd question is going to be will this concatenate/append the hashes or does it insert an entire hash a a record to the first? Code organizer_items = { food1="Pet Food Alpha",
food2="Pet Food Beta",
food3="Pet Food Gamma",
food4="Pet Food Delta",
food5="Pet Food Epsilon",
food6="Pet Food Zeta",
food7="Pet Food Eta",
food8="Pet Food Theta",
call_beast_items,
echos="Echo Drops",
shihei="Shihei",
orb="Macrocosmic Orb"
}
Quetzalcoatl.Lirian
Serveur: Quetzalcoatl
Game: FFXI
Posts: 1
By Quetzalcoatl.Lirian 2015-07-23 15:44:20
Hey,
I'm fairly new to GS myself. I was attempting to update this premade file this morning. There was no precast set so I attempted to add then got Error. Attempt to index field 'precast' (a nil value). Not sure what it means.. I'll post Lua as well.
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()
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent.
function job_setup()
state.Buff['Aftermath'] = buffactive['Aftermath: Lv.1'] or
buffactive['Aftermath: Lv.2'] or
buffactive['Aftermath: Lv.3']
or false
end
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
-- Options: Override default values
options.OffenseModes = {'Normal', 'Acc', 'Multi'}
options.DefenseModes = {'Normal', 'PDT', 'Reraise'}
options.WeaponskillModes = {'Normal', 'Acc', 'Att', 'Mod'}
options.CastingModes = {'Normal'}
options.IdleModes = {'Normal'}
options.RestingModes = {'Normal'}
options.PhysicalDefenseModes = {'PDT', 'Reraise'}
options.MagicalDefenseModes = {'MDT'}
state.Defense.PhysicalMode = 'PDT'
adjust_engaged_sets()
-- Additional local binds
send_command('bind ^` input /ja "Hasso" <me>')
send_command('bind !` input /ja "Seigan" <me>')
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
--------------------------------------
-- Precast Sets
-- Precast sets to enhance JAs
sets.precast.JA['Diabolic Eye'] = {hands="Abyss Gauntlets +2"}
sets.precast.JA['Arcane Circle'] = {feet="Ignominy Sollerets"}
sets.precast.JA['Nether Void'] = {legs="Bale Flanchard +2"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {ammo="Sonia's Plectrum",
head="Yaoyotl Helm",
body="Mikinaak Breastplate",hands="Buremte Gloves",
legs="Cizin Breeches",feet="Karieyh Sollerets +1"}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
set.precast.DarkMagic = {ammo="Impatiens",
head="Fallen's Burgeonet +1",neck="Dark Torque",ear1="Loquacious Earring",
body="Yorium Cuirass",hands="Yorium gauntlets",ring1="Prolix ring",waist="Ninurta's sash",legs="Enif Cosciales",
feet="Yorium sabatons"}
-- Midcast Sets
sets.midcast.FastRecast = {ammo="Impatiens",
head="Fallen's Burgeonet +1",neck="Dark Torque",ear1="Dark Earring",ear2="Loquacious Earring",
body="Yorium Cuirass",hands="Yorium Gauntlets",ring1="Prolix Ring",ring2="Excelsis Ring",
back="Niht Mantle",waist="Ninurta's Sash",legs="Enif Cosciales",feet="Yorium sabatons"}
-- Specific spells
sets.midcast.Absorbs = {ammo="Impatiens",
head="Ignominy Burgeonet +1",neck="Dark Torque",ear1="Lifestorm earring",ear2="Psystorm earring",
body="Demon's Harness",hands="Onyx Gadlings",ring1="Prolix Ring",ring2="Sangoma Ring",back="Chuparrosa Mantle",
waist="Casso sash",legs="Heathen's Flanchard +1",feet="Ignominy Sollerets +1"}
sets.midcast.DarkMagic = {ammo="Impatiens",
head="Ignominy Burgeonet +1",neck="Dark Torque",ear1="Loquacious Earring",ear2="Dark Earring",
body="Demon's Harness",hands="Pavor Gauntlets",ring1="Prolix Ring",ring2="Rajas Ring",
back="Niht mantle",waist="Zoran's Belt",legs="Bale Flanchard +2",feet="Yorium sabatons"}
sets.midcast.EnfeeblingMagic = sets.midcast.DarkMagic
sets.midcast['Dread Spikes'] = {body="Heathen Cuirass +1"}
sets.midcast.Stun = set_combine(sets.midcast.DarkMagic, {
head="Cizin Helm",ear1="Lifestorm Earring",ear2="Psystorm Earring",
ring2="Balrahn's Ring"})
sets.midcast.Drain = {ammo="Impatiens",
head="Striga Crown",neck="Dark Torque",ear1="Dark Earring",ear2="Hirudinea Earring",
body="Demon's Harness",hands="Pavor Gauntlets",ring1="Excelsis Ring",ring2="Rajas Ring",
back="Niht Mantle",waist="Zoran's Belt",legs="Bale Flanchard +2",feet="Yorium Sabatons"}
sets.midcast.Aspir = sets.midcast.Drain
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {ammo="Hagneia Stone",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Brutal Earring",ear2="Moonshade Earring",
body="Fallen's Cuirass",hands="Acro gauntlets",ring1="Ifrit Ring",ring2="Rajas Ring",
back="Niht Mantle",waist="Caudata Belt",legs="Acro Breeches",feet="Acro Leggings"}
sets.precast.WS.Acc = set_combine(sets.precast.WS, {back="Niht Mantle"})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Catastrophe'] = set_combine(sets.precast.WS, {neck="Soil Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring"})
sets.precast.WS['Catastrophe'].Acc = set_combine(sets.precast.WS.Acc, {neck="Soil Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring"})
sets.precast.WS['Catastrophe'].Mod = set_combine(sets.precast.WS['Catastrophe'], {waist="Soil Belt",ear1="Bladeborn Earring",ear2="Steelflash Earring"})
sets.precast.WS['Entropy'] = set_combine(sets.precast.WS, {neck="Soil Gorget",legs="Acro Breeches"})
sets.precast.WS['Entropy'].Acc = set_combine(sets.precast.WS.Acc, {neck="Soil Gorget",legs="Acro Breeches"})
sets.precast.WS['Entropy'].Mod = set_combine(sets.precast.WS['Entropy'], {waist="Soil Belt",legs="Acro Breeches"})
sets.precast.WS['Resolution'] = set_combine(sets.precast.WS, {neck="Soil Gorget",ring2="Rajas ring"})
sets.precast.WS['Resolution'].Acc = set_combine(sets.precast.WS.Acc, {neck="Soil Gorget",ring2="Rajas Ring"})
sets.precast.WS['Resolution'].Mod = set_combine(sets.precast.WS['Resolution'], {waist="Caudata belt",ring2="Rajas Ring"})
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {neck="Coatl gorget +1",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Lugra cloak",hands="Heathen's gauntlets +1",ring1="Dark ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Zoran's Belt",legs="Crimson Cuisses",feet="Phorcys Schuhs"}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle.Town = {
neck="Coatl gorget +1",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Lugra Cloak",hands="Heathen's gauntlets +1",ring1="Dark ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Zoran Belt",legs="Crimson Cuisses",feet="Phorcys schuhs"}
sets.idle.Field = {
neck="Coatl gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Lugra Cloak",hands="Heathen's gauntlets +1",ring1="Dark Ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Zoran Belt",legs="Crimson Cuisses",feet="Phorcys schuhs"}
sets.idle.Weak = {
head="Twilight Helm",neck="Bale Choker",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Twilight Mail",hands="Buremte Gloves",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Letalis Mantle",waist="Goading Belt",legs="Cizin Breeches",feet="Ejekamal Boots"}
-- Defense sets
sets.defense.PDT = {
head="Cizin Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Cizin Mail",hands="Cizin Mufflers",ring1="Dark Ring",ring2="Dark Ring",
back="Mollusca Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Cizin Greaves"}
sets.defense.Reraise = {
head="Twilight Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Twilight Mail",hands="Cizin Mufflers",ring1="Dark Ring",ring2="Paguroidea Ring",
back="Mollusca Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Cizin Greaves"}
sets.defense.MDT = {
head="Yaoyotl Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Cizin Mail",hands="Cizin Mufflers",ring1="Dark Ring",ring2="Dark Ring",
back="Engulfer Cape",waist="Dynamic Belt",legs="Cizin Breeches",feet="Cizin Greaves"}
sets.Kiting = {legs="Blood Cuisses"}
sets.Reraise = {head="Twilight Helm",body="Twilight Mail"}
-- Engaged sets
sets.engaged = {ammo="Yetshila",
head="Yaoyotl helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mes'yohi Haubergeon",hands="Acro gauntlets",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Zoran Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Acc = {ammo="Yetshila",
head="Yaoyotl Helm",neck="Iqabi necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mes'yohi Haubergeon",hands="Acro gauntlets",ring1="Mars's Ring",ring2="Rajas Ring",
back="Kayapa cape",waist="Dynamic Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged = {ammo="Yestshila",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mes'yohi Haubergeon",hands="Acro gauntlets",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Zoran Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Multi = {ammo="Yestshila",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Acro surcoat",hands="Acro gauntlets",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Zoran Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Reraise = {ammo="Fire Bomblet",
head="Twilight Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Twilight Mail",hands="Acro gauntlets",ring1="Dark Ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Zoran Belt",legs="Acro Breeches",feet="Acro leggings"}
-- 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.Apocalypse = {ammo="Yestshila",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mes'yohi Haubergeon",hands="Acro gauntlets",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Zoran Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Apocalypse.Acc = {ammo="Yestshila",
head="Yaoyotl Helm",neck="Iqabi necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mes'yohi Haubergeon",hands="Acro gauntlets",ring1="Mars's Ring",ring2="Rajas Ring",
back="Kayapa cape",waist="Dynamic Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Apocalypse.AM = {ammo="Hagneia Stone",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mes'yohi Haubergeon",hands="Acro gauntlets",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Windbuffet Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Apocalypse.Multi = {ammo="Yestshila",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Acro surcoat",hands="Acro gauntlets",ring1="K'ayres Ring",ring2="Rajas Ring",
back="Atheling Mantle",waist="Zoran Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Apocalypse.Multi.PDT = {ammo="Yestshila",
head="Quiahuiz Helm",neck="Twilight torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Eschite breastplate",hands="Acro gauntlets",ring1="Dark Ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Dynamic Belt",legs="Acro Breeches",feet="Phorcys schuhs"}
sets.engaged.Apocalypse.Multi.Reraise = {ammo="Yestshila",
head="Twilight Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Twilight Breastplate",hands="Acro gauntlets",ring1="Rajas Ring",ring2="Mars's Ring",
back="Shadow Mantle",waist="Dynamic Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged.Apocalypse.PDT = {ammo="Yestshila",
head="Quiahuiz helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Eschite breastplate",hands="Acro gauntlets",ring1="Dark Ring",ring2="Dark Ring",
back="Shadow Mantle",waist="Dynamic belt",legs="Acro Breeches",feet="Phorcys schuhs"}
-- Custom Melee Group
sets.engaged['Ragnarok'] = {ammo="Yestshila",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mes'yohi",hands="Heathen Gauntlets+1",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Zoran's Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged['Ragnarok'].Acc = {ammo="Yestshila",
head="Yaoyotl Helm",neck="Iqabi necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Acro surcoat",hands="Heathen gauntlets",ring1="Rajas Ring",ring2="Mars's Ring",
back="Kayapa cape",waist="Dynamic Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged['Ragnarok'].Multi = {ammo="Hagneia Stone",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mikinaak Breastplate",hands="Acro gauntlets",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Zoran Belt",legs="Acro Breeches",feet="Acro leggings"}
sets.engaged['Ragnarok'].Multi.PDT = {ammo="Hagneia Stone",
head="Yaoyotl Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Cizin Mail",hands="Cizin Mufflers",ring1="Rajas Ring",ring2="Mars's Ring",
back="Letalis Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Cizin Graves"}
sets.engaged['Ragnarok'].Multi.Reraise = {ammo="Hagneia Stone",
head="Twilight Helm",neck="Ganesha's Mala",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Pak Corselet",hands="Cizin Mufflers",ring1="Rajas Ring",ring2="Mars's Ring",
back="Letalis Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Ejekamal Boots"}
sets.engaged['Ragnarok'].PDT = {ammo="Hagneia Stone",
head="Yaoyotl Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mikinaak Breastplate",hands="Cizin Mufflers",ring1="Dark Ring",ring2="Dark Ring",
back="Mollusca Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Karieyh Sollerets +1"}
sets.engaged['Ragnarok'].Acc.PDT = {ammo="Hagneia Stone",
head="Yaoyotl Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Mikinaak Breastplate",hands="Cizin Mufflers",ring1="Dark Ring",ring2="Dark Ring",
back="Mollusca Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Karieyh Sollerets +1"}
sets.engaged['Ragnarok'].Reraise = {ammo="Hagneia Stone",
head="Twilight Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Twilight Mail",hands="Cizin Mufflers",ring1="Dark Ring",ring2="Dark Ring",
back="Letalis Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Karieyh Sollerets +1"}
sets.engaged['Ragnarok'].Acc.Reraise = {ammo="Hagneia Stone",
head="Twilight Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Twilight Mail",hands="Cizin Mufflers",ring1="Dark Ring",ring2="Dark Ring",
back="Letalis Mantle",waist="Dynamic Belt",legs="Cizin Breeches",feet="Karieyh Sollerets +1"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks that are called to process player actions at specific points in time.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Magic' then
equip(sets.precast.FC)
end
end
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
function job_midcast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Magic' then
equip(sets.midcast.FastRecast)
end
end
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if state.DefenseMode == 'Reraise' or
(state.Defense.Active and state.Defense.Type == 'Physical' and state.Defense.PhysicalMode == 'Reraise') then
equip(sets.Reraise)
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)
-- if not spell.interrupted then
-- if state.Buff[spell.english] ~= nil then
-- state.Buff[spell.english] = true
-- end
-- end
-- end
-------------------------------------------------------------------------------------------------------------------
-- Customization hooks for idle and melee sets, after they've been automatically constructed.
-------------------------------------------------------------------------------------------------------------------
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
return idleSet
end
-- Modify the default melee set after it was constructed.
function customize_melee_set(meleeSet)
return meleeSet
end
-------------------------------------------------------------------------------------------------------------------
-- General hooks for other events.
-------------------------------------------------------------------------------------------------------------------
-- Called when the player's status changes.
function job_status_change(newStatus, oldStatus, eventArgs)
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 buff:startswith('Aftermath') then
state.Buff.Aftermath = gain
adjust_melee_groups()
handle_equipping_gear(player.status)
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
adjust_engaged_sets()
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function adjust_engaged_sets()
state.CombatWeapon = player.equipment.main
adjust_melee_groups()
end
function adjust_melee_groups()
classes.CustomMeleeGroups:clear()
if state.Buff.Aftermath then
classes.CustomMeleeGroups:append('AM')
end
end
function select_default_macro_book()
-- Default macro set/book
set_macro_page(1, 1)
-- I realize this will be better used with different /subs per book,
-- but I won't worry about that till I get this working properly.
end
Serveur: Fenrir
Game: FFXI
Posts: 183
By Fenrir.Brimstonefox 2015-07-23 21:46:26
I'm trying to do 2 things:
1. I'm trying to have an alias to call beast: (ie type //crab and it will equip "Fish Broth" and do call beast)
2. without duplicating effort I want to embed my call_beast_items hash table inside the organizer_items hash table so when I to //gs org it grabs all my broths I have (and I just ran back to MH and moved the broths back to mog safe and ran it and it shows up so that code is working, so this can be ignored)
I was able to get it to work, first I have a file call alias.txt in the scripts directory which has lines like this:
alias hermes gs c callbeast SharpwitHermes
alias honey gs c callbeast AlluringHoney
Then I have this in the job_setup (listing full thing if anyone wants to cut and paste): Code --Call Beast items
call_beast_items = {
CrabFamiliar="Fish Broth",
SlipperySilas="Wormy Broth",
HareFamiliar="Carrot Broth",
SheepFamiliar="Herbal Broth",
FlowerpotBill="Humus",
TigerFamiliar="Meat Broth",
FlytrapFamiliar="Grasshopper Broth",
LizardFamiliar="Carrion Broth",
MayflyFamiliar="Bug Broth",
EftFamiliar="Mole Broth",
BeetleFamiliar="Tree Sap",
AntlionFamiliar="Antica Broth",
MiteFamiliar="Blood Broth",
KeenearedSteffi="Famous Carrot Broth",
LullabyMelodia="Singing Herbal Broth",
FlowerpotBen="Rich Humus",
SaberSiravarde="Warm Meat Broth",
FunguarFamiliar="Seedbed Soil",
ShellbusterOrob="Quadav Bug Broth",
ColdbloodComo="Cold Carrion Broth",
CourierCarrie="Fish Oil Broth",
Homunculus="Alchemist Water=",
VoraciousAudrey="Noisy Grasshopper Broth",
AmbusherAllie="Lively Mole Broth",
PanzerGalahad="Scarlet Sap",
LifedrinkerLars="Clear Blood Broth",
ChopsueyChucky="Fragrant Antica Broth",
AmigoSabotender="Sun Water",
NurseryNazuna="Dancing Herbal Broth",
CraftyClyvonne="Cunning Brain Broth",
PrestoJulio="Chirping Grasshopper Broth",
SwiftSieghard="Mellow Bird Broth",
MailbusterCetas="Goblin Bug Broth",
AudaciousAnna="Bubbling Carrion Broth",
TurbidToloi="Auroral Broth",
LuckyLulush="Lucky Carrot Broth",
DipperYuly="Wool Grease",
FlowerpotMerle="Vermihumus",
DapperMac="Briny Broth",
DiscreetLouise="Deepbed Soil",
FatsoFargann="Curdled Plasma",
FaithfulFalcorr="Lucky Broth",
BugeyedBroncha="Savage Mole Broth",
BloodclawShasra="Razor Brain Broth",
GorefangHobs="Burning Carrion Broth",
GooeyGerard="Cloudy Wheat Broth",
CrudeRaphie="Shadowy Broth",
DroopyDortwin="Swirling Broth",
SunburstMalfik="Shimmering Broth",
WarlikePatrick="Livid Broth",
ScissorlegXerin="Spicy Broth",
RhymingShizuna="Lyrical Broth",
AttentiveIbuki="Salubrious Broth",
AmiableRoche="Airy Broth",
HeraldHenry="Translucent Broth",
BrainyWaluis="Crumbly Soil",
HeadbreakerKen="Blackwater Broth",
RedolentCandi="Electrified Broth",
CaringKiyomaro="Fizzy Broth",
HurlerPercival="Pale Sap",
BlackbeardRandy="Meaty Broth",
GenerousArthur="Dire Broth",
ThreestarLynn="Muddy Broth",
BraveHeroGlenn="Wispy Broth",
SharpwitHermes="Saline Broth",
AlluringHoney="Bug-Ridden Broth"
}
In user setup I have this:
gear.Broth = {name=""}
Then for organizer I have this in init_gear_setup (this should get everything with //gs org): Code organizer_items = {
food1="Pet Food Alpha",
food2="Pet Food Beta",
food3="Pet Food Gamma",
food4="Pet Food Delta",
food5="Pet Food Epsilon",
food6="Pet Food Zeta",
food7="Pet Food Eta",
food8="Pet Food Theta",
call_beast_items,
echos="Echo Drops",
shihei="Shihei",
orb="Macrocosmic Orb"
}
Then I have a gear set like this:
sets.precast.JA['Call Beast'] = {main="Kumbhakarna",ammo=gear.Broth,hands="Mst. Gloves +2"}
Then these functions: Code function job_self_command(cmdParams, eventArgs)
-- add_to_chat(122,'self command')
handle_flags(cmdParams, eventArgs)
if cmdParams[1]:lower() == 'callbeast' then
handle_callbeast(cmdParams)
eventArgs.handled = true
end
end
function handle_callbeast(cmdParams)
-- cmdParams[1] == 'callbeast'
-- cmdParams[2] == pet to use
if not cmdParams[2] then
add_to_chat(123,'Error: No Pet command given.')
return
end
local petcall = cmdParams[2]
if call_beast_items[petcall] ~= nil then
gear.Broth.name = call_beast_items[petcall]
send_command('input /ja "Call Beast" <me>')
else
add_to_chat(123,'Unknown Pet:'..petcall)
end
end
and its working. I type //<some pet alias> and they show up.
joy to the world, no more fumbling through menus and lost equipment.
Leviathan.Vow
Serveur: Leviathan
Game: FFXI
Posts: 125
By Leviathan.Vow 2015-07-24 15:08:18
Code function job_precast(spell, action, spellMap, eventArgs)
local FinishingMoves
if buffactive['Finishing Move 1'] then
FinishingMoves = 1
elseif buffactive['Finishing Move 2'] then
FinishingMoves = 2
elseif buffactive['Finishing Move 3'] then
FinishingMoves = 3
elseif buffactive['Finishing Move 4'] then
FinishingMoves = 4
elseif buffactive['Finishing Move 5'] then
FinishingMoves = 5
elseif buffactive['Finishing Move 6'] then
FinishingMoves = 6
elseif buffactive['Finishing Move 7'] then
FinishingMoves = 7
else
FinishingMoves = 0
end
Unrelated: you can save a lot of time typing this sort of code by using logical operators. Code
local FinishingMoves = buffactive['Finishing Move 1'] and 1
or buffactive['Finishing Move 2'] and 2
or buffactive['Finishing Move 3'] and 3
or buffactive['Finishing Move 4'] and 4
or buffactive['Finishing Move 5'] and 5
or buffactive['Finishing Move 6'] and 6
or buffactive['Finishing Move 7'] and 7
or 0
Serveur: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2015-07-26 15:53:25
Unrelated: you can save a lot of time typing this sort of code by using logical operators. Nice! Never really knew how to use those, cool. Thanks!
Serveur: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2015-07-27 01:33:28
Quetzalcoatl.Lirian said: »set.precast.DarkMagic this should be sets.precast.FC['Dark Magic']
Serveur: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2015-07-27 01:45:10
Bismarck.Snprphnx said: »Posted this to BG, and received no reply.
Quote: Using Motes files, can anyone provide advice on getting the Waist slot to equip properly. I just noticed mine is not equipping the normal nuking waist. When I have a weather active, and nuke to the matching weather, it will equip Hachirin-no-obi just fine. It is currently coded as
In the Mote-Globals file, I have Maniacus Sash set as my gear.default.obi_waist, if that information is pertinent to this issue. Try listing it in your job lua too, even though you put it in your globals. If that doesn't work, upload your lua to http://www.pastebin.com and link it here so it can be looked over for conflicts.
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.
|
|