|
Gearswap Support Thread
Asura.Velata
Server: Asura
Game: FFXI
Posts: 28
By Asura.Velata 2014-09-18 10:32:54
Having an issue with Day/Night changes, specifically in Hands/Feet. They only work when I reload Gearswap and hit F12 to refresh and won't adjust later when swapping in and out of idle.
Originally I thought to just tinker with select_movement_feet() based on Kinematics' NIN.lua for Danzo/Ninja Kayhan but that didn't work at all. It was a long shot but figured it was worth a try.
My best success has been creating a user function select_idle_feet/select_idle_hands but still only works on the time changes when GS is reloaded and gear's refreshed with F12.
I've tried Code if world.time >= 17*60 or world.time < 7*60 then
with > and <, >= and <, and >= and <=. The above has been the best option but again doesn't change without reloading gearswap.
Not sure what's wrong but pastebin to see if anyone has any insight it would be most appreciated.
http://pastebin.com/CgFpvkS7
Siren.Azat
Server: Siren
Game: FFXI
Posts: 1
By Siren.Azat 2014-09-19 11:04:25
Hoping could get some help with an issue with my cor lua. It won't load my phantom roll gear for double-ups or load any roll specific gear pieces.
At first I thought the problem was limited to just when I was using snake-eyes, lua has double-up follow in a send_command after snake eye use, but a friend told me about showswaps command to debug it and that revealed it wasn't doing the swaps for double-up in general or any of the gear specific rolls at all. I'm using the Bokura cor template.
Code elseif spell.type == "JobAbility" then
if sets.JA[spell.english] then
equip(sets.JA[spell.english])
if spell.english == "Snake Eye" then -- Auto Double-Up After You Use Snake Eye --
send_command('@wait 1;input //gs equip sets.Rolls;input /ja Double-Up <me>')
end
end
elseif (spell.type == "CorsairRoll" or spell.english == "Double-Up") then
equip(sets.Rolls)
if spell.type == "CorsairRoll" or spell.english == "Double-Up" and Luzaf =='ON' then
equip(sets.Rolls.Luzaf)
elseif spell.english == "Tactician's Roll" then
equip({body="Nvrch. Frac +2"})
elseif spell.english == "Caster's Roll" then
equip({legs="Nvrch. Culottes +2"})
elseif spell.english == "Courser's Roll" then
equip({feet="Nvrch. Bottes +2"})
end
As far as I'm aware of it should be working, but it only loads my roll gear on first use of a roll and only that, maybe I'm overlooking something but any help would be appreciated.
Full lua for reference. Code function get_sets()
AccIndex = 1
AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For Shooting/QD/TP/WS. Default ACC Set Is LowACC. The First TP Set Of Your Main Weapon Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
IdleIndex = 1
IdleArray = {'Movement', 'Regen'} -- Default Idle Set Is Movement --
Armor = 'None'
define_roll_values()
AutoMode = 'OFF' -- Set Default Auto RA/WS ON or OFF Here --
Obi = 'ON' -- Turn Default Obi ON or OFF Here --
Luzaf = 'OFF' --Turn Default Luzaf Ring ON or OFF Here--
target_distance = 5 -- Set Default Distance Here --
select_default_macro_book() -- Change Default Macro Book At The End --
ranged_ws = S{
"Hot Shot","Split Shot","Sniper Shot","Slug Shot","Detonator","Numbing Shot",
"Last Stand","Leaden Salute","Wildfire"}
ACC_Shots = S{"Light Shot","Dark Shot"}
Cure_Spells = {"Cure","Cure II","Cure III","Cure IV"} -- Cure Degradation --
Curaga_Spells = {"Curaga","Curaga II"} -- Curaga Degradation --
sc_map = {SC1="CoursersRoll", SC2="DiaII", SC3="LightShot"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
-- Idle/Town Sets --
sets.Idle = {}
sets.Idle.Regen = {
head="Blood Mask",
neck="Wiglen Gorget",
ear1="Colossus's Earring",
ear2="Ethereal Earring",
body="Lanun Fraq",
hands="Iuitl Wristbands",
ring1="Paguroidea Ring",
ring2="Sheltered Ring",
back="Shadow Mantle",
waist="Flume Belt",
legs="Crimson cuisses",
feet="Iuitl Gaiters"}
sets.Idle.Movement = set_combine(sets.Idle.Regen,{
head="Ejekamal Mask",
neck="Twilight Torque",
ring1="Luzaf's Ring",
ring2="Barataria Ring",
back="Shadow Mantle"})
-- QD Sets --
sets.QD = {
ammo="Animikii Bullet",
head="Blood Mask",
neck="Stoicheion Medal",
ear1="Novio Earring",
ear2="Friomisi Earring",
body="Mirke Wardecors",
hands="Schutzen Mittens",
ring1="Acumen Ring",
ring2="Demon's Ring",
back="Gunslinger's Cape",
waist="Aquiline Belt",
legs="Shned. Tights +1",
feet="Comm. Boots +2"}
sets.QD.MidACC = set_combine(sets.QD,{})
sets.QD.HighACC = set_combine(sets.QD.MidACC,{
neck="Faith Torque",
ear1="Lifestorm Earring",
ear2="Psystorm Earring",
hands="Sigyn's Bazubands",
ring1="Moepapa Ring",
ring2="Arvina Ringlet",
legs="Thur. Tights +1"})
-- PDT/MDT Sets --
sets.PDT = {
head="Ejekamal Mask",
neck="Twilight Torque",
ear1="Colossus's Earring",
ear2="Ethereal Earring",
body="Lanun Fraq",
hands="Iuitl Wristbands",
ring1="Dark Ring",
ring2="jelly Ring",
back="Shadow Mantle",
waist="Flume Belt",
legs="Iuitl Tights",
feet="Iuitl Gaiters"}
sets.MDT = set_combine(sets.PDT,{
ear1="Merman's Earring",
ear2="Merman's Earring",
ring2="Shadow Ring",
back="Engulfer Cape",
waist="Resolute Belt"})
-- Roll Set --
sets.Rolls = set_combine(sets.PDT,{
head="Lanun Tricorne",
hands="Nvrch. Gants +2",
legs="Desultor Tassets",
ring2="Barataria Ring"})
sets.Rolls.Luzaf = set_combine(sets.PDT.Rolls,{
ring1="Luzaf's Ring",})
-- Preshot --
sets.Preshot = {
head="Aurore Beret",
ammo="Oberon's Bullet",
hands="Iuitl Wristbands",
back="Navarch's Mantle",
waist="Impulse Belt",
legs="Nvrch. Culottes +2"}
-- Shooting Base Set --
sets.Midshot = {
ammo="Oberon's Bullet",
head="Lanun Tricorne",
neck="Houyi's gorget",
ear1="Clearview Earring",
ear2="Volley Earring",
body="Navarch's Frac +2",
hands="Buremte Gloves",
ring1="Arvina Ringlet",
ring2="Bellona's Ring",
back="Libeccio Mantle",
waist="Impulse Belt",
legs="Navarch's Culottes +2",
feet="Iuitl Gaiters"}
-- Death Penalty Sets --
sets.Midshot['Death Penalty'] = {
ammo="Oberon's Bullet",
head="Lanun Tricorne",
neck="Houyi's gorget",
ear1="Clearview Earring",
ear2="Volley Earring",
body="Navarch's Frac +2",
hands="Buremte Gloves",
ring1="Arvina Ringlet",
ring2="Bellona's Ring",
back="Libeccio Mantle",
waist="Impulse Belt",
legs="Navarch's Culottes +2",
feet="Iuitl Gaiters"}
sets.Midshot['Death Penalty'].MidACC = set_combine(sets.Midshot['Death Penalty'],{})
sets.Midshot['Death Penalty'].HighACC = set_combine(sets.Midshot['Death Penalty'].MidACC,{})
-- Vanir Gun Sets --
sets.Midshot['Homestead Gun'] = {
ammo="Oberon's Bullet",
head="Lanun Tricorne",
neck="Houyi's gorget",
ear1="Clearview Earring",
ear2="Volley Earring",
body="Navarch's Frac +2",
hands="Buremte Gloves",
ring1="Arvina Ringlet",
ring2="Bellona's Ring",
back="Libeccio Mantle",
waist="Impulse Belt",
legs="Navarch's Culottes +2",
feet="Iuitl Gaiters"}
sets.Midshot['Homestead Gun'].MidACC = set_combine(sets.Midshot['Homestead Gun'],{
head="Lak. Hat +1",
neck="Ej necklace +1",
ear1="Clearview Earring",
back="Gunslinger's Cape"})
sets.Midshot['Homestead Gun'].HighACC = set_combine(sets.Midshot['Homestead Gun'].MidACC,{
hands="Sigyn's Bazubands",
ring2="Hajduk Ring +1",
legs="Thur. Tights +1"})
-- Armageddon Sets --
sets.Midshot.Armageddon = {}
sets.Midshot.Armageddon.MidACC = set_combine(sets.Midshot.Armageddon,{})
sets.Midshot.Armageddon.HighACC = set_combine(sets.Midshot.Armageddon.MidACC,{})
-- Melee Sets --
sets.Melee = {
ammo="Oberon's Bullet",
head="Ejekamal Mask",
neck="Asperity Necklace",
ear1="Steelflash Earring",
ear2="Bladeborn Earring",
body="Thaumas Coat",
hands="buremte Glvoes",
ring1="Mars's Ring",
ring2="Epona's Ring",
back="Atheling Mantle",
waist="Windbuffet Belt",
legs="Quiahuiz Trousers",
feet="Iuitl Gaiters"}
sets.Melee.MidACC = set_combine(sets.Melee,{})
sets.Melee.HighACC = set_combine(sets.Melee.MidACC,{})
-- WS Base Set --
sets.WS = {}
-- Last Stand Sets --
sets.WS["Last Stand"] = {
ammo="Bismuth Bullet",
head="Lanun Tricorne",
neck="Flame Gorget",
ear1="Moonshade Earring",
ear2="Drone Earring",
body="Lanun Fraq",
hands="Iuitl Wristbands",
ring1="Stormsoul Ring",
ring2="Stormsoul Ring",
back="Libeccio Mantle",
waist="Flame Belt",
legs="Kaabnax Trousers",
feet="Iuitl Gaiters"}
sets.WS["Last Stand"].MidACC = set_combine(sets.WS["Last Stand"],{})
sets.WS["Last Stand"].HighACC = set_combine(sets.WS["Last Stand"].MidACC,{})
-- Wildfire Sets --
sets.WS.Wildfire = {}
sets.WS.Wildfire.MidACC = set_combine(sets.WS.Wildfire,{})
sets.WS.Wildfire.HighACC = set_combine(sets.WS.Wildfire.MidACC,{})
-- Leaden Salute Sets --
sets.WS['Leaden Salute'] = {
ammo="Bismuth Bullet",
head="Uk'uxkaj Cap",
neck="Houyi's Gorget",
ear1="Friomisi Earring",
ear2="Novio Earring",
body="Lanun Fraq",
hands="Iuitl Wristbands",
ring1="Archon Ring",
ring2="Stormsoul Ring",
back="Gunslinger's Cape",
waist="Elanid Belt",
legs="Shned. Tights +1",
feet="Iuitl Gaiters"}
sets.WS['Leaden Salute'].MidACC = set_combine(sets.WS['Leaden Salute'],{})
sets.WS['Leaden Salute'].HighACC = set_combine(sets.WS['Leaden Salute'].MidACC,{})
-- Elemental Obi --
sets.Obi = {}
sets.Obi.Thunder = {waist='Rairin Obi'}
sets.Obi.Water = {waist='Suirin Obi'}
sets.Obi.Fire = {waist='Karin Obi'}
sets.Obi.Ice = {waist='Hyorin Obi'}
sets.Obi.Wind = {waist='Furin Obi'}
sets.Obi.Earth = {waist='Dorin Obi'}
sets.Obi.Light = {waist='Korin Obi'}
sets.Obi.Dark = {waist='Anrin Obi'}
-- JA Sets --
sets.JA = {}
sets.JA["Double-Up"]
sets.JA["Random Deal"] = {body="Lanun Frac"}
sets.JA.Fold = {hands="Lanun Gauntlets"}
sets.JA["Snake Eye"] = {legs="Lanun Culottes"}
sets.JA["Wild Card"] = {feet="Comm. Bottes +2"}
-- Waltz Set --
sets.Waltz = {}
sets.Precast = {}
--Fastcast Set --
sets.Precast.FastCast = {}
sets.Midcast = {}
-- Magic Haste Set --
sets.Midcast.Haste = set_combine(sets.PDT,{})
end
function pretarget(spell,action)
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
elseif spell.type == "CorsairRoll" and buffactive[spell.english] then -- Change Any Rolls To Double-Up When You Have A Roll Up --
cancel_spell()
send_command('doubleup')
elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
cancel_spell()
send_command('ThirdEye')
elseif spell.english == "Meditate" and player.tp > 2900 then -- Cancel Meditate If TP Is Above 290 --
cancel_spell()
add_to_chat(123, spell.name .. ' Canceled: ' .. player.tp)
elseif (spell.english == 'Ranged' and spell.target.distance > 24.9) or (player.status == 'Engaged' and ((ranged_ws:contains(spell.english) and spell.target.distance > 16+target_distance) or (spell.type == "WeaponSkill" and not ranged_ws:contains(spell.english) and spell.target.distance > target_distance))) then -- Cancel Ranged Attack or WS If You Are Out Of Range --
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
elseif spell.english == 'Ranged' then -- Auto WS --
if player.tp >= 100 and AutoMode == 'ON' and not buffactive.amnesia then
cancel_spell()
autoWS()
end
end
end
function precast(spell,action)
if spell.english == 'Ranged' or spell.type == "WeaponSkill" then
if player.equipment.ammo == "Animikii Bullet" then -- Cancel Ranged Attack or WS If You Have Animikii Bullet Equipped --
cancel_spell()
add_to_chat(123, spell.name .. ' Canceled: [Animikii Bullet Equipped!]')
return
elseif spell.english=='Ranged' then
equip(sets.Preshot)
elseif spell.type == "WeaponSkill" then
if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
cancel_spell()
add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
return
else
equipSet = sets.WS
if equipSet[spell.english] then
equipSet = equipSet[spell.english]
end
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
if spell.english == "Last Stand" and (player.tp > 299 or buffactive.Sekkanoki) then -- Equip Altdorf's Earring and Wilhelm's Earring When You Have 300 TP or Sekkanoki For Last Stand --
equipSet = set_combine(equipSet,{ear1="Altdorf's Earring",ear2="Wilhelm's Earring"})
end
equip(equipSet)
end
end
elseif spell.type == "JobAbility" then
if sets.JA[spell.english] then
equip(sets.JA[spell.english])
if spell.english == "Snake Eye" then -- Auto Double-Up After You Use Snake Eye --
send_command('@wait 1;input //gs equip sets.Rolls;input /ja Double-Up <me>')
end
end
elseif (spell.type == "CorsairRoll" or spell.english == "Double-Up") then
equip(sets.Rolls)
if spell.type == "CorsairRoll" or spell.english == "Double-Up" and Luzaf =='ON' then
equip(sets.Rolls.Luzaf)
elseif spell.english == "Tactician's Roll" then
equip({body="Nvrch. Frac +2"})
elseif spell.english == "Caster's Roll" then
equip({legs="Nvrch. Culottes +2"})
elseif spell.english == "Courser's Roll" then
equip({feet="Nvrch. Bottes +2"})
end
elseif spell.type == "CorsairShot" then
equipSet = sets.QD
if ACC_Shots:contains(spell.english) then
equipSet = sets.QD.HighACC
else
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
if not ACC_Shots:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' then -- Use Obi Toggle To Unlock Elemental Obi --
equipSet = set_combine(equipSet,sets.Obi[spell.element])
end
end
equip(equipSet)
elseif spell.type:endswith('Magic') or spell.type == 'Ninjutsu' then
if string.find(spell.english,'Utsusemi') then
if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
cancel_spell()
add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
return
else
equip(sets.Precast.FastCast)
end
else
equip(sets.Precast.FastCast)
end
elseif spell.type == "Waltz" then
refine_waltz(spell,action)
equip(sets.Waltz)
elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
cast_delay(0.2)
send_command('cancel Sneak')
end
end
function midcast(spell,action)
if spell.english=='Ranged' then
equipSet = sets.Midshot
if equipSet[player.equipment.range] then
equipSet = equipSet[player.equipment.range]
end
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
equip(equipSet)
elseif spell.type:endswith('Magic') or spell.type == "Ninjutsu" then
if spell.english == "Stoneskin" then
if buffactive.Stoneskin then
send_command('@wait 2.8;cancel stoneskin')
end
equip(sets.Midcast.Stoneskin)
elseif spell.english == "Sneak" then
if spell.target.name == player.name and buffactive['Sneak'] then
send_command('cancel sneak')
end
equip(sets.Midcast.Haste)
elseif string.find(spell.english,'Utsusemi') then
if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
send_command('@wait 1.7;cancel Copy Image*')
end
equip(sets.Midcast.Haste)
elseif spell.english == 'Monomi: Ichi' then
if buffactive['Sneak'] then
send_command('@wait 1.7;cancel sneak')
end
equip(sets.Midcast.Haste)
else
equip(sets.Midcast.Haste)
end
end
end
function aftercast(spell,action)
if spell.english == 'Ranged' and AutoMode == 'ON' then
autoRA()
elseif not spell.interrupted then
if spell.type == "WeaponSkill" then
send_command('wait 0.2;gs c TP')
elseif spell.type == 'CorsairRoll' then
display_roll_info(spell)
elseif spell.english == 'Light Shot' then -- Sleep Countdown --
send_command('wait 50;input /echo '..spell.name..' Effect: [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..' Effect: [OFF]')
end
else
status_change(player.status)
end
end
function status_change(new,old)
if Armor == 'PDT' then
equip(sets.PDT)
elseif Armor == 'MDT' then
equip(sets.MDT)
elseif new == 'Engaged' then
equipSet = sets.Melee
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
equip(equipSet)
elseif new == 'Idle' then
equip(sets.Idle[IdleArray[IdleIndex]])
elseif new == 'Resting' then
equip(sets.Resting)
end
end
function buff_change(buff,gain)
buff = string.lower(buff)
if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
if gain then
send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
else
send_command('timers delete "Aftermath: Lv.3"')
add_to_chat(123,'AM3: [OFF]')
end
elseif buff == 'weakness' then -- Weakness Timer --
if gain then
send_command('timers create "Weakness" 300 up')
else
send_command('timers delete "Weakness"')
end
end
if not midaction() then
status_change(player.status)
end
end
-- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
function self_command(command)
if command == 'C1' then -- Accuracy Level Toggle --
AccIndex = (AccIndex % #AccArray) + 1
status_change(player.status)
add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
elseif command == 'C5' then -- Auto Update Gear Toggle --
status_change(player.status)
add_to_chat(158,'Auto Update Gear')
elseif command == 'C20' then -- Luzaf Toggle --
if Luzaf == 'ON' then
Luzaf = 'OFF'
add_to_chat(123,'Luzaf: [OFF]')
else
Luzaf = 'ON'
add_to_chat(158,'Luzaf: [ON]')
end
status_change(player.status)
elseif command == 'C3' then -- Obi Toggle --
if Obi == 'ON' then
Obi = 'OFF'
add_to_chat(123,'Obi: [OFF]')
else
Obi = 'ON'
add_to_chat(158,'Obi: [ON]')
end
status_change(player.status)
elseif command == 'C7' then -- PDT Toggle --
if Armor == 'PDT' then
Armor = 'None'
add_to_chat(123,'PDT Set: [Unlocked]')
else
Armor = 'PDT'
add_to_chat(158,'PDT Set: [Locked]')
end
status_change(player.status)
elseif command == 'C15' then -- MDT Toggle --
if Armor == 'MDT' then
Armor = 'None'
add_to_chat(123,'MDT Set: [Unlocked]')
else
Armor = 'MDT'
add_to_chat(158,'MDT Set: [Locked]')
end
status_change(player.status)
elseif command == 'C8' then -- Distance Toggle --
if player.target.distance then
target_distance = math.floor(player.target.distance*10)/10
add_to_chat(158,'Distance: '..target_distance)
else
add_to_chat(123,'No Target Selected')
end
elseif command == 'C6' then -- Idle Toggle --
IdleIndex = (IdleIndex % #IdleArray) + 1
status_change(player.status)
add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
elseif command == 'C2' then -- Auto RA/WS Toggle. *Don't Rely On This. It Isn't As Fast As Shooting Manually. It Is Mainly For AFK or When You Dualbox* --
if AutoMode == 'ON' then
AutoMode = 'OFF'
add_to_chat(123,'Auto Mode: [OFF]')
else
AutoMode = 'ON'
add_to_chat(158,'Auto Mode: [ON]')
end
elseif command == 'TP' then
add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
elseif command:match('^SC%d$') then
send_command('//' .. sc_map[command])
end
end
function autoRA()
send_command('@wait 2.7; input /ra <t>')
end
function autoWS() -- Change Auto WS Here --
send_command('input /ws "Last Stand" <t>')
end
function define_roll_values()
rolls = {
CorsairsRoll = {lucky=5, unlucky=9, bonus="Experience Points"},
NinjaRoll = {lucky=4, unlucky=8, bonus="Evasion"},
HuntersRoll = {lucky=4, unlucky=8, bonus="Accuracy"},
ChaosRoll = {lucky=4, unlucky=8, bonus="Attack"},
MagussRoll = {lucky=2, unlucky=6, bonus="Magic Defense"},
HealersRoll = {lucky=3, unlucky=7, bonus="Cure Potency Received"},
PuppetRoll = {lucky=4, unlucky=8, bonus="Pet Magic Accuracy/Attack"},
ChoralRoll = {lucky=2, unlucky=6, bonus="Spell Interruption Rate"},
MonksRoll = {lucky=3, unlucky=7, bonus="Subtle Blow"},
BeastRoll = {lucky=4, unlucky=8, bonus="Pet Attack"},
SamuraiRoll = {lucky=2, unlucky=6, bonus="Store TP"},
EvokersRoll = {lucky=5, unlucky=9, bonus="Refresh"},
RoguesRoll = {lucky=5, unlucky=9, bonus="Critical Hit Rate"},
WarlocksRoll = {lucky=4, unlucky=8, bonus="Magic Accuracy"},
FightersRoll = {lucky=5, unlucky=9, bonus="Double Attack Rate"},
DrachenRoll = {lucky=3, unlucky=7, bonus="Pet Accuracy"},
GallantsRoll = {lucky=3, unlucky=7, bonus="Defense"},
WizardsRoll = {lucky=5, unlucky=9, bonus="Magic Attack"},
DancersRoll = {lucky=3, unlucky=7, bonus="Regen"},
ScholarsRoll = {lucky=2, unlucky=6, bonus="Conserve MP"},
BoltersRoll = {lucky=3, unlucky=9, bonus="Movement Speed"},
CastersRoll = {lucky=2, unlucky=7, bonus="Fast Cast"},
CoursersRoll = {lucky=3, unlucky=9, bonus="Snapshot"},
BlitzersRoll = {lucky=4, unlucky=9, bonus="Attack Delay"},
TacticiansRoll = {lucky=5, unlucky=8, bonus="Regain"},
AlliessRoll = {lucky=3, unlucky=10, bonus="Skillchain Damage"},
MisersRoll = {lucky=5, unlucky=7, bonus="Save TP"},
CompanionsRoll = {lucky=2, unlucky=10, bonus="Pet Regain and Regen"},
AvengersRoll = {lucky=4, unlucky=8, bonus="Counter Rate"}
}
end
function display_roll_info(spell)
rollinfo = rolls[(string.gsub((string.gsub(spell.english, "%'+", "")), "%s+", ""))]
if rollinfo then
add_to_chat(158, spell.english..' = '..rollinfo.bonus..'. Lucky Roll is '..
tostring(rollinfo.lucky)..', Unlucky Roll is '..tostring(rollinfo.unlucky)..'.')
end
end
function refine_waltz(spell,action)
if spell.type ~= 'Waltz' then
return
end
if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
return
end
local newWaltz = spell.english
local missingHP = 0
local targ
if spell.target.type == "SELF" then
targ = alliance[1][1]
missingHP = player.max_hp - player.hp
elseif spell.target.isallymember then
targ = find_player_in_alliance(spell.target.name)
local est_max_hp = targ.hp / (targ.hpp/100)
missingHP = math.floor(est_max_hp - targ.hp)
end
if targ then
if player.sub_job == 'DNC' then
if missingHP < 40 then
add_to_chat(123,'Full HP!')
cancel_spell()
return
elseif missingHP < 150 then
newWaltz = 'Curing Waltz'
elseif missingHP < 300 then
newWaltz = 'Curing Waltz II'
else
newWaltz = 'Curing Waltz III'
end
else
return
end
end
local waltzTPCost = {['Curing Waltz'] = 20,['Curing Waltz II'] = 35,['Curing Waltz III'] = 50,['Curing Waltz IV'] = 65,['Curing Waltz V'] = 80}
local tpCost = waltzTPCost[newWaltz]
local downgrade
if player.tp < tpCost and not buffactive.trance then
if player.tp < 20 then
add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
cancel_spell()
return
elseif player.tp < 35 then
newWaltz = 'Curing Waltz'
elseif player.tp < 50 then
newWaltz = 'Curing Waltz II'
elseif player.tp < 65 then
newWaltz = 'Curing Waltz III'
elseif player.tp < 80 then
newWaltz = 'Curing Waltz IV'
end
downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
end
if newWaltz ~= spell.english then
send_command('wait 0.03;input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
if downgrade then
add_to_chat(158, downgrade)
end
cancel_spell()
return
end
if missingHP > 0 then
add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
end
end
function find_player_in_alliance(name)
for i,v in ipairs(alliance) do
for k,p in ipairs(v) do
if p.name == name then
return p
end
end
end
end
function actualCost(originalCost)
if buffactive["Penury"] then
return originalCost*.5
elseif buffactive["Light Arts"] then
return originalCost*.9
else
return originalCost
end
end
function degrade_spell(spell,degrade_array)
spell_index = table.find(degrade_array,spell.name)
if spell_index>1 then
new_spell = degrade_array[spell_index - 1]
change_spell(new_spell,spell.target.raw)
add_to_chat(8,spell.name..' Canceled: ['..player.mp..'/'..player.max_mp..'MP::'..player.mpp..'%] Casting '..new_spell..' instead.')
end
end
function change_spell(spell_name,target)
cancel_spell()
send_command('//'..spell_name..' '..target)
end
function sub_job_change(newSubjob, oldSubjob)
select_default_macro_book()
end
function set_macro_page(set,book)
if not tonumber(set) then
add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
return
end
if set < 1 or set > 10 then
add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
return
end
if book then
if not tonumber(book) then
add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
return
end
if book < 1 or book > 20 then
add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
return
end
send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
else
send_command('@input /macro set '..tostring(set))
end
end
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'SAM' then
set_macro_page(1, 5)
elseif player.sub_job == 'WHM' then
set_macro_page(2, 4)
elseif player.sub_job == 'DNC' then
set_macro_page(3, 4)
elseif player.sub_job == 'NIN' then
set_macro_page(5, 5)
elseif player.sub_job == 'RDM' then
set_macro_page(8, 5)
elseif player.sub_job == 'WAR' then
set_macro_page(9, 5)
elseif player.sub_job == 'DRG' then
set_macro_page(10, 4)
else
set_macro_page(2, 4)
end
end
Ragnarok.Flippant
Server: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2014-09-20 02:39:10
@Velata
user_setup() is only called once--upon startup. Because of that, the functions you've created will only be called the moment your file is loaded/reloaded. The functions would need to be somewhere that would be called whenever you'd want to check the conditions again (Mote uses the function job_status_change(new_status,old_status) for this in his NIN file).
@Azat
Double-up's type is JobAbility, so it's being caught by the first condition, and never has a chance to reach the next. You could switch the two around (put lines 1-7 after line 18).
Asura.Lewyo
Server: Asura
Game: FFXI
Posts: 86
By Asura.Lewyo 2014-09-20 05:55:33
Been try to get the sacrifice torque to equip when i get sleept and for some reason it just does not wona to work. Any ideas?
Code function status_change(new,old)
if Nirvana == 1 then
equip(sets.Nirvana)
end
if Nirvana == 1 then ---Main Weapon Lock---
disable('main','sub')
else
enable('main','sub')
end
if Armor == 'PDT' then
equip(sets.PDT)
elseif pet.isvalid then
if SpiritPacts:contains(pet.name) then
equip(sets.Spirits)
elseif buffactive == "Sleep" and gain and player.hp > 200 then -- Equip Sacrifice Torque When You Are Asleep, Have More Then 200HP & Have Pet Out --
equip({neck="Sacrifice torque"})
elseif buffactive["Avatar's Favor"] then
equip(sets.Favor)
else
equip(sets.Avatars)
if sets.Avatars[pet.name] then
equip(sets.Avatars[pet.name])
end
end
if Kiting == 'ON' then
equip({feet="Herald's Gaiters"})
end
elseif buffactive["Sublimation: Activated"] then
equip(sets.Sublimation)
if Kiting == 'ON' then
equip({feet="Herald's Gaiters"})
end
elseif new == 'Engaged' then
equip(sets.Melee)
elseif new == 'Idle' then
equip(sets.Idle[IdleArray[IdleIndex]])
elseif new == 'Resting' then
equip(sets.Resting)
end
if Armor == 'PetPdt' then
equip(sets.PetPdt)
end
if DDLock == 1 then
equip(sets.Melee)
end
if CapeLock == 1 then
equip(sets.Cape)
end
end
Asura.Velata
Server: Asura
Game: FFXI
Posts: 28
By Asura.Velata 2014-09-20 09:31:55
Ragnarok.Flippant said: »@Velata
user_setup() is only called once--upon startup. Because of that, the functions you've created will only be called the moment your file is loaded/reloaded. The functions would need to be somewhere that would be called whenever you'd want to check the conditions again (Mote uses the function job_status_change(new_status,old_status) for this in his NIN file).
I thought it was just something I overlooked.
Thank you very much.
Ragnarok.Flippant
Server: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2014-09-20 15:43:54
Been try to get the sacrifice torque to equip when i get sleept and for some reason it just does not wona to work. Any ideas?
Code elseif buffactive == "Sleep" and gain and player.hp > 200 then -- Equip Sacrifice Torque When You Are Asleep, Have More Then 200HP & Have Pet Out --
equip({neck="Sacrifice torque"})
The variable buffactive is a table, with keys by the name of your current buffs ("Sleep","Haste",etc). This variable will never be equal to the string "Sleep," like your condition is asking. Instead, you can check the condition by using buffactive.Sleep (which will return nil if the key is not found in the table, thereby setting the condition to false). Additionally, the variable gain is nonexistent in this function, so it will also be returning nil.
Likely this code was copied from the buff_change(buff,gain) function, where it -would- be appropriate to write it as you have above (but changing buffactive to buff), because then the types of variables you are trying to use do exist.
By Santi 2014-09-21 00:33:55
Whats the buffid for "Slow"?
Also, is there a list of buffid's somewhere?
Server: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2014-09-21 08:41:19
Whats the buffid for "Slow"?
Also, is there a list of buffid's somewhere? You can use the Windower4/res/buffs.lua file to view all the buffs/debuffs in the game. Slow has 2 IDs: 13 and 565.
Two questions:
First, I've been trying to work in the new head piece, Gavialis Helm, into WS rules and can't quite figure out the coding. I tried making a general rule, similar to the obi rules, but I was clearly missing something. This is something similar to what I came across on a thread somewhere about the Mekira-Oto, but even this doesn't seem to swap in the helm on the corresponding days. I'm almost certain there's a much cleaner way to set this up, but this is all I got: Code function job_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if spell.english == 'Tachi: Fudo' then
if world.day == (
'Lightsday' or
'Windsday' or
'Lightningday' or
'Firesday' or
'Iceday' or
'Watersday') then
equipSetWS = set_combine(sets.precast.WS['Tachi: Fudo'], {head="Gavialis Helm"})
else
equipSetWS = sets.precast.WS['Tachi: Fudo']
end
end
end
end Second question, similar to one asked above:
A rule to equip Berserker's Torque whilst asleep and to subsequently take it off upon waking. I got it to equip when getting put to sleep, but it won't un-equip once I wake back up. It throws the add_to_chat that it should upon waking but it doesn't change gear, which leads me to believe the meleeSet part is incorrect. Here's what I've got: Code function job_buff_change(buff, gain)
if buff == 'sleep' then
if gain then
equip({neck="Berserker's Torque"})
add_to_chat(122, "***Asleep!! Equipping Berserker's Torque!!***")
else
if player.status == 'Engaged' then
equip(meleeSet)
add_to_chat(122, "***Awake!! Un-Equipping Berserker's Torque!!***")
end
end
end
end Thoughts?
Ragnarok.Martel
Server: Ragnarok
Game: FFXI
Posts: 2954
By Ragnarok.Martel 2014-09-21 08:51:20
What I don't get, is why you've got the engaged check for berserker in the wake up part of the code rather than the got slept part. <,<
You don't want to equip berserker unless you're engaged. But the way that's coded, it'll always equip it when slept, but only take it off on wakeup when engaged. <,<
Server: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2014-09-21 08:58:26
What I don't get, is why you've got the engaged check for berserker in the wake up part of the code rather than the got slept part. <,<
You don't want to equip berserker unless you're engaged. But the way that's coded, it'll always equip it when slept, but only take it off on wakeup when engaged. <,< That is true, I didn't think about that. Ultimately doesn't make *that* big a difference, but a useful pointer regardless, ty. So I guess new code would be (that still needs the re-equip fixed): Code function job_buff_change(buff, gain)
if buff == 'sleep' and player.status == 'Engaged' then
if gain then
equip({neck="Berserker's Torque"})
add_to_chat(122, "***Asleep!! Equipping Berserker's Torque!!***")
else
equip(meleeSet)
add_to_chat(122, "***Awake!! Un-Equipping Berserker's Torque!!***")
end
end
end
Ragnarok.Martel
Server: Ragnarok
Game: FFXI
Posts: 2954
By Ragnarok.Martel 2014-09-21 09:43:29
What I don't get, is why you've got the engaged check for berserker in the wake up part of the code rather than the got slept part. <,<
You don't want to equip berserker unless you're engaged. But the way that's coded, it'll always equip it when slept, but only take it off on wakeup when engaged. <,< That is true, I didn't think about that. Ultimately doesn't make *that* big a difference, but a useful pointer regardless, ty. So I guess new code would be (that still needs the re-equip fixed): Code function job_buff_change(buff, gain)
if buff == 'sleep' and player.status == 'Engaged' then
if gain then
equip({neck="Berserker's Torque"})
add_to_chat(122, "***Asleep!! Equipping Berserker's Torque!!***")
else
equip(meleeSet)
add_to_chat(122, "***Awake!! Un-Equipping Berserker's Torque!!***")
end
end
end Oh. well. I think I know why this isn't working. On the unequip side.
equip(meleeSet)
I assume meleeSet there is a variable that you used to build up a TP set based on your rules?
well, you're in buff_change, not status_change. Since in this process status change hasn't run, meleeSet is most likely null, or doesn't exist.
Can I safely assume your TP rules are in status_change? Probably the easiest thing to do here would be to call status change, to trigger it, rather than attempting an equip change.
So status_change(player.status) rather than the equip. Although I can't be certain that'll work, cause I'm not that familiar it motenten's lua's structure. Is there a job_status_change or something? Well, anyway, call whatever function your TP rules are in.
Server: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2014-09-21 10:00:02
What I don't get, is why you've got the engaged check for berserker in the wake up part of the code rather than the got slept part. <,<
You don't want to equip berserker unless you're engaged. But the way that's coded, it'll always equip it when slept, but only take it off on wakeup when engaged. <,< That is true, I didn't think about that. Ultimately doesn't make *that* big a difference, but a useful pointer regardless, ty. So I guess new code would be (that still needs the re-equip fixed): Code function job_buff_change(buff, gain)
if buff == 'sleep' and player.status == 'Engaged' then
if gain then
equip({neck="Berserker's Torque"})
add_to_chat(122, "***Asleep!! Equipping Berserker's Torque!!***")
else
equip(meleeSet)
add_to_chat(122, "***Awake!! Un-Equipping Berserker's Torque!!***")
end
end
end Oh. well. I think I know why this isn't working. On the unequip side.
equip(meleeSet)
I assume meleeSet there is a variable that you used to build up a TP set based on your rules?
well, you're in buff_change, not status_change. Since in this process status change hasn't run, meleeSet is most likely null, or doesn't exist.
Can I safely assume your TP rules are in status_change? Probably the easiest thing to do here would be to call status change, to trigger it, rather than attempting an equip change.
So status_change(player.status) rather than the equip. Although I can't be certain that'll work, cause I'm not that familiar it motenten's lua's structure. Is there a job_status_change or something? Well, anyway, call whatever function your TP rules are in. Thanks, that actually helped get the thought process flowing. Mote uses something called "handle_equipping_gear(player.status)" that works perfectly for that. So, for anyone interested, revised, fixed code is: Code function job_buff_change(buff, gain)
if buff == 'sleep' and player.status == 'Engaged' then
if gain then
equip({neck="Berserker's Torque"})
add_to_chat(122, "***Asleep!! Equipping Berserker's Torque!!***")
else
handle_equipping_gear(player.status)
add_to_chat(122, "***Awake!! Un-Equipping Berserker's Torque!!***")
end
end
end So that solves one part of it, still interested in the other part, how to properly equip Gavialis Helm/Mekira-Oto: Code function job_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if spell.english == 'Tachi: Fudo' then
if world.day == (
'Lightsday' or
'Windsday' or
'Lightningday' or
'Firesday' or
'Iceday' or
'Watersday') then
equipSetWS = set_combine(sets.precast.WS['Tachi: Fudo'], {head="Gavialis Helm"})
else
equipSetWS = sets.precast.WS['Tachi: Fudo']
end
end
end
end
Ragnarok.Martel
Server: Ragnarok
Game: FFXI
Posts: 2954
By Ragnarok.Martel 2014-09-21 11:29:41
Code
if world.day == (
'Lightsday' or
'Windsday' or
'Lightningday' or
'Firesday' or
'Iceday' or
'Watersday') then
Soooo. what are those parenthesis for? there's nothing for them to separate. <,< not much point in separating world.day, from the days you want to check. Try removing them and see what happens.
Also, yes, there are better ways of handling this. But the differences between mote's lua and mine mean I can't just toss you mine and expect it to work.
But try that first and lemme know.
Ragnarok.Mariote
Server: Ragnarok
Game: FFXI
Posts: 4
By Ragnarok.Mariote 2014-09-21 12:00:24
Hello! Just came back from a long time ago, didnt know anything about gearswap. I'm just copying some lua files and trying to make them work, but this thing i don't understand:
function user_setup()
state.OffenseMode:options('Normal', 'MediumAcc', 'HighAcc')
state.HybridMode:options('Normal', 'Hybrid')
state.CastingMode:options('Normal')
state.IdleMode:options('Normal', 'Refresh', 'Reraise')
state.RestingMode:options('Normal')
state.PhysicalDefenseMode:options('PDT', 'Killer', 'Reraise')
state.MagicalDefenseMode:options('MDT', 'Absorb', 'MKiller')
Apparently i can change between this sets, but i dont find the "key" or "button" or how to do it in the game. There are other "state" commands which have a keybind, this I understand and i can change in game with the binded buttons, but this other thing i don't know how to change between sets.
Any help will be appreciated, thanks a lot in advance! (and i hope you understand my question)
Quetzalcoatl.Orestes
Server: Quetzalcoatl
Game: FFXI
Posts: 430
By Quetzalcoatl.Orestes 2014-09-21 15:14:45
end[/code]So that solves one part of it, still interested in the other part, how to properly equip Gavialis Helm/Mekira-Oto: Code function job_precast(spell, action, spellMap, eventArgs)
if spell.type == 'WeaponSkill' then
if spell.english == 'Tachi: Fudo' then
if world.day == (
'Lightsday' or
'Windsday' or
'Lightningday' or
'Firesday' or
'Iceday' or
'Watersday') then
equipSetWS = set_combine(sets.precast.WS['Tachi: Fudo'], {head="Gavialis Helm"})
else
equipSetWS = sets.precast.WS['Tachi: Fudo']
end
end
end
end
If you're interested, this is how I'm doing it. It works for all ws's by default, but you can see how I've excluded a few here. https://github.com/AlanWarren/gearswap/blob/master/DRK.lua#L98
Cerberus.Conagh
Server: Cerberus
Game: FFXI
Posts: 3189
By Cerberus.Conagh 2014-09-21 16:49:10
Code if (spell.english == "Tachi: Fudo") then
if world.day == 'Lightsday' or world.day == 'Windsday' or world.day == 'Lightningday' or world.day == 'Firesday'or world.day == 'Iceday'or world.day == 'Watersday' then
add_to_chat(8, 'Weapon Day Bonus')
equipSet = set_combine(equipSet,{head=""})
end
end
equip(equipSet)
This work's.
not elegant, and its messy but it gets the job done.
Server: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2014-09-21 23:02:12
Hello! Just came back from a long time ago, didnt know anything about gearswap. I'm just copying some lua files and trying to make them work, but this thing i don't understand:
function user_setup()
state.OffenseMode:options('Normal', 'MediumAcc', 'HighAcc')
state.HybridMode:options('Normal', 'Hybrid')
state.CastingMode:options('Normal')
state.IdleMode:options('Normal', 'Refresh', 'Reraise')
state.RestingMode:options('Normal')
state.PhysicalDefenseMode:options('PDT', 'Killer', 'Reraise')
state.MagicalDefenseMode:options('MDT', 'Absorb', 'MKiller')
Apparently i can change between this sets, but i dont find the "key" or "button" or how to do it in the game. There are other "state" commands which have a keybind, this I understand and i can change in game with the binded buttons, but this other thing i don't know how to change between sets.
Any help will be appreciated, thanks a lot in advance! (and i hope you understand my question) First off, welcome back. You can find these all listed in the Mote-Globals.lua file included in the Windower4/addons/GearSwap/libs folder, but for the sake of answering your question: Code send_command('bind f9 gs c cycle OffenseMode')
send_command('bind ^f9 gs c cycle HybridMode')
send_command('bind !f9 gs c cycle RangedMode')
send_command('bind @f9 gs c cycle WeaponskillMode')
send_command('bind f10 gs c set DefenseMode Physical')
send_command('bind ^f10 gs c cycle PhysicalDefenseMode')
send_command('bind !f10 gs c toggle Kiting')
send_command('bind f11 gs c set DefenseMode Magical')
send_command('bind ^f11 gs c cycle CastingMode')
send_command('bind f12 gs c update user')
send_command('bind ^f12 gs c cycle IdleMode')
send_command('bind !f12 gs c reset DefenseMode') Hope this helps you.
Server: Asura
Game: FFXI
Posts: 363
By Asura.Vafruvant 2014-09-21 23:08:22
Code
if world.day == (
'Lightsday' or
'Windsday' or
'Lightningday' or
'Firesday' or
'Iceday' or
'Watersday') then
Soooo. what are those parenthesis for? there's nothing for them to separate. <,< not much point in separating world.day, from the days you want to check. Try removing them and see what happens.
Also, yes, there are better ways of handling this. But the differences between mote's lua and mine mean I can't just toss you mine and expect it to work.
But try that first and lemme know. If I understand the ( ) correctly in that regard, it allows me to not do something like: Code if world.day == 'Lightsday' or world.day == 'Windsday' or world.day == 'Lightningday' or world.day == 'Firesday'or world.day == 'Iceday'or world.day == 'Watersday' then I could be mistaken, but I'm pretty sure you would have to specify world.day for each individual day without them. Code if (spell.english == "Tachi: Fudo") then
if world.day == 'Lightsday' or world.day == 'Windsday' or world.day == 'Lightningday' or world.day == 'Firesday'or world.day == 'Iceday'or world.day == 'Watersday' then
add_to_chat(8, 'Weapon Day Bonus')
equipSet = set_combine(equipSet,{head=""})
end
end
equip(equipSet)
This work's.
not elegant, and its messy but it gets the job done. I appreciate that, though I think I'm going to go with the following generalized function, tyvm though. I'm not going to have a chance to test this tonight, but I plan to first thing tomorrow! Thank you very much!
Ragnarok.Mariote
Server: Ragnarok
Game: FFXI
Posts: 4
By Ragnarok.Mariote 2014-09-22 02:21:16
@Vafruvant
Yay!
Thanks a lot, that is exactly what i was missing :D
VIP
Server: Fenrir
Game: FFXI
Posts: 764
By Fenrir.Motenten 2014-09-22 02:33:15
If I understand the ( ) correctly in that regard, it allows me to not do something like: Code
if world.day == 'Lightsday' or world.day == 'Windsday' or world.day == 'Lightningday' or world.day == 'Firesday'or world.day == 'Iceday'or world.day == 'Watersday' then
I could be mistaken, but I'm pretty sure you would have to specify world.day for each individual day without them.
You are mistaken. There is no such shortcut. What you wrote originally is meaningless. Well, technically it would evaluate to Code
if world.day == 'Lightsday' then
but as far as actual intended logic, meaningless.
For clarification: The parentheses isolate a subset of code and force it to be evaluated first. The parenthesized portion of the code you used was an or'd series of day names (strings). When you evaluate [A or B], it will always evalute to A if A is neither nil nor false (which, for a string, is -always- the case), otherwise it will take B. If you have a series of them [A or B or C] it does the same thing, except that if B is false or nil it checks C, and so forth.
Because you provided a series of strings, it always stops at A — 'Lightsday' — and then compares that with world.day.
Ragnarok.Flippant
Server: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2014-09-22 05:15:28
That functionality is already provided by luacore libs by using the Set class.
Code fudoDays = S{'Lightsday','Windsday','Lightningday','Firesday','Iceday','Watersday'}
if fudoDays:contains(world.day) then
-- do stuff
end
By kaiju9 2014-09-22 11:29:42
Asked on BG, figured I'd try here as well.
Gradually trying to convert from Spellcast to GS, and started with my mule's RDM.
For dualboxing, I've always used AutoExec to register events that would trigger actions from sending /tells back & forth. For example, /t muleName "cure3" would cause them to cure the person who sent the tell. When I unload Spellcast on my mule, and run GS instead, this stops working. Is there some other way I should be handling this when using GearSwap?
My /t muleName follow macro still causes them to follow me, but the events dealing with spells (i.e. /ma "Cure III" mainCharName) aren't firing.
Bismarck.Inference
Server: Bismarck
Game: FFXI
Posts: 417
By Bismarck.Inference 2014-09-22 11:34:37
Is your Autoexec using the shorthands that spellcast allowed?(i.e. //c3 Inf instead of /ma "Cure III" Inference). GearSwap does not have that functionality built in and you'd need to download the addon "Shortcuts" to get that back. Otherwise you'd have to edit the autoexec to use vanilla syntax.
By kaiju9 2014-09-22 14:07:34
Nah, my Autoexec uses full vanilla syntax for the action to take when each /tell event is detected. When my mule is using GS, I do load the Shortcuts addon to handle shorthand stuff. Main character is still using Spellcast (no Shortcuts/GS) since I don't have job luas for it yet.
I don't have the file in front of me, so I might mess this up, but it's something like this:
<register silent="true" event="chat_tell_mainCharName_cure3">input /ma "Cure III" "mainCharName"</register>
It has worked for years while using Spellcast. I haven't tested whether it works with both Spellcast & GS unloaded.
Ragnarok.Martel
Server: Ragnarok
Game: FFXI
Posts: 2954
By Ragnarok.Martel 2014-09-22 14:22:45
Asked on BG, figured I'd try here as well.
Gradually trying to convert from Spellcast to GS, and started with my mule's RDM.
For dualboxing, I've always used AutoExec to register events that would trigger actions from sending /tells back & forth. For example, /t muleName "cure3" would cause them to cure the person who sent the tell. When I unload Spellcast on my mule, and run GS instead, this stops working. Is there some other way I should be handling this when using GearSwap?
My /t muleName follow macro still causes them to follow me, but the events dealing with spells (i.e. /ma "Cure III" mainCharName) aren't firing. Has anyone suggested you use Send instead?
Rather than sending a tell, you do like so. //send name /ma "Cure III" <targetname > Replacing name and target name with the appropriate character names.
If you're a typer, rather than a macro user, I could see how you'd prefer the tells. But you can always alias your send commands. As an example:
alias sc3 send Arduwyn /ma "Cure III" <Martel>
then just typing //sc3 would trigger it.
Personally, I just use a bunch of dualboxing macros using send.
By kaiju9 2014-09-22 15:56:37
Martel said: Has anyone suggested you use Send instead?
Rather than sending a tell, you do like so. //send name /ma "Cure III" <targetname > Replacing name and target name with the appropriate character names.
If you're a typer, rather than a macro user, I could see how you'd prefer the tells. But you can always alias your send commands. As an example:
alias sc3 send Arduwyn /ma "Cure III" <Martel>
then just typing //sc3 would trigger it.
Personally, I just use a bunch of dualboxing macros using send.
I'll gladly try that tonight -- would meet my needs just fine.
I primarily use macros, but out of curiosity, where do I define aliases? Is that in a settings file for the Send addon?
Ragnarok.Martel
Server: Ragnarok
Game: FFXI
Posts: 2954
By Ragnarok.Martel 2014-09-22 16:05:31
Aliases are native to windower itself.
generally ppl put them in Windower4\scripts\init.txt. As that file runs every time windower starts. But you can create an alias via //alias anytime, from chat, or put them in macros etc. It's just another type of text cmd.
tip, you can view your current aliases with //listaliases.
By kaiju9 2014-09-23 16:43:16
Thanks Martel. Send is working great for me with GearSwap. Mule also seems to react much quicker than the old way I'd been doing things.
Couple unrelated questions:
1. Trying to learn my way around Mote's lua files, and tried adding a simple self command yesterday. I added the code below to the bottom of RDM.lua, reloaded GS, and then typed //gs c C1 in-game, but nothing happened. What am I doing wrong? Do I need to set eventArgs.handled = true?
Code
function job_self_command(command)
if command == 'C1' then
add_to_chat(158,'Test Command')
end
end
2. Can anyone give a quick run-down of sidecar files? Like where I put them, what I can name them, etc? Seems clear that I'd put init_gear_sets() in <charactername>_<job>_gear.lua with all my gear sets, but do I also put stuff like job_self_command(), job_midcast(), etc for custom functionality in the same file, or do I create multiple files (if so, is there a naming convention?)?
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.
|
|