diff --git a/Include/Core/Internal.hpp b/Include/Core/Internal.hpp index 4f98a1e..61092cf 100644 --- a/Include/Core/Internal.hpp +++ b/Include/Core/Internal.hpp @@ -136,6 +136,7 @@ namespace Internal std::int32_t GetCrosshairState(); std::vector GetCurrentLevels(); std::int32_t GetCurrentWorld(); + Widget GetDraggingWidget(); std::int32_t GetDraggingItemDuration(); Cache GetDynamicObjectCache(); std::vector GetExchangeOffers(); diff --git a/Include/Game/Interactable/DecorativeObject.hpp b/Include/Game/Interactable/DecorativeObject.hpp index 6055f30..4a4e9c3 100644 --- a/Include/Game/Interactable/DecorativeObject.hpp +++ b/Include/Game/Interactable/DecorativeObject.hpp @@ -12,6 +12,7 @@ #include "../../Game/Tools/Camera.hpp" #include #include +#include namespace Interactable { @@ -47,6 +48,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; bool Interact(const std::function&)>& InteractMethod) const; diff --git a/Include/Game/Interactable/GameObject.hpp b/Include/Game/Interactable/GameObject.hpp index 2167640..811260e 100644 --- a/Include/Game/Interactable/GameObject.hpp +++ b/Include/Game/Interactable/GameObject.hpp @@ -12,6 +12,7 @@ #include "../../Game/Tools/Camera.hpp" #include #include +#include namespace Interactable { @@ -49,6 +50,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; bool Interact(const std::function&)>& InteractMethod) const; diff --git a/Include/Game/Interactable/GroundItem.hpp b/Include/Game/Interactable/GroundItem.hpp index 87cb9df..52a9651 100644 --- a/Include/Game/Interactable/GroundItem.hpp +++ b/Include/Game/Interactable/GroundItem.hpp @@ -12,6 +12,7 @@ #include "../../Game/Tools/Camera.hpp" #include #include +#include namespace Interactable { @@ -50,6 +51,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; bool Interact(const std::function&)>& InteractMethod) const; diff --git a/Include/Game/Interactable/GroundObject.hpp b/Include/Game/Interactable/GroundObject.hpp index 9336130..2cd28c1 100644 --- a/Include/Game/Interactable/GroundObject.hpp +++ b/Include/Game/Interactable/GroundObject.hpp @@ -12,6 +12,7 @@ #include "../../Game/Tools/Camera.hpp" #include #include +#include namespace Interactable { @@ -47,6 +48,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; bool Interact(const std::function&)>& InteractMethod) const; diff --git a/Include/Game/Interactable/Item.hpp b/Include/Game/Interactable/Item.hpp index 4b7ff45..7990d76 100644 --- a/Include/Game/Interactable/Item.hpp +++ b/Include/Game/Interactable/Item.hpp @@ -9,6 +9,7 @@ #include "../../Core/Input.hpp" #include #include +#include namespace Interactable { @@ -46,6 +47,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = false) const; bool Interact(const std::vector& Options, bool CheckTarget = false) const; bool Interact(const std::function& InteractMethod) const; diff --git a/Include/Game/Interactable/NPC.hpp b/Include/Game/Interactable/NPC.hpp index 9755eda..abc85f2 100644 --- a/Include/Game/Interactable/NPC.hpp +++ b/Include/Game/Interactable/NPC.hpp @@ -12,6 +12,7 @@ #include "../../Game/Tools/Camera.hpp" #include #include +#include namespace Interactable { @@ -51,6 +52,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; bool Interact(const std::function&)>& InteractMethod) const; diff --git a/Include/Game/Interactable/Player.hpp b/Include/Game/Interactable/Player.hpp index 9ce9e7a..996bbd5 100644 --- a/Include/Game/Interactable/Player.hpp +++ b/Include/Game/Interactable/Player.hpp @@ -12,6 +12,7 @@ #include "../../Game/Tools/Camera.hpp" #include #include +#include namespace Interactable { @@ -50,6 +51,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; bool Interact(const std::function&)>& InteractMethod) const; diff --git a/Include/Game/Interactable/WallObject.hpp b/Include/Game/Interactable/WallObject.hpp index 040d884..49b7529 100644 --- a/Include/Game/Interactable/WallObject.hpp +++ b/Include/Game/Interactable/WallObject.hpp @@ -12,6 +12,7 @@ #include "../../Game/Tools/Camera.hpp" #include #include +#include namespace Interactable { @@ -47,6 +48,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option, bool CheckTarget = false) const; bool Interact(const std::string& Option, bool CheckTarget = true) const; bool Interact(const std::vector& Options, bool CheckTarget = true) const; bool Interact(const std::function&)>& InteractMethod) const; diff --git a/Include/Game/Interactable/Widget.hpp b/Include/Game/Interactable/Widget.hpp index db3b615..63db21e 100644 --- a/Include/Game/Interactable/Widget.hpp +++ b/Include/Game/Interactable/Widget.hpp @@ -10,6 +10,7 @@ #include "../../Core/Input.hpp" #include #include +#include namespace Interactable { @@ -38,6 +39,7 @@ namespace Interactable bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::regex& Option) const; bool Interact(const std::string& Option) const; bool Interact(const std::vector& Options) const; bool Interact(const std::function& InteractMethod) const; diff --git a/Include/Game/Interfaces/Bank.hpp b/Include/Game/Interfaces/Bank.hpp index 854d92f..56a99d2 100644 --- a/Include/Game/Interfaces/Bank.hpp +++ b/Include/Game/Interfaces/Bank.hpp @@ -42,25 +42,30 @@ namespace Bank std::vector GetItems(); std::vector GetItems(std::int32_t ID); + std::vector GetItems(const std::regex& Name); std::vector GetItems(const std::string& Name); std::vector GetItems(const std::vector& IDs); std::vector GetItems(const std::vector& Names); std::vector GetItems(const std::function& Filter); Interactable::Item GetItem(std::int32_t ID); + Interactable::Item GetItem(const std::regex& Name); Interactable::Item GetItem(const std::string& Name); Interactable::Item GetItem(const std::vector& IDs); Interactable::Item GetItem(const std::vector& Names); Interactable::Item GetItem(const std::function& Filter); std::int32_t Count(std::int32_t ID); + std::int32_t Count(const std::regex& Name); std::int32_t Count(const std::string& Name); std::int32_t Count(const Interactable::Item& Item); std::int32_t GetIndexOf(std::int32_t ID); + std::int32_t GetIndexOf(const std::regex& Name); std::int32_t GetIndexOf(const std::string& Name); bool Contains(std::int32_t ID); + bool Contains(const std::regex& Name); bool Contains(const std::string& Name); bool Contains(const Interactable::Item& Item); bool Contains(const std::vector& IDs); // true if all items are found at least once @@ -73,25 +78,30 @@ namespace Bank std::int32_t GetCurrentTab(); std::int32_t GetTabOf(std::int32_t ID); + std::int32_t GetTabOf(const std::regex& Name); std::int32_t GetTabOf(const std::string& Name); std::int32_t GetTabOf(const Interactable::Item& Item); bool OpenTab(std::int32_t Tab); bool ScrollTo(std::int32_t ID, bool OpenRespectiveTab = false); + bool ScrollTo(const std::regex& Name, bool OpenRespectiveTab = false); bool ScrollTo(const std::string& Name, bool OpenRespectiveTab = false); bool ScrollTo(const Interactable::Item& Item, bool OpenRespectiveTab = false); // -1 = all, 0 = all-but-one bool Withdraw(std::int32_t ID, std::int32_t Amount, bool OpenRespectiveTab = false); + bool Withdraw(const std::regex& Name, std::int32_t Amount, bool OpenRespectiveTab = false); bool Withdraw(const std::string& Name, std::int32_t Amount, bool OpenRespectiveTab = false); bool Withdraw(const Interactable::Item& Item, std::int32_t Amount, bool OpenRespectiveTab = false); // -1 = all bool Deposit(std::int32_t ID, std::int32_t Amount); + bool Deposit(const std::regex& Name, std::int32_t Amount); bool Deposit(const std::string& Name, std::int32_t Amount); bool Deposit(const Interactable::Item& Item, std::int32_t Amount); bool DepositAllExcept(std::int32_t ID, double DepsositAllChance = 0.00); // DepositAllChance = the chance it will click deposit all on the individual item, instead of left clicking if possible. Will deposit all if the current default quantity is not enough to one click it + bool DepositAllExcept(const std::regex& Name, double DepsositAllChance = 0.00); bool DepositAllExcept(const std::string& Name, double DepsositAllChance = 0.00); bool DepositAllExcept(const Interactable::Item& Item, double DepsositAllChance = 0.00); bool DepositAllExcept(const std::vector& IDs, double DepsositAllChance = 0.00); diff --git a/Include/Game/Interfaces/Chat.hpp b/Include/Game/Interfaces/Chat.hpp index 7a795d3..95b9363 100644 --- a/Include/Game/Interfaces/Chat.hpp +++ b/Include/Game/Interfaces/Chat.hpp @@ -91,11 +91,13 @@ namespace Chat bool WaitDialogueState(std::uint32_t Duration, std::uint32_t Step, Chat::DIALOGUE_STATE State, bool Result = true); // Waits until the current chat state equals State + bool DialogueContains(const std::regex& Text); bool DialogueContains(const std::string& Text); bool DialogueContains(const std::vector& Texts); bool ClickContinue(bool UseKeyboard = false); bool EnterAmount(std::int32_t Amount); + bool SelectDialogueOption(const std::regex& Option, bool UseKeyboard = false); bool SelectDialogueOption(const std::string& Option, bool UseKeyboard = false); bool SelectDialogueOption(const std::vector& Options, bool UseKeyboard = false); } diff --git a/Include/Game/Interfaces/GameTabs/Equipment.hpp b/Include/Game/Interfaces/GameTabs/Equipment.hpp index 2c752b3..8059d92 100644 --- a/Include/Game/Interfaces/GameTabs/Equipment.hpp +++ b/Include/Game/Interfaces/GameTabs/Equipment.hpp @@ -35,6 +35,7 @@ namespace Equipment std::vector GetItems(); std::vector GetItems(std::int32_t ID); + std::vector GetItems(const std::regex& Name); std::vector GetItems(const std::string& Name); std::vector GetItems(const std::vector& Slots); std::vector GetItems(const std::vector& IDs); @@ -43,6 +44,7 @@ namespace Equipment Interactable::Item GetItem(SLOT Slot); Interactable::Item GetItem(std::int32_t ID); + Interactable::Item GetItem(const std::regex& Name); Interactable::Item GetItem(const std::string& Name); Interactable::Item GetItem(const std::vector& IDs); Interactable::Item GetItem(const std::vector& Names); @@ -50,6 +52,7 @@ namespace Equipment std::int32_t Count(SLOT Slot); std::int32_t Count(std::int32_t ID); + std::int32_t Count(const std::regex& Name); std::int32_t Count(const std::string& Name); std::int32_t Count(const Interactable::Item& Item); std::int32_t Count(const std::vector& IDs); @@ -57,9 +60,11 @@ namespace Equipment std::int32_t Count(const std::vector& Items); SLOT GetSlotOf(std::int32_t ID); + SLOT GetSlotOf(const std::regex& Name); SLOT GetSlotOf(const std::string& Name); bool Contains(std::int32_t ID); + bool Contains(const std::regex& Name); bool Contains(const std::string& Name); bool Contains(const Interactable::Item& Item); bool Contains(const std::vector& IDs); // true if all items are found at least once @@ -71,6 +76,7 @@ namespace Equipment bool ContainsAny(const std::vector& Items); bool ContainsOnly(std::int32_t ID); + bool ContainsOnly(const std::regex& Name); bool ContainsOnly(const std::string& Name); bool ContainsOnly(const Interactable::Item& Item); bool ContainsOnly(const std::vector& IDs); @@ -79,6 +85,7 @@ namespace Equipment bool Unequip(SLOT Slot); bool Unequip(std::int32_t ID); + bool Unequip(const std::regex& Name); bool Unequip(const std::string& Name); bool Unequip(const Interactable::Item& Item); } diff --git a/Include/Game/Interfaces/GameTabs/Inventory.hpp b/Include/Game/Interfaces/GameTabs/Inventory.hpp index 2ca12bc..5d9ecbf 100644 --- a/Include/Game/Interfaces/GameTabs/Inventory.hpp +++ b/Include/Game/Interfaces/GameTabs/Inventory.hpp @@ -21,12 +21,14 @@ namespace Inventory std::vector GetItems(); std::vector GetItems(std::int32_t ID); + std::vector GetItems(const std::regex& Name); std::vector GetItems(const std::string& Name); std::vector GetItems(const std::vector& IDs); std::vector GetItems(const std::vector& Names); std::vector GetItems(const std::function& Filter); Interactable::Item GetItem(std::int32_t ID); + Interactable::Item GetItem(const std::regex& Name); Interactable::Item GetItem(const std::string& Name); Interactable::Item GetItem(const std::vector& IDs); Interactable::Item GetItem(const std::vector& Names); @@ -39,12 +41,14 @@ namespace Inventory bool IsItemSelected(); bool IsItemSelected(std::int32_t ID); + bool IsItemSelected(const std::regex& Name); bool IsItemSelected(const std::string& Name); bool IsItemSelected(const Interactable::Item& Item); std::string GetItemSelectedName(); std::int32_t Count(std::int32_t ID); + std::int32_t Count(const std::regex& Name); std::int32_t Count(const std::string& Name); std::int32_t Count(const Interactable::Item& Item); std::int32_t Count(const std::vector& IDs); @@ -55,20 +59,24 @@ namespace Inventory std::int32_t CountEmpty(); std::int32_t GetIndexOf(std::int32_t ID); + std::int32_t GetIndexOf(const std::regex& Name); std::int32_t GetIndexOf(const std::string& Name); std::int32_t GetIndexOf(const std::vector& IDs); // Returns first found ID index std::int32_t GetIndexOf(const std::vector& Names); // Returns first found Name Index std::vector GetIndicesOf(std::int32_t ID); + std::vector GetIndicesOf(const std::regex& Name); std::vector GetIndicesOf(const std::string& Name); std::vector GetIndicesOf(const std::vector& IDs); std::vector GetIndicesOf(const std::vector& Names); std::vector GetSlotBoxes(); std::vector GetBoxesOf(std::int32_t ID); + std::vector GetBoxesOf(const std::regex& Name); std::vector GetBoxesOf(const std::string& Name); bool Contains(std::int32_t ID); + bool Contains(const std::regex& Name); bool Contains(const std::string& Name); bool Contains(const Interactable::Item& Item); bool Contains(const std::vector& IDs); // true if all items are found at least once @@ -80,6 +88,7 @@ namespace Inventory bool ContainsAny(const std::vector& Items); bool ContainsOnly(std::int32_t ID); + bool ContainsOnly(const std::regex& Name); bool ContainsOnly(const std::string& Name); bool ContainsOnly(const Interactable::Item& Item); bool ContainsOnly(const std::vector& IDs); @@ -91,10 +100,12 @@ namespace Inventory bool Use(const Interactable::Item& Item, const Interactable::Item& Item2 = Interactable::Item(), bool UseSecondFirst = false); bool Equip(std::int32_t ID); + bool Equip(const std::regex& Name); bool Equip(const std::string& Name); bool Equip(const Interactable::Item& Item); bool Drop(std::int32_t ID, bool AllowShiftClick = true); + bool Drop(const std::regex& Name, bool AllowShiftClick = true); bool Drop(const std::string& Name, bool AllowShiftClick = true); bool Drop(const Interactable::Item& Item, bool AllowShiftClick = true); } diff --git a/Include/Game/Interfaces/Mainscreen.hpp b/Include/Game/Interfaces/Mainscreen.hpp index 2bd6c4f..2d06c5c 100644 --- a/Include/Game/Interfaces/Mainscreen.hpp +++ b/Include/Game/Interfaces/Mainscreen.hpp @@ -8,6 +8,7 @@ #include #include #include +#include /** * @brief A namespace containing various functions related to the Mainscreen @@ -57,6 +58,7 @@ namespace Mainscreen bool IsUpText(const std::string& UpText); bool IsUpText(const std::vector& UpTexts); + bool UpTextContains(const std::regex& Regex); bool UpTextContains(const std::string& UpText); bool UpTextContains(const std::vector& UpTexts); bool UpTextContains(const std::string& UpText, std::uint32_t CheckTime, std::uint32_t FailCheckTime); diff --git a/Include/Game/Interfaces/Menu.hpp b/Include/Game/Interfaces/Menu.hpp index 362a64b..af71f0c 100644 --- a/Include/Game/Interfaces/Menu.hpp +++ b/Include/Game/Interfaces/Menu.hpp @@ -5,6 +5,7 @@ #include #include #include +#include /** * @brief A namespace containing various functions for the right-click menu @@ -125,6 +126,19 @@ namespace Menu */ std::tuple FindOption(std::uint32_t Index); + /** + * @brief Looks for a menu option containing the passed Regex, and returns information about the found option + * + * @param Regex %Menu regex to look for, the more specific, the more accurate the result will be + * @return std::tuple + * std::int32_t [0] = Index of the option that was found, -1 if the option wasn't found + * std::string [1] = Action that was found + * std::string [2] = Target that was found + * @see Menu::IndexOf(const std::string& Option) + * @warning The result can rarely be inaccurate if the menu isn't open before calling this function + */ + std::tuple FindOption(const std::regex& Regex); + /** * @brief Looks for a menu option containing the passed Option, and returns information about the found option * @@ -151,6 +165,19 @@ namespace Menu */ std::tuple FindOption(const std::vector& Options); + /** + * @brief Looks for a menu option containing the passed Regex, and returns information of all options that were found + * + * @param Regex %Menu regex to look for, the more specific the option, the more accurate the result will be + * @return std::vector> + * std::int32_t [0] = Index of the option that was found, -1 if the option wasn't found + * std::string [1] = Action that was found + * std::string [2] = Target that was found + * @warning The result can rarely be inaccurate if the menu isn't open before calling this function + * @see Menu::IndexOf(const std::string& Option) + */ + std::vector> FindOptions(const std::regex& Regex); + /** * @brief Looks for a menu option containing the passed Option, and returns information of all options that were found * diff --git a/Include/Game/Models/DecorativeObjects.hpp b/Include/Game/Models/DecorativeObjects.hpp index 665fda0..e1504ca 100644 --- a/Include/Game/Models/DecorativeObjects.hpp +++ b/Include/Game/Models/DecorativeObjects.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace DecorativeObjects { @@ -13,6 +14,7 @@ namespace DecorativeObjects std::vector GetAll(); std::vector GetAll(std::int32_t ID, std::int32_t Distance = -1); + std::vector GetAll(const std::regex& Name, std::int32_t Distance = -1); std::vector GetAll(const std::string& Name, std::int32_t Distance = -1); std::vector GetAll(const std::vector& IDs, std::int32_t Distance = -1); std::vector GetAll(const std::vector& Names, std::int32_t Distance = -1); @@ -20,6 +22,7 @@ namespace DecorativeObjects Interactable::DecorativeObject Get(const Tile& T); Interactable::DecorativeObject Get(std::int32_t ID, std::int32_t Distance = -1); + Interactable::DecorativeObject Get(const std::regex& Name, std::int32_t Distance = -1); Interactable::DecorativeObject Get(const std::string& Name, std::int32_t Distance = -1); Interactable::DecorativeObject Get(const std::vector& IDs, std::int32_t Distance = -1); Interactable::DecorativeObject Get(const std::vector& Names, std::int32_t Distance = -1); diff --git a/Include/Game/Models/GameObjects.hpp b/Include/Game/Models/GameObjects.hpp index 18d8e73..6c2b3ca 100644 --- a/Include/Game/Models/GameObjects.hpp +++ b/Include/Game/Models/GameObjects.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace GameObjects { @@ -14,6 +15,7 @@ namespace GameObjects std::vector GetAll(); std::vector GetAll(const Tile& T); std::vector GetAll(std::int32_t ID, std::int32_t Distance = -1); + std::vector GetAll(const std::regex& Name, std::int32_t Distance = -1); std::vector GetAll(const std::string& Name, std::int32_t Distance = -1); std::vector GetAll(const std::vector& IDs, std::int32_t Distance = -1); std::vector GetAll(const std::vector& Names, std::int32_t Distance = -1); @@ -21,6 +23,7 @@ namespace GameObjects Interactable::GameObject Get(const Tile& T); Interactable::GameObject Get(std::int32_t ID, std::int32_t Distance = -1); + Interactable::GameObject Get(const std::regex& Name, std::int32_t Distance = -1); Interactable::GameObject Get(const std::string& Name, std::int32_t Distance = -1); Interactable::GameObject Get(const std::vector& IDs, std::int32_t Distance = -1); Interactable::GameObject Get(const std::vector& Names, std::int32_t Distance = -1); diff --git a/Include/Game/Models/GroundItems.hpp b/Include/Game/Models/GroundItems.hpp index 5f68e74..0ed6a4d 100644 --- a/Include/Game/Models/GroundItems.hpp +++ b/Include/Game/Models/GroundItems.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace GroundItems { @@ -14,6 +15,7 @@ namespace GroundItems std::vector GetAll(); std::vector GetAll(const Tile& T); std::vector GetAll(std::int32_t ID, std::int32_t Distance = -1); + std::vector GetAll(const std::regex& Name, std::int32_t Distance = -1); std::vector GetAll(const std::string& Name, std::int32_t Distance = -1); std::vector GetAll(const std::vector& IDs, std::int32_t Distance = -1); std::vector GetAll(const std::vector& Names, std::int32_t Distance = -1); @@ -21,6 +23,7 @@ namespace GroundItems Interactable::GroundItem Get(const Tile& T); Interactable::GroundItem Get(std::int32_t ID, std::int32_t Distance = -1); + Interactable::GroundItem Get(const std::regex& Name, std::int32_t Distance = -1); Interactable::GroundItem Get(const std::string& Name, std::int32_t Distance = -1); Interactable::GroundItem Get(const std::vector& IDs, std::int32_t Distance = -1); Interactable::GroundItem Get(const std::vector& Names, std::int32_t Distance = -1); diff --git a/Include/Game/Models/GroundObjects.hpp b/Include/Game/Models/GroundObjects.hpp index 52893ac..489c1f1 100644 --- a/Include/Game/Models/GroundObjects.hpp +++ b/Include/Game/Models/GroundObjects.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace GroundObjects { @@ -13,6 +14,7 @@ namespace GroundObjects std::vector GetAll(); std::vector GetAll(std::int32_t ID, std::int32_t Distance = -1); + std::vector GetAll(const std::regex& Name, std::int32_t Distance = -1); std::vector GetAll(const std::string& Name, std::int32_t Distance = -1); std::vector GetAll(const std::vector& IDs, std::int32_t Distance = -1); std::vector GetAll(const std::vector& Names, std::int32_t Distance = -1); @@ -20,6 +22,7 @@ namespace GroundObjects Interactable::GroundObject Get(const Tile& T); Interactable::GroundObject Get(std::int32_t ID, std::int32_t Distance = -1); + Interactable::GroundObject Get(const std::regex& Name, std::int32_t Distance = -1); Interactable::GroundObject Get(const std::string& Name, std::int32_t Distance = -1); Interactable::GroundObject Get(const std::vector& IDs, std::int32_t Distance = -1); Interactable::GroundObject Get(const std::vector& Names, std::int32_t Distance = -1); diff --git a/Include/Game/Models/NPCs.hpp b/Include/Game/Models/NPCs.hpp index c4a29f5..1d43d29 100644 --- a/Include/Game/Models/NPCs.hpp +++ b/Include/Game/Models/NPCs.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace NPCs { @@ -14,6 +15,7 @@ namespace NPCs std::vector GetAll(); std::vector GetAll(const Tile& T); std::vector GetAll(std::int32_t ID, std::int32_t Distance = -1); + std::vector GetAll(const std::regex& Name, std::int32_t Distance = -1); std::vector GetAll(const std::string& Name, std::int32_t Distance = -1); std::vector GetAll(const std::vector& IDs, std::int32_t Distance = -1); std::vector GetAll(const std::vector& Names, std::int32_t Distance = -1); @@ -21,6 +23,7 @@ namespace NPCs Interactable::NPC Get(const Tile& T); Interactable::NPC Get(std::int32_t ID, std::int32_t Distance = -1); + Interactable::NPC Get(const std::regex& Name, std::int32_t Distance = -1); Interactable::NPC Get(const std::string& Name, std::int32_t Distance = -1); Interactable::NPC Get(const std::vector& IDs, std::int32_t Distance = -1); Interactable::NPC Get(const std::vector& Names, std::int32_t Distance = -1); diff --git a/Include/Game/Models/Players.hpp b/Include/Game/Models/Players.hpp index c15649d..bd48241 100644 --- a/Include/Game/Models/Players.hpp +++ b/Include/Game/Models/Players.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace Players { @@ -14,11 +15,13 @@ namespace Players std::vector GetAll(); std::vector GetAll(const Tile& Tile); + std::vector GetAll(const std::regex& Name, std::int32_t Distance = -1); std::vector GetAll(const std::string& Name, std::int32_t Distance = -1); std::vector GetAll(const std::vector& Names, std::int32_t Distance = -1); std::vector GetAll(const std::function& Filter, std::int32_t Distance = -1); Interactable::Player Get(const Tile& Tile); + Interactable::Player Get(const std::regex& Name, std::int32_t Distance = -1); Interactable::Player Get(const std::string& Name, std::int32_t Distance = -1); Interactable::Player Get(const std::vector& Names, std::int32_t Distance = -1); Interactable::Player Get(const std::function& Filter, std::int32_t Distance = -1); diff --git a/Include/Game/Models/WallObjects.hpp b/Include/Game/Models/WallObjects.hpp index aad06ce..3bb11cf 100644 --- a/Include/Game/Models/WallObjects.hpp +++ b/Include/Game/Models/WallObjects.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace WallObjects { @@ -13,6 +14,7 @@ namespace WallObjects std::vector GetAll(); std::vector GetAll(std::int32_t ID, std::int32_t Distance = -1); + std::vector GetAll(const std::regex& Name, std::int32_t Distance = -1); std::vector GetAll(const std::string& Name, std::int32_t Distance = -1); std::vector GetAll(const std::vector& IDs, std::int32_t Distance = -1); std::vector GetAll(const std::vector& Names, std::int32_t Distance = -1); @@ -20,6 +22,7 @@ namespace WallObjects Interactable::WallObject Get(const Tile& T); Interactable::WallObject Get(std::int32_t ID, std::int32_t Distance = -1); + Interactable::WallObject Get(const std::regex& Name, std::int32_t Distance = -1); Interactable::WallObject Get(const std::string& Name, std::int32_t Distance = -1); Interactable::WallObject Get(const std::vector& IDs, std::int32_t Distance = -1); Interactable::WallObject Get(const std::vector& Names, std::int32_t Distance = -1); diff --git a/Include/Game/Tools/Interact.hpp b/Include/Game/Tools/Interact.hpp index 9e2bf12..f229ed8 100644 --- a/Include/Game/Tools/Interact.hpp +++ b/Include/Game/Tools/Interact.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace Interact { @@ -15,14 +16,17 @@ namespace Interact bool Click(const Button& B = BUTTON_LEFT); bool Click(const Point& P, const Button& B = BUTTON_LEFT); + bool Click(const Point& P, const std::regex& Regex, const std::regex& Target = std::regex("(.*)")); bool Click(const Point& P, const std::string& Option, const std::string& Target = ""); bool Click(const Point& P, const std::vector& Options, const std::string& Target = ""); bool Click(const Box& B, const Button& Button = BUTTON_LEFT); + bool Click(const Box& B, const std::regex& Regex, const std::regex& Target = std::regex("(.*)")); bool Click(const Box& B, const std::string& Option, const std::string& Target = ""); bool Click(const Box& B, const std::vector& Options, const std::string& Target = ""); bool Click(const Convex& C, const Button& B = BUTTON_LEFT); + bool Click(const Convex& C, const std::regex& Regex, const std::regex& Target = std::regex("(.*)")); bool Click(const Convex& C, const std::string& Option, const std::string& Target = ""); bool Click(const Convex& C, const std::vector& Options, const std::string& Target = ""); diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index bab3079..5ee4af9 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ