diff --git a/.gitignore b/.gitignore index 4b82ccd9..9a2bdcce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vs/ bin/ obj/ +Community Scripts/AutoRetainer Companions/RobustGCturnin/cycleCharsandUNLOCKHALATALIMcVaxius.lua diff --git a/Community Scripts/AutoRetainer Companions/AutoMaintenance/FUTAconfig_McVaxius.lua b/Community Scripts/AutoRetainer Companions/AutoMaintenance/FUTAconfig_McVaxius.lua deleted file mode 100644 index e69de29b..00000000 diff --git a/Community Scripts/AutoRetainer Companions/AutoMaintenance/FulllyUnifiedTaskAutomation_McVaxius.lua b/Community Scripts/AutoRetainer Companions/AutoMaintenance/FulllyUnifiedTaskAutomation_McVaxius.lua index a89ef04b..4c7220eb 100644 --- a/Community Scripts/AutoRetainer Companions/AutoMaintenance/FulllyUnifiedTaskAutomation_McVaxius.lua +++ b/Community Scripts/AutoRetainer Companions/AutoMaintenance/FulllyUnifiedTaskAutomation_McVaxius.lua @@ -10,29 +10,40 @@ It could be ocean fishing, triple triad, inventory cleaning, going for a jog aro Requirements : SND and maybe more - let's see where we go with it +everything from the folder you found this +and https://github.com/Jaksuhn/SomethingNeedDoing/blob/master/Community%20Scripts/AutoRetainer%20Companions/RobustGCturnin/_functions.lua +throw everything into %AppData%\XIVLauncher\pluginConfigs\SomethingNeedDoing\ What is working? - Geting Fisher Levels and determining who is the lowest level fisher + Geting Fisher Levels and determining who is the lowest level fisher - we cant safely AYS RELOG yet.. Outputting to log file if Red Onion Helm Detected - Repricing items in retainers first time 100%, 10% chance after that unless you configure it differently. + Updating Inventories, FC, Chocobo saddlebags for Atools by opening them. + Repricing items in retainers first time 100%, 10% chance after that unless you configure it differently. DONT ASK ABOUT THIS IN PUNISH DISC OR YOU WILL BE SENT TO THE TEASPOON DROPPING CLOSET Doing GC Turnins when configured inventory slots free is below a certain amount Visiting personal houses when we reach specified number of retainer cleanings + Rebuying Ceruleum Fuel + +Soon to be working + Automatic Magitek Repair kit trickling -> requirements you will restock the stuff yourself, if your out of materials youll get a log message What is almost working Ocean fishing would work if i could bypass the post AR lock on ays relog. thats coming soon. purposefully locked it out for - now but if your smart you can install AHK And wintitle plugin and comment out one line of code and try it. its mesmsy and i dont recommend it + now but if your smart you can install AHK And wintitle plugin and comment out one line of code and try it. its messy and i dont recommend it --]] + +------------------------------------------------------------ +----------------------GLOBAL VARIABLES---------------------- +------------------------------------------------------------ FUTA_config_file = "FUTAconfig_McVaxius.lua" force_fishing = 0 -- Set to 1 if you want the default indexed char to fish whenever possible -gc_cleaning_safetystock = 50 -- How many inventory units before we do a cleaning +venture_cleaning = 20 -- How many venture coins do we need to have left we do a cleaning - useful for leveling new retainer abusers 21072 is item id folderPath = os.getenv("appdata").."\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\" loadfiyel = os.getenv("appdata").."\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\_functions.lua" fullPath = os.getenv("appdata") .. "\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\" .. FUTA_config_file functionsToLoad = loadfile(loadfiyel) functionsToLoad() - ------------------------------------------ --Config and change back after done!------ ------------------------------------------ @@ -41,23 +52,42 @@ re_organize_return_locations = 0 -- only set this one time and run the script so ------------------------------------------ ------------------------------------------ -yield("/wintitle Final Fantasy XIV") +--yield("/wintitle Final Fantasy XIV") --FOR HACKY FISHIN SWITCHER WITH AHK --yield("/wait 5") --yield("/waitaddon _ActionBar ") + +--update atools w fc and inventory +yield("/echo Fully Unified Task Automation (F.U.T.A.) Initializing .....") +yield("/freecompanycmd") +yield("/echo Free Company command executed.") +yield("/inventory") +yield("/echo Inventory command executed.") +yield("/saddlebag") +yield("/echo Saddlebag command executed.") +yield("/echo Fully Unified Task Automation (F.U.T.A.) atools database updated") +yield("/echo Non Aggregated Recursive Integration (N.A.R.I.) Initializing .....") + FUTA_processors = {} -- Initialize variable + -- 3D Table {}[i][j][k] +---- -> --?- -> not possible yet/partially implemented +---- -> --X- -> not implemented +---- -> --Y- -> not implemented + FUTA_defaults = { { - {"Firstname Lastname@Server", 0}, ---{}[i][1][1..2]--name@server and return type 0 return home to fc entrance, 1 return home to a bell, 2 don't return home, 3 is gridania inn, 4 limsa bell near aetheryte, 5 personal estate entrance, 6 bell near personal home - {"FISH", 0}, ---{}[i][2][1..2]--level, 0 = doont do anything, 100 = dont do anything, 101 = automatically pick this char everytime, minimum = pick this char if no 101 exists - {"CLEAN", 100, 0, 0, 50}, ---{}[i][3][1..5]--chance to do random cleaning/100 if 100 it will be changed to 10 after 1 run, process_gc_rank = 0=no,1=yes. expert_hack = 0=no,1=yes. clean_inventory = 0=no, >0 check inventory slots free and try to clean out inventory. - {"FUEL", 0, 0}, ---{}[i][4][1..3]--fuel safety stock trigger, fuel to buy up to - {"TT", 0, 0}, ---{}[i][5][1..3]--minutes of TT, npc to play 1= roe 2= manservant - {"CUFF", 0}, ---{}[i][6][1..2]--minutes of cufffacur to run . assumes in front of an "entrance" - {"MRK", 0}, ---{}[i][7][1..2]--number of magitek repair kits to quick synth after each AR check - {"FCB", "nothing", "nothing"}, ---{}[i][8][1..3]--refresh FC buffs if they have 1 or less hours remaining on them. (remove and re-assign) - {"PHV", 0, 100}, ---{}[i][9][1..3]--0 = no personal house 1 = has a personal house, personal house visit counter, once it reaches {}[][][2] it will reset to 1 after a visit, each ar completion will +1 it - {"DUTY", "Teaspoon Dropping Closet", -5, 0} --{}[i][10][1..4]--name of duty, number of times to run (negative values for one time run - set to 0 after), normal 0 unsynced 1 + {"Firstname Lastname@Server", 0}, --Y--{}[i][1][1..2]--name@server and return type 0 return home to fc entrance, 1 return home to a bell, 2 don't return home, 3 is gridania inn, 4 limsa bell near aetheryte, 5 personal estate entrance, 6 bell near personal home + {"FISH", 0}, --?--{}[i][2][1..2]--level, 0 = dont do anything, 100 = dont do anything, 101 = automatically pick this char everytime, minimum = pick this char if no 101 exists + {"CLEAN", 100, 0, 0, 50}, --Y--{}[i][3][1..5]--chance to do random cleaning/100 if 100 it will be changed to 11 after 1 run, process_gc_rank = 0=no,1=yes. expert_hack = 0=no,1=yes. clean_inventory = 0=no, >0 check inventory slots free and try to clean out inventory. + {"FUEL", 0, 0}, --Y--{}[i][4][1..3]--fuel safety stock trigger, fuel to buy up to i[4][3] amount when hitting i[4][2] amount or lower leave i[4][2] at 0 if you dont want it to process this + {"TT", 0, 0}, --N--{}[i][5][1..3]--minutes of TT, npc to play 1= roe 2= manservant + {"CUFF", 0}, --N--{}[i][6][1..2]--minutes of cufff-a-cur to run . assumes in front of an "entrance" + {"MRK", 0}, --N--{}[i][7][1..2]--number of magitek repair kits to quick synth after each AR check + {"FCB", "nothing", "nothing"}, --N--{}[i][8][1..3]--refresh FC buffs if they have 1 or less hours remaining on them. (remove and re-assign) + {"PHV", 0, 100}, --Y--{}[i][9][1..3]--0 = no personal house 1 = has a personal house, personal house visit counter, once it reaches {}[][][2] it will reset to 1 after a visit, each ar completion will +1 it + {"DUTY", "Teaspoon Dropping Closet", -5, 0},--N-{}[i][10][1..4]--name of duty, number of times to run (negative values for one time run - set to 0 after), normal 0 unsynced 1 https://www.youtube.com/watch?v=TsFGJqXnqBE + {"MINI", 0, 0, 0}, --N-{}[i][11][1..4]--Daily mini cactpot, [2] year [3] month [4] day, if we are in the next day after reset time. then we go run it again and set the time. again. + {"VERM", 0, 0, 0} --N-{}[i][12][1..4]--Verminion, [2] year [3] month [4] day, if we are in the next week after reset time. then we go run it again and set the time. again. } } @@ -76,7 +106,7 @@ else yield("/echo Error: Serialized data is nil.") end ---loadfiyel2 = os.getenv("appdata").."\\XIVLauncher\\pluginConfi----gs\\SomethingNeedDoing\\FUTAconfig_McVaxius.lua" +--loadfiyel2 = os.getenv("appdata").."\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\FUTAconfig_McVaxius.lua" --functionsToLoad2 = loadfile(loadfiyel2) --functionsToLoad2() @@ -125,6 +155,7 @@ for i = 1, #FUTA_processors do end end +yield("/echo N.A.R.I. Table Processor Completed") --[[ @@ -227,7 +258,7 @@ if FUTA_processors[lowestID][2][2] == 100 and force_fishing == 0 or FUTA_process yield("/echo Lowest char is max level or no chars have fishing so we aren't fishing") end -wheeequeheeheheheheheehhhee = 0 --meh we cant do this safely +wheeequeheeheheheheheehhhee = 0 --meh we cant do this safely --FOR HACKY FISHIN SWITCHER WITH AHK --- REMOVE IF YOU WANT TO USE IT -- It's fishing time if wheeequeheeheheheheheehhhee == 1 then if GetCharacterCondition(31) == false then @@ -241,6 +272,7 @@ if wheeequeheeheheheheheehhhee == 1 then yield("/waitaddon _ActionBar ") + --FOR HACKY FISHIN SWITCHER WITH AHK --- START if FUTA_processors[lowestID][1][1] ~= GetCharacterName(true) then --if we are on wrong char. we gotta kill AR And let AHK fire up the right char in a sec ;o yield("/echo Hacky whacky") @@ -267,6 +299,7 @@ if wheeequeheeheheheheheehhhee == 1 then --end the script here yield("/pcraft stop") end + --FOR HACKY FISHIN SWITCHER WITH AHK --- END fishing() yield("/echo Debug: Fishing completed") @@ -292,6 +325,7 @@ end ------------------------------FISHING END---------------------------------------- --------------------------------------------------------------------------------- if wheeequeheeheheheheheehhhee == 0 then + ---------------------------- --CLEAN-- ---------------------------- @@ -304,18 +338,19 @@ if wheeequeheeheheheheheehhhee == 0 then -- If [3] was 100, we set it back down to 10 because 100 means a one-time guaranteed cleaning yield("/echo rolling dice to see if we do a repricing !") if FUTA_processors[hoo_arr_weeeeee][3][2] > 99 then - FUTA_processors[hoo_arr_weeeeee][3][2] = 10 + FUTA_processors[hoo_arr_weeeeee][3][2] = 11 --for easier find replace shenanigans [2] = 11 -> [2] = 99, for example tablebunga(FUTA_config_file, "FUTA_processors", folderPath) yield("/echo Debug: Inventory cleaning adjustment completed") end end end + ---------------------------- --CLEAN2 Electric boogaloo-- ---------------------------- --check inventory size and do gcturnin shit yield("/echo Do we need to clear inventory?") - if GetInventoryFreeSlotCount() < FUTA_processors[hoo_arr_weeeeee][3][5] and FUTA_processors[hoo_arr_weeeeee][3][5] > 0 then + if GetInventoryFreeSlotCount() < FUTA_processors[hoo_arr_weeeeee][3][5] and FUTA_processors[hoo_arr_weeeeee][3][5] > 0 or GetItemCount(21072) > 0 and GetItemCount(21072) < venture_cleaning then yield("/echo Yes we need to clean inventory and turnin GC stuff! 1/5 debug") loadfiyel2 = os.getenv("appdata").."\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\FUTA_GC.lua" yield("/echo Yes we need to clean inventory and turnin GC stuff! 2/5 debug") @@ -326,10 +361,23 @@ if wheeequeheeheheheheheehhhee == 0 then FUTA_robust_gc() yield("/echo Yes we need to clean inventory and turnin GC stuff! 5/5 debug") end + + ---------------------------- + -----Buy Ceruleum Fuel------ + ----------------------------- + if FUTA_processors[hoo_arr_weeeeee][4][2] > 0 then + if GetItemCount(10155) < FUTA_processors[hoo_arr_weeeeee][4][2] then + try_to_buy_fuel(FUTA_processors[hoo_arr_weeeeee][4][3]) + end + end + ---------------------------- --PHV Personal House Visit-- ---------------------------- + --This should be done last-- + ---------------------------- if FUTA_processors[hoo_arr_weeeeee][9][2] > 0 then + yield("/echo Personal House Visit counter Incremented by 1") FUTA_processors[hoo_arr_weeeeee][9][2] = 1 + FUTA_processors[hoo_arr_weeeeee][9][2] if FUTA_processors[hoo_arr_weeeeee][9][2] > FUTA_processors[hoo_arr_weeeeee][9][3] then FUTA_processors[hoo_arr_weeeeee][9][2] = 1 @@ -337,7 +385,7 @@ if wheeequeheeheheheheheehhhee == 0 then CharacterSafeWait() return_fc_entrance() --does the same thing just enters target CharacterSafeWait() - loggabunga("FUTA_", " - Home Visit Executed by -> "..FUTA_processors[lowestID][1][1]) + loggabunga("FUTA_", " - Home Visit Executed by -> "..FUTA_processors[hoo_arr_weeeeee][1][1]) zungazunga() FUTA_return() --return to configured location end @@ -349,4 +397,5 @@ zungazunga() if wheeequeheeheheheheheehhhee == 1 then yield("/ays multi e") --if we had to toggle AR end -yield("/echo Debug: Finished all processing") \ No newline at end of file +yield("/echo Debug: Finished all processing") +tablebunga(FUTA_config_file, "FUTA_processors", folderPath) \ No newline at end of file diff --git a/Community Scripts/AutoRetainer Companions/RobustGCturnin/_functions.lua b/Community Scripts/AutoRetainer Companions/RobustGCturnin/_functions.lua index b42c0136..10eaef6b 100644 --- a/Community Scripts/AutoRetainer Companions/RobustGCturnin/_functions.lua +++ b/Community Scripts/AutoRetainer Companions/RobustGCturnin/_functions.lua @@ -133,9 +133,13 @@ end function ungabunga() yield("/send ESCAPE ") + yield("/pcall SelectYesno true 0") yield("/send ESCAPE ") + yield("/pcall SelectYesno true 0") yield("/send ESCAPE ") + yield("/pcall SelectYesno true 0") yield("/send ESCAPE ") + yield("/pcall SelectYesno true 0") yield("/wait 3") end @@ -387,6 +391,7 @@ function return_fc_entrance() yield("/release Q") yield("/interact") yield("/wait 1") + yield("/pcall SelectYesno true 0") end function return_fc_near_bell() @@ -513,8 +518,16 @@ function clean_inventory() --*loop every 5 seconds and check if we have the right char condition to resume whatever we were doing. --/automarket start|stop zungazunga() + yield("/target Summoning Bell") + yield("/lockon on") + yield("/automove on ") + yield("/interact") yield("/automarket start") yield("/wait 5") + yield("/target Summoning Bell") + yield("/wait 1") + yield("/interact") + yield("/automarket start") exit_cleaning = 0 while GetCharacterCondition(50) == false and exit_cleaning < 20 do yield("/wait 1") @@ -522,10 +535,25 @@ function clean_inventory() yield("/echo Waiting for repricer to start -> "..exit_cleaning.."/20") end exit_cleaning = 0 + --forced_am = 0 while GetCharacterCondition(50) == true and exit_cleaning < 300 do yield("/wait 1") exit_cleaning = exit_cleaning + 1 - yield("/echo Waiting for repricer to end -> "..exit_cleaning.." seconds duration so far") + flandom = getRandomNumber(1,20) + --yield("/echo Waiting for repricer to end -> "..exit_cleaning.." seconds duration so far flandom -> "..flandom) + yield("/echo Waiting for repricer to end -> "..exit_cleaning.."/300") +--[[ + forced_am = forced_am + 1 + if flandom == 1 and exit_cleaning > 50 and forced_am > 49 then + ungabunga() + ungabunga() + forced_am = 0 + --yield("/automarket start") + yield("Giving Automarket a little push to get it moving and waiting 20 seconds") + --yield("/wait 20") + exit_cleaning = exit_cleaning + 25 + end + --]] end CharacterSafeWait() zungazunga() @@ -535,6 +563,10 @@ function clean_inventory() yield("/automarket stop") end +function getRandomNumber(min, max) + return math.random(min,max) +end + function try_to_buy_fuel(restock_amt) --target mammet yield("/wait 5") diff --git a/Community Scripts/AutoRetainer Companions/RobustGCturnin/bagman_mcvaxius.lua b/Community Scripts/AutoRetainer Companions/RobustGCturnin/bagman_mcvaxius.lua index 6dc5a6f5..6fe6be53 100644 --- a/Community Scripts/AutoRetainer Companions/RobustGCturnin/bagman_mcvaxius.lua +++ b/Community Scripts/AutoRetainer Companions/RobustGCturnin/bagman_mcvaxius.lua @@ -330,6 +330,10 @@ local function shake_hands() DropboxSetItemQuantity(filled_bags[i][1],true,0) yield("/wait 0.5") end + end + if bagman_type == 4 then + DropboxSetItemQuantity(franchise_owners[windex][5],false,0) --clear the specific item from list + yield("/echo cleaning this list out to 0 so we dont send multiple packages to same tony") end yield("/echo Woah we need another tony out here im not giving you this next bag you mook") --yield("/dbq 1:1") diff --git a/Community Scripts/Gathering/LegendaryFarmer-1.0.4.lua b/Community Scripts/Gathering/LegendaryFarmer-1.0.4.lua new file mode 100644 index 00000000..9bbd863a --- /dev/null +++ b/Community Scripts/Gathering/LegendaryFarmer-1.0.4.lua @@ -0,0 +1,1151 @@ +--[[ + + **************************************** + * GBR - LegendaryFarmer | Legendary Node/Crystal/Cluster/Sand Farmer * + * Aetherial Reduction | Scrip Exchanege * + * * * + **************************************** + +Author: Ahernika +Script is mostly re used codes from existing codes on snd wiki and some my additions, thanks to friends on punish disco +notably but not least of: + 1.A4N-AR Integration:Author UcanPatates/Ice + 2.Spearfishing Desynth | Author - Ice + 3.GBR-AR integration: Author - EllipsisVidakel + 4. Gathering Helper| Author Leaffriend + + ********************** + * Version | 1.0.4 * + ********************** + -> 1.0.4 : Added Scrip Exchange/Retainers in Solution 9 + -> 1.0.3 : Added Scrip Exchange in only Gridania for now/ Ranamed the scripts + -> 1.0.1 : Quick Additional funtionality for extract materia/potion and food use -credit Gathering helper + : Removed reqiremenet for plugin collections due addition of qol commands like /gbr auto on/off + : Other minor clean ups to help easy inital setup, no need to set character name now + -> 1.0.0 : Working gbr crystal farmer (using Aetherial Reduction Method) with AutoRetainer. + + *************** + * Description * + *************** + Description: LegendaryFarmer + The script allows you to use Gather Buddy Reborn Auto gathering and when you get to a certain inventory amount it will pause for you and proceed to reduce all your collectables. + And process retainers whe AR is ready + Will do scrip exchange and collectible Appriaser when inventory below threshold (can do them in solution) + Particular use cases are + 1.is farming crystals/clusters and sands from DT time nodes using aetherial reduction method. + 2.Farming Legendary nodes and purple/orange collectible DT nodes + 3.General Support script for GBR even for Regular Nodes (to help do potions/food, repair/extract, retainers/gc deliveries etc) + ********************* + * Required Plugins * + ********************* + + -> SomethingNeedDoing (Expanded Edition) [Make sure to press the lua button when you import this] -> https://puni.sh/api/repository/croizat + -> vnavmesh : https://puni.sh/api/repository/veyn [might require restart of game every once in a while when vnvmesh fails, use command /xlrestart] + -> Pandora's Box : https://love.puni.sh/ment.json [used to set auto cordial, set high enough not to overcap, mine is around 600 GP., disable auto interact and Pandora quick gathering to be safe] + -> Gather Buddy Reborn : https://raw.githubusercontent.com/FFXIV-CombatReborn/CombatRebornRepo/main/pluginmaster.json [our main gathering tool, set minimum GP to inetract with nodes to around 500GP for collectibles (can try and check other setting btw 400 and 600 as well)] + -> AutoRetainer : https://love.puni.sh/ment.json [currently using /ays e for single character, need to test with /ays multi] + -> Lifestream for /li gc command + -> Deliveroo: to do gc deliveries https://plugins.carvel.li/ + -> YesAlready: Auto Return to x location requires setting a yes already for it (look up yes already channel for help or disable this feature in settings) + + Some other notes: !!IMPORTANT!! + Set a auto gather list in GBR with timed emphemeral nodes preferabley from EW (ghostly umbral rock,sohora roots/ewer clay,lunar/earthern quartz, palm chippings etc. ) and DT (volcanic grass, goldbranch, electocoal, brightwind ore.) set order based on crystal/cluster preference having multiple items helps avaoid any downtime. + Example GBR gather list preset i use (you don't have to)) + DT Orange: H4sIAAAAAAAACjWLPQvCMBCGwZ9y8wlpzqWZ69DFInQTh2gPCdhY0usgpf/d5FQOHt6v263QCo/tMIO7HKi2NRZaJRWSuaJu+vfEZVWhXk7Pi48SJJR4Bf0GVxmDqq3qn6Fs/g2Zb7MhnPzI4KDp913y8cGA0PB8T2GS8Iq5ycEx+tuTB3CSFt4+E/b7mbEAAAA= + DT purple: H4sIAAAAAAAACmOqVvIsSc31TClWsoo2MbY0stAxMTEyNtEBsQ3BpFmsDlhNSGVBKkiVoQ4YAkUDSxPzSjJLMkHC1Upg3UpWhgYGOkpgM2BskElIbDMwu1ZHyS8xN1XJSsklRDegtKggJ1VJR8kltTi5KLOgJDM/DygDFHDNS0zKSU1RsiopKk2tBQBZshanrgAAAA== + DT Legendaries:H4sIAAAAAAAACk2NywrCMBBFwU+Z9QipTV9Z10VBBMGNiItoBwnYWNJ0IaX/bjKChIEDZ+48Ngt0noaun0BdpcykwMC8ZjbMglkxyxvy/PkzUtzI8F8hOc3aeuNNjBbga6B2QgiMktepNKkUqVSplD9ZEY56IFDQXrYHepLttYt/EFqaHs6M3rxtiENjb/X9RT0o72Zav++o8QbhAAAA + make more for yourself and add it to GBR (make sure atleast 1 is enabled before triggering) + make sure you have this list enabled before trigerring the script + ************** + * SETTINGS * + ************** + --]] +---Food Settings---!!!!!!-------------- +food_to_eat = +"Stuffed Peppers " --what food to eat (false if none) --there is no check if you don't have that food, script will move on after set time +medicine_to_use = +"Superior Spiritbond Potion " --what potion to use (false if none) --there is no check if you don't have that potion, script will move on after set time + +--things you want to enable +do_extract = true --If true, will extract materia if possible (GBR does this now, so only use one of the two to avaoid conflicts) +do_reduce = true --If true, will reduce ephemerals if possible +do_repair = true --If true, will do repair if possible set repair amount below +do_scrips = true --If true, will do colletibles and scrip exchange (only in griania for now) !!!!read the settings below carefully!!! to set items +--If currently does purple=high coridals and orange = mythbloom aethersand (you can change it) +do_ar = true --If true, will do AR (autoretainers) +do_gc_delivery = true --If true, will do GC deliveries using deliveroo everytime retainers are processed +--use_tickets = true --If true, will use tickets to Teleport to GC town for gc deliveries :) for ppl with lot gc seals only +-------------------------------------- +--General Settings +use_gbr = true --use GBR for gathering +return_to_gc_town = true --[Will Require !!!Yes ALready set to accept promt!!!] if true will use fast return to GC town for retainers and scrip exchange (that assumes you set return location to your gc town else turn it false), else false +num_inventory_free_slot_threshold = 10 --set !!!carefully how much inventory before script stops gathering and does additonal tasks!!! +msgDelay = 10 +crystal_check = true --just fun little warning if you are about overcap crystals, checks every 30s (will not stop script so be careful of wasting crystals/clusters) +verbose = true +interval_rate = 0.1 --general wait time used in the script can play with it if your system loads ui more slowly +timeout_threshold = 10 --certain functions timeout and close if they don't work as intended due to some reason, after this period +-------------------------------------- +--Food and Potion Settings +consume_threshold = 10 --how long till script tries to eat food, leave it as it is +--Repair Settings +RepairAmount = 50 --repair threshold, adjust as needed +-------------------------------------- +--desynth settings +-------------------------------------- +--AR Settings +all_characters = false --do you want to do it for 1 character or multiple, tested only on 1 character for now, so false +interval_rate = 0.1 +additional_scrip_exchange = true --important if this is set true script will do retainers/scrip exchange in 4 th additional location (beside GC cities) +additional_scrip_exchange_location = "solution" --teleporter command location name for the 4th location (Solution Nine here by default) +additional_scrip_exchange_sublocation = "nexus" --/li aethyryte name in case you need to get somewhere within that city + + +--vnav x,y,z cordinates of bell and zoneid of location city (shown below are examples for 3 GC cities and solution 9 +paths_to_mb = { --paths to retainer bell, leave it as it is unless you edit functions below aswell + { -124.703, 18.00, 19.887, 129 }, -- Path to Retainer Bells + { 168.72, 15.5, -100.06, 132 }, + { 146.760, 4, -42.992, 130 }, + { -152.465, 0.660, -13.557, 1186 } --Path to bell in solution 9 in this example/4th location +} + +--vnav x,y,z cordinates of collectable appraiser and zoneid of location city (shown below are examples for 3 GC cities and solution 9 +paths_to_scrip = { --paths to scrip exchnage, leave it as it is unless you edit functions below aswell + { -258.09, 16.079, 42.089, 129 }, -- Path to Scrip Exchange/Collectable Appraiser + { 142.15, 13.74, -105.39, 132 }, + { 149.349, 4, -18.722, 130 }, + { -158.019, 0.922, -37.884, 1186} -- vnav cordinates for the 4th additional location appraiser (here one in solution 9)/4th location + +} +--Collecable Appraiser and Scrip Exchange Settings +min_items_before_turnins = 1 --how many collectibles before turining in +scrip_overcap_limit = 3900 --when should you stop turnin in, to avoid scrip wasteage + +--collectible_to_turnin_row, item_id, job_for_turnin, turnin_scrip_type (follow examples shared here) +collectible_item_table = +{ + --MINER + --orange scips --39 for orange scrips + { 0, 43922, 8, 39 }, --ra'kaznar ore + { 1, 43923, 8, 39 }, --ash soil + { 3, 43921, 8, 39 }, --magnesite ore + --BOTANIST + { 0, 43929, 9, 39 }, --acacia log + { 1, 43930, 9, 39 }, --windsbalm bay lef + { 3, 43928, 9, 39 }, --dark mahagony + + --MINER + --white scips --38 for white scrips + { 4, 44233, 8, 38 }, --white gold ore + { 5, 43920, 8, 38 }, --gold ore + { 6, 43919, 8, 38 }, --dark amber + --BOTANIST + { 4, 44234, 9, 38 }, --acacia bark + { 5, 43927, 9, 38 }, --kukuru beans + { 6, 43926, 9, 38 } --mountain flax +} +--scrip_exchange_category,scrip_exchange_subcategory,scrip_exchange_item_to_buy_row, collectible_scrip_price (follow examples shared here) change as needed +min_scrip_for_exchange = 20 +exchange_item_table = { + { 4, 8, 6, 1000 }, --what to spend orange (rroneek tokens here) --only 1 item to spend orange scrips on and one time to purple scrips on + { 4, 1, 0, 20 }, --what to spend purple on (high cordials) +} + +--example setup +--Purple Scrips +--{ 5, 1, 0, 250 } -Gatherer's Gueurdon Materia XI (Gathering + 20) +--{ 5, 1, 1, 250 } -Gatherer's Guile Materia XI (Perception + 20) +--{ 5, 1, 2, 250 } -Gatherer's Grasp Materia XI (GP + 9) +--{ 4, 1, 0, 20 } -High Coridals + +--Orange Scrips +--{ 5, 2, 0, 500 } -Gatherer's Gueurdon Materia XII (Gathering + 36) +--{ 5, 2, 1, 500 } -Gatherer's Guile Materia XII (Perception + 36) +--{ 5, 2, 2, 500 } -Gatherer's Grasp Materia XII (GP + 11) +--{ 4, 8, 2, 100 } -Sunglit Sand +--{ 4, 8, 3, 200 } -Mythload Sand +--{ 4, 8, 4, 200 } -Mythroot Sand +--{ 4, 8, 5, 200 } -Mythbrine Sand +--{ 4, 8, 6, 1000 } -RRoneek Horn Tokens + + +----------------------------------------------------- +--some default stuff leave as it is +--init +local stop_main = false +local i_count = tonumber(GetInventoryFreeSlotCount()) +local loop = 1 +---------------------------------------- +--[[ + + ************** + * Start of * + * Script * + ************** + --------------------------------------------------------------- + --]] +--some helper lua functions +function Set(list) + local set = {} + for _, l in ipairs(list) do set[l] = true end + return set +end + +function Split(inputstr, sep) + if sep == nil then sep = "%s" end + local t = {} + for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do + table.insert(t, str) + end + return t +end + +function AddToSet(set, key) + set[key] = true +end + +function ParseNodeDataString(string) + return Split(string, ",") +end + +--Return printable node +function PrintNode(node) + local printable_node = node or "" + if truncate then + local data = ParseNodeDataString(node) + local x = Truncate1Dp(data[2]) + local y = Truncate1Dp(data[3]) + local z = Truncate1Dp(data[4]) + printable_node = data[1] .. "," .. x .. "," .. y .. "," .. z + end + return printable_node +end + +function Id_Print(string, print, debug) + local time = -msgDelay + if print == nil then print = true end + if debug == nil then debug = false end + print_history = print_history or Set {} + script_start = script_start or os.clock() + + if debug then + LogDebug("[LegendaryFarmer] [DEBUG] " .. string) + return + end + + + for k, _ in pairs(print_history) do + entry = Split(k, "_") + if entry and time < tonumber(entry[1]) and entry[2] == string then + time = tonumber(entry[1]) + end + end + + if print and os.clock() - script_start >= time + msgDelay then + yield("/echo [LegendaryFarmer] " .. string) + AddToSet(print_history, (os.clock() - script_start) .. "_" .. string) + end +end + +function Truncate1Dp(num) + return truncate and ("%.1f"):format(num) or num +end + +--------------------------------------------------------------------------------- +--Utility and Check Funtions +--MoveTo +function MoveTo(valuex, valuey, valuez, stopdistance, FlyOrWalk) + function MeshCheck() + function Truncate1Dp(num) + return truncate and ("%.1f"):format(num) or num + end + + local was_ready = NavIsReady() + if not NavIsReady() then + while not NavIsReady() do + LogInfo("[Debug]Building navmesh, currently at " .. Truncate1Dp(NavBuildProgress() * 100) .. "%") + yield("/wait 1") + local was_ready = NavIsReady() + if was_ready then + LogInfo("[Debug]Navmesh ready!") + end + end + else + LogInfo("[Debug]Navmesh ready!") + end + end + + MeshCheck() + if FlyOrWalk then + if TerritorySupportsMounting() then + while GetCharacterCondition(4, false) do + yield("/wait 0.1") + if GetCharacterCondition(27) then + yield("/wait 2") + else + yield('/gaction "mount roulette"') + end + end + if HasFlightUnlocked(GetZoneID()) then + PathfindAndMoveTo(valuex, valuey, valuez, true) -- flying + else + LogInfo("[MoveTo] Can't fly trying to walk.") + PathfindAndMoveTo(valuex, valuey, valuez, false) -- walking + end + else + LogInfo("[MoveTo] Can't mount trying to walk.") + PathfindAndMoveTo(valuex, valuey, valuez, false) -- walking + end + else + PathfindAndMoveTo(valuex, valuey, valuez, false) -- walking + end + while ((PathIsRunning() or PathfindInProgress()) and GetDistanceToPoint(valuex, valuey, valuez) > stopdistance) do + yield("/wait 0.3") + end + PathStop() + LogInfo("[MoveTo] Completed") +end + + +function CheckNavmeshReady() + was_ready = NavIsReady() + while not NavIsReady() do + Id_Print("Building navmesh, currently at " .. Truncate1Dp(NavBuildProgress() * 100) .. "%") + yield("/wait " .. (interval_rate * 10)) + end + if not was_ready then Id_Print("Navmesh is ready!") end +end + +function NodeMoveFly(node, force_moveto) + local force_moveto = force_moveto or false + local x = tonumber(ParseNodeDataString(node)[2]) or 0 + local y = tonumber(ParseNodeDataString(node)[3]) or 0 + local z = tonumber(ParseNodeDataString(node)[4]) or 0 + last_move_type = last_move_type or "NA" + + CheckNavmeshReady() + start_pos = Truncate1Dp(GetPlayerRawXPos()) .. + "," .. Truncate1Dp(GetPlayerRawYPos()) .. "," .. Truncate1Dp(GetPlayerRawZPos()) + if not force_moveto and ((GetCharacterCondition(4) and GetCharacterCondition(77)) or GetCharacterCondition(81)) then + last_move_type = "fly" + PathfindAndMoveTo(x, y, z, true) + else + last_move_type = "walk" + PathfindAndMoveTo(x, y, z) + end + while PathfindInProgress() do + Id_Print("[VERBOSE] Pathfinding from " .. start_pos .. " to " .. PrintNode(node) .. " in progress...", verbose) + yield("/wait " .. interval_rate) + end + Id_Print("[VERBOSE] Pathfinding complete.", verbose) +end + +function StopMoveFly() + PathStop() + while PathIsRunning() do + yield("/wait " .. interval_rate) + end +end + +function VNavMovement() -- Used to Do NOTHING While Moving + repeat + yield("/wait " .. interval_rate * 10) + until not PathIsRunning() +end + +function Dismount() + if GetCharacterCondition(77) then + local random_j = 0 + ::DISMOUNT_START:: + CheckNavmeshReady() + + local land_x + local land_y + local land_z + local i = 0 + while not land_x or not land_y or not land_z do + land_x = QueryMeshPointOnFloorX(GetPlayerRawXPos() + math.random(0, random_j), + GetPlayerRawYPos() + math.random(0, random_j), GetPlayerRawZPos() + math.random(0, random_j), false, i) + land_y = QueryMeshPointOnFloorY(GetPlayerRawXPos() + math.random(0, random_j), + GetPlayerRawYPos() + math.random(0, random_j), GetPlayerRawZPos() + math.random(0, random_j), false, i) + land_z = QueryMeshPointOnFloorZ(GetPlayerRawXPos() + math.random(0, random_j), + GetPlayerRawYPos() + math.random(0, random_j), GetPlayerRawZPos() + math.random(0, random_j), false, i) + i = i + 1 + end + NodeMoveFly("land," .. land_x .. "," .. land_y .. "," .. land_z) + + + local timeout_start = os.clock() + repeat + yield("/wait " .. interval_rate) + if os.clock() - timeout_start > timeout_threshold then + Id_Print("Failed to navigate to dismountable terrain.") + Id_Print("Trying another place to dismount...") + random_j = random_j + 1 + goto DISMOUNT_START + end + until not PathIsRunning() + + yield('/gaction "Mount Roulette"') + + timeout_start = os.clock() + repeat + yield("/wait " .. interval_rate) + if os.clock() - timeout_start > timeout_threshold then + Id_Print("Failed to dismount.") + Id_Print("Trying another place to dismount...") + random_j = random_j + 1 + goto DISMOUNT_START + end + until not GetCharacterCondition(77) + end + if GetCharacterCondition(4) then + yield('/gaction "Mount Roulette"') + repeat + yield("/wait " .. interval_rate) + until not GetCharacterCondition(4) + end +end + +function CrystalCheck() + if crystal_check then + Id_Print("[LegendaryFarmer] Current Crystals/Clusters in Inventory") + Id_Print("***Fire Crystals/Clusters:" .. GetItemCount(8) .. "/ " .. GetItemCount(14)) + Id_Print("***Wind Crystals:" .. GetItemCount(10) .. "/ " .. GetItemCount(16)) + Id_Print("***Earth Crystals:" .. GetItemCount(11) .. "/ " .. GetItemCount(17)) + Id_Print("***Lightning Crystals:" .. GetItemCount(12) .. "/ " .. GetItemCount(18)) + + if ((GetItemCount(8) > 9900) or (GetItemCount(10) > 9900) or (GetItemCount(11) > 9900) or (GetItemCount(12) > 9900)) then + Id_Print("***This maybe good time to dump your crystals to your retainers or MB") + end + end +end + +--window closing functions +function getOutOfGathering() + while GetCharacterCondition(6) or GetCharacterCondition(42) do + yield("/wait " .. interval_rate * 13) + yield("/echo waiting to disable GBR") + yield("/callback Gathering true -1") + yield("/wait " .. interval_rate * 2) + yield("/callback GatheringMasterpiece true -1") + end +end + +-------------------------------------------------------------------------------------------------------------- +--Pathing Functions to certain locations retainers and scrips +function PathToScrip() + if additional_scrip_exchange then + local x = paths_to_scrip[4][1] + local y = paths_to_scrip[4][2] + local z = paths_to_scrip[4][3] + + local zoneid = paths_to_scrip[4][4] + yield("/vnav stop") + + yield("/tp " .. additional_scrip_exchange_location) + yield("/wait " .. interval_rate * 15) + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + yield("/wait " .. interval_rate * 10) + yield("/li " .. additional_scrip_exchange_sublocation) + yield("/wait " .. interval_rate * 30) + MoveTo(x, y, z, 0.1, false) + yield("/wait " .. interval_rate * 10) + else + if return_to_gc_town then + yield("/return") + yield("/wait " .. interval_rate * 10) + else + TeleportToGCTown() + end + + + local gc_no = GetPlayerGC() + if gc_no == 1 then + local zoneid = paths_to_scrip[1][4] + local x = paths_to_scrip[1][1] + local y = paths_to_scrip[1][2] + local z = paths_to_scrip[1][3] + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + --yield("/wait " .. interval_rate * 20) + --yield("/li hawkers") + yield("/wait " .. interval_rate * 50) + PathfindAndMoveTo(x, y, z, false) + elseif gc_no == 2 then + local zoneid = paths_to_scrip[2][4] + local x = paths_to_scrip[2][1] + local y = paths_to_scrip[2][2] + local z = paths_to_scrip[2][3] + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + yield("/li leatherworker") + yield("/wait " .. interval_rate * 50) + PathfindAndMoveTo(x, y, z, false) + elseif gc_no == 3 then + local zoneid = paths_to_scrip[3][4] + local x = paths_to_scrip[3][1] + local y = paths_to_scrip[3][2] + local z = paths_to_scrip[3][3] + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + yield("/li sapphire") + yield("/wait " .. interval_rate * 50) + PathfindAndMoveTo(x, y, z, false) + end + yield("/wait " .. interval_rate) + if PathIsRunning() then + repeat + yield("/wait " .. interval_rate) + until not PathIsRunning() + end + end +end + +function PathToMB() + if additional_scrip_exchange then + local x = paths_to_mb[4][1] + local y = paths_to_mb[4][2] + local z = paths_to_mb[4][3] + + local zoneid = paths_to_mb[4][4] + yield("/vnav stop") + + yield("/tp " .. additional_scrip_exchange_location) + yield("/wait " .. interval_rate * 15) + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + yield("/wait " .. interval_rate * 10) + yield("/li " .. additional_scrip_exchange_sublocation) + yield("/wait " .. interval_rate * 30) + MoveTo(x, y, z, 0.1, false) + yield("/wait " .. interval_rate * 10) + else + if return_to_gc_town then + yield("/return") + yield("/wait " .. interval_rate * 10) + else + TeleportToGCTown() + end + + + local gc_no = GetPlayerGC() + if gc_no == 1 then + local zoneid = paths_to_mb[1][4] + local x = paths_to_mb[1][1] + local y = paths_to_mb[1][2] + local z = paths_to_mb[1][3] + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + --yield("/wait " .. interval_rate * 20) + --yield("/li hawkers") + yield("/wait " .. interval_rate * 50) + PathfindAndMoveTo(x, y, z, false) + elseif gc_no == 2 then + local zoneid = paths_to_mb[2][4] + local x = paths_to_mb[2][1] + local y = paths_to_mb[2][2] + local z = paths_to_mb[2][3] + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + yield("/li leatherworker") + yield("/wait " .. interval_rate * 50) + PathfindAndMoveTo(x, y, z, false) + elseif gc_no == 3 then + local zoneid = paths_to_mb[3][4] + local x = paths_to_mb[3][1] + local y = paths_to_mb[3][2] + local z = paths_to_mb[3][3] + repeat + yield("/wait " .. interval_rate) + until (zoneid == GetZoneID()) and (not GetCharacterCondition(27)) and (not GetCharacterCondition(45)) and (not GetCharacterCondition(51)) + yield("/li sapphire") + yield("/wait " .. interval_rate * 50) + PathfindAndMoveTo(x, y, z, false) + end + yield("/wait " .. interval_rate) + if PathIsRunning() then + repeat + yield("/wait " .. interval_rate) + until not PathIsRunning() + end + end +end + + +-------------------------------------------------------------------------------------------------------------- +--enable and set property functions +function setSNDPropertyIfNotSet(propertyName) + if GetSNDProperty(propertyName) == false then + SetSNDProperty(propertyName, "true") + LogInfo("[SetSNDPropertys] " .. propertyName .. " set to True") + end +end + +function unsetSNDPropertyIfSet(propertyName) + if GetSNDProperty(propertyName) then + SetSNDProperty(propertyName, "false") + LogInfo("[SetSNDPropertys] " .. propertyName .. " set to False") + end +end + +--GBR enable/disable functions +function DeliverooEnable() + if not DeliverooIsTurnInRunning() then + yield("/wait " .. interval_rate * 10) + yield("/deliveroo enable") + end +end + +function GBRAutoenable() + yield("/wait " .. interval_rate) + yield("/gbr auto on") +end + +function GBRAutodisable() + yield("/wait " .. interval_rate) + yield("/vnav stop") + while (GetCharacterCondition(6) or GetCharacterCondition(42) or GetCharacterCondition(27) or GetCharacterCondition(51)) do + yield("/wait " .. interval_rate * 13) + yield("/echo waiting for gathering or teleport to be completed before disabling GBR") + end + + yield("/gbr auto off") + yield("/wait " .. interval_rate * 10) + getOutOfGathering() --incase of wrong disable + yield("/wait " .. interval_rate * 10) +end + +-------------------------------------------------------------------------------- +--Main Task Funtions +--Wrapper for using potions, and if want to consume, consume if not medicated +function UseMedicine() + if type(medicine_to_use) ~= "string" and type(medicine_to_use) ~= "table" then return end + if GetZoneID() == 1055 then return end + + if not HasStatus("Medicated") then + local timeout_start = os.clock() + local user_settings = { GetSNDProperty("UseItemStructsVersion"), GetSNDProperty("StopMacroIfItemNotFound"), + GetSNDProperty("StopMacroIfCantUseItem") } + SetSNDProperty("UseItemStructsVersion", "true") + SetSNDProperty("StopMacroIfItemNotFound", "false") + SetSNDProperty("StopMacroIfCantUseItem", "false") + repeat + if type(medicine_to_use) == "string" then + Id_Print("Attempt to use " .. medicine_to_use) + yield("/item " .. medicine_to_use) + elseif type(medicine_to_use) == "table" then + for _, medicine in ipairs(medicine_to_use) do + Id_Print("Attempting to use " .. medicine, verbose) + yield("/item " .. medicine) + yield("/wait " .. math.max(interval_rate, 1)) + if HasStatus("Medicated") then break end + end + end + + yield("/wait " .. math.max(interval_rate, 1)) + until HasStatus("Medicated") or os.clock() - timeout_start > consume_threshold + SetSNDProperty("UseItemStructsVersion", tostring(user_settings[1])) + SetSNDProperty("StopMacroIfItemNotFound", tostring(user_settings[2])) + SetSNDProperty("StopMacroIfCantUseItem", tostring(user_settings[3])) + end +end + +--Wrapper for eating food, and if want to consume, consume if not fooded +function EatFood() + if type(food_to_eat) ~= "string" and type(food_to_eat) ~= "table" then return end + if GetZoneID() == 1055 then return end + + if not HasStatus("Well Fed") then + local timeout_start = os.clock() + local user_settings = { GetSNDProperty("UseItemStructsVersion"), GetSNDProperty("StopMacroIfItemNotFound"), + GetSNDProperty("StopMacroIfCantUseItem") } + SetSNDProperty("UseItemStructsVersion", "true") + SetSNDProperty("StopMacroIfItemNotFound", "false") + SetSNDProperty("StopMacroIfCantUseItem", "false") + repeat + if type(food_to_eat) == "string" then + Id_Print("Attempt to eat " .. food_to_eat) + yield("/item " .. food_to_eat) + elseif type(food_to_eat) == "table" then + for _, food in ipairs(food_to_eat) do + Id_Print("Attempting to eat " .. food, verbose) + yield("/item " .. food) + yield("/wait " .. math.max(interval_rate, 1)) + if HasStatus("Well Fed") then break end + end + end + + yield("/wait " .. math.max(interval_rate, 1)) + until HasStatus("Well Fed") or os.clock() - timeout_start > consume_threshold + SetSNDProperty("UseItemStructsVersion", tostring(user_settings[1])) + SetSNDProperty("StopMacroIfItemNotFound", tostring(user_settings[2])) + SetSNDProperty("StopMacroIfCantUseItem", tostring(user_settings[3])) + end +end + +--function to take care of repair, materia extract and aetherial reduction +function RepairExtractReduceCheck() + if GetZoneID() == 1055 then return true end + + function SelfRepair() + if do_repair and NeedsRepair(RepairAmount) then + StopMoveFly() + if GetCharacterCondition(4) then + Id_Print("Attempting to dismount...") + Dismount() + end + while not IsAddonVisible("Repair") do + yield("/generalaction repair") + yield("/wait " .. interval_rate * 5) + end + yield("/callback Repair true 0") + yield("/wait " .. interval_rate) + if GetNodeText("_TextError", 1) == "You do not have the dark matter required to repair that item." and + IsAddonVisible("_TextError") then + LogInfo("[LegendaryFarmer] Set to False not enough dark matter") + end + if IsAddonVisible("SelectYesno") then + yield("/callback SelectYesno true 0") + end + while GetCharacterCondition(39) do + yield("/wait " .. interval_rate * 10) + end + yield("/wait " .. interval_rate * 10) + if IsAddonVisible("Repair") then + yield("/callback Repair true -1") + end + Id_Print("[LegendaryFarmer] Repair Completed") + end + end + + SelfRepair() + function MateriaExtract() + if do_extract and CanExtractMateria(100) then + StopMoveFly() + if GetCharacterCondition(4) then + Id_Print("[LegendaryFarmer] Attempting to dismount...") + Dismount() + end + Id_Print("Attempting to extract materia...") + yield("/generalaction \"Materia Extraction\"") + yield("/waitaddon Materialize") + + while CanExtractMateria(100) == true do + yield("/callback Materialize true 2 0") + yield("/wait " .. interval_rate * 5) + if IsAddonVisible("MaterializeDialog") then + yield("/callback MaterializeDialog true 0") + end + while GetCharacterCondition(39) do + yield("/wait " .. interval_rate * 30) + end + yield("/wait " .. interval_rate * 20) + end + + yield("/wait " .. interval_rate * 10) + yield("/callback Materialize true -1") + Id_Print("Materia extraction complete!") + end + end + + MateriaExtract() + + function HasReducibles() + while not IsAddonVisible("PurifyItemSelector") and not IsAddonReady("PurifyItemSelector") do + yield('/gaction "Aetherial Reduction"') + local timeout_start = os.clock() + repeat + yield("/wait " .. interval_rate) + until IsNodeVisible("PurifyItemSelector", 1, 6) or IsNodeVisible("PurifyItemSelector", 1, 7) or os.clock() - timeout_start > timeout_threshold + end + yield("/wait " .. interval_rate) + local visible = IsNodeVisible("PurifyItemSelector", 1, 7) and not IsNodeVisible("PurifyItemSelector", 1, 6) + while IsAddonVisible("PurifyItemSelector") do + yield('/gaction "Aetherial Reduction"') + local timeout_start = os.clock() + repeat + yield("/wait " .. interval_rate) + until not IsAddonVisible("PurifyItemSelector") or os.clock() - timeout_start >= timeout_threshold + end + return not visible + end + + --if HasReducibles() then yield("/echo has reducible") end --debug statement + + if do_reduce and HasReducibles() and GetInventoryFreeSlotCount() < num_inventory_free_slot_threshold then + StopMoveFly() + if GetCharacterCondition(4) then + Id_Print("Attempting to dismount...") + Dismount() + end + Id_Print("Attempting to perform aetherial reduction...") + repeat + yield('/gaction "Aetherial Reduction"') + local timeout_start = os.clock() + repeat + yield("/wait " .. interval_rate) + until IsNodeVisible("PurifyItemSelector", 1, 6) or IsNodeVisible("PurifyItemSelector", 1, 7) or os.clock() - timeout_start > timeout_threshold + until IsAddonVisible("PurifyItemSelector") and IsAddonReady("PurifyItemSelector") + yield("/wait " .. interval_rate) + while not IsNodeVisible("PurifyItemSelector", 1, 7) and IsNodeVisible("PurifyItemSelector", 1, 6) do + yield("/callback PurifyItemSelector true 12 0") + repeat + yield("/wait " .. interval_rate * 5) + until not GetCharacterCondition(39) + end + while IsAddonVisible("PurifyItemSelector") do + yield('/gaction "Aetherial Reduction"') + local timeout_start = os.clock() + repeat + yield("/wait " .. interval_rate) + until not IsAddonVisible("PurifyItemSelector") or os.clock() - timeout_start >= timeout_threshold + end + Id_Print("Aetherial reduction complete!") + end + + return true +end + +function DoAR() + if ARRetainersWaitingToBeProcessed(all_characters) and do_ar then + timeout_start = os.clock() + if PathIsRunning() then + repeat + yield("/wait " .. interval_rate) + until ((not PathIsRunning()) and IsPlayerAvailable()) or (os.clock() - timeout_start > timeout_threshold) + yield("/wait " .. interval_rate) + yield("/vnavmesh stop") + end + + if not IsPlayerAvailable() then + timeout_start = os.clock() + repeat + yield("/wait " .. interval_rate) + until IsPlayerAvailable() or (os.clock() - timeout_start > timeout_threshold) + end + PathToMB() + yield("/wait " .. interval_rate * 3) + yield("/target Summoning Bell") + yield("/wait " .. interval_rate * 3) + + if GetTargetName() == "Summoning Bell" and GetDistanceToTarget() <= 4.5 then + yield("/interact") + yield("/ays multi") + yield("/wait " .. interval_rate) + yield("/ays e") + LogInfo("[LegendaryFarmer] AR Started") + while ARRetainersWaitingToBeProcessed(all_characters) do + yield("/wait " .. interval_rate) + end + else + yield("No Summoning Bell") + end + yield("/wait " .. interval_rate * 100) + if IsAddonVisible("RetainerList") then + yield("/callback RetainerList true -1") + yield("/wait " .. interval_rate) + end + + if GetTargetName() ~= "" then + ClearTarget() + end + yield("/wait " .. interval_rate) + yield("/ays multi") + end +end + +function DoGCTurnin() + if do_gc_delivery then + if PathIsRunning() then + yield("/wait " .. interval_rate) + yield("/vnavmesh stop") + end + if not IsPlayerAvailable() then + repeat + yield("/wait " .. interval_rate) + until IsPlayerAvailable() + end + yield("/wait " .. interval_rate * 5) + local gc_no = GetPlayerGC() + local zoneid = paths_to_mb[gc_no][4] + + yield("/li gc") + while (not IsInZone(zoneid)) and (not GetCharacterCondition(37)) do + yield("/wait " .. interval_rate) + end + yield("/wait " .. interval_rate * 40) + VNavMovement() + yield("/wait " .. interval_rate * 200) + LogInfo("[LegendaryFarmer] Reached Player's GC") + DeliverooEnable() + while DeliverooIsTurnInRunning() do + yield("/wait " .. interval_rate * 10) + end + yield("/echo [LegendaryFarmer] Turnins done!") + end +end + +--------------------------------------------------------------------------------- +function CollectableAppraiser() + while not IsAddonVisible("CollectablesShop") and not IsAddonReady("CollectablesShop") do + if GetTargetName() ~= "Collectable Appraiser" then + yield("/target Collectable Appraiser") + elseif not IsAddonVisible("SelectIconString") then + yield("/interact") + else + yield("/callback SelectIconString true 0") + end + yield("/wait " .. interval_rate) + end + yield("/wait " .. interval_rate * 10) + + + local orange_scrips_raw = GetNodeText("CollectablesShop", 39, 1):gsub(",", ""):match("^([%d,]+)/") + local purple_scrips_raw = GetNodeText("CollectablesShop", 38, 1):gsub(",", ""):match("^([%d,]+)/") + + local orange_scrips = tonumber(orange_scrips_raw) + local purple_scrips = tonumber(purple_scrips_raw) + + if (orange_scrips < scrip_overcap_limit) or (purple_scrips < scrip_overcap_limit) then + for i, item in ipairs(collectible_item_table) do + local collectible_to_turnin_row = item[1] + local collectible_item_id = item[2] + local job_for_turnin = item[3] + local turnins_scrip_type = item[4] + yield("Turnin in: " .. collectible_item_id) + if GetItemCount(collectible_item_id) > 0 then + yield("/callback CollectablesShop true 14 " .. job_for_turnin) + yield("/wait " .. interval_rate) + yield("/callback CollectablesShop true 12 " .. collectible_to_turnin_row) + yield("/wait " .. interval_rate) + scrips_owned = tonumber(GetNodeText("CollectablesShop", turnins_scrip_type, 1):gsub(",", ""):match( + "^([%d,]+)/")) + while (scrips_owned <= scrip_overcap_limit) and (not IsAddonVisible("SelectYesno")) and (GetItemCount(collectible_item_id) > 0) do + --iyield("ITEM: " .. collectible_item_id .. " Qty: " .. GetItemCount(collectible_item_id)) + yield("/callback CollectablesShop true 15 0") + yield("/wait " .. interval_rate * 2) + scrips_owned = tonumber(GetNodeText("CollectablesShop", turnins_scrip_type, 1):gsub(",", ""):match( + "^([%d,]+)/")) + end --will break if either orange or purple scrip limit cap reached + yield("/wait " .. interval_rate) + end + yield("/wait " .. interval_rate) + if IsAddonVisible("SelectYesno") then + yield("/callback SelectYesno true 1") + break + end + end + end + yield("/wait " .. interval_rate) + yield("/callback CollectablesShop true -1") + + if GetTargetName() ~= "" then + ClearTarget() + yield("/wait " .. interval_rate) + end +end + +function ScripExchange() + --EXCHANGE OPEN-- + while not IsAddonVisible("InclusionShop") and not IsAddonReady("InclusionShop") do + if GetTargetName() ~= "Scrip Exchange" then + yield("/target Scrip Exchange") + elseif not IsAddonVisible("SelectIconString") then + yield("/interact") + else + yield("/callback SelectIconString true 0") + end + yield("/wait " .. interval_rate) + end + + yield("/wait " .. interval_rate * 10) + + --EXCHANGE CATEGORY-- + for i, reward in ipairs(exchange_item_table) do + local scrip_exchange_category = reward[1] + local scrip_exchange_subcategory = reward[2] + local scrip_exchange_item_to_buy_row = reward[3] + local collectible_scrip_price = reward[4] + yield("Price:" .. collectible_scrip_price) + + yield("/wait " .. interval_rate * 5) + yield("/callback InclusionShop true 12 " .. scrip_exchange_category) + yield("/wait " .. interval_rate) + yield("/callback InclusionShop true 13 " .. scrip_exchange_subcategory) + yield("/wait " .. interval_rate) + + --EXCHANGE PURCHASE-- + scrips_owned_str = GetNodeText("InclusionShop", 21):gsub(",", "") + scrips_owned = tonumber(scrips_owned_str) + if scrips_owned >= min_scrip_for_exchange then + scrip_shop_item_row = scrip_exchange_item_to_buy_row + 21 + scrip_item_number_to_buy = scrips_owned // collectible_scrip_price + local scrip_item_number_to_buy_final = math.min(scrip_item_number_to_buy, 99) + yield("/callback InclusionShop true 14 " .. + scrip_exchange_item_to_buy_row .. " " .. scrip_item_number_to_buy_final) + yield("/wait " .. interval_rate * 5) + if IsAddonVisible("ShopExchangeItemDialog") then + yield("/callback ShopExchangeItemDialog true 0") + yield("/wait " .. interval_rate) + end + end + end + --EXCHANGE CLOSE-- + yield("/wait " .. interval_rate) + yield("/callback InclusionShop true -1") + + if GetTargetName() ~= "" then + ClearTarget() + yield("/wait " .. interval_rate) + end +end + +function CanTurnin() + local flag = false + for i, item in ipairs(collectible_item_table) do + local collectible_item_id = item[2] + if GetItemCount(collectible_item_id) >= min_items_before_turnins then + flag = true --turnin even if one item is available for turnins + end + end + return flag +end + +function CollectableAppraiserScripExchange() + if IsPlayerAvailable() and do_scrips then + PathToScrip() + yield("/wait " .. interval_rate * 20) + while CanTurnin() do + CollectableAppraiser() + yield("/wait " .. interval_rate * 20) + ScripExchange() + yield("/wait " .. interval_rate * 20) + end + yield("/wait " .. interval_rate * 10) + ScripExchange() + end +end + +--------------------------------------------------------------------------------- +function Main() + ----------------------------------------------------------------------------- + i_count = tonumber(GetInventoryFreeSlotCount()) + --wait while gathering status + while (not (i_count < num_inventory_free_slot_threshold)) and (not CanExtractMateria(100)) do + yield("/wait " .. interval_rate * 300) + i_count = tonumber(GetInventoryFreeSlotCount()) + yield("/echo [LegendaryFarmer] Gathering...") + yield("/echo [LegendaryFarmer] Slots Remaining: " .. i_count) + + if do_ar and (ARRetainersWaitingToBeProcessed(all_characters)) then + break + yield("/echo [LegendaryFarmer] Stopping to Process Retainers...") + end + end + --------------------------------------------------------------------------------- + + --waiting to complete last bit of gathering status + if (GetCharacterCondition(6) or GetCharacterCondition(42)) then + yield("/wait " .. interval_rate * 24) + end + + yield("/echo [LegendaryFarmer] Disabling GBR to process additional enabled tasks") + yield("/echo [LegendaryFarmer] Food/Potion Check, Extract/Repair, Reduce/Scrips and Retainers/GC Turnins") + GBRAutodisable() + yield("/wait " .. interval_rate * 80) + CrystalCheck() + + --On site tasks + yield("/wait " .. interval_rate * 10) + Dismount() + yield("/wait " .. interval_rate * 10) + RepairExtractReduceCheck() + yield("/wait " .. interval_rate * 10) + UseMedicine() + yield("/wait " .. interval_rate * 10) + EatFood() + yield("/wait " .. interval_rate * 10) + + --Off Site/Requiring TP tasks + --Do Scrip Exchange + i_count = tonumber(GetInventoryFreeSlotCount()) + if i_count < num_inventory_free_slot_threshold then + yield("/echo [LegendaryFarmer] Moving to do Collectable Appraiser and Scrip Exchnage") + CollectableAppraiserScripExchange() + end + yield("/wait " .. interval_rate * 20) + --Do Retainers using AR + if (ARRetainersWaitingToBeProcessed(all_characters) and do_ar) then + yield("/echo [LegendaryFarmer] AR required") + DoAR() + yield("/wait " .. interval_rate * 24) + if do_gc_delivery then + yield("/echo [LegendaryFarmer] GCTurins required") + yield("/wait " .. interval_rate * 24) + DoGCTurnin() + yield("/wait " .. interval_rate * 50) + end + end + + ----------------------------------------------------------------------------------- + --Renable GBR status + yield("/wait " .. interval_rate * 25) + yield("/echo [LegendaryFarmer] Reanable GBR Auto and start gathering again!") + if use_gbr then + GBRAutoenable() + end + ------------------------------------------------------------------------------- +end + +----------------------------------------------------------------------------------- +--***STARTING THE SCRIPT***----- +-------------------------------- +--starting GBR at start of the script +i_count = tonumber(GetInventoryFreeSlotCount()) +GBRAutodisable() +yield("/wait " .. interval_rate * 10) +Dismount() +yield("/wait " .. interval_rate * 10) +yield("/echo [LegendaryFarmer] Starting GBR-Legendary Farmer for Gathering & Support Tasks") +yield("/wait " .. interval_rate * 10) +CrystalCheck() +RepairExtractReduceCheck() +yield("/wait " .. interval_rate * 10) +UseMedicine() +yield("/wait " .. interval_rate * 10) +EatFood() +yield("/wait " .. interval_rate * 10) +--inventory after reduce +i_count = tonumber(GetInventoryFreeSlotCount()) +if (i_count < num_inventory_free_slot_threshold) and CanTurnin() then + yield("/echo [LegendaryFarmer] Moving to do Collectable Appraiser and Scrip Exchange") + CollectableAppraiserScripExchange() + yield("/wait " .. interval_rate * 30) +end + +if use_gbr then + GBRAutoenable() +end +--------------------------------------------------------- +--***MAIN CHARACTER LOOP***------------------------------ +setSNDPropertyIfNotSet("UseSNDTargeting") +unsetSNDPropertyIfSet("StopMacroIfTargetNotFound") +while not stop_main do + i_count = tonumber(GetInventoryFreeSlotCount()) + yield("/echo [LegendaryFarmer] Going into Gathering Mode") + yield("/wait " .. interval_rate) + Main() + loop = loop + 1 + yield("/echo [LegendaryFarmer] cycle count " .. loop) + yield("/wait " .. interval_rate) +end +---------------------------------------------------------- diff --git a/Community Scripts/Gathering/lv9Fishinggear_McVaxius.lua b/Community Scripts/Gathering/lv9Fishinggear_McVaxius.lua index 328ff7cf..8f3eda2b 100644 --- a/Community Scripts/Gathering/lv9Fishinggear_McVaxius.lua +++ b/Community Scripts/Gathering/lv9Fishinggear_McVaxius.lua @@ -1,6 +1,23 @@ ---config. ---you need navmesh, pandora, teleporter, lifestream, somethingeeddoing, textadvance, yesalready ---and yesalready. setup yesalready to auto accept any purchases from npcs ;o +--[[ +Usage: +You have finished the first fishin quest and are level 10. +Talk to sissipoo to complete fisher quest 1 +Talk to Roegadyn next to her to get ocean fishing quest. +now run the sccript and enjoy. (I hope you read the below config requirements). + + +config. +you need navmesh, pandora, teleporter, lifestream, somethingeeddoing, textadvance, yesalready +and yesalready. setup yesalready to auto accept any purchases from npcs ;o +to do the auto purchase, just make 2 entries with + +/Buy.*/ +and include target specific, and put the two npcs names +Iron Thunder +and for the 2nd one, +Syneyhil + +--]] function visland_stop_moving() yield("/equipguud") diff --git a/Community Scripts/Misc/frenrider_McVaxius.lua b/Community Scripts/Misc/frenrider_McVaxius.lua index a1cb69c6..1604546a 100644 --- a/Community Scripts/Misc/frenrider_McVaxius.lua +++ b/Community Scripts/Misc/frenrider_McVaxius.lua @@ -99,6 +99,8 @@ clingtype = ini_check("clingtype", 0) -- Clingtype, 0 = navmesh, 1 = vislan clingtypeduty = ini_check("clingtypeduty", 2) -- do we need a diff clingtype in duties? use same numbering as above maxbistance = ini_check("maxbistance", 50) -- Max distance from fren that we will actually chase them, so that we dont get zone hopping situations ;p limitpct = ini_check("limitpct", -1) -- What percentage of life on target should we use LB at. It will automatically use LB3 if that's the cap or it will use LB2 if that's the cap, -1 disables it +rotationplogon = ini_check("rotationplogon", "RSR") -- Which plogon for rotations? valid options are BMR, VBM, RSR +autorotationtype = ini_check("autorotationtype", "xan") -- If we are using BossMod rotation, what preset name shall we use? use "none" to manually configure it yourself. keep in mind you have to make the rotation and name it in the first place. "xan" is what i call mine rotationtype = ini_check("rotationtype", "Auto") -- What RSR type shall we use? Auto or Manual are common ones to pick. if you choose "none" it won't change existing setting. bossmodAI = ini_check("bossmodAI", "on") -- do we want bossmodAI to be "on" or "off" xpitem = ini_check("xpitem", 0) -- xp item - attemp to equip whenever possible azyma_earring = 41081 btw, if this value is 0 it won't do anything @@ -154,8 +156,19 @@ yield("/wait 0.5") yield("/vbmai "..bossmodAI) yield("/bmrai "..bossmodAI) -if rotationtype ~= "none" then - yield("/rotation "..rotationtype) +--rotation handling +if rotationplogon == "BMR" or rotationplogon == "VBM" then + yield("/rotation cancel") --turn off RSR + if autorotationtype ~= "none" then + yield("/vbm ar set "..autorotationtype) + yield("/bmr ar set "..autorotationtype) + end +end +if rotationplogon == "RSR" or rotationplogon == "VBM" then + yield("/bmr ar toggle") --turn off Boss Mod + if rotationtype ~= "none" then + yield("/rotation "..rotationtype) + end end if fulftype ~= "unchanged" then @@ -383,6 +396,8 @@ while weirdvar == 1 do TargetClosestEnemy() --end yield("/send KEY_2") + flandom = getRandomNumber(1,3) + if flandom == 1 then yield("/send E") end yield("/wait 0.5") end end @@ -423,12 +438,12 @@ while weirdvar == 1 do --seems like max lb is 1013040 when ultimate weapon buffs you to lb3 but you only have 30k on your bar O_o --anyways it will trigger if lb3 is ready or when lb2 is max and it hits lb2 if (GetLimoot == (GetLimitBreakBarCount() * GetLimitBreakBarValue())) or GetLimoot > 29999 then - yield("/rotation Cancel") + --yield("/rotation Cancel") --dont do this yield("/echo Attempting "..local_teext) yield("/ac "..local_teext) end if GetLimoot < GetLimitBreakBarCount() * GetLimitBreakBarValue() then - yield("/rotation auto") + --yield("/rotation auto") end --yield("/echo limitpct "..limitpct.." HPP"..GetTargetHPP().." HP"..GetTargetHP().." get limoot"..GetLimitBreakBarCount() * GetLimitBreakBarValue()) --debug line end diff --git a/Community Scripts/Quests And Levelling/Costa Del Sol and Quarrymill Leves/CostaDelSolLeve_McVaxius.lua b/Community Scripts/Quests And Levelling/Costa Del Sol and Quarrymill Leves/CostaDelSolLeve_McVaxius.lua index 04df40ac..ded085bc 100644 --- a/Community Scripts/Quests And Levelling/Costa Del Sol and Quarrymill Leves/CostaDelSolLeve_McVaxius.lua +++ b/Community Scripts/Quests And Levelling/Costa Del Sol and Quarrymill Leves/CostaDelSolLeve_McVaxius.lua @@ -2,6 +2,26 @@ --put the sea pickles into chocobo --turnoff addon errors + +--beter code for handling leves thanks to mootykins https://discord.com/channels/1001823907193552978/1196163718216679514/1275953553088708700 +--[[ +local known_quests = { + ["A Recipe for Disaster"] = 778, + ["Just Call Me Late for Dinner"] = 779, + ["Kitchen Nightmares No More"] = 780, + ["The Blue Period"] = 781 +} + +function checkingu_node() + local quest_name = GetNodeText("GuildLeve", 11, 40, 4) + yield("/echo Node Text -> "..quest_name) + local quest_id = known_quests[quest_name] + if quest_id then + yield("/callback JournalDetail true 3 " .. quest_id) + end +end +--]] + function visland_stop_moving() yield("/equipguud") yield("/equiprecommended") diff --git a/SomethingNeedDoing/Misc/Commands/WorldStateCommands.cs b/SomethingNeedDoing/Misc/Commands/WorldStateCommands.cs index e9ec8a3f..e1d1c23d 100644 --- a/SomethingNeedDoing/Misc/Commands/WorldStateCommands.cs +++ b/SomethingNeedDoing/Misc/Commands/WorldStateCommands.cs @@ -61,12 +61,16 @@ public unsafe ushort GetNearestFate() => FateManager.Instance()->Fates.AsSpan(). .FirstOrDefault(); public unsafe bool IsInFate() => FateManager.Instance()->CurrentFate is not null; + public unsafe int GetFateStartTimeEpoch(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->StartTimeEpoch; public unsafe float GetFateDuration(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->Duration; + public unsafe string GetFateName(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->Name.ToString(); public unsafe float GetFateHandInCount(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->HandInCount; public unsafe float GetFateLocationX(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->Location.X; public unsafe float GetFateLocationY(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->Location.Y; public unsafe float GetFateLocationZ(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->Location.Z; public unsafe float GetFateProgress(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->Progress; + public unsafe bool GetFateIsBonus(ushort fateID) => FateManager.Instance()->GetFateById(fateID)->IsBonus; + public unsafe uint GetFateNpcObjectId(ushort fateID) => FateManager.Instance()->FateDirector->FateNpcObjectId; #endregion public float DistanceBetween(float x1, float y1, float z1, float x2, float y2, float z2) => Vector3.DistanceSquared(new Vector3(x1, y1, z1), new Vector3(x2, y2, z2));