diff --git a/Community Scripts/Dungeons/Alex - Burden of Father [A4N] -- 15-30fps Edition.lua b/Community Scripts/Dungeons/Alex - Burden of Father [A4N] -- 15-30fps Edition.lua new file mode 100644 index 00000000..fcce9cd2 --- /dev/null +++ b/Community Scripts/Dungeons/Alex - Burden of Father [A4N] -- 15-30fps Edition.lua @@ -0,0 +1,193 @@ +--[[ +FPS Rate Version: 15-30 +This is meant to be used for Alexander - The Burden of the Father (NORMAL NOT SAVAGE) +It's setup to where you should be able to loop it as many time as you want, and be able to farm mats for GC seals +Known classes to work: ALL +Version: 3.0 +Created by: Ice, Class Support: Ellipsis + +Creators note: thank you Ellipsis for getting all the classes working, you did an amazing job. You deserve the credit here. + +Plugins that are used are: +-> Visland (for pathing) +-> Pandora (Setting "Open Chest") +-> RotationSolver +]] + +-- How many loops do you wanna do +NumberofLoops = 30 + +--Visland Loops +Alex_Start = "H4sIAAAAAAAACk2PW2vDMAyF/4ueTXCyNJv9VrYO8tDdIVvHKKbVqKG2Rq3uQsh/nxJctjcd6dPRUQ83LiBYmO/xe12vH0FB534+yEdOYF97uKPk2VME28MzWF3oqrmYmaY2Cl7AlrqY1ea8qhWswJrCNGdaV4MoitheyYKCB7f1R3ErCxFL+sSAkadJGxkPbsOd591tpv/3cjgJlXb0dZpIGnF7d/uEf/gUsVSwCMSnwy1jyOV8IrK4P2LiXI/GnfPjt9lxVNd0uKS4zZ8LNjaffMClcHp4G34B1YIamzkBAAA=" +Alex_Chest = "H4sIAAAAAAAACuWQSWvDMBCF/0qZsyMkR7It3UIX8CHdCLgLJYhkTASxVWy5C8b/vYpj40ALvRZ605t5enr6WrjWBYKCxR4/1ny9ggAy/flqTelqUM8t3NraOGNLUC08gAqJFDGXEQ/gERSjJKJcijCAJ1AzQZKEJiHrvLQlphegaAD3emsaH8aIF0v7hgWWrt+kpcNKb1xm3O5mcJ/Ohm6+U72z7+PGl/Fpud7XONn7hiyAy8K68eHUYTEcF71jEHcN1m44H4IzbdyUeFBXtjq35Xb4OD0OV6bApffRLviGZUYJo5IyGU9kBOeRkEcykgjJEhH/QzIhoaHkyURlLrk4UonIPJpTmZxQ4YfdyMVf/Y0Ljz3hH8i4CnXdVHi2sXmO1Z8D9dJ9Ad/rgrl7AwAA" + +-- Values that are needed for the whole script +CurrentLoop = 1 -- This is just the loop counter itself, keeps tracks of how many you've done. +DutyCounter = 0 +DutyFail = 0 + +::LoopTest:: +if NumberofLoops >= CurrentLoop then + yield("/echo Loop: "..CurrentLoop.." out of ".. NumberofLoops) +elseif NumberofLoops < CurrentLoop then + goto StopLoop +end + +::DutyFinder:: +if DutyFail == 4 then + goto StopLoop + +elseif DutyCounter == 0 then -- Initially setting up duty to loop Alexander - Burden of the Father (A4N) + yield("/visland resume") + yield("/visland stop") + yield("/dutyfinder") + yield("/wait 2") + +-- Setting up Unsync if it wasn't already + yield("/pcall ContentsFinder True 15") + yield("/wait 2") + yield("/pcall ContentsFinderSetting True 1 1 1") + yield("/wait 2") + yield("/pcall ContentsFinderSetting True 0") + yield("/wait 2") + + yield("/pcall ContentsFinder True 12 1") -- Clearing out any old duties + yield("/wait 2") + OpenRegularDuty(115) + yield("/wait 1") + yield("/send NUMPAD0") + yield("/wait 1") + yield("/send NUMPAD0") + + yield("/pcall ContentsFinder True 12 0") + DutyCounter = DutyCounter + 1 + yield("/wait 2.0") +elseif DutyCounter == 1 then -- Quicker menu'ing here to load in + yield("/visland resume") + yield("/visland stop") + yield("/dutyfinder") --Open Duty Finder + yield("/wait 2") + yield("/pcall ContentsFinder True 12 0") --Duty Load + yield("/wait 2") +elseif DutyCounter == 2 then + yield("/echo Hmm... it seems like this has failed, so going to reset it") + DutyCounter = 0 + DutyFail = DutyFail + 1 + goto DutyFinder +end + + +::DutyCommence:: +yield("/click duty_commence") +yield("/wait 3") + +while GetCharacterCondition(45) do + yield("/wait 1") +end + +::Start:: +if IsInZone(445) then + yield("/wait 1") +end + +while IsAddonVisible("_Image") == false do + yield("/wait 1") +end + +::BattleInitialize:: +manip_phase = 0 + +if GetCharacterCondition(26, false) +then +-- Target selection and movement logic + local current_target = GetTargetName() + if not current_target or current_target == "" then + yield("/targetenemy") -- Attempt to auto-target the next enemy + current_target = GetTargetName() + if current_target == "" then + yield("/wait 0.5") -- Wait for a longer period if no target is found + end + end + -- This wait might be too long for fast-paced combat scenarios; adjust as needed + + local enemy_max_dist = 40 + local dist_to_enemy = GetDistanceToTarget() + if dist_to_enemy and dist_to_enemy > 0 then + if dist_to_enemy <= enemy_max_dist then + local enemy_x = GetTargetRawXPos() + local enemy_y = GetTargetRawYPos() + local enemy_z = GetTargetRawZPos() + yield("/visland moveto " .. enemy_x .. " " .. enemy_y .. " " .. enemy_z) + yield("/wait 1") + --yield("/send KEY_1") + yield("/rotation manual") + yield("/wait 5") -- Adjust wait time as necessary for movement completion + yield("/visland stop") -- Stop movement after reaching near the target +end + end +end + +::StartofBattle:: + +yield("/wait 0.5") +--rotation + +while GetCharacterCondition(26) do + yield("/wait 1") + -- Target selection and movement logic + local current_target = GetTargetName() + if not current_target or current_target == "" then + yield("/targetenemy") -- Attempt to auto-target the next enemy + current_target = GetTargetName() + if current_target == "" then + yield("/wait 0.5") -- Wait for a longer period if no target is found +end-- This wait might be too long for fast-paced combat scenarios; adjust as needed + end + local enemy_max_dist = 40 + local dist_to_enemy = GetDistanceToTarget() + if dist_to_enemy and dist_to_enemy > 0 then + if dist_to_enemy <= enemy_max_dist then + local enemy_x = GetTargetRawXPos() + local enemy_y = GetTargetRawYPos() + local enemy_z = GetTargetRawZPos() + yield("/visland moveto " .. enemy_x .. " " .. enemy_y .. " " .. enemy_z) + yield("/wait 2.5") -- Adjust wait time as necessary for movement completion + yield("/visland stop") -- Stop movement after reaching near the target + end + end +end +-- This section might need an additional command to re-target or adjust positioning +-- if the enemy is beyond the max distance, depending on your needs. + +yield ("/wait 4") + +if (not GetCharacterCondition(26)) then +yield("/rotation cancel") +yield("/visland exectemponce "..Alex_Chest) +end + +yield("/wait 2") + +while IsMoving() do +yield("/wait 1") +end + +CurrentLoop = CurrentLoop + 1 +yield("/echo Leaving the instance") +yield("/wait 0.3") +yield("/pdfleave") +yield("/wait 1") + +while GetCharacterCondition(45) do + yield("/wait 1") + yield("/echo Transitioning") +end + +goto LoopTest + +::StopLoop:: +if DutyFail < 4 then + yield("/echo Alex Looping has completed") +elseif DutyFail >= 4 then + yield("/echo It seems like it's failed, maybe lag?") +end \ No newline at end of file diff --git a/Community Scripts/Dungeons/Alexander - Burden of Father (A4n) Farming.lua b/Community Scripts/Dungeons/Alex - Burden of Father [A4N] -- 60fps Edition.lua similarity index 56% rename from Community Scripts/Dungeons/Alexander - Burden of Father (A4n) Farming.lua rename to Community Scripts/Dungeons/Alex - Burden of Father [A4N] -- 60fps Edition.lua index a95d97f4..551bcc47 100644 --- a/Community Scripts/Dungeons/Alexander - Burden of Father (A4n) Farming.lua +++ b/Community Scripts/Dungeons/Alex - Burden of Father [A4N] -- 60fps Edition.lua @@ -1,10 +1,14 @@ --[[ + +FPS: 60+ + This is meant to be used for Alexander - The Burden of the Father (NORMAL NOT SAVAGE) It's setup to where you should be able to loop it as many time as you want, and be able to farm mats for GC seals -Known classes to work: MCH | SMN | RDM | BLM | BRD +Known classes to work: ALL +Version: 3.0 +Created by: Ice, Class Support: Ellipsis -Version: 2.1 -Created by: Ice +Creators note: thank you Ellipsis for getting all the classes working, you did an amazing job. You deserve the credit here. Plugins that are used are: -> Visland (for pathing) @@ -13,7 +17,7 @@ Plugins that are used are: ]] -- How many loops do you wanna do -NumberofLoops = 15 +NumberofLoops = 1 --Visland Loops Alex_Start = "H4sIAAAAAAAACk2PW2vDMAyF/4ueTXCyNJv9VrYO8tDdIVvHKKbVqKG2Rq3uQsh/nxJctjcd6dPRUQ83LiBYmO/xe12vH0FB534+yEdOYF97uKPk2VME28MzWF3oqrmYmaY2Cl7AlrqY1ea8qhWswJrCNGdaV4MoitheyYKCB7f1R3ErCxFL+sSAkadJGxkPbsOd591tpv/3cjgJlXb0dZpIGnF7d/uEf/gUsVSwCMSnwy1jyOV8IrK4P2LiXI/GnfPjt9lxVNd0uKS4zZ8LNjaffMClcHp4G34B1YIamzkBAAA=" @@ -93,34 +97,79 @@ end ::BattleInitialize:: manip_phase = 0 -yield("/visland exectemponce "..Alex_Start) -yield("/wait 0.3") - -while IsVislandRouteRunning() do - yield("/targetenemy") - yield("/rotation Manual") - yield("/wait 1") +if GetCharacterCondition(26, false) +then +-- Target selection and movement logic + local current_target = GetTargetName() + if not current_target or current_target == "" then + yield("/targetenemy") -- Attempt to auto-target the next enemy + current_target = GetTargetName() + if current_target == "" then + yield("/wait 0.5") -- Wait for a longer period if no target is found + end + end + -- This wait might be too long for fast-paced combat scenarios; adjust as needed + + local enemy_max_dist = 40 + local dist_to_enemy = GetDistanceToTarget() + if dist_to_enemy and dist_to_enemy > 0 then + if dist_to_enemy <= enemy_max_dist then + local enemy_x = GetTargetRawXPos() + local enemy_y = GetTargetRawYPos() + local enemy_z = GetTargetRawZPos() + yield("/visland moveto " .. enemy_x .. " " .. enemy_y .. " " .. enemy_z) + yield("/wait 1") + --yield("/send KEY_1") + yield("/rotation manual") + yield("/wait 4") -- Adjust wait time as necessary for movement completion + yield("/visland stop") -- Stop movement after reaching near the target end - + end +end + ::StartofBattle:: -yield ("/wait 4") - -while GetCharacterCondition(26) do - yield("/wait 2") - yield("/targetenemy") +yield("/wait 0.5") +--rotation + +while GetCharacterCondition(26) do + yield("/wait 1") + -- Target selection and movement logic + local current_target = GetTargetName() + if not current_target or current_target == "" then + yield("/targetenemy") -- Attempt to auto-target the next enemy + current_target = GetTargetName() + if current_target == "" then + yield("/wait 0.5") -- Wait for a longer period if no target is found +end-- This wait might be too long for fast-paced combat scenarios; adjust as needed + end + local enemy_max_dist = 40 + local dist_to_enemy = GetDistanceToTarget() + if dist_to_enemy and dist_to_enemy > 0 then + if dist_to_enemy <= enemy_max_dist then + local enemy_x = GetTargetRawXPos() + local enemy_y = GetTargetRawYPos() + local enemy_z = GetTargetRawZPos() + yield("/visland moveto " .. enemy_x .. " " .. enemy_y .. " " .. enemy_z) + yield("/wait 2.5") -- Adjust wait time as necessary for movement completion + yield("/visland stop") -- Stop movement after reaching near the target + end + end end +-- This section might need an additional command to re-target or adjust positioning +-- if the enemy is beyond the max distance, depending on your needs. yield ("/wait 4") if (not GetCharacterCondition(26)) then - yield("/visland exectemponce "..Alex_Chest) +yield("/rotation cancel") +yield("/visland exectemponce "..Alex_Chest) end yield("/wait 2") while IsMoving() do - yield("/wait 1") +yield("/wait 1") end CurrentLoop = CurrentLoop + 1 diff --git a/Community Scripts/Dungeons/arbitrary duty solver/1044.duty b/Community Scripts/Dungeons/arbitrary duty solver/1044.duty new file mode 100644 index 00000000..ba8829a6 --- /dev/null +++ b/Community Scripts/Dungeons/arbitrary duty solver/1044.duty @@ -0,0 +1,18 @@ +1,196.96076965332,185.99942016602,-5.5055732727051,5,0 +1,232.08404541016,155.68911743164,-30.1077003479,3,0 +1,190.95698547363,151.87268066406,-81.554885864258,3,0 +1,172.84265136719,156.0,-25.480905532837,3,0 +1,191.6067199707,76.0,0.05311793833971,3,0 +1,175.10542297363,76.0,3.9009022712708,3,0 +1,176.16802978516,102.21385955811,-67.949180603027,3,0 +1,168.72315979004,101.79106140137,-106.60729217529,3,0 +0,136.84997558594,78.846633911133,-86.483200073242,3,0 +0,92.192047119141,66.560981750488,24.106510162354,3,0 +1,242.15399169922,66.38240814209,85.118667602539,3,0 +0,229.8122253418,64.799140930176,67.407188415527,3,180 +1,-63.371337890625,-103.96941375732,-0.93277209997177,3,0 +0,-164.94715881348,-104.39965820313,0.32639053463936,3,0 +1,-176.00271606445,-103.88856506348,0.29225087165833,3,0 +0,-218.74710083008,-103.99738311768,0.634516954422,3,0 +0,-237.78915405273,-103.99738311768,-18.510906219482,3,300 +0,-561.11535644531,-268.0,220.39717102051,3,0 \ No newline at end of file diff --git a/Community Scripts/Dungeons/Trial_Farmer_MxVaxius.ini b/Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_McVaxius.ini similarity index 94% rename from Community Scripts/Dungeons/Trial_Farmer_MxVaxius.ini rename to Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_McVaxius.ini index eb565e1c..df925d05 100644 --- a/Community Scripts/Dungeons/Trial_Farmer_MxVaxius.ini +++ b/Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_McVaxius.ini @@ -8,7 +8,8 @@ local char_snake = "no follow" --firstname lastname (of party member) you want to follow. dont put the @server -- the enemy to follow. 4 means character slot 4, slot 1 is us, dont use 1, can throw in text if you want it to be a specific enemy or player -> wrap it with double quotes -local enemy_snake = "The Ultima Weapon" +local enemy_snake = "whatever" +--local enemy_snake = "The Ultima Weapon" --local enemy_snake = "nothing" --some names --nothing - dont do anything just attack if something pops on target otherwise we will solve mechs with snd @@ -50,15 +51,12 @@ local limitpct = 30 --local movetype = visland local movetype = vnavmesh ---we'll deal with this later but for now its going into the ini file -local spread_marker_entities = { -"Buttcheeks", -"Chuttbeeks", -"Kuchkeebs" -} - - +--try to load load duty file or not? +--default on, 0 = off +trytoload = 1 --DEPRECRATED SECTION --limit break level permitted number is lowest level permitted DEPRECATED FOR NOW but won't remove it from template. ill just keep deprecated stuff at the bottom local limitlevel = 2 + + diff --git a/Community Scripts/Dungeons/Trial_Farmer_McVaxius.lua b/Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_McVaxius.lua similarity index 77% rename from Community Scripts/Dungeons/Trial_Farmer_McVaxius.lua rename to Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_McVaxius.lua index 0cba8ecb..564733be 100644 --- a/Community Scripts/Dungeons/Trial_Farmer_McVaxius.lua +++ b/Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_McVaxius.lua @@ -52,6 +52,7 @@ yesalready -> setup a leave from instance.. the first time you exit you can auto textadvance -> auto on and add your char to the list Final Fantasy XIV Itself -> Preselect port decumana in the duty finder menu on the designated party leader then close the window, OR Do it in the duty support window if thats the option you are choosing +Final Fantasy XIV Itself -> Character -> Targeting -> Ground Targeting -> Unlocked --*make this a pcall later but leave a note somewhere to user so they can change it if they wanna aim imanually later. -------------- SCRIPT CONFIG -------------- @@ -60,8 +61,8 @@ Read the ini file - it should self explain the variables. and it respects comme the ini file goes into the folder you can see below \\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\ you can change that to a different folder if you wish. just find the appropriate line of code in here to do that. -to use this find the Trial_Farmer_MxVaxius.ini file and rename it to Trial_Farmer_Yourcharfirstlast.ini notice no spaces. -so if your character is named Pomelo Pup'per then you would call the .ini file Trial_Farmer_PomeloPupper.ini +to use this find the arbitraryduty_McVaxius.ini file and rename it to arbitraryduty_Yourcharfirstlast.ini notice no spaces. +so if your character is named Pomelo Pup'per then you would call the .ini file arbitraryduty_PomeloPupper.ini just remember it will strip spaces and apostrophes -------------- enjoy @@ -104,15 +105,15 @@ end -- Specify the path to your text file -- forward slashes are actually backslashes. ---to use this find the Trial_Farmer_MxVaxius.ini file and rename it to Trial_Farmer_Yourcharfirstlast.ini notice no spaces. ---so if your character is named Pomelo Pup'per then you would call the .ini file Trial_Farmer_PomeloPupper.ini +--to use this find the arbitraryduty_McVaxius.ini file and rename it to arbitraryduty_Yourcharfirstlast.ini notice no spaces. +--so if your character is named Pomelo Pup'per then you would call the .ini file arbitraryduty_PomeloPupper.ini --also be sure to update the folder name as per your preference --just remember it will strip spaces and apostrophes tempchar = GetCharacterName() --tempchar = tempchar:match("%s*(.-)%s*") --remove spaces at start and end only tempchar = tempchar:gsub("%s", "") --remove all spaces tempchar = tempchar:gsub("'", "") --remove all apostrophes -local filename = os.getenv("appdata").."\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\Trial_Farmer_"..tempchar..".ini" +local filename = os.getenv("appdata").."\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\arbitraryduty_"..tempchar..".ini" -- Call the function to load variables from the file loadVariablesFromFile(filename) @@ -136,6 +137,7 @@ yield("/echo limituse:"..limituse) yield("/echo limitpct:"..limitpct) yield("/echo limitlevel:"..limitlevel) yield("/echo movetype:"..movetype) +yield("/echo trytoload:"..trytoload) --cleanup the variablesa bit. maybe well lowercase them later toohehe. char_snake = char_snake:match("^%s*(.-)%s*$"):gsub('"', '') @@ -177,6 +179,12 @@ local we_are_spreading = 0 --by default we aren't spreading local dutycheck = 0 local dutycheckupdate = 1 +--arbitrary duty solver +local dutyloaded = 0 +local dutytoload = "buttcheeks" +local doodie = {} --initialize table for waypoints +local whereismydoodie = 1 --position in doodie table + local function distance(x1, y1, z1, x2, y2, z2) return math.sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2) end @@ -225,6 +233,7 @@ local function do_we_spread() --return true we_are_spreading = 1 --indicate to the follow functions that we are spreading and not to try and do stuff spread_em(5) --default 5 "distance" movement for now IMPROVE LATER with multi variable array with distances for each spread marker? and maybe some actual math because 1,1 is actually 1.4 distance from origin. + did_we_find_one = 0 end if did_we_find_one == 0 then --return false @@ -272,8 +281,119 @@ local function setdeest() end end ---duty specific functions -local function praetorium() +--duty functions +local function load_duty_data() + --tablestructure: visland OR vnavmesh (0, 1), x,y,z, wait at waypoint (seconds for /wait x) before /stop visland/vnavmesh, distance to be over to end waypoint if it was an area transition. default 0 + local file_path = os.getenv("appdata").."\\XIVLauncher\\pluginConfigs\\SomethingNeedDoing\\"..dutytoload + local doodies = {} -- Initialize an empty table + if dutytoload ~= "buttcheeks" then + yield("/echo Attempting to load -> "..file_path) + local file = io.open(file_path, "r") -- Open the file in read mode + if file then + for line in file:lines() do -- Iterate over each line in the file + if line ~= "" then -- Skip empty lines + local row = {} -- Initialize an empty table for each row + for value in line:gmatch("[^,]+") do -- Split the line by comma + table.insert(row, value) -- Insert each value into the row table + --yield("/echo value "..value) + end + table.insert(doodies, row) -- Insert the row into the main table + end + end + file:close() -- Close the file + dutyloaded = 1 + return doodies -- Return the loaded table + else + yield("/echo Error: Unable to open table file '" .. file_path .. "'") + return nil + end + end +end + +local function getmovetype(wheee) + local funtimes = "vnavmesh" + yield("/echo DEBUG get move type for muuvtype -> "..wheee) + if tonumber(wheee) == 0 then + funtimes = "visland" + yield("/echo DEBUG get move type for muuvtype -> SHOULD BE VISLAND") + end + return funtimes +end + +local function arbitrary_duty() + if type(GetZoneID()) == "number" and GetZoneID() == 1044 and GetCharacterCondition(4) then --Praetorium + --will spam 2 and auto lockon. eventually clear the garbage + if string.len(GetTargetName()) > 0 then + yield("/lockon on") --need this for various stuff hehe. + yield("/automove") + yield("/send w") + yield("/wait 0.3") + yield("/send q") + yield("/send KEY_2") + yield("/wait 0.5") + yield("/send e") + yield("/wait 0.3") + yield("/send KEY_2") + yield("/wait 0.5") + yield("/send KEY_2") + yield("/wait 0.5") + yield("/send w") + yield("/wait 0.3") + yield("/send KEY_2") + yield("/wait 0.5") + yield("/wait 0.3") + yield("/send w") + yield("/send KEY_2") + yield("/wait 0.5") + end + end + --just make it use the zoneID no more need to edit this script for it to work + dutytoload = GetZoneID()..".duty" + --*if we die: + --*wait 20 seconds then accept respawn (new counter var.. just in case we get a rez + --*set waypoint to 1 so the whole thing can start over again. walk of shame back to boss. + --*resume mode - if there is a shortcut available: + --*search waypoint table for a waypoint closest to where we are after entering shortcut + --*set the waypoint to that closest waypoint and resume + + --if we are in a duty + if GetCharacterCondition(34) == true then + --if we haven't loaded a duty file. load it + if dutyloaded == 0 and dutytoload ~= "buttcheeks" then --we take a doodie from a .duty file + doodie = load_duty_data() + yield("/echo Waypoints loaded for this area -> "..#doodie) + end + if whereismydoodie < (#doodie+1) then + local muuvtype = "wheeeeeeeeeeeeeeeeeeeee" + local tempdist = distance(GetPlayerRawXPos(),GetPlayerRawYPos(),GetPlayerRawZPos(),doodie[whereismydoodie][2],doodie[whereismydoodie][3],doodie[whereismydoodie][4]) + --if we are in combat stop navmesh/visland + if GetCharacterCondition(26) == true then + yield("/visland stop") + yield("/vnavmesh stop") + yield("/automove off") + yield("/echo stopping nav cuz in combat") + end + if GetCharacterCondition(26) == false then + muuvtype = getmovetype(doodie[whereismydoodie][1]) --grab the movetype from the waypoint + yield("/"..muuvtype.." moveto "..doodie[whereismydoodie][2].." "..doodie[whereismydoodie][3].." "..doodie[whereismydoodie][4]) --move to the x y z in the waypoint + yield("/automove off") + yield("/echo starting nav cuz not in combat, WP -> "..whereismydoodie.." navtype -> "..muuvtype.." nav code -> "..doodie[whereismydoodie][1].." current dist to objective -> "..tempdist) + end + --if we are 0 and tempdist > tonumber(doodie[whereismydoodie][6]))then + yield("/echo Onto the next waypoint! Current WP completed --> "..whereismydoodie) + yield("/wait "..doodie[whereismydoodie][5]) + whereismydoodie = whereismydoodie + 1 + yield("/automove off") + yield("/visland stop") + yield("/vnavmesh stop") + end + end + end +end + --[[ + --for followers -- probably delete once we get the above part working. + --i heard you liked if statements so i nested an if statement in your if statement that i nested an if statement in your if statement that i ahahahah. i could have done 5-6 more nested if if type(GetZoneID()) == "number" and GetZoneID() == 1048 and char_snake ~= "party leader" and char_snake ~= "no follow" then --if we not in combat. target a terminal if GetCharacterCondition(34) == true and GetCharacterCondition(26) == false then --if we aren't in combat and in praetorium @@ -291,7 +411,7 @@ local function praetorium() end end end -end + ]] local function porta_decumana() if type(GetZoneID()) == "number" and GetZoneID() == 1048 then @@ -371,7 +491,11 @@ yield("/vbmai on") while repeated_trial < (repeat_trial + 1) do --yield("/echo get limoooot"..GetLimitBreakCurrentValue().."get limootmax"..GetLimitBreakBarCount() * GetLimitBreakBarValue()) --debug for hpp. its bugged atm 2024 02 12 and seems to return 0 - yield("/targetenemy") --this will trigger RS to do stuff. + yield("/targetenemy") --this will trigger RS to do stuff. this is also kind of spammy in the text box. how do i fix this so its not spammy? + --some other spams. + --the command "targetnenemy" is unavailable at this time + --unable to execute command while occupied + --unable to execute command while mounted if enemy_snake ~= "nothing" then --check if we are forcing a target or not yield("/target "..enemy_snake) --this will trigger RS to do stuff. currentLocX = GetTargetRawXPos() @@ -418,11 +542,12 @@ while repeated_trial < (repeat_trial + 1) do end if GetCharacterCondition(26)==false and GetCharacterCondition(34)==true then --if we are not in combat AND we are in a duty then we will look for an exit or shortcut - if type(GetDistanceToObject("Exit")) == "number" and GetDistanceToObject("Exit") < 15 then - yield("/target exit") - end - if type(GetDistanceToObject("shortcut")) == "number" and GetDistanceToObject("shortcut") < 15 then - yield("/target shortcut") + --we dont need to manually exit. automaton can do that now + --if type(GetDistanceToObject("Exit")) == "number" and GetDistanceToObject("Exit") < 25 then + -- yield("/target exit") + --end + if type(GetDistanceToObject("Shortcut")) == "number" and GetDistanceToObject("shortcut") < 25 then + yield("/target Shortcut") end yield("/wait 0.1") if GetTargetName()=="Exit" or GetTargetName()=="Shortcut" then --get out ! assuming pandora setup for auto interaction @@ -466,12 +591,15 @@ while repeated_trial < (repeat_trial + 1) do --test dist to the intended party leader if GetCharacterCondition(34)==true then --if we are in a duty --check for spread_marker_entities - do_we_spread() --single target spread marker handler function + --do_we_spread() --single target spread marker handler function + --call the waypoint system if we are wanting to from the .ini file + if trytoload == 1 then + arbitrary_duty() + end --duty specific stuff if type(we_are_in) == "number" and we_are_in == 1048 then --porta decumana --yield("/echo Decumana Check!") porta_decumana() - praetorium() end --regular movement to target if char_snake ~= "no follow" and char_snake ~= "party leader" and enemy_snake == "nothing" and we_are_spreading == 0 then --close gaps to party leader only if we are on follow mode @@ -552,6 +680,12 @@ while repeated_trial < (repeat_trial + 1) do dutycheck = 0 --by default we aren't going to stop things because we are in a duty dutycheckupdate = 1 --sometimes we don't want to update dutycheck because we reached phase 2 in a fight. end + --if we arent in a duty - reset some duty stuff + if GetCharacterCondition(34) == false then + dutyloaded = 0 + dutytoload = "buttcheeks" + whereismydoodie = 1 + end end --/xldata object table, vbm debug, automaton debug @@ -561,4 +695,4 @@ end --17BB97515D0:40000B8A[42] - BattleNpc - Aetheroplasm - X-715.5605 Y-185.53157 Z491.5273 D21 R2.3561823 - Target: E0000000 --17BB9754550:40000B8B[44] - BattleNpc - Aetheroplasm - X-692.46704 Y-185.53159 Z491.52734 D12 R-2.3562784 - Target: E0000000 ---v451 \ No newline at end of file +--v123321 \ No newline at end of file diff --git a/Community Scripts/Dungeons/GenericDungeonSolver_McVaxius.lua b/Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_ideas.lua similarity index 100% rename from Community Scripts/Dungeons/GenericDungeonSolver_McVaxius.lua rename to Community Scripts/Dungeons/arbitrary duty solver/arbitraryduty_ideas.lua diff --git a/Community Scripts/Dungeons/arbitrary duty solver/list of duties and instructions.txt b/Community Scripts/Dungeons/arbitrary duty solver/list of duties and instructions.txt new file mode 100644 index 00000000..b08252bf --- /dev/null +++ b/Community Scripts/Dungeons/arbitrary duty solver/list of duties and instructions.txt @@ -0,0 +1,54 @@ +note to reader: +please go ahead and steal the code etc. +would appreciate if you help to improve it and PR your .duty files. + +-------------------------------------------- +--------how to make a .duty file------------ +-------------------------------------------- +Make script entries in SND with the following: + +---------------------------------------------------------------------------------------- +--zoneID for filename +yield("/echo this is the zone/area ID = "..GetZoneID().." you can call the file "..GetZoneID()..".duty") +---------------------------------------------------------------------------------------- + +---------------------------------------------------------------------------------------- +--basic line entry for the .duty file for the x,y,z values +yield("/echo 1,"..GetPlayerRawXPos()..","..GetPlayerRawYPos()..","..GetPlayerRawZPos()..",3,0") +---------------------------------------------------------------------------------------- + +---------------------------------------------------------------------------------------- +--for getting the distance after an area transition for column 6 of the .duty file +local function distance(x1, y1, z1, x2, y2, z2) + return math.sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2) +end +x2 = 123 +y2 = 123 +z2 = 123 +yield("/echo distance to waypoint after area transition -> "..distance(GetPlayerRawXPos(),GetPlayerRawYPos(),GetPlayerRawZPos(), x2, y2, z2)) --x2 y2 z2 are up to you to input +---------------------------------------------------------------------------------------- + +---------------------------------------- +--------.duty file structure------------ +---------------------------------------- +Every duty file has a number of rows. each one has 6 columns separated by a comman (,) and no spaces between commmas and values. + +Value 1: 0, 1 || movement type || 0 Visland, 1 = Vnavmesh +Value 2: x || get from above script +Value 3: y || get from above script +Value 4: z || get from above script +Value 5: t || seconds to wait after reaching waypoint before next waypoint trigger. default 3 seconds +Value 6: r || value 0 normall, anything above 0 otherwise. Explanation: if we have gone through a sub area transition like the magitek armor in prae -> basement section, +we need to solve that. simply put in the appropriate value a few y lower than the distance to waypoint AFTER the area transition. the prae (1044.duty) preset has a few entries in it. + + +General tips: +use visland to get through area transitions +if you think navmesh might be weird around some messy corners, dont trust it implicitly and set some good spots it can reach or just use visland. +if the duty requires some weird stuff to proceed come to the disc and let's find a solution ill write the lua or you can and we can make it work. +some stuff isn't yet solved by bossmod but we can solve in SND for now + +-------------------------------------------- +---------------List of Duties--------------- +-------------------------------------------- +1044 Level 50 The Praetorium Some customization in .lua for mounted portion and area transition reconciliation \ No newline at end of file diff --git a/Community Scripts/Gathering/AutoCollectables_SingleRun.lua b/Community Scripts/Gathering/AutoCollectables_SingleRun.lua new file mode 100644 index 00000000..d03e3c97 --- /dev/null +++ b/Community Scripts/Gathering/AutoCollectables_SingleRun.lua @@ -0,0 +1,226 @@ +--[[ + Name: AutoCollectables + Description: General collectables script for MIN/BTN, based on auto gather collectables for the miner or botanist relic steps from Em + Author: LeafFriend, Em + Version: 0.1.1.1 +]] + +--[[ + + 0.1.1.1 - Added support for calling script in GatheringHelper + 0.1.1 - Refactored Ageless Words/Solid Reason code block into its own wrapper + - Added above wrapper to low stat rotation + 0.1 - Initial Version +]] + +--Settings +ignore_nodes_went = false --Loop this script +nodes_went_threshold = 1 --How many times to loop this script before it terminates +interval_rate = 0.5 --Seconds to wait for each action +time_to_wait_after_gather = 0.1 --Seconds to wait after finishing gathering and before looking for the next gathering node + +--Variables +max_base_scour_coll = 200 +max_coll = 1000 +scrutiny_gp = 200 +action_one_more_gp = 300 + +--Prints given string into chat with script identifier +function Id_Print(string) + yield("/echo [AutoCollectables] "..string) +end + +--Wrapper for Gatherer class check and their respective ingame Actions +function class_check() + if (GetClassJobId() == 17) then + action_name_one_more = "Ageless Words" + action_name_meticulous = "Meticulous Woodsman" + elseif (GetClassJobId() == 16) then + action_name_one_more = "Solid Reason" + action_name_meticulous = "Meticulous Prospector" + end +end + +--Wrapper for running ingame Actions +function action(action_name) + Id_Print("Using \""..action_name.."\"") + yield("/action \""..action_name.."\"") + yield("/wait "..interval_rate) + + while(GetCharacterCondition(42)) do yield("/wait "..interval_rate) end + + --Ensure Scrutiny is active + if (action_name == "Scrutiny" and not HasStatus("Scrutiny")) then + Id_Print("\"Scrutiny\" not active, Attempting again...") + action(action_name) + end + + yield("/wait "..interval_rate) +end + +--Returns Collectability gain using Scour from Collectables UI +function scour_coll() + local data + repeat + yield("/wait "..interval_rate) + data = GetNodeText("GatheringMasterpiece", 97) + until (type(data) == "string") + return tonumber(data:sub(-3)) or 0 +end + +--Returns Collectability gain using Meticulous Woodsman/Prospector from Collectables UI +function meticulous_coll() + local data + repeat + yield("/wait "..interval_rate) + data = GetNodeText("GatheringMasterpiece", 73) + until (type(data) == "string") + return tonumber(data:sub(-3)) or 0 +end + +--Returns current Collectability of Collectable being gathered +function current_coll() + return tonumber(GetNodeText("GatheringMasterpiece", 175)) or max_coll +end + +--Returns available actions left before gathering node disappears +function actions_left() + return tonumber(GetNodeText("GatheringMasterpiece", 55)) or 0 +end + +--Returns maximum actions possible at current gathering node +function max_actions() + return tonumber(GetNodeText("GatheringMasterpiece", 53)) or 0 +end + +--Returns minimum Collectability for the current Collectable being gathered to be usable +function min_coll() + return tonumber(GetNodeText("GatheringMasterpiece", 168, 0)) or 0 +end + +--Wrapper for gaining more gathering attempts to Collect +function gain_more_action() + while (GetGp() >= action_one_more_gp) do + if (actions_left() < max_actions()) then action(action_name_one_more) end + if (HasStatus("Eureka Moment")) then + if (actions_left() > max_actions() - 1) then action("Collect") end + action("Wise to the World") + end + end +end + +--Wrapper for collecting current collectables at the end of rotations +function collect_all() + while((actions_left() > 0) and IsAddonReady("GatheringMasterpiece")) do + --Ends function if function called without any scouring + if (current_coll() == 0) then return end + + Id_Print("Actions left: "..actions_left()) + action("Collect") + end +end + +--Standard Collectable Rotation +function standard() + Id_Print("Doing Standard Rotation...") + + action("Scrutiny") + action(action_name_meticulous) + action("Scrutiny") + action(action_name_meticulous) + + if (current_coll() == max_coll) then + elseif (meticulous_coll() + current_coll() >= max_coll) then + action(action_name_meticulous) + else + action("Scour") + end + if (actions_left() > 1) then + action("Collect") + end + + gain_more_action() + + collect_all() +end + +--[[ + Low Stat Rotation, for when not enough GP for Standard Rotation, + or when maximum possible base Collectability gain (Scour without Scrutiny at max gathering) not reached +--]] +function low_stat() + Id_Print("Doing Low Stat Rotation...") + + action("Scrutiny") + action("Scour") + action("Scrutiny") + + if (meticulous_coll() >= scour_coll()) then + action(action_name_meticulous) + else + action("Scour") + end + + while (actions_left() > 1 and current_coll() < max_coll) do + if (math.max(scour_coll(), meticulous_coll()) + current_coll() < max_coll) then + action("Scrutiny") + end + + if (meticulous_coll() >= scour_coll()) then + action(action_name_meticulous) + else + action("Scour") + end + end + + gain_more_action() + + collect_all() +end + +--Ephemeral Rotation, for when insufficient GP to do any other rotation and trying to get usable Collectables +function ephemeral() + Id_Print("Doing Ephemeral Rotation...") + + while (current_coll() < min_coll() and actions_left() > 1) do + if (meticulous_coll() >= scour_coll()) then + action(action_name_meticulous) + else + action("Scour") + end + end + + collect_all() +end + +function main() + while(not IsAddonReady("GatheringMasterpiece")) do + Id_Print("Waiting for node...") + yield("/wait "..interval_rate) + end + + Id_Print("At node.") + current_gp = GetGp() + Id_Print("Current GP: "..current_gp) + class_check() + + --Logic for which rotation to perform + if (scour_coll() == max_base_scour_coll and current_gp >= 2 * scrutiny_gp + action_one_more_gp) then + standard() + elseif (current_gp >= 3 * scrutiny_gp) then + low_stat() + else + ephemeral() + end + + Id_Print("Done gathering!") + yield("/wait "..time_to_wait_after_gather) +end + +Id_Print("----------Starting AutoCollectables----------") +nodes_went = 0 +repeat + main() + nodes_went = nodes_went + 1 +until ignore_nodes_went or nodes_went >= nodes_went_threshold +Id_Print("----------Stopping AutoCollectables----------") \ No newline at end of file diff --git a/Community Scripts/Gathering/GatheringHelper.lua b/Community Scripts/Gathering/GatheringHelper.lua new file mode 100644 index 00000000..0e1ba79e --- /dev/null +++ b/Community Scripts/Gathering/GatheringHelper.lua @@ -0,0 +1,563 @@ +--[[ + Name: GatheringHelper + Description: General gathering node recorder and movement script for MIN/BTN + Author: LeafFriend, plottingCreeper (food and repair) + Version: 0.1.3.1 + Needed Plugins: vnavmesh, Pandora + Needed Plugin Settings enabled: Pandora Quick Gather +]] + +--[[ + + 0.1.3.1 - Properly implement zone change script termination implementation + 0.1.3 - Implemented class checker to wipe found_nodes if class is changed and prompt if not DoL + - Implemented food check before homing into found gathering node + - Implemented gear condition checking + - Implemented dislodging if char stuck in position moving + - Implemented script termination if zone change is detected + 0.1.2 - Optimised node traversal + - Re-enabled truncation for readbility + - Removed lockon + - Implemented dislodging if not moving + - Implemented calling of collectable script if gathering collectables + - Implemented script termination if inventory free slot threshold reached + 0.1.1 - Implemented VnavmeshMoveFly to determine whether to use /vnavmesh moveto or /vnavmesh flyto + 0.1 - Initial Version +]] + +--[[ + + 1. Change settings as wanted + 2. Run script in lua + 3. Find gathering nodes when starting or when prompted + 4. Script will register found nodes and go back to them after visiting all of them once +]] + +--[[ + + - More Optimisation, eventually... + -- See if GetNearbyObjectNames() helps + -- Use plottingCreeper's MoveNear() + - Implement node checker to wipe found_nodes if gathered item is not gatherable from current node + - Implement randomised wait time + - Implement verbose/rate-limiting Id_Print() + - Implement distance-based mounting before moving to next node + - Implement spiritbond checking + - Implement Diadem aetheromatic auger usage +--]] + +--Settings +---Food Settings +food_to_eat = false --Name of the food you want to use, in quotes. Set false otherwise. + --Include if high quality. (i.e. "[Name of food] ") DOES NOT CHECK ITEM COUNT YET +eat_food_threshold = 10 --Maximum number of times to check if food is consumed + +---Repair Settings +do_repair = false --false, "npc" or "self". Add a number to set threshhold; "npc 10" to only repair if under 10% + +---Gathering logic Settings +interval_rate = 1 --Seconds to wait for each action +min_distance_to_dismount = 5 --Minimum distance before dismounting while travelling to gathering node +time_to_wait_after_gather = 3 --Seconds to wait after finishing gathering and before looking for the next gathering node +missing_node_distance_tolerance = 3 --Maximum distance before script considers node moving to is not interactable +moving_count_threshold = 15 --Maximum number of pings script will attempt before detecting it is stuck and attempt to dislodge itself +diadem_moving_count_threshold = 60 --Same as above, but for diadem +not_moving_count_threshold = 3 --Number of pings script will do before attempting to dislodge itself if it isn't moving +num_inventory_free_slot_threshold = 1 --Max number of free slots to be left before stopping script + +---Collectables Settings +collectables_script_name = "AutoCollectables_SingleRun" --Name of collectables script in SND to run when collectable UI is detected + + + + +--Helper functions +function Set(list) + local set = {} + for _, l in ipairs(list) do set[l] = true end + return set +end + +function SetLength(set) + local count = 0 + for _,_ in pairs(set) do + count = count + 1 + end + return count +end + +function AddToSet(set, key) + set[key] = true +end + +function RemoveFromSet(set, key) + set[key] = nil +end + +function SetContains(set, key) + return set[key] ~= nil +end + +function PrintSet(set, label) + local next = next + if next(set) ~= nil then + Id_Print("["..label.."]Set:") + for k,_ in pairs(found_nodes) do + Id_Print("["..label.."]"..tostring(k)) + end + end +end + +function Queue(list) + local queue = {} + return {first = 0, last = -1} +end + +function IsQueue(struct) + return struct.first ~= nil and struct.last ~= nil +end + +function QueueIsEmpty(queue) + return queue.first > queue.last +end + +function QueueLength(queue) + local count = 0 + for _,_ in pairs(queue) do + count = count + 1 + end + return count - 2 +end + +function QueuePush(queue, value) + local last = queue.last + 1 + queue.last = last + queue[last] = value +end + +function QueuePop(queue) + local first = queue.first + if first > queue.last then error("queue is empty") end + local value = queue[first] + queue[first] = nil -- to allow garbage collection + queue.first = first + 1 + return value +end + +function QueueContains(queue, value) + local first = queue.first + if first > queue.last then return false end + for _,v in pairs(queue) do + if v == value then return true end + end + return false +end + +function PrintQueue(queue, label) + local next = next + if next(queue) ~= nil then + Id_Print("["..label.."]Queue:") + for k,v in pairs(queue) do + Id_Print("["..label.."]k: "..tostring(k)..", v: "..tostring(v)) + end + end +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 + +--Global Variable Initialisation +gathering_node_names = {} +gathering_nodes = Set(gathering_node_names) +found_nodes = Set{} +nodes_went = Queue{} +current_target = "" +last_node_gathered = "" +moving_count = 0 +not_moving_count = 0 +last_job_id = 0 +stop_main = false +current_zone = 0 + +--Wrappers & Functions +--Prints given string into chat with script identifier +function Id_Print(string) + yield("/echo [GatheringHelper] "..string) +end + +--Returns given number truncated to 1 decimal place +function Truncate1Dp(num) + return ("%.1f"):format(num) +end + +--Wrapper for class checking, node names to gather from and return current job_id +function ClassCheck() + local job_id = GetClassJobId() + if job_id == last_job_id then return job_id end + --Change names of gathering nodes to gather from based on class + repeat + job_id = GetClassJobId() + if job_id == 16 then --MIN + gathering_node_names = { + "Mineral Deposit", "Rocky Outcrop", + "Unspoiled Mineral Deposit", "Unspoiled Rocky Outcrop", + "Legendary Mineral Deposit", "Legendary Rocky Outcrop", + } + elseif job_id == 17 then --BTN + gathering_node_names = { + "Mature Tree", "Lush Vegetation Patch", + "Unspoiled Mature Tree", "Unspoiled Lush Vegetation Patch", + "Legendary Mature Tree", "Legendary Lush Vegetation Patch", + } + elseif job_id == 18 then --FSH + gathering_node_names = { + "Teeming Waters", + } + else --not a gatherer + gathering_node_names = {} + Id_Print("Not a Disciple of Land!") + Id_Print("Change class to continue script") + yield("/wait "..interval_rate) + end + until 16 <= job_id and job_id <= 18 + gathering_nodes = Set(gathering_node_names) + --Empty found_nodes if job_id ~= last_job_id + if job_id ~= last_job_id then found_nodes = Set{} end + return job_id +end + +--Wrapper for food checking, and if want to consume, consume if not fooded +function EatFood() + if type(food_to_eat) == "string" and not HasStatus("Well Fed") then + local eat_food_tick = 0 + repeat + Id_Print("Eating "..food_to_eat) + yield("/item "..food_to_eat) + yield("/wait "..interval_rate) + eat_food_tick = eat_food_tick + 1 + until HasStatus("Well Fed") or eat_food_tick >= eat_food_threshold + end +end + +--Wrapper for repair check, return true if repaired +function RepairCheck() + local repair_threshold + function IsNeedRepair() + if type(do_repair) ~= "string" then + return false + else + repair_threshold = tonumber(string.gsub(do_repair, "%D", "")) or 99 + if NeedsRepair(tonumber(repair_threshold)) then + if string.find(string.lower(do_repair), "self") then + return "self" + else + return "npc" + end + else + return false + end + end + end + + local repair_token = IsNeedRepair() + if repair_token then + if repair_token == "self" then + while GetCharacterCondition(4) do + Id_Print("Attempting to dismount...") + yield("/mount") + yield("/wait "..interval_rate) + end + Id_Print("Attempting to self repair...") + while not IsAddonVisible("Repair") do + ExecuteGeneralAction(6) + yield("/wait "..interval_rate * 0.1) + end + yield("/pcall Repair true 0") + yield("/wait "..interval_rate) + if IsAddonVisible("SelectYesno") then + yield("/pcall SelectYesno true 0") + yield("/wait "..interval_rate) + end + while GetCharacterCondition(39) do yield("/wait "..interval_rate * 0.1) end + yield("/wait "..interval_rate) + while IsAddonVisible("Repair") do + ExecuteGeneralAction(6) + yield("/wait "..interval_rate * 0.1) + end + if NeedsRepair(repair_threshold) then + Id_Print("Self Repair failed!") + Id_Print("Please place the appropriate Dark Matter in your inventory,") + Id_Print("Or find a NPC mender.") + return false + end + elseif repair_token == "npc" then + Id_Print("Equipment below "..repair_threshold.."%!") + Id_Print("Please go find a NPC mender.") + return false + end + end + return true +end + +--Returns false if zone has changed since start of script +function CheckIfSameZoneSinceScriptStart() + return current_zone == GetZoneID() +end + +--Returns name and co-ordinates of target node in a string with format ",,," +function GetTargetNodeData() + local name = GetTargetName() + local x = Truncate1Dp(GetTargetRawXPos()) + local y = Truncate1Dp(GetTargetRawYPos()) + local z = Truncate1Dp(GetTargetRawZPos()) + return name..","..x..","..y..","..z +end + +--Parse given string containing node name and co-ords and returns a table containing them +function ParseNodeDataString(string) + return Split(string, ",") +end + +--Returns displacement between given node as a string and current character position +function GetDistanceToNode(node) + local given_node = ParseNodeDataString(node) + return GetDistanceToPoint(tonumber(given_node[2]), tonumber(given_node[3]), tonumber(given_node[4])) +end + +--Return the closest gathering node found thus far given by found_nodes, and not went to given by nodes_went +function FindNearestFoundNodeNotGathered() + local least_distance_to_nodes_not_went = 10000000000000.0 + local node_with_least_distance_not_went = nil + + for node,_ in pairs(found_nodes) do + if node ~= last_node_gathered and not QueueContains(nodes_went, node) then + local distance_to_node = GetDistanceToNode(node) + if distance_to_node < least_distance_to_nodes_not_went then + node_with_least_distance_not_went = node + least_distance_to_nodes_not_went = math.min(least_distance_to_nodes_not_went, distance_to_node) + end + end + end + return node_with_least_distance_not_went +end + +--Return the appropriate moving_count_threshold after checking the current zone +function ZoneBasedMovingCountThreshold() + local zone_id = GetZoneID() + if zone_id == 939 then return diadem_moving_count_threshold + else return moving_count_threshold end +end + +--Wrapper to handle data as needed +function HandleDataAsNeeded() + local do_pop = false + for k,_ in pairs(found_nodes) do + if k == last_node_gathered and QueueContains(nodes_went, k) then do_pop = true end + end + if do_pop then + QueuePop(nodes_went) + end +end + +--Wrapper to add node to given set or queue +function AddNodeDataToSetOrQueue(node, set_or_queue, name_of_set_or_queue) + if set_or_queue == nil or node == nil or ParseNodeDataString(node)[1] == "" then return end + local name_of_set_or_queue = name_of_set_or_queue or "NAMENOTGIVEN" + + if IsQueue(set_or_queue) then --Given struct is Queue + if not QueueContains(set_or_queue, node) then QueuePush(set_or_queue, node) end + else --Given struct is Set (or not Queue) + if not SetContains(set_or_queue, node) then AddToSet(set_or_queue, node) end + end +end + +--Wrapper to handle vnavmesh Movement +function VnavmeshMoveFly(x, y, z, force_moveto) + local force_moveto = force_moveto or false + if not force_moveto and GetCharacterCondition(4) and GetCharacterCondition(77) then + yield("/vnavmesh flyto "..x.. " "..y.." "..z) + else + yield("/vnavmesh moveto "..x.. " "..y.." "..z) + end +end + +--Wrapper to handle dismount if within given minimum distance to dismount +function CheckDistanceToDismount(node) + if GetDistanceToNode(node) < min_distance_to_dismount and GetCharacterCondition(4) then + yield("/mount") + yield("/vnavmesh stop") + yield("/wait "..interval_rate * 0.1) + end +end + +--Wrapper handling when player stopped moving +function ActionsIfDetectedNotMoving() + Id_Print("Detected not moving...") + Id_Print("Attempting to dislodge...") + --Implement random coord base on current player position + VnavmeshMoveFly(Truncate1Dp(GetPlayerRawXPos()+math.random(-5, 5)), + Truncate1Dp(GetPlayerRawYPos()+math.random(-5, 5)), Truncate1Dp(GetPlayerRawZPos()+math.random(-5, 5)), true) + yield("/wait "..interval_rate * 3) +end + +--Script logic +function main() +--[[ + --Prints out found nodes + PrintSet(found_nodes, "DEBUG0") + Id_Print("[DEBUG0]len(found_nodes): "..SetLength(found_nodes)) + --Prints out nodes went + PrintQueue(nodes_went, "DEBUG0") + Id_Print("[DEBUG0]len(nodes_went): "..QueueLength(nodes_went)) + Id_Print("[DEBUG0]last_node_gathered: "..last_node_gathered) +--]] + + --Pre-gather Checks + ---Check if need repairs at start + ---Check if there's inventory space left + ---Check if zone has changed + ::BEFORE_GATHER:: + if not RepairCheck() + or GetInventoryFreeSlotCount() <= num_inventory_free_slot_threshold + or not CheckIfSameZoneSinceScriptStart() then + if GetInventoryFreeSlotCount() <= num_inventory_free_slot_threshold then + Id_Print("Inventory free slot threshold reached.") + end + if not CheckIfSameZoneSinceScriptStart() then + Id_Print("Zone change detected.") + end + + stop_main = true + return + end + + --Check for nearest node not went to if any + ::FIND_NEXT_NODE:: + last_job_id = ClassCheck() + nextNodeToMoveTo = FindNearestFoundNodeNotGathered() + + --Find nearest gathering node + ::MOVE_NEXT_NODE:: + repeat + last_job_id = ClassCheck() + if not CheckIfSameZoneSinceScriptStart() then goto BEFORE_GATHER end + Id_Print("Pinging for nearby Gathering Nodes...") + + if nextNodeToMoveTo == nil then + Id_Print("Traversed all found nodes!") + Id_Print("Go find another!") + yield("/wait "..interval_rate) + else + if not IsMoving() then + VnavmeshMoveFly(ParseNodeDataString(nextNodeToMoveTo)[2], + ParseNodeDataString(nextNodeToMoveTo)[3], ParseNodeDataString(nextNodeToMoveTo)[4]) + Id_Print("Moving to "..nextNodeToMoveTo) + yield("/wait "..interval_rate) + end + + if IsMoving() then + moving_count = moving_count + 1 + else + not_moving_count = not_moving_count + 1 + end + if GetDistanceToNode(nextNodeToMoveTo) < missing_node_distance_tolerance + and not gathering_nodes[GetTargetName()] then + Id_Print("Gathering Node not Found!") + AddNodeDataToSetOrQueue(nextNodeToMoveTo, nodes_went, "nodes_went") + yield("/vnavmesh stop") + goto CHECK_DATA + elseif moving_count > ZoneBasedMovingCountThreshold() then + ActionsIfDetectedNotMoving() + moving_count = 0 + elseif not_moving_count > not_moving_count_threshold then + ActionsIfDetectedNotMoving() + not_moving_count = 0 + end + end + + yield("/tnpc") + yield("/wait "..interval_rate) + until gathering_nodes[GetTargetName()] + + Id_Print("Gathering Node found!") + yield("/vnavmesh stop") + yield("/automove off") + EatFood() + moving_count = 0 + not_moving_count = 0 + + repeat + current_target = GetTargetNodeData() + yield("/wait "..interval_rate * 0.1) + until current_target ~= nil and ParseNodeDataString(current_target)[1] ~= "" + if not SetContains(found_nodes, current_target) then Id_Print("New Gathering Node: "..current_target) end + AddNodeDataToSetOrQueue(current_target, found_nodes, "found_nodes") + + --Movement logic, also dismounts if mounted when close enough + ::HOME_IN_NEXT_NODE:: + repeat + last_job_id = ClassCheck() + if not CheckIfSameZoneSinceScriptStart() then goto BEFORE_GATHER end + CheckDistanceToDismount(current_target) + if not IsMoving() then + VnavmeshMoveFly(ParseNodeDataString(current_target)[2], + ParseNodeDataString(current_target)[3], ParseNodeDataString(current_target)[4]) + Id_Print("Moving to Target...") + yield("/wait "..interval_rate) + end + + if IsMoving() then + moving_count = moving_count + 1 + else + not_moving_count = not_moving_count + 1 + end + if moving_count > ZoneBasedMovingCountThreshold() then + ActionsIfDetectedNotMoving() + moving_count = 0 + elseif not_moving_count > not_moving_count_threshold then + ActionsIfDetectedNotMoving() + not_moving_count = 0 + end + + yield("/wait "..interval_rate) + until GetCharacterCondition(6) + + ::START_GATHER:: + Id_Print("Starting to gather from current gathering node...") + AddNodeDataToSetOrQueue(current_target, nodes_went, "nodes_went") + last_node_gathered = current_target + yield("/vnavmesh stop") + yield("/pinteract") + + --Wait for gathering to finish + ::FINISH_GATHER:: + repeat + --if is collectable, run collectables script + if IsAddonVisible("GatheringMasterpiece") then + yield("/runmacro "..collectables_script_name) + yield("/wait "..interval_rate * 0.1) + end + + yield("/wait "..interval_rate * 0.1) + until not GetCharacterCondition(6) + Id_Print("Finished gathering from current gathering node!") + Id_Print("Waiting for "..time_to_wait_after_gather.."s before moving on...") + yield("/wait "..time_to_wait_after_gather) + + ::CHECK_DATA:: + HandleDataAsNeeded(found_nodes, nodes_went, last_node_gathered) +end + +--Run script +Id_Print("----------Starting GatheringHelper----------") +current_zone = GetZoneID() +while not stop_main do + main() +end +Id_Print("----------Stopping GatheringHelper----------") \ No newline at end of file diff --git a/Community Scripts/Misc/Deep Dungeon Inuition Farm.lua b/Community Scripts/Misc/Deep Dungeon Inuition Farm.lua index 7494f7e3..d1fbdaef 100644 --- a/Community Scripts/Misc/Deep Dungeon Inuition Farm.lua +++ b/Community Scripts/Misc/Deep Dungeon Inuition Farm.lua @@ -30,6 +30,10 @@ Save_Slot = 1 -- true will make it to where you are in control till you get the Intuition ManualMovement = false +-- If you're running on standard control scheme (like my raid mates), make sure to change this to "standard", it'll make vnavmesh work properly +-- Options: legacy | standard +MovementType = "legacy" + ::DeepDungeon:: while IsInZone(613) == false do yield("/wait 1") @@ -83,15 +87,26 @@ if GetToastNodeText(2, 3) == "You sense the Accursed Hoard calling you..." then end yield("/echo Hey! A Hoard is here and in range.") - yield("/pcall DeepDungeonStatus True 11 18 ") -- Concealment pomander + if MovementType == "standard" then + yield("/characterconfig") + yield("/pcall ConfigCharacter True 10 0 0 1") -- Makes sure you're on the Contorl Settings Tab + yield("/wait 0.2") + yield("/pcall ConfigCharaOpeGeneral True 18 143 1 0") --Legacy Button + yield("/wait 0.2") + yield("/pcall ConfigCharacter True 0") -- Applies the settings + yield("/wait 0.2") + yield("/pcall ConfigCharacter True 1") -- Closes the Config Menu + yield("/wait 1") + end + yield("/pcall DeepDungeonStatus True 11 18 ") -- Concealment pomander if HasStatusId(1496) == false then -- Invisible status check yield("/pcall DeepDungeonStatus True 12 0") -- primal summon yield("/wait 3") yield("/pcall DeepDungeonStatus True 11 1") -- safety pomander yield("/wait 3") end - yield("/ac sprint") yield("/vnavmesh moveto "..string.format("%.2f", GetAccursedHoardRawX()).." "..string.format("%.2f", GetAccursedHoardRawY()).." "..string.format("%.2f", GetAccursedHoardRawZ())) + yield("/ac sprint") Chest_Got = false elseif GetToastNodeText(2, 3) == "You do not sense the call of the Accursed Hoard on this floor..." then @@ -114,6 +129,18 @@ if Chest_Got == true then yield("/wait 1") end yield("/wait 1") + if MovementType == "standard" then + yield("/characterconfig") + yield("/pcall ConfigCharacter True 10 0 0 1") -- Makes sure you're on the Contorl Settings Tab + yield("/wait 0.2") + yield("/pcall ConfigCharaOpeGeneral True 18 143 0 0") --Standard Button + yield("/wait 0.2") + yield("/pcall ConfigCharacter True 0") -- saves the Settings + yield("/wait 0.2") + yield("/pcall ConfigCharacter True 1") -- closes the character config + yield("/wait 0.2") + end + LeaveDuty() goto DeepDungeon end \ No newline at end of file diff --git a/Community Scripts/Misc/Idyllshire Turnin.lua b/Community Scripts/Misc/Idyllshire Turnin.lua index ea04a3aa..3061c8cd 100644 --- a/Community Scripts/Misc/Idyllshire Turnin.lua +++ b/Community Scripts/Misc/Idyllshire Turnin.lua @@ -14,8 +14,9 @@ This requires: -> Pandora (Enable "Auto-select Turn-ins & Automatically Confirm") -> Lifestream -> Deliveroo [If you need the link, here --> https://plugins.carvel.li/] + -> vnavmesh (replaced visland) - Version: 2.7 [Finally Released, now with GC Teleport Tickets] + Version: 3.0 [The navmesh update] - Fixed the teleport issue in Idyllshire ]] @@ -25,106 +26,105 @@ This requires: Default is 1 cause that's worked for me, but 5 has helped others as well]] Alex_Shop_Timer = 1 - --- Visland Routes -LimsaGC = "H4sIAAAAAAAACuWT20oDMRCGX0XmOoRsJsluciceoBf1UJRaxYvFjTTgJtLNKrL03c0e2oJ9A5ur+SfDzz8fSQc3ZW3BwKP3qajOFqGNFggsy5/P4HxswLx0cBcaF13wYDp4AsORFixTSGAFRjDK+iMIPIPJBcVcI26TCt7OLsFkvCCwKCvXJrOMMgLz8GVr6yOYJGY+2k35Fpcurm/7+T+9KWDK1KzD9+4mhUlu7+VHYw/jQ8KMwFUdot1ZRVtP5fkwMYn71jZxqnvjZeniwbFX12FzEXw1Lc7G5oOr7TzNsS05wiI4zSQTWgxcUFOdjtxj0RKzU8SiJFUoimL/WkYinAqFXJ4ikVzSHFHxIyKy0FydIhGNlCmh90R4LlGl3cevIwshlfj/XF63vz7BbA6QBQAA" -UldahGC = "H4sIAAAAAAAACuWUy2rDMBBFfyXM2h00elnyrqQPskgfoSV90IVpVGKIrRIrLSXk3ys7dgMhX1B7pTu6XMaHi7Zwk5cOMnhcLfLl6Ho8mvlNcJDAPP/59EUVashet3Dn6yIUvoJsC0+QnZHgyBXXNoHnKDmyBF6auRKoNUmzi9pXbnIBGYl4OcsXxSZmUeOc+i9XuipAFsWkCm6dv4d5EZa3jf9o1i0YV6qX/ru/ibvEtI98VbuDvV2QErgsfXB9VHBldzxvHZ2437g6dOcmeJ4X4ZDYqCu/Hvtq0f032w8fitJNo4/tkhNUSCOzknRLhdC2n+nQCIVkLFfDRMMVWm6FaNEc+sIlcp0qOUwoxDA1sTX7wsg/Kkyh5FzTQLtCKTKj6IiKNUhWi4FWJb4ezFjbI2lfFtnXhaMiKfgwyUiOklQaYZxCo9EYkYr/j+Zt9wtPlPDdzQcAAA==" -GridaniaGC = "H4sIAAAAAAAACuWVTUsDMRCG/0qZ8zYkmXzt3qRq6aF+FKF+4GGxkQbcjXRTRUr/u9PdLQXFc8He8mZehpmHmWQDV2XloYDxKizKOpSD8Wgwi+vkIYN5+fUeQ50aKJ42cBObkEKsodjAPRTSMp0jtzqDBygEkxk8QoHIcqGt3JKKtZ+cUwgpNCsXYU15kPEMpvHDV75OUJCY1Mmvypc0D2l5vfP/uOvro3KaZfzcR6gOyvZavjX+YG+LUxlcVDH5farkq/541jp6cbv2TerPu8TzMqRDxp26jKtRrBd9z7y7vAuVn5KPb7PfRKg5aY1ReyJKc8lNy0UqptApiccDI44GZqiYdEpgNypDwSxJlLolIwRz3KEyp0mGuhe5yTsyxMlaabqREZJxZ7R0JwlGO5YbTpPRkSEWlvYn78ggQ26cVSdJxiiGTtjulRlypjmiwu6VYcqqXPPT3CVjGRqp+onZgREatW3JDHMmuZP8z4+J7P+EzPP2G0RZ1w7VBwAA" -IdyllshireAlex = "H4sIAAAAAAAACuWUyWrDMBCGX6XMWRUaydbiW+kCOaRLKKRp6cE0UyKIrRIrLSXk3Ss7DqHJpddinWbTzz8fQhu4LSuCAkbzJTULv6KzSVhHAgbT8vsj+Do2ULxs4D40PvpQQ7GBJyjOleXaOGs1gxkUUmiOmVM5g+fUROROau3MNuWhptEVFJmxDCbl3K+TIHLBYBw+qaI6pusMRnWkVfkWpz4u7tp58bvW20y+mkX42neSoaT2Xi4bOox3LpHBdRUi7aUiVX140U30ycOamtjHrfC09PGg2GY3YXUZ6nm/vNgVH31F4zQntuwUjTRco1XW7NCg4C4du0MjW04mz9Qw0QiujMnQ9Wi6ZbsXI7iVKHU+SCwoubICzTGVFpd0mRwmFMUFSpudUFGCp6eS24FicVyhEDZ9tUdYdMKSW/dHKkcE/hOV1+0Pt8UVbrcGAAA=" -Limsa_Ticket_Usage = "H4sIAAAAAAAACl2PW0sDMRCF/0o5z2HZW3c1b6IWCtYbla0tPoR2aoMmkWaqyLL/3WSJCL7NmXx8OdPjVhmCxI02Xk2WevtGPHny6pUg0KnvD6cte8hNj3vnNWtnIXusIM+rbNo0As+QdZ6V7bRqBdaQbZ1VeVXWzRCiszS/gizKM4FHtdOnoCqyXGDhPsmQZcgQ5pbpqLbcaT7cRf7fLnUMjfzBff2+hCrBtlfvnv7wsV8hcG0cj19HFZNJ48VIpPBwIs9pjuJO6XhqMsY0c8dLZ3fp7IDF5VIbWgQuH16GHyf6vu9AAQAA" -Gridania_Ticket_Usage = "H4sIAAAAAAAACl2Py07DMBBFf6WatYniJqmMd6g81EV5qSgF1IXVDHQEtlHsglCUf2ccGSGxmzM+ur4zwLWxCBqueuqMIzPb0P4N4+whmFcEAa35/vDkYgD9PMCtDxTJO9ADbEGfLFSh6lrWAh6ZyqIpZTNfnAp4YlRFpapGVSOjd7g6By2ruYB709GR82RRClj7T7ToImiGlYvYm31sKR5ukv9vl7tyrXDwX78v3IfTXsx7wD99KikFXFgfp69TVESbx7PJyHB3xBDznIJbQ+nenJjo0vdL77p8O2tpuSGLa/bKcTf+ALqh+NVIAQAA" -Uldah_Ticket_Usage = "H4sIAAAAAAAACt1Qy07DMBD8lWovXExkJyHUviEeUg/lpVYpIA5WsxCLxkb1FoSi/DubNlUR4gvY087saDQ7LVzbBsHAfHVU2Xo0c8s3pNE82lcEAaX9eg/OUwTz1MJtiI5c8GBaWIA5Vlme6EJLLeABTJ5IzTM+EfDIRz1OlE5l3jEMHicXYFQmBdzbym3YTyUMpuEDG/QEhsHEE67tkkpH9U2v/8UNSTlWrMPn/sJ52O3FriIe5NuQSsBlEwj3VoTNsJ5tFQO422CkYe+NS+vo4Nijq7A+D74afpc7cuYanLJOduKPZvI00adFlv5sRue7ZpQsmEj1/2/mufsGGpBPq2ACAAA=" +-- If you would like it to buy the max amount of items that it can on each run +MaxInventory = true +-- This is meant to help try and get some of the suspicion of "why is this person teleporting to the GC so fast every time" +-- Personally have this value set at 1.5 minutes, but you can increase it if you would like, or you could just leave it be. +SlowDownTeleport = true +SlowDownTimer = 90 -- time is in seconds ::Functions:: -function TeleportTest() -while GetCharacterCondition(27) do + function TeleportTest() + while GetCharacterCondition(27) do yield("/wait 1") end - yield("/wait 1") + yield("/wait 1") while GetCharacterCondition(45) or GetCharacterCondition(51) do yield("/wait 3") end -end - -function AetheryteTeleport() --- body - while GetCharacterCondition(32) do - yield("/wait 1") end - yield("/wait 1") - while GetCharacterCondition(45) or GetCharacterCondition(51) do - yield("/wait 1") + + function AetheryteTeleport() + while GetCharacterCondition(32) do + yield("/wait 1") + end + yield("/wait 1") + while GetCharacterCondition(45) or GetCharacterCondition(51) do + yield("/wait 1") + end end -end + function DistanceToVendor() + if IsInZone(478) then -- Idyllshire + Distance_Test = GetDistanceToPoint(-19.277, 211, -36.076) + elseif IsInZone(132) then -- Gridania + Distance_Test = GetDistanceToPoint(-67.769, -0.501, -8.502) + elseif IsInZone(128) then -- Limsa Upper + Distance_Test = GetDistanceToPoint(93.219, 40.275, 75.265) + elseif IsInZone(130) then -- Ul' dah + Distance_Test = GetDistanceToPoint(-142.361, 4.1, -106.919) + end + end --tarnished gordian item ids, hardcoded. -LensID = 12674 -ShaftID = 12675 -CrankID = 12676 -SpringID = 12677 -PedalID = 12678 -BoltID = 12680 -LimsaTicketID = 21069 -GridaniaTicketID = 21070 -UldahTicketID = 21071 - ---initialize item counts -LensCount = GetItemCount(LensID) -ShaftCount = GetItemCount(ShaftID) -CrankCount = GetItemCount(CrankID) -SpringCount = GetItemCount(SpringID) -PedalCount = GetItemCount(PedalID) -BoltCount = GetItemCount(BoltID) -LimsaGCTicket = GetItemCount(LimsaTicketID) -GridaniaGCTicket = GetItemCount(GridaniaTicketID) -UldahGCTicket = GetItemCount(UldahTicketID) + LensID = 12674 + ShaftID = 12675 + CrankID = 12676 + SpringID = 12677 + PedalID = 12678 + BoltID = 12680 + LimsaTicketID = 21069 + GridaniaTicketID = 21070 + UldahTicketID = 21071 + + --initialize item counts + LensCount = GetItemCount(LensID) + ShaftCount = GetItemCount(ShaftID) + CrankCount = GetItemCount(CrankID) + SpringCount = GetItemCount(SpringID) + PedalCount = GetItemCount(PedalID) + BoltCount = GetItemCount(BoltID) + LimsaGCTicket = GetItemCount(LimsaTicketID) + GridaniaGCTicket = GetItemCount(GridaniaTicketID) + UldahGCTicket = GetItemCount(UldahTicketID) ::IdyllshireTurnin:: -while IsInZone(478) == false and GetCharacterCondition(27) == false do - yield("/tp Idyllshire") - yield("/wait 1.0") -end + while IsInZone(478) == false and GetCharacterCondition(27) == false do + yield("/tp Idyllshire") + yield("/wait 1.0") + end -TeleportTest() + TeleportTest() -if IsInZone(478) == false and GetCharacterCondition(27) == false then - yield("/echo Hmm.... either you moved, or the teleport failed, lets try that again") - yield("/wait 1") - goto IdyllshireTurnin -end + if IsInZone(478) == false and GetCharacterCondition(27) == false then + yield("/echo Hmm.... either you moved, or the teleport failed, lets try that again") + yield("/wait 1") + goto IdyllshireTurnin + end -if IsInZone(478) then - yield("/wait 3") - yield("/target Aetheryte") - yield("/lockon") - yield("/automove") - yield("/wait 1.5") - yield("/automove") - yield("/li West") - yield("/wait 1") -end + if IsInZone(478) then + + DistanceToVendor() + if Distance_Test > 1 then + if GetCharacterCondition(4) == false then + yield('/gaction "Mount Roulette"') + yield("/wait 3") + end + yield("/vnavmesh moveto -19.277 211 -36.076") + end + end -AetheryteTeleport() +::SabinaTest:: -Distance_Test = GetDistanceToPoint(-71.618, 208.926, -24.662) -if Distance_Test > 4 then - yield ("/echo hmm.... that failed for some reason. Gonna try that again") - goto IdyllshireTurnin -end + DistanceToVendor() -yield("/visland resume") -yield("/visland stop") -yield("/visland exectemponce "..IdyllshireAlex) -yield("/wait 0.5") - -while IsVislandRouteRunning() do - yield("/wait 0.5") -end + while Distance_Test > 1 do + yield ("/wait 0.5") + DistanceToVendor() + end -if (not IsVislandRouteRunning()) then yield("/ac dismount") yield("/wait 2") yield("/target Sabina") @@ -137,14 +137,14 @@ if (not IsVislandRouteRunning()) then yield("/wait 1.0") yield("/pcall SelectString True 0") yield("/wait 1.0") -end -Shop_Menu = 1 -Gordian_Part = 1 + Shop_Menu = 1 + Gordian_Part = 1 ::ShopInitialize:: - -if Shop_Menu == 1 then + -- In order it goes | Shop | Shaft 1/2 | Crank 1/2 | Spring 1/2 | Pedal 1/2 | Bolt 1/2 | Stop + if Shop_Menu == 1 then + Shop1Array = {3, 3, 5, 6, 8, 9, 11, 12, 14, 15, 22, 23} Alex_Shop = 3 Alex_Shaft1 = 3 Alex_Shaft2 = 5 @@ -157,280 +157,347 @@ if Shop_Menu == 1 then Alex_Bolt1 = 15 Alex_Bolt2 = 22 Alex_Stop = 23 - -elseif Shop_Menu == 2 then - Gordian_Part = 1 - Alex_Shop = 2 - Alex_Shaft1 = 2 - Alex_Shaft2 = 3 - Alex_Crank1 = 4 - Alex_Crank2 = 5 - Alex_Spring1 = 6 - Alex_Spring2 = 7 - Alex_Pedal1 = 8 - Alex_Pedal2 = 9 - Alex_Bolt1 = 10 - Alex_Bolt2 = 13 - Alex_Stop = 14 - -elseif Shop_Menu == 3 then - - Gordian_Part = 1 - Alex_Shop = 2 - Alex_Shaft1 = 2 - Alex_Shaft2 = 3 - Alex_Crank1 = 4 - Alex_Crank2 = 5 - Alex_Spring1 = 6 - Alex_Spring2 = 7 - Alex_Pedal1 = 8 - Alex_Pedal2 = 9 - Alex_Bolt1 = 10 - Alex_Bolt2 = 17 - Alex_Stop = 18 -end + elseif Shop_Menu == 2 then + Gordian_Part = 1 + Alex_Shop = 2 + Alex_Shaft1 = 2 + Alex_Shaft2 = 3 + Alex_Crank1 = 4 + Alex_Crank2 = 5 + Alex_Spring1 = 6 + Alex_Spring2 = 7 + Alex_Pedal1 = 8 + Alex_Pedal2 = 9 + Alex_Bolt1 = 10 + Alex_Bolt2 = 13 + Alex_Stop = 14 + elseif Shop_Menu == 3 then + Gordian_Part = 1 + Alex_Shop = 2 + Alex_Shaft1 = 2 + Alex_Shaft2 = 3 + Alex_Crank1 = 4 + Alex_Crank2 = 5 + Alex_Spring1 = 6 + Alex_Spring2 = 7 + Alex_Pedal1 = 8 + Alex_Pedal2 = 9 + Alex_Bolt1 = 10 + Alex_Bolt2 = 17 + Alex_Stop = 18 + end ::BuyingItems:: - -while (Gordian_Part == 1) and (Shop_Menu <= Alex_Shaft2) do - - -- Shaft Section - if (ShaftCount <=3) and (Alex_Shop >= Alex_Shaft1) and (Alex_Shop <= Alex_Shaft2) then - Alex_Shop = Alex_Crank1 - -- yield("/echo Shaft Count: "..ShaftCount) - -- yield("/echo Should be moving to next menu") - -- yield("/echo Shop Menu: "..Alex_Shop) - elseif (ShaftCount >= 4 ) and (Alex_Shop >= Alex_Shaft1) and (Alex_Shop <= Alex_Shaft2) then - yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") - Alex_Shop = Alex_Shop + 1 - CrankCount = GetItemCount(CrankID) - --yield("/echo Shop Menu: "..Alex_Shop) -- Just Debugging Stuff - yield("/wait "..Alex_Shop_Timer) - - -- Crank Section - elseif (CrankCount <=1) and (Alex_Shop >= Alex_Crank1) and (Alex_Shop <= Alex_Crank2) then - Alex_Shop = Alex_Spring1 - -- yield("/echo Crank Count: "..CrankCount) - -- yield("/echo Should be moving to Shaft") - - elseif (CrankCount >= 2) and (Alex_Shop >= Alex_Crank1) and (Alex_Shop <= Alex_Crank2) then - yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") - Alex_Shop = Alex_Shop + 1 - SpringCount = GetItemCount(SpringID) - --yield("/echo Shop Menu: "..Alex_Shop) - yield("/wait "..Alex_Shop_Timer) + -- this is moreso a footnote to myself. The Gordian_Part == 1 is to break the sequence after it gets done w/ the shop ENTIRELY. + while (Gordian_Part == 1) and (Shop_Menu <= Alex_Shaft2) do + + ShaftCount = GetItemCount(ShaftID) -- 4 + CrankCount = GetItemCount(CrankID) -- 2 + SpringCount = GetItemCount(SpringID) -- 4 + PedalCount = GetItemCount(PedalID) -- 2 + BoltCount = GetItemCount(BoltID) -- 1 + i_count = GetInventoryFreeSlotCount() + + -- Shaft Section + if (ShaftCount <=3) and (Alex_Shop >= Alex_Shaft1) and (Alex_Shop <= Alex_Shaft2) then + Alex_Shop = Alex_Crank1 + -- yield("/echo Shaft Count: "..ShaftCount) + -- yield("/echo Should be moving to next menu") + -- yield("/echo Shop Menu: "..Alex_Shop) + elseif (ShaftCount >= 4 ) and (Alex_Shop >= Alex_Shaft1) and (Alex_Shop <= Alex_Shaft2) then + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") + Alex_Shop = Alex_Shop + 1 + ShaftCount = GetItemCount(ShaftID) + --yield("/echo Shop Menu: "..Alex_Shop) -- Just Debugging Stuff + yield("/wait "..Alex_Shop_Timer) + i_count = GetInventoryFreeSlotCount() + if Shop_Menu == 3 and MaxInventory == true and Alex_Shop == Alex_Shaft2 then + if i_count > math.floor(ShaftCount/4) then + i_count = math.floor(ShaftCount/4) + end + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." "..i_count) + yield("/wait "..Alex_Shop_Timer) + Alex_Shop = Alex_Shop + 1 + yield("/wait "..Alex_Shop_Timer) + ShaftCount = GetItemCount(ShaftID) + i_count = GetInventoryFreeSlotCount() + end + + -- Crank Section + elseif (CrankCount <=1 and Alex_Shop >= Alex_Crank1 and Alex_Shop <= Alex_Crank2) then + Alex_Shop = Alex_Spring1 + -- yield("/echo Crank Count: "..CrankCount) + -- yield("/echo Should be moving to Shaft" + elseif (CrankCount >= 2) and (Alex_Shop >= Alex_Crank1) and (Alex_Shop <= Alex_Crank2) then + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") + Alex_Shop = Alex_Shop + 1 + CrankCount = GetItemCount(CrankID) + --yield("/echo Shop Menu: "..Alex_Shop) + yield("/wait "..Alex_Shop_Timer) + i_count = GetInventoryFreeSlotCount() + if Shop_Menu == 3 and MaxInventory == true and Alex_Shop == Alex_Crank2 and (ShaftCount <= 3) then + if i_count > math.floor(CrankCount/2) then + i_count = math.floor(CrankCount/2) + end + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." "..i_count) + yield("/wait "..Alex_Shop_Timer) + Alex_Shop = Alex_Shop + 1 + yield("/wait "..Alex_Shop_Timer) + CrankCount = GetItemCount(CrankID) + i_count = GetInventoryFreeSlotCount() + end -- Springs Section - elseif (SpringCount <=3) and (Alex_Shop >= Alex_Spring1) and (Alex_Shop <= Alex_Spring2) then - Alex_Shop = Alex_Pedal1 - -- yield("/echo Spring Count: "..SpringCount) - -- yield("/echo Should be moving to Crank") - - elseif (SpringCount >=4) and (Alex_Shop >= Alex_Spring1) and (Alex_Shop <= Alex_Spring2) then - yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") - Alex_Shop = Alex_Shop + 1 - SpringCount = GetItemCount(SpringID) - --yield("/echo Shop Menu: "..Alex_Shop) - yield("/wait "..Alex_Shop_Timer) - + elseif (SpringCount <=3 and Alex_Shop >= Alex_Spring1 and Alex_Shop <= Alex_Spring2) then + Alex_Shop = Alex_Pedal1 + -- yield("/echo Spring Count: "..SpringCount) + -- yield("/echo Should be moving to Crank") + elseif (SpringCount >=4) and (Alex_Shop >= Alex_Spring1) and (Alex_Shop <= Alex_Spring2) then + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") + Alex_Shop = Alex_Shop + 1 + SpringCount = GetItemCount(SpringID) + --yield("/echo Shop Menu: "..Alex_Shop) + yield("/wait "..Alex_Shop_Timer) + i_count = GetInventoryFreeSlotCount() + if Shop_Menu == 3 and MaxInventory == true and Alex_Shop == Alex_Spring2 and (ShaftCount <= 3 and CrankCount <=1) then + if i_count > math.floor(SpringCount/4) then + i_count = math.floor(SpringCount/4) + end + yield("/e Spring Send Amount = "..i_count) + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." "..i_count) + yield("/wait "..Alex_Shop_Timer) + Alex_Shop = Alex_Shop + 1 + yield("/wait "..Alex_Shop_Timer) + SpringCount = GetItemCount(SpringID) + i_count = GetInventoryFreeSlotCount() + end + -- Pedal Check Section - elseif (PedalCount <= 1) and (Alex_Shop >= Alex_Pedal1) and (Alex_Shop <= Alex_Pedal2) then - Alex_Shop = Alex_Bolt1 - -- yield("/echo Pedal Count: "..PedalCount) - -- yield("/echo Should be moving to Springs") - yield("/wait 0.2") - - elseif (PedalCount >= 2) and (Alex_Shop >= Alex_Pedal1) and (Alex_Shop <= Alex_Pedal2) then - yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") - Alex_Shop = Alex_Shop + 1 - PedalCount = GetItemCount(PedalID) - --yield("/echo Shop Menu: "..Alex_Shop) - yield("/wait "..Alex_Shop_Timer) - --- Bolt Section - -- If no bolts, then it stops - elseif (BoltCount == 0) and (Alex_Shop >= Alex_Bolt1) and (Alex_Shop <= Alex_Bolt2) then - Alex_Shop = Alex_Stop - -- yield("/echo Bolt Count: "..BoltCount) - -- yield("/echo Should be moving to Pedals") - - elseif (BoltCount >= 1) and (Alex_Shop >= Alex_Bolt1) and (Alex_Shop <= Alex_Bolt2) then - yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") - Alex_Shop = Alex_Shop + 1 - BoltCount = GetItemCount(BoltID) - --yield("/echo Shop Menu: "..Alex_Shop) - yield("/wait "..Alex_Shop_Timer) + elseif (PedalCount <= 1 and Alex_Shop >= Alex_Pedal1 and Alex_Shop <= Alex_Pedal2) then + Alex_Shop = Alex_Bolt1 + -- yield("/echo Pedal Count: "..PedalCount) + -- yield("/echo Should be moving to Springs") + yield("/wait 0.2") + elseif (PedalCount >= 2) and (Alex_Shop >= Alex_Pedal1) and (Alex_Shop <= Alex_Pedal2) then + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") + Alex_Shop = Alex_Shop + 1 + PedalCount = GetItemCount(PedalID) + --yield("/echo Shop Menu: "..Alex_Shop) + yield("/wait "..Alex_Shop_Timer) + i_count = GetInventoryFreeSlotCount() + if Shop_Menu == 3 and MaxInventory == true and Alex_Shop == Alex_Pedal2 and (ShaftCount <= 3 and CrankCount <=1 and SpringCount <= 3) then + if i_count > math.floor(PedalCount/2) then + i_count = math.floor(PedalCount/2) + end + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." "..i_count) + yield("/wait "..Alex_Shop_Timer) + Alex_Shop = Alex_Shop + 1 + yield("/wait "..Alex_Shop_Timer) + PedalCount = GetItemCount(PedalID) + i_count = GetInventoryFreeSlotCount() + end + + -- Bolt Section + -- If no bolts, then it stops + elseif (BoltCount == 0 and Alex_Shop >= Alex_Bolt1 and Alex_Shop <= Alex_Bolt2) then + Alex_Shop = Alex_Stop + -- yield("/echo Bolt Count: "..BoltCount) + -- yield("/echo Should be moving to Pedals") + elseif (BoltCount >= 1) and (Alex_Shop >= Alex_Bolt1) and (Alex_Shop <= Alex_Bolt2) then + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." 1") + Alex_Shop = Alex_Shop + 1 + BoltCount = GetItemCount(BoltID) + --yield("/echo Shop Menu: "..Alex_Shop) + yield("/wait "..Alex_Shop_Timer) + i_count = GetInventoryFreeSlotCount() + if Shop_Menu == 3 and MaxInventory == true and Alex_Shop == Alex_Bolt2 and (ShaftCount <= 3 and CrankCount <=1 and SpringCount <= 3 and PedalCount <= 1) then + if i_count > BoltCount then + i_count = BoltCount + end + yield("/pcall ShopExchangeItem True 0 "..Alex_Shop.." "..i_count) + yield("/wait "..Alex_Shop_Timer) + Alex_Shop = Alex_Shop + 1 + yield("/wait "..Alex_Shop_Timer) + BoltCount = GetItemCount(BoltID) + end -- Time to swap menu's - elseif (Alex_Shop == Alex_Stop) and (Shop_Menu == 1) then - -- yield("/echo DOW 1 Menu is completed") + elseif (Alex_Shop == Alex_Stop) and (Shop_Menu == 1) then + -- yield("/echo DOW 1 Menu is completed") - Gordian_Part = Gordian_Part + 1 - Shop_Menu = (Shop_Menu + 1) + Shop_Menu = (Shop_Menu + 1) - -- yield("/echo Shop Menu is Currently: "..Shop_Menu) + -- yield("/echo Shop Menu is Currently: "..Shop_Menu) - yield("/pcall ShopExchangeItem True -1") - yield("/wait 1") - yield("/pcall SelectString True 1") - yield("/wait 1.5") + yield("/pcall ShopExchangeItem True -1") + yield("/wait 1") + yield("/pcall SelectString True 1") + yield("/wait 1.5") - goto ShopInitialize + goto ShopInitialize - elseif (Alex_Shop == Alex_Stop) and (Shop_Menu == 2) then - -- yield("/echo DOW 2 Menu is completed") + elseif (Alex_Shop == Alex_Stop) and (Shop_Menu == 2) then + -- yield("/echo DOW 2 Menu is completed") - Gordian_Part = Gordian_Part + 1 - Shop_Menu = (Shop_Menu + 1) + Shop_Menu = (Shop_Menu + 1) - -- yield("/echo Shop Menu is Currently: "..Shop_Menu) + -- yield("/echo Shop Menu is Currently: "..Shop_Menu) - yield("/pcall ShopExchangeItem True -1") - yield("/wait 1") - yield("/pcall SelectString True 2") - yield("/wait 1.5") + yield("/pcall ShopExchangeItem True -1") + yield("/wait 1") + yield("/pcall SelectString True 2") + yield("/wait 1.5") - goto ShopInitialize + goto ShopInitialize - elseif (Alex_Shop == Alex_Stop) and (Shop_Menu == 3) then - --yield("/echo DOM Menu is completed") + elseif (Alex_Shop == Alex_Stop) and (Shop_Menu == 3) then + --yield("/echo DOM Menu is completed") - Gordian_Part = Gordian_Part + 1 - Shop_Menu = (Shop_Menu + 1) + Gordian_Part = Gordian_Part + 1 + Shop_Menu = (Shop_Menu + 1) - --yield("/echo Shop Menu is Currently: "..Shop_Menu) + --yield("/echo Shop Menu is Currently: "..Shop_Menu) - yield("/pcall ShopExchangeItem True -1") - yield("/wait 1") - yield("/pcall SelectString True 7") - yield("/wait 1.5") + yield("/pcall ShopExchangeItem True -1") + yield("/wait 1") + yield("/pcall SelectString True 7") + yield("/wait 1.5") end end ::TicketsPlease:: -LimsaGCTicket = GetItemCount(LimsaTicketID) -GridaniaGCTicket = GetItemCount(GridaniaTicketID) -UldahGCTicket = GetItemCount(UldahTicketID) + LimsaGCTicket = GetItemCount(LimsaTicketID) + GridaniaGCTicket = GetItemCount(GridaniaTicketID) + UldahGCTicket = GetItemCount(UldahTicketID) ::GrandCompanyTurnin:: -if (LimsaGCTicket >= 1) then - yield("/item Maelstrom aetheryte ticket") - yield("/wait 1.0") -elseif (GridaniaGCTicket >= 1) then - yield("/item Twin Adder aetheryte ticket") - yield("/wait 1.0") -elseif (UldahGCTicket >= 1) then - yield("/item Immortal Flames aetheryte tickets") - yield("/wait 1.0") -elseif (LimsaGCTicket == 0) or (GridaniaGCTicket == 0) or (UldahGCTicket == 0) then - TeleportToGCTown() - yield("/wait 1.0") -end + if (LimsaGCTicket >= 1) then + yield("/item Maelstrom aetheryte ticket") + yield("/wait 1.0") + elseif (GridaniaGCTicket >= 1) then + yield("/item Twin Adder aetheryte ticket") + yield("/wait 1.0") + elseif (UldahGCTicket >= 1) then + yield("/item Immortal Flames aetheryte ticket") + yield("/wait 1.0") + elseif (LimsaGCTicket == 0) or (GridaniaGCTicket == 0) or (UldahGCTicket == 0) then + TeleportToGCTown() + yield("/wait 1.0") + end -TeleportTest() + TeleportTest() -if IsInZone(478) == true and GetCharacterCondition(27) == false then - yield("/echo Hmm.... either you moved, or the teleport failed, lets try that again") - yield("/wait 1") - goto GrandCompanyTurnin -end + if IsInZone(478) == true and GetCharacterCondition(27) == false then + yield("/echo Hmm.... either you moved, or the teleport failed, lets try that again") + yield("/wait 1") + goto GrandCompanyTurnin + end ::GrandCompanyCheck:: -if (LimsaGCTicket >= 1) then - goto LimsaAetheryteTicket -elseif (GridaniaGCTicket >= 1) then - goto GridaniaAetheryteTicket -elseif (UldahGCTicket >= 1) then - goto UldahAetheryteTicket -elseif IsInZone(129) and (LimsaGCTicket == 0) then -- Limsa's GC - goto LimsaLower -elseif IsInZone(130) and (GridaniaGCTicket == 0) then -- Ul'dah's GC - goto Uldah -elseif IsInZone(132) and (UldahGCTicket == 0) then -- Grdiania's GC - goto Gridania -end + if (LimsaGCTicket >= 1) then + goto LimsaAetheryteTicket + elseif (GridaniaGCTicket >= 1) then + goto GridaniaAetheryteTicket + elseif (UldahGCTicket >= 1) then + goto UldahAetheryteTicket + elseif IsInZone(129) and (LimsaGCTicket == 0) then -- Limsa's GC + goto LimsaLower + elseif IsInZone(130) and (GridaniaGCTicket == 0) then -- Ul'dah's GC + goto Uldah + elseif IsInZone(132) and (UldahGCTicket == 0) then -- Grdiania's GC + goto Gridania + end ::LimsaLower:: -if IsInZone(129) then -- Limsa's GC - yield("/target Aetheryte") - yield("/lockon") - yield("/automove") - yield("/wait 1.0") - yield("/automove") - yield("/li The Aftcastle") - yield("/wait 1") - while GetCharacterCondition(32) do - yield("/wait 1") - end - while GetCharacterCondition(45) or GetCharacterCondition(51) do - yield("/wait 1") - end -end + if IsInZone(129) then -- Limsa's Lower, moving to the upper to get to the GC + yield("/target Aetheryte") + yield("/lockon") + yield("/automove") + yield("/wait 1.0") + yield("/automove") + yield("/li The Aftcastle") + yield("/wait 1") + while GetCharacterCondition(32) do + yield("/wait 1") + end + while GetCharacterCondition(45) or GetCharacterCondition(51) do + yield("/wait 1") + end + end -if IsInZone(128) then -- Limsa Upper - yield("/visland exectemponce "..LimsaGC) - yield("/wait 0.5") - goto WalkingtoGC -end + if IsInZone(128) then -- Limsa Upper + yield("/vnavmesh moveto 93.9 40.175 75.409") + yield("/wait 0.5") + goto WalkingtoGC + end ::Uldah:: -if IsInZone(130) then - yield("/visland exectemponce "..UldahGC) - yield("/wait 0.5") - goto WalkingtoGC -end + if IsInZone(130) then + DistanceToVendor() + yield("/vnavmesh moveto -142.361 4.1 -106.919") + yield("/wait 0.5") + goto WalkingtoGC + end ::Gridania:: -if IsInZone(132) then - yield("/visland exectemponce "..GridaniaGC) - yield("/wait 0.5") - goto WalkingtoGC -end + if IsInZone(132) then + yield("/vnavmesh moveto -67.757 -0.501 -8.393") + yield("/wait 0.5") + goto WalkingtoGC + end ::LimsaAetheryteTicket:: -if IsInZone(128) then -- Limsa Upper - yield("/visland exectemponce "..Limsa_Ticket_Usage) - yield("/wait 0.5") - goto WalkingtoGC -end + if IsInZone(128) then -- Limsa Upper + yield("/vnavmesh moveto 93.9 40.175 75.409") + yield("/wait 0.5") + goto WalkingtoGC + end ::GridaniaAetheryteTicket:: -if IsInZone(132) then - yield("/visland exectemponce "..Gridania_Ticket_Usage) - yield("/wait 0.5") - goto WalkingtoGC -end + if IsInZone(132) then + yield("/vnavmesh moveto -67.757 -0.501 -8.393") + yield("/wait 0.5") + goto WalkingtoGC + end ::UldahAetheryteTicket:: -if IsInZone(130) then - yield("/visland exectemponce "..Uldah_Ticket_Usage) - yield("/wait 0.5") - goto WalkingtoGC -end - - + if IsInZone(130) then + yield("/vnavmesh moveto -142.361 4.1 -106.919") + yield("/wait 0.5") + goto WalkingtoGC + end ::WalkingtoGC:: -while IsVislandRouteRunning() do - yield("/wait 2") -end + DistanceToVendor() + + while Distance_Test > 1 do + yield ("/wait 0.5") + DistanceToVendor() + end ::GCTurnin:: -yield("/deliveroo enable") -yield("/wait 0.5") + yield("/deliveroo enable") + yield("/wait 0.5") -while DeliverooIsTurnInRunning() do - yield("/wait 1") -end + while DeliverooIsTurnInRunning() do + yield("/wait 1") + end ::InventoryCheck:: -if BoltCount == 0 then + + ShaftCount = GetItemCount(ShaftID) -- 4 + CrankCount = GetItemCount(CrankID) -- 2 + SpringCount = GetItemCount(SpringID) -- 4 + PedalCount = GetItemCount(PedalID) -- 2 + BoltCount = GetItemCount(BoltID) -- 1 + + if (ShaftCount <= 3 and CrankCount <= 1 and SpringCount <=3 and PedalCount <=1 and BoltCount == 0) then yield("/visland stop") goto StoppingScript -elseif (BoltCount > 0) then + elseif (ShaftCount >= 4 or CrankCount >= 2 or SpringCount >= 4 or PedalCount >= 2 or BoltCount >= 1) then yield("/visland stop") goto IdyllshireTurnin end