Rebornbuddy
Loading...
Searching...
No Matches
ff14bot.Behavior.CommonTasks Class Reference

Class that houses several functions useful to 3rd-party developers. More...

Static Public Member Functions

static Task< bool > ExecuteCoroutine (this Composite composite, object context=null)
 Executes the composite inside a coroutine.
static async Task HandleLoading ()
 Waits indefinitely for the game to finish loading.
static async Task< bool > CloseTradeWindows ()
 Checks the status of the global settings for handling trade windows and the closes and blacklists players based on those settings.
static async Task< bool > Return ()
 Attempts to use the return command to return to the players home point.
static async Task< bool > Teleport (uint aetheryteId)
 Attempts to teleport to the provided aetheryte.
static async Task< MoveResultMoveTo (Vector3 destination, string destinationName=null)
 Moves to a location.
static async Task< bool > MoveAndStop (MoveToParameters parameters, float range, bool stopInRange=false, string destinationName=null)
 Moves the player to a specified location and stops when certain conditions are met.
static async Task< bool > MoveAndStop (MoveToParameters parameters, Func< bool > stopPredicate, string destinationName=null)
 Moves the player to the specified destination and stops when the stop condition is met.
static async Task< MoveResultMoveTo (MoveToParameters parameters, string destinationName=null)
 Moves to a location.
static async Task< bool > StopMoving (string reason=null)
 Executes a MoveStop command if moving and waits for movement to stop.
static async Task< bool > StopAndDismount ()
 Stops the player from moving and dismounts. Function 'sleeps' for the proper amount of time after stopping or dismounting If player is already stopped and dismounting the function does not sleep.
static Task< bool > MountUp ()
 Attempts to mountup.
static async Task< bool > MountUp (uint mountid)
 Attempts to mountup.
static async Task< bool > SummonFlyingMount ()
 Attempts to mount up If the current mount cannot fly, will dismount and mount the black chocobo.
static async Task< bool > TakeOff ()
 Attempts to mount up and take off If the current mount cannot fly, will dismount and mount the black chocobo.
static async Task< AscendToResultAscendTo (float height)
 Attempts to fly vertically up to height Does a raycast before doing anything to see if there is something in our way.
static async Task< DescendToResultDescendTo (float height)
 Attempts to descend vertically to a given height Does a raycast before doing anything to see if there is something in our way.
static async Task< CanLandResultCanLand ()
 Attempts to find if we can land by descending straight down from the current point.
static async Task< CanLandResultCanLand (Vector3 pointInAir)
 Attempts to find if we can land by descending straight down from a given location Providing a vector that is more then 100yards away in 3d space will always return maybe as after that point the results were unreliable.
static async Task< bool > Land ()
 Attempts to descend all the way until we land. Currently does not implement any advanced logic to ensure that we are currently over someplace that we can actually dismount.
static async Task< float > GetDesynthesisChance (BagSlot slot)
 Gets the chance to succesfully desynthesize an item Leaves the SalvageDialog window open after completion.
static async Task< DesynthesisResultDesynthesize (BagSlot slot, int delay=5000)
 Attempts to desyntheize the item at the given bagslot.
static async Task< bool > HandOverRequestedItems (bool useHQifNoNQ=true)
 Function attempts to hand over all the items requested by the open request dialog Will attempt to use HQ items if no NQ of the requested item is available by default.
static async Task< SellItemResultSellItem (BagSlot bagslot, int delay=5000)
 Coroutine that attempts to sell the item to the currently open vendor.
static async Task< AetherialReductionResultAetherialReduction (BagSlot bagslot)
 Coroutine that attempts to use aetherial reduction on the supplied item.
static async Task< SpiritbondResultExtractMateria (BagSlot bagslot, int sleepDuration=5000)
 Coroutine that will attempt to extract an materia from an item.
static async Task< SpiritbondResultConvertToMateria (BagSlot bagslot, int sleepDuration=5000)

Detailed Description

Class that houses several functions useful to 3rd-party developers.

Member Function Documentation

◆ AetherialReduction()

async Task< AetherialReductionResult > ff14bot.Behavior.CommonTasks.AetherialReduction ( BagSlot bagslot)
static

Coroutine that attempts to use aetherial reduction on the supplied item.

Parameters
bagslotBagslot to reduce
Returns

◆ AscendTo()

async Task< AscendToResult > ff14bot.Behavior.CommonTasks.AscendTo ( float height)
static

Attempts to fly vertically up to height Does a raycast before doing anything to see if there is something in our way.

Parameters
heightHeight to fly up to
Returns
returns a flag with various states

◆ CanLand() [1/2]

async Task< CanLandResult > ff14bot.Behavior.CommonTasks.CanLand ( )
static

Attempts to find if we can land by descending straight down from the current point.

Returns
CanLandResult.Yes = If we descend from our current position we will land in a location where we can dismount CanLandResult.No = If we descend from our current position we will NOT land in a location where we can dismount CanLandResult.Maybe = We are too far above ground to be able to tell if we can land

◆ CanLand() [2/2]

async Task< CanLandResult > ff14bot.Behavior.CommonTasks.CanLand ( Vector3 pointInAir)
static

Attempts to find if we can land by descending straight down from a given location Providing a vector that is more then 100yards away in 3d space will always return maybe as after that point the results were unreliable.

Parameters
pointInAir
Returns
CanLandResult.Yes = If we descend from pointInAir we will land in a location where we can dismount CanLandResult.No = If we descend from pointInAir we will NOT land in a location where we can dismount CanLandResult.Maybe = Our raycast was limited in resolution, and as such the provided point was too far away or we were too far above ground

◆ CloseTradeWindows()

async Task< bool > ff14bot.Behavior.CommonTasks.CloseTradeWindows ( )
static

Checks the status of the global settings for handling trade windows and the closes and blacklists players based on those settings.

Returns

◆ ConvertToMateria()

async Task< SpiritbondResult > ff14bot.Behavior.CommonTasks.ConvertToMateria ( BagSlot bagslot,
int sleepDuration = 5000 )
static

◆ DescendTo()

async Task< DescendToResult > ff14bot.Behavior.CommonTasks.DescendTo ( float height)
static

Attempts to descend vertically to a given height Does a raycast before doing anything to see if there is something in our way.

Parameters
heightHeight to descend to
Returns
returns a flag with various states

◆ Desynthesize()

async Task< DesynthesisResult > ff14bot.Behavior.CommonTasks.Desynthesize ( BagSlot slot,
int delay = 5000 )
static

Attempts to desyntheize the item at the given bagslot.

Parameters
slot
delayHow long to wait in milliseconds after pressing the desyntheize button
Returns
Success if the bagslot was desynthzied, otherwise failure. Success is returned even if the desynthesis was botched.

◆ ExecuteCoroutine()

Task< bool > ff14bot.Behavior.CommonTasks.ExecuteCoroutine ( this Composite composite,
object context = null )
static

Executes the composite inside a coroutine.

Parameters
composite
context
Returns
true if the composite finished with RunStatus.Success; otherwise false.

◆ ExtractMateria()

async Task< SpiritbondResult > ff14bot.Behavior.CommonTasks.ExtractMateria ( BagSlot bagslot,
int sleepDuration = 5000 )
static

Coroutine that will attempt to extract an materia from an item.

Parameters
bagslotSlot that contains the item to convert
sleepDurationHow long to sleep after clicking yes in milliseconds.
Returns
Returns CannotSpiritbond if slot is not valid or item is not convertible Returns SpiritbondNotComplete if bagslot spiritbond percent is less than 100 Returns Failure if we attempted to convert the item but something went wrong Returns Success otherwise

inheritdoc cref="ExtractMateria"/>

◆ GetDesynthesisChance()

async Task< float > ff14bot.Behavior.CommonTasks.GetDesynthesisChance ( BagSlot slot)
static

Gets the chance to succesfully desynthesize an item Leaves the SalvageDialog window open after completion.

Parameters
slot
Returns
float.MinValue if something went wrong

◆ HandleLoading()

async Task ff14bot.Behavior.CommonTasks.HandleLoading ( )
static

Waits indefinitely for the game to finish loading.

Returns
A task that completes when the loading screen has ended.

◆ HandOverRequestedItems()

async Task< bool > ff14bot.Behavior.CommonTasks.HandOverRequestedItems ( bool useHQifNoNQ = true)
static

Function attempts to hand over all the items requested by the open request dialog Will attempt to use HQ items if no NQ of the requested item is available by default.

Parameters
useHQifNoNQif false, fail instead of using
Exceptions
System.InvalidOperationExceptionThrown when we don't have the required amount of a requested item
Returns
returns true if we handed everything over, false if the window wasn't open

◆ Land()

async Task< bool > ff14bot.Behavior.CommonTasks.Land ( )
static

Attempts to descend all the way until we land. Currently does not implement any advanced logic to ensure that we are currently over someplace that we can actually dismount.

Returns

◆ MountUp() [1/2]

Task< bool > ff14bot.Behavior.CommonTasks.MountUp ( )
static

Attempts to mountup.

Returns
true if we are mounted, false otherwise

◆ MountUp() [2/2]

async Task< bool > ff14bot.Behavior.CommonTasks.MountUp ( uint mountid)
static

Attempts to mountup.

Parameters
mountidid of the mount to use
Returns
true if we are mounted, false otherwise

◆ MoveAndStop() [1/2]

async Task< bool > ff14bot.Behavior.CommonTasks.MoveAndStop ( MoveToParameters parameters,
float range,
bool stopInRange = false,
string destinationName = null )
static

Moves the player to a specified location and stops when certain conditions are met.

Parameters
parametersThe movement parameters containing location data and other movement settings.
rangeThe range within which the movement should stop.
stopInRangeIndicates whether to stop movement when within the specified range.
destinationNameAn optional name for the destination, used for logging purposes.
Returns
A task that represents the asynchronous operation. Returns true if movement was required and completed; otherwise, false if no movement was necessary.

◆ MoveAndStop() [2/2]

async Task< bool > ff14bot.Behavior.CommonTasks.MoveAndStop ( MoveToParameters parameters,
Func< bool > stopPredicate,
string destinationName = null )
static

Moves the player to the specified destination and stops when the stop condition is met.

Parameters
parametersThe parameters defining the movement details, including the destination.
stopPredicateA function that determines whether the character should stop moving.
destinationNameAn optional friendly name of the destination for logging or debugging.
Returns
true if the movement was completed successfully; otherwise, false.

◆ MoveTo() [1/2]

async Task< MoveResult > ff14bot.Behavior.CommonTasks.MoveTo ( MoveToParameters parameters,
string destinationName = null )
static

Moves to a location.

Parameters
parametersThe parameters.
destinationNameThe location name to show in the log.
Returns
The result.

◆ MoveTo() [2/2]

async Task< MoveResult > ff14bot.Behavior.CommonTasks.MoveTo ( Vector3 destination,
string destinationName = null )
static

Moves to a location.

Parameters
destinationThe destination.
destinationNameThe location name to show in log.
Returns
The result.

◆ Return()

async Task< bool > ff14bot.Behavior.CommonTasks.Return ( )
static

Attempts to use the return command to return to the players home point.

Returns
true if return finished, false otherwise

◆ SellItem()

async Task< SellItemResult > ff14bot.Behavior.CommonTasks.SellItem ( BagSlot bagslot,
int delay = 5000 )
static

Coroutine that attempts to sell the item to the currently open vendor.

Parameters
bagslotBagslot to vendor
delayHow long should we wait for selectyesno and for the slot to become empty, in milliseconds
Returns

◆ StopAndDismount()

async Task< bool > ff14bot.Behavior.CommonTasks.StopAndDismount ( )
static

Stops the player from moving and dismounts. Function 'sleeps' for the proper amount of time after stopping or dismounting If player is already stopped and dismounting the function does not sleep.

Returns

◆ StopMoving()

async Task< bool > ff14bot.Behavior.CommonTasks.StopMoving ( string reason = null)
static

Executes a MoveStop command if moving and waits for movement to stop.

Parameters
reasonThe reason.
Returns
true if any action was taken; false otherwise.

◆ SummonFlyingMount()

async Task< bool > ff14bot.Behavior.CommonTasks.SummonFlyingMount ( )
static

Attempts to mount up If the current mount cannot fly, will dismount and mount the black chocobo.

Returns
true if we were able to mount up

◆ TakeOff()

async Task< bool > ff14bot.Behavior.CommonTasks.TakeOff ( )
static

Attempts to mount up and take off If the current mount cannot fly, will dismount and mount the black chocobo.

Returns
False if we couldn't take off, true if MovementManager.IsFlying is true

◆ Teleport()

async Task< bool > ff14bot.Behavior.CommonTasks.Teleport ( uint aetheryteId)
static

Attempts to teleport to the provided aetheryte.

Parameters
aetheryteIdid of the aetheryte to teleport to
Returns
true if teleport finished, false otherwise