Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed May 2, 2024
2 parents efcec6e + 7a9e490 commit d44438d
Show file tree
Hide file tree
Showing 12 changed files with 885 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,22 @@ local chars_fn = {
----------------------
--Behaviour Configs --
----------------------
local rcuck_count = 1 --0..n starting the counter at 1, this is in case your manually resuming or want to start at later index value instead of just commenting out parts of it
local gachi_jumpy = 0 --0=no jump, 1=yes jump. jump or not. sometimes navmesh goes through the shortcut in uldah and sometimes gets stuck getting to bells in housing districts
rcuck_count = 1 --0..n starting the counter at 1, this is in case your manually resuming or want to start at later index value instead of just commenting out parts of it
gachi_jumpy = 0 --0=no jump, 1=yes jump. jump or not. sometimes navmesh goes through the shortcut in uldah and sometimes gets stuck getting to bells in housing districts
auto_eqweep = 0 --0=no, 1=yes + job change. Basically this will check to see if your on a DOH or DOL, if you are then it will scan your DOW/DOM and switch you to the highest level one you have, auto equip and save gearset. niche feature i like for myself . off by default
config_sell = 0 --0=dont do anything,1=change char setting to not give dailog for non tradeables etc selling to npc, 2=reset setting back to yes check for non tradeables etc selling to npc. usecase for 1 and 2 are one time things for a cleaning run so that they can subsequently handle selling or not selling. this feature will be stripped out once limiana updaptes AR
----------------------
--Refueling Configs --
----------------------
restock_fuel = 11111 --0=don't do anything, n>0 -> if we have less ceruleum fuel than this amount on a character that has repair materials, restock up to at least the restock_amt value on next line
restock_amt = 66666 --n>0 minimum amount of total fuel to reach, when restocking
--------------------
--Process Configs --
--------------------
local process_fc_buffs = 1 --0=no,1=yes. do we bother with fc buffs? turning this on will run the chars from chars_FCBUFF to turn on FC buffs
local buy_fc_buffs = 1 --0=no,1=yes. do we refresh the buffs on this run? turning this on will run the chars from chars_FCBUFF to buy FC buffs
local process_players = 1 --0=no,1=yes. do we run the actual GC turnins? turning this on will run the chars from chars_fn to go do seal turnins and process whatever deliveroo rules you setup
local process_emblem = 0 --0=no,1=yes. do we randomize the emblem on this run? turning this on will process the chars from chars_EMBLEM and go randomize their FC emblems
process_fc_buffs = 1 --0=no,1=yes. do we bother with fc buffs? turning this on will run the chars from chars_FCBUFF to turn on FC buffs
buy_fc_buffs = 1 --0=no,1=yes. do we refresh the buffs on this run? turning this on will run the chars from chars_FCBUFF to buy FC buffs and it will attempt to buy "Seal Sweetener II" 15 times
process_players = 1 --0=no,1=yes. do we run the actual GC turnins? turning this on will run the chars from chars_fn to go do seal turnins and process whatever deliveroo rules you setup
process_emblem = 0 --0=no,1=yes. do we randomize the emblem on this run? turning this on will process the chars from chars_EMBLEM and go randomize their FC emblems. btw rank 7 FC gets additional crest unlocks.

--[[
------------------------
Expand All @@ -78,14 +85,18 @@ get _functions.lua from same place as this script came from
--PLUGIN CONFIGURATIONS--
-------------------------
FFXIV itself -> make sure all login notifications are off. like help, achievements etc. this is unfortunately super annoying. you may need to login/out a few times to ensure no weird popups are appearing.
Simpletweaks -> Setup autoequip command, "/equipguud"
Simpletweaks -> Setup autoequip command, "/equipguud" or just use the default "/equiprecommended"
Simpletweaks -> Setup equipjob command, "/equipjob"
Simpletweaks -> targeting fix on
SND -> Turn off SND targeting
YesAlready -> Lists -> Edit company crest design.
YesAlready -> Lists -> Retire to an inn room.
YesAlready -> Lists -> Move to the company workshop
YesAlready -> Lists -> Change free company allegiance.
YesAlready -> YesNo -> /Pay the 15,000-gil fee to switch your company's allegiance to the.*/
YesAlready -> YesNo -> /Execute.*/
YesAlready -> YesNo -> /of ceruleum for.*/
YesAlready -> YesNo -> /Enter the estate.*/
YesAlready -> YesNo -> Save changes to crest design?
Optional:
Expand All @@ -95,6 +106,7 @@ YesAlready -> YesNo -> /Purchase the action .*/
--some ideas for next version
--https://discord.com/channels/1001823907193552978/1196163718216679514/1215227696607531078
--stop repeating code for returning home.. introduces danger of errors popping up
--add in a check to see which job that isnt DOL or DOH is highest and switch to it for the auto equip shenanigans. but only if they are on a doh or dol job. make it a configuration option
]]


Expand Down Expand Up @@ -141,9 +153,12 @@ function Final_GC_Cleaning()
dellycount = dellycount + 1
yield("/echo Processing Retainer Abuser "..rcuck_count.."/"..#chars_fn)
if dellycount > 100 then
--do some stuff like turning off deliveroo and targeting and untargeting an npc
--i think we just need to target the quartermaster and open the dialog with him
--this will solve getting stuck on deliveroo doing nothing
--this will solve getting stuck on deliveroo doing nothing while its enabled
yield("/deliveroo disable")
yield("/wait 2")
ungabunga()
yield("/deliveroo enable")
yield("/wait 3")
dellycount = 0
end
end
Expand Down Expand Up @@ -224,9 +239,7 @@ if process_emblem == 1 then
yield("/interact")
yield("<wait.4>")
--all set
yield("/send ESCAPE <wait.1.5>")
yield("/send ESCAPE <wait.1.5>")
--quick escape in case we got stuck in menu
ungabunga() --quick escape in case we got stuck in menu

--now we get to the emblematizer
yield("<wait.5>")
Expand Down Expand Up @@ -303,10 +316,7 @@ if process_fc_buffs == 1 then
yield("<wait.1>")
buycount = buycount + 1
end
yield("/send ESCAPE <wait.1.5>")
yield("/send ESCAPE <wait.1.5>")
yield("/send ESCAPE <wait.1.5>")
yield("<wait.5>")
ungabunga() --quick escape in case we got stuck in menu

end
yield("/echo FC Seal Buff II")
Expand Down Expand Up @@ -341,19 +351,51 @@ end
--gc turn in
if process_players == 1 then
for i=1, #chars_fn do
yield("/echo Loading Characters for GC TURNIN -> "..chars_fn[i][1])
yield("/echo Processing Retainer Abuser "..i.."/"..#chars_fn)
yield("/ays relog " ..chars_fn[i][1])
--yield("/echo 15 second wait")
yield("/wait 2")
CharacterSafeWait()
yield("/echo Processing Retainer Abuser "..i.."/"..#chars_fn)
TeleportToGCTown()
ZoneTransition()
WalkToGC()
rcuck_count = i
yield("/wait 2")
Final_GC_Cleaning()
yield("/echo Loading Characters for GC TURNIN -> "..chars_fn[i][1])
yield("/echo Processing Retainer Abuser "..i.."/"..#chars_fn)
yield("/ays relog " ..chars_fn[i][1])
--yield("/echo 15 second wait")
yield("/wait 2")
CharacterSafeWait()
yield("/echo Processing Retainer Abuser "..i.."/"..#chars_fn)
--before we dump gear lets check to see if we are on the right job or if we care about it.
if config_sell == 1 then
yield("/maincommand Item Settings")
yield("/wait 0.5")
yield("/pcall ConfigCharaItem true 18 288 0 u0")
yield("/pcall ConfigCharaItem true 0")
yield("/wait 0.5")
yield("/pcall ConfigCharacter true 1")
end
if config_sell == 2 then
yield("/maincommand Item Settings")
yield("/wait 0.5")
yield("/pcall ConfigCharaItem true 18 288 1 u0")
yield("/pcall ConfigCharaItem true 0")
yield("/wait 0.5")
yield("/pcall ConfigCharacter true 1")
end
if auto_eqweep == 1 then
if are_we_dol() then
yield("/equipjob "..job_short(which_cj()))
yield("/echo Switching to "..job_short(which_cj()))
yield("/wait 3")
end
end
TeleportToGCTown()
ZoneTransition()
yield("/wait 2")
WalkToGC()
yield("/wait 2")
WalkToGC()
yield("/wait 2")
WalkToGC()
rcuck_count = i
yield("/wait 2")
Final_GC_Cleaning()
if restock_fuel > 0 and GetItemCount(10373) > 0 and GetItemCount(10155) <= restock_fuel then
try_to_buy_fuel(restock_amt)
end
end
end
--last one out turn off the lights
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,56 @@
function ungabunga()
yield("/send ESCAPE <wait.1.5>")
yield("/send ESCAPE <wait.1.5>")
yield("/send ESCAPE <wait.1.5>")
yield("/send ESCAPE <wait.1>")
yield("/wait 3")
end

function WalkTo(x, y, z)
PathfindAndMoveTo(x, y, z, false)
countee = 0
while (PathIsRunning() or PathfindInProgress()) do
yield("/wait 0.5")
--if GetZoneID() == 130 or GetZoneID() == 341 then --130 is uldah. dont need to jump anymore it paths properly. we will test anyways.
if gachi_jumpy == 1 then --we only doing jumps if we configured for it
countee = countee + 1
if gachi_jumpy == 1 and countee == 10 and GetZoneID() ~= 129 then --we only doing jumps if we configured for it
--if GetZoneID() == 341 then --only need to jump in goblet for now
yield("/gaction jump")
countee = 0
end
end
end

function ZoneTransition()
iswehehe = IsPlayerAvailable()
iswoah = 0
repeat
yield("/wait 0.5")
yield("/echo Are we ready?")
until not IsPlayerAvailable()
yield("/echo Are we ready? -> "..iswoah.."/20")
iswehehe = IsPlayerAvailable()
iswoah = iswoah + 1
if iswoah == 20 then
iswehehe = false
end
until not iswehehe
iswoah = 0
repeat
yield("/wait 0.5")
yield("/echo Are we ready? (backup check)")
until IsPlayerAvailable()
yield("/echo Are we ready? (backup check)-> "..iswoah.."/20")
iswehehe = IsPlayerAvailable()
iswoah = iswoah + 1
if iswoah == 20 then
iswehehe = true
end
until iswehehe
end

function WalkToGC()
if GetPlayerGC() == 1 then
yield("/li The Aftcastle")
ZoneTransition()
if GetZoneID() ~= 128 then
yield("/li The Aftcastle")
ZoneTransition()
end
WalkTo(94, 40.5, 74.5)
elseif GetPlayerGC() == 2 then
WalkTo(-68.5, -0.5, -8.5)
Expand All @@ -50,11 +76,14 @@ end

function visland_stop_moving()
yield("/equipguud")
yield("/equiprecommended")
yield("/character")
yield("/pcall Character true 15")
yield("/wait 0.5")
yield("/pcall SelectYesno true 0")
yield("/character")
yield("/pcall Character true 15")
yield("/pcall SelectYesno true 0")
yield("/wait 3")
muuv = 1
muuvX = GetPlayerRawXPos()
Expand Down Expand Up @@ -113,4 +142,140 @@ function return_fc_near_bell()
--PathfindAndMoveTo(GetObjectRawXPos("Summoning Bell"), GetObjectRawYPos("Summoning Bell"), GetObjectRawZPos("Summoning Bell"), false)
WalkTo(GetObjectRawXPos("Summoning Bell"), GetObjectRawYPos("Summoning Bell"), GetObjectRawZPos("Summoning Bell"))
visland_stop_moving() --added so we don't accidentally end before we get to the bell
end

function are_we_dol()
is_it_dol = false
yield("Our job is "..GetClassJobId())
if type(GetClassJobId()) == "number" and GetClassJobId() > 7 and GetClassJobId() < 19 then
is_it_dol = true
yield("/echo We are a Disciple of the (H/L)and")
end
return is_it_dol
end

function which_cj()
highest_cj = 0
highest_cj_level = 0
yield("Time to figure out which job ID to switch to !")
for i=0,7 do
if tonumber(GetLevel(i)) > highest_cj_level then
highest_cj_level = GetLevel(i)
highest_cj = i
yield("/echo Oh my maybe job->"..i.." lv->"..highest_cj_level.." is the highest one?")
end
end
for i=19,29 do
if tonumber(GetLevel(i)) > highest_cj_level then
highest_cj_level = GetLevel(i)
highest_cj = i
yield("/echo Oh my maybe job->"..i.." lv->"..highest_cj_level.." is the highest one?")
end
end
return tonumber(highest_cj)
end

function job_short(which_cj)
yield("Time to figure out which job shortname to switch to !")
if which_cj == -1 then shortjob = "adv" end
if which_cj == 1 then shortjob = "gld"
if GetItemCount(4542) > 0 then
shortjob = "pld"
end
end
if which_cj == 0 then shortjob = "pgl"
if GetItemCount(4543) > 0 then
shortjob = "mnk"
end
end
if which_cj == 2 then shortjob = "mrd"
if GetItemCount(4544) > 0 then
shortjob = "war"
end
end
if which_cj == 4 then shortjob = "lnc"
if GetItemCount(4545) > 0 then
shortjob = "drg"
end
end
if which_cj == 3 then shortjob = "arc"
if GetItemCount(4546) > 0 then
shortjob = "brd"
end
end
if which_cj == 6 then shortjob = "cnj"
if GetItemCount(4547) > 0 then
shortjob = "whm"
end
end
if which_cj == 5 then shortjob = "thm"
if GetItemCount(4548) > 0 then
shortjob = "blm"
end
end
if which_cj == 19 then shortjob = "rog"
if GetItemCount(7886) > 0 then
shortjob = "nin"
end
end
if which_cj == 20 then shortjob = "mch" end
if which_cj == 21 then shortjob = "drk" end
if which_cj == 22 then shortjob = "ast" end
if which_cj == 23 then shortjob = "sam" end
if which_cj == 24 then shortjob = "rdm" end
if which_cj == 25 then shortjob = "blu" end
if which_cj == 26 then shortjob = "gnb" end
if which_cj == 27 then shortjob = "dnc" end
if which_cj == 28 then shortjob = "rpr" end
if which_cj == 29 then shortjob = "sge" end
return shortjob
end

function try_to_buy_fuel(restock_amt)
--enter house
yield("/wait 0.5")
yield("/interact")
yield("/wait 5")
--enter workshop
yield("/target \"Entrance to Additional Chambers\"")
yield("/wait 0.5")
yield("/lockon")
yield("/automove")
visland_stop_moving()
yield("/interact")
yield("/wait 1")
yield("/pcall SelectString true 0")
yield("/wait 5")
--target mammet
yield("/target mammet")
yield("/wait 0.5")
yield("/lockon")
yield("/automove")
visland_stop_moving()
--open mammet menu
yield("/automove off")
yield("/interact")
yield("/wait 2")
yield("/pcall SelectIconString true 0")
yield("/wait 2")
--buy exactly restock_amt final value for fuel
--grab current fuel total
curFuel = GetItemCount(10155)
oldFuel = curFuel + 1
while curFuel < restock_amt do
buyamt = 99 --this can be set to 231u if you want but i wouldn't recommend it as it shows on lodestone
if (restock_amt - curFuel) < 99 then
buyamt = restock_amt - curFuel
end
yield("/pcall FreeCompanyCreditShop false 0 0u "..buyamt.."u")
yield("/wait 1")
oldFuel = curFuel
curFuel = GetItemCount(10155)
if oldFuel == curFuel then
curFuel = restock_amt
yield("/echo we ran out of FC points before finishing our purchases :(")
end
end
yield("/echo We now have "..GetItemCount(10155).." Ceruelum Fuel Tanks")
ungabunga()
end
Loading

0 comments on commit d44438d

Please sign in to comment.