Skip to content

Commit

Permalink
9/5/2016 2:18 PM
Browse files Browse the repository at this point in the history
Reworked include loading
---wait till the display starts and your good to go from there
added a function to check if your sub job can use Dual Wield
---dwsj()
---check my updated Main File Examples/WAR.lua to see how to use
  • Loading branch information
smd111 committed Sep 5, 2016
1 parent efd4495 commit 336243f
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 41 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ What the Display can do for you-------------------------------------
--------------------------------------------------------------------
On loading-----------------------------------------------------

If you do not wait for the chat line "Smd111's Gearswap Include is ready for usee."
on Load or (if you load with your char in the mog house) when you Zone
this include will not function correctly
Once the display loads your good to go.

--------------------------------------------------------------------
Reporting bug's-----------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion SMDinclude/Main File Examples/BLM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ include('SMDinclude/includes/Include.lua')
--Job functions
function gear_setup()
sets["Waltz"] = {} -- use this set for all Waltz
sets.weapon['Club'] = {main="Eminent Wand",sub="Eminent Dagger"}
if dwsj() then
sets.weapon['Club'] = {main="Eminent Wand",sub="Eminent Dagger"}
end
sets.range['Other'] = {range="",ammo=""}
sets.armor['Basic'] = {}
sets.armor['Capacity_Points'] = {back="Aptitude Mantle +1",}
Expand Down
4 changes: 3 additions & 1 deletion SMDinclude/Main File Examples/BST.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ include('SMDinclude/includes/Include.lua')
--Job functions
function gear_setup()
sets["Waltz"] = {} -- use this set for all Waltz
sets.weapon['Axe'] = {main="Eminent Axe",sub="Eminent Dagger"}
if dwsj() then
sets.weapon['Axe'] = {main="Eminent Axe",sub="Eminent Dagger"}
end
sets.weapon['None'] = {main=empty,sub=empty}
sets.armor['Basic'] = {}
sets.armor['Capacity_Points'] = {back="Aptitude Mantle +1",}
Expand Down
4 changes: 3 additions & 1 deletion SMDinclude/Main File Examples/COR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ include('SMDinclude/includes/Include.lua')
--Job functions
function gear_setup()
sets["Waltz"] = {} -- use this set for all Waltz
sets.weapon['Sword'] = {main="Eminent Scimitar",sub={ name="Firmament", augments={'Wind resistance-2 Earth resistance+2',}}}
if dwsj() then
sets.weapon['Sword'] = {main="Eminent Scimitar",sub={ name="Firmament", augments={'Wind resistance-2 Earth resistance+2',}}}
end
sets.weapon['None'] = {main=empty,sub=empty}
sets.range['Marksmanship'] = {range="Eminent Gun",ammo="Bullet"}
sets.armor['Basic'] = {}
Expand Down
4 changes: 3 additions & 1 deletion SMDinclude/Main File Examples/GEO.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ include('SMDinclude/includes/Include.lua')
--Job functions
function gear_setup()
sets["Waltz"] = {} -- use this set for all Waltz
sets.weapon['Club'] = {main="Rose Wand",sub="Rose Wand"}
if dwsj() then
sets.weapon['Club'] = {main="Rose Wand",sub="Rose Wand"}
end
sets.weapon['None'] = {main=empty,sub=empty}
sets.range['Handbells'] = {range="Matre Bell",ammo=empty}
sets.armor['Basic'] = {}
Expand Down
5 changes: 5 additions & 0 deletions SMDinclude/Main File Examples/PUP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ function custom_menu_build()
local custom_properties = L{}
custom_properties:append('Enable Auto Pup ${eap}')
if Enable_auto_pup then custom_properties:append('Auto Skill Up Maneuver\'s ${esku}') end
if player.sub_job == "DNC" then
custom_properties:append('DNC sub')
elseif player.sub_job == "COR" then
custom_properties:append('COR sub')
end
return custom_properties
end
function custom_menu_commands(a)
Expand Down
4 changes: 3 additions & 1 deletion SMDinclude/Main File Examples/RDM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ include('SMDinclude/includes/Include.lua')
--Job functions
function gear_setup()
sets["Waltz"] = {} -- use this set for all Waltz
sets.weapon['Sword'] = {main="Eminent Scimitar",sub="Eminent Dagger"}
if dwsj() then
sets.weapon['Sword'] = {main="Eminent Scimitar",sub="Eminent Dagger"}
end
sets.weapon['None'] = {main=empty,sub=empty}
sets.range['Other'] = {range="",ammo=""}
sets.armor['Basic'] = {}
Expand Down
4 changes: 3 additions & 1 deletion SMDinclude/Main File Examples/RNG.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ include('SMDinclude/includes/Include.lua')
--Job functions
function gear_setup()
sets["Waltz"] = {} -- use this set for all Waltz
sets.weapon['Dagger'] = {main="Eminent Dagger",sub="Eminent Axe"}
if dwsj() then
sets.weapon['Dagger'] = {main="Eminent Dagger",sub="Eminent Axe"}
end
sets.weapon['None'] = {main=empty,sub=empty}
sets.range = {}
sets.range['Archery'] = {range="Eminent Bow",ammo="Iron Arrow"}
Expand Down
10 changes: 6 additions & 4 deletions SMDinclude/Main File Examples/WAR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ include('SMDinclude/includes/Include.lua')
--Job functions
function gear_setup()
sets["Waltz"] = {} -- use this set for Waltz
sets.weapon['Axe'] = {main="Eminent Axe",sub="Eminent Scimitar"}
sets.weapon['Dagger'] = {main="Eminent Dagger",sub="Eminent Scimitar"}
if dwsj() then
sets.weapon['Axe'] = {main="Eminent Axe",sub="Eminent Scimitar"}
sets.weapon['Dagger'] = {main="Eminent Dagger",sub="Eminent Scimitar"}
sets.weapon['Sword'] = {main="Eminent Scimitar",sub="Eminent Dagger"}
end
sets.weapon['Great_Axe'] = {main="Eminent Voulge",sub="Uther's Grip"}
sets.weapon['Great_Sword'] = {main="Eminent Sword",sub="Uther's Grip"}
sets.weapon['Hand-to-Hand'] = {main="Em. Baghnakhs",ammo=empty}
sets.weapon['Scythe'] = {main="Eminent Sickle",sub="Uther's Grip"}
sets.weapon['Sword'] = {main="Eminent Scimitar",sub="Eminent Dagger"}
sets.weapon['None'] = {main=empty,sub=empty}
sets.weapon['Great_Axe2'] = {main="Blurred Cleaver",sub="Uther's Grip"}
sets.weapon['Great_Axe Su2'] = {main="Blurred Cleaver",sub="Uther's Grip"}
sets.range['Marksmanship'] = {range="Lion Crossbow",ammo="Crossbow Bolt"}
sets.range['Throwing'] = {range="Snakeeye",ammo=empty}
sets.armor['Basic'] = {}
Expand Down
33 changes: 25 additions & 8 deletions SMDinclude/includes/Include.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ function gearswap.refresh_item_list(itemlist)
end
gearswap.parse.i[0x01D] = function (data)
gearswap.refresh_globals()
if not loaded and not (world.in_mog_house or world.mog_house) then
send_command("gs reload")
add_to_chat(cc.mc,"Smd111's Gearswap Include is ready for use.")
if not loaded then
-- add_to_chat(cc.mc,"Smd111's Gearswap Include is ready for use.")
loaded = true
include("SMDinclude/includes/Include.lua")
end
if auto_ring and check_ring_buff() then
schedule_xpcp_ring()
end
end
if not loaded then
mf = {}
return
end
include_setup()
--Saved Variable Recovery ---------------------------------------------------------------------------------------------------------
if gearswap.pathsearch({'SMDinclude/includes/map.lua'}) and gearswap.pathsearch({'SMDinclude/includes/extra.lua'}) then
Expand Down Expand Up @@ -107,10 +111,10 @@ function get_sets()
add_gear_modes(sets.range,'range_types')
add_gear_modes(sets.armor,'armor_types')
if update_display then
update_display:schedule(1.5)
update_display()
end
if mf.file_load then
mf.file_load:schedule(1.5)
mf.file_load()
end
if file_write and file_write.write then
file_write.write()
Expand Down Expand Up @@ -237,7 +241,17 @@ function indi_change(indi_table,gain)
end
end
function sub_job_change(new,old)
send_command("gs reload")
if file_write and file_write.write then
file_write.write()
end
windower.prim.delete('window_button')
include('SMDinclude/includes/map.lua')
include('SMDinclude/includes/extra')
if gearswap.pathsearch({'Saves/job_'..player.main_job..'var.lua'}) then
include('Saves/job_'..player.main_job..'var.lua')
end
load_rings()
get_sets()
end
function self_command(com)
local status = {end_event=false,stop_swapping_gear=true}
Expand All @@ -254,7 +268,9 @@ function self_command(com)
end
end
function file_unload(new_job)
mf.file_unload(new_job)
if mf.file_unload then
mf.file_unload(new_job)
end
if file_write and file_write.write then
file_write.write()
end
Expand All @@ -269,4 +285,5 @@ load_include(Conquest_Gear, 'more/Conquest_Gear.lua')
load_include(Registered_Events, 'more/Registered_Events.lua')
load_include(Debug, 'more/Debug.lua')
load_include(Display, 'more/Display.lua')
load_include(File_Write, 'more/File_Write.lua')
load_include(File_Write, 'more/File_Write.lua')
get_sets()
29 changes: 20 additions & 9 deletions SMDinclude/includes/extra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,23 @@ end
function c_equip(delay, set, event)--delay equip
return gearswap.equip_sets:schedule(delay, event..'_delayed_equip', nil, set)
end
for _,ring in ipairs({"None","Vocation Ring","Trizek Ring","Capacity Ring","Undecennial Ring","Decennial Ring","Allied Ring","Novennial Ring","Kupofried's Ring",
"Anniversary Ring","Emperor Band","Empress Band","Chariot Band","Duodec. Ring","Expertise Ring"}) do
local item = item_to_bag(ring)
if item and not rings:contains(ring) then
rings:append(ring)
elseif not item and rings:contains(ring) then
rings:delete(ring)
end
end
function dwsj()
if player.sub_job == "NIN" and player.sub_job_level >= 10 then
return true
elseif player.sub_job == "DNC" and player.sub_job_level >= 20 then
return true
end
return false
end
function load_rings()
for _,ring in ipairs({"None","Vocation Ring","Trizek Ring","Capacity Ring","Undecennial Ring","Decennial Ring","Allied Ring","Novennial Ring","Kupofried's Ring",
"Anniversary Ring","Emperor Band","Empress Band","Chariot Band","Duodec. Ring","Expertise Ring"}) do
local item = item_to_bag(ring)
if item and not rings:contains(ring) then
rings:append(ring)
elseif not item and rings:contains(ring) then
rings:delete(ring)
end
end
end
load_rings()
2 changes: 1 addition & 1 deletion SMDinclude/includes/map.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
menu,auto_use_shards,File_Write,Registered_Events,ISr,tsstown = {pos = {x = 100,y = 100}},false,true,true,true,true
weapon_types_count,range_types_count,armor_types_count,xpcpcoring,rings_count = 1,1,1,1,1 conquest = {ring={},neck={}}
sets.armor,sets.pet_aftercast,sets.weapon,mf,partynames,sets.pretarget,sets.precast,sets.midcast,sets.aftercast = {},{},{},{},{},{},{},{},{}
sets.armor,sets.pet_aftercast,sets.weapon,partynames,sets.pretarget,sets.precast,sets.midcast,sets.aftercast = {},{},{},{},{},{},{},{}
sets.range,sets.building,sets.pet_midcast,cc = {['ThrowLVL.99+'] = {range="Halakaala",ammo=empty}},{},{},{mc=9,r1=11,r2=10,g1=158,g2=6,b1=5,b2=205,y1=36,y2=37}
log_in_time = os.clock()
equip_from_bags = {"inventory","wardrobe","wardrobe2","wardrobe3","wardrobe4"}
Expand Down
10 changes: 5 additions & 5 deletions SMDinclude/includes/more/Display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ function initialize(text, settings, name)
' Change Ring ${cringc}\n Ring Type = \\cs(255,255,0)${cring}\\cr')
end
elseif menu_set == 4 then
line:append('--System Settings--\nWatch midaction() ${watchmid}')
line:append('--System Settings--\nWatch midaction() ${watchmid}')
if jobs.pet:contains(player.main_job) or jobs.pet:contains(player.sub_job) then
line:append('Watch pet_midaction() ${watchpetmid}')
end
line:append('CP XP ring = ${axpcpring}')
line:append('CP XP ring ${axpcpring}')
if auto_ring then
line:append(' Ring = ${xpcpring}')
line:append(' ${resetring}')
end
line:append('Auto Shard Use ${ashard}\nNo Spells in Town${sstown}')
line:append('Auto Shard Use ${ashard}\nNo Spells in Town ${sstown}')
if Registered_Events then
line:append('-Show-\n MJob and LVL ${tmjl}\n Skill Level ${tskill}\n Aggro Count ${aggroenable}')
line:append('-Show-\n MJob and LVL ${tmjl}\n Skill Level ${tskill}\n Aggro Count ${aggroenable}')
end
if Debug then
line:append('Show Debug ${dbenable}')
line:append('Show Debug ${dbenable}')
if full_debug then
line:append(' in = ${debugtype}')
end
Expand Down
5 changes: 0 additions & 5 deletions SMDinclude/includes/more/Registered_Events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ function reg_event.zone_change(new_id,old_id) --zone change event
if mf.zone_change then
mf.zone_change(new,old)
end
if new_id == old_id and not (world.in_mog_house or world.mog_house) then
loaded = false
else
loaded = true
end
end
reg_event.zone_change_id = windower.raw_register_event('zone change', reg_event.zone_change)
function reg_event.level_change() --updates display when player lvls up/down
Expand Down

0 comments on commit 336243f

Please sign in to comment.