AlpacaLibary  1.63
A closed source C++ bot for OSRS
Bank.hpp
Go to the documentation of this file.
1 #ifndef BANK_HPP_INCLUDED
2 #define BANK_HPP_INCLUDED
3 
4 #include "../../Core/Types/Convex.hpp"
5 #include "../../Game/Interactable/Item.hpp"
6 #include <functional>
7 #include <string>
8 #include <cstdint>
9 #include <vector>
10 
11 namespace Bank
12 {
14  {
15  ALL = -1,
16  ALL_BUT_ONE = 0
17  };
18 
19  typedef enum WITHDRAW_MODE
20  {
22  NOTED
24 
25  typedef enum PIN_STEP
26  {
33  BANK_OPEN
35 
36  bool IsOpen();
37  bool Close(bool AllowEsc = true);
38 
39  std::vector<std::int32_t> GetItemIDs();
40  std::vector<std::string> GetItemNames();
41  std::vector<std::int32_t> GetItemAmounts();
42 
43  std::vector<Interactable::Item> GetItems();
44  std::vector<Interactable::Item> GetItems(std::int32_t ID);
45  std::vector<Interactable::Item> GetItems(const std::string& Name);
46  std::vector<Interactable::Item> GetItems(const std::vector<std::int32_t>& IDs);
47  std::vector<Interactable::Item> GetItems(const std::vector<std::string>& Names);
48  std::vector<Interactable::Item> GetItems(const std::function<bool (const Interactable::Item&)>& Filter);
49 
50  Interactable::Item GetItem(std::int32_t ID);
51  Interactable::Item GetItem(const std::string& Name);
52  Interactable::Item GetItem(const std::vector<std::int32_t>& IDs);
53  Interactable::Item GetItem(const std::vector<std::string>& Names);
54  Interactable::Item GetItem(const std::function<bool (const Interactable::Item&)>& Filter);
55 
56  std::int32_t Count(std::int32_t ID);
57  std::int32_t Count(const std::string& Name);
58  std::int32_t Count(const Interactable::Item& Item);
59 
60  std::int32_t GetIndexOf(std::int32_t ID);
61  std::int32_t GetIndexOf(const std::string& Name);
62 
63  bool Contains(std::int32_t ID);
64  bool Contains(const std::string& Name);
65  bool Contains(const Interactable::Item& Item);
66  bool Contains(const std::vector<std::int32_t>& IDs); // true if all items are found at least once
67  bool Contains(const std::vector<std::string>& Names); // true if all items are found at least once
68  bool Contains(const std::vector<Interactable::Item>& Items);
69 
70  bool ContainsAny(const std::vector<std::int32_t>& IDs);
71  bool ContainsAny(const std::vector<std::string>& Names);
72  bool ContainsAny(const std::vector<Interactable::Item>& Items);
73 
74  std::int32_t GetCurrentTab();
75  std::int32_t GetTabOf(std::int32_t ID);
76  std::int32_t GetTabOf(const std::string& Name);
77  std::int32_t GetTabOf(const Interactable::Item& Item);
78  bool OpenTab(std::int32_t Tab);
79 
80  bool ScrollTo(std::int32_t ID, bool OpenRespectiveTab = false);
81  bool ScrollTo(const std::string& Name, bool OpenRespectiveTab = false);
82  bool ScrollTo(const Interactable::Item& Item, bool OpenRespectiveTab = false);
83 
84  // -1 = all, 0 = all-but-one
85  bool Withdraw(std::int32_t ID, std::int32_t Amount, bool OpenRespectiveTab = false);
86  bool Withdraw(const std::string& Name, std::int32_t Amount, bool OpenRespectiveTab = false);
87  bool Withdraw(const Interactable::Item& Item, std::int32_t Amount, bool OpenRespectiveTab = false);
88 
89  // -1 = all
90  bool Deposit(std::int32_t ID, std::int32_t Amount);
91  bool Deposit(const std::string& Name, std::int32_t Amount);
92  bool Deposit(const Interactable::Item& Item, std::int32_t Amount);
93 
94  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
95  bool DepositAllExcept(const std::string& Name, double DepsositAllChance = 0.00);
96  bool DepositAllExcept(const Interactable::Item& Item, double DepsositAllChance = 0.00);
97  bool DepositAllExcept(const std::vector<std::int32_t>& IDs, double DepsositAllChance = 0.00);
98  bool DepositAllExcept(const std::vector<std::string>& Names, double DepsositAllChance = 0.00);
99  bool DepositAllExcept(const std::vector<Interactable::Item>& Items, double DepsositAllChance = 0.00);
100 
101  bool DepositAll();
103 
106 
109  bool EnterPin(bool TerminateOnError = true);
110 
112  bool SetDefaultWithdrawQuantity(std::int32_t Amount);
113 }
114 
115 #endif // BANK_HPP_INCLUDED
Definition: Bank.hpp:12
bool ScrollTo(std::int32_t ID, bool OpenRespectiveTab=false)
bool OpenTab(std::int32_t Tab)
bool DepositAllExcept(std::int32_t ID, double DepsositAllChance=0.00)
BANK_AMOUNT
Definition: Bank.hpp:14
@ ALL
Definition: Bank.hpp:15
@ ALL_BUT_ONE
Definition: Bank.hpp:16
std::vector< Interactable::Item > GetItems()
bool Contains(std::int32_t ID)
PIN_STEP GetEnterPinStep()
WITHDRAW_MODE GetWithdrawMode()
Interactable::Item GetItem(std::int32_t ID)
bool EnterPin(bool TerminateOnError=true)
bool IsOpen()
WITHDRAW_MODE
Definition: Bank.hpp:20
@ NOTED
Definition: Bank.hpp:22
@ ITEM
Definition: Bank.hpp:21
bool Deposit(std::int32_t ID, std::int32_t Amount)
std::vector< std::string > GetItemNames()
bool Close(bool AllowEsc=true)
bool DepositEquipment()
bool IsEnterPinOpen()
std::int32_t GetIndexOf(std::int32_t ID)
bool SetWithdrawMode(WITHDRAW_MODE Mode)
std::int32_t GetDefaultWithdrawQuantity()
bool SetDefaultWithdrawQuantity(std::int32_t Amount)
PIN_STEP
Definition: Bank.hpp:26
@ TOO_MANY_ATTEMPTS
Definition: Bank.hpp:32
@ BANK_OPEN
Definition: Bank.hpp:33
@ FIRST
Definition: Bank.hpp:27
@ THIRD
Definition: Bank.hpp:29
@ FOURTH
Definition: Bank.hpp:30
@ SECOND
Definition: Bank.hpp:28
@ SUBMITTING
Definition: Bank.hpp:31
bool ContainsAny(const std::vector< std::int32_t > &IDs)
std::vector< std::int32_t > GetItemIDs()
std::int32_t GetCurrentTab()
bool Withdraw(std::int32_t ID, std::int32_t Amount, bool OpenRespectiveTab=false)
std::vector< std::int32_t > GetItemAmounts()
std::int32_t Count(std::int32_t ID)
bool DepositAll()
std::int32_t GetTabOf(std::int32_t ID)