Neanel Posted May 29, 2019 Share Posted May 29, 2019 Hey there, I was wondering what the best method was for grabbing gear from the bank & equipping it + filling the inventory with the necessary items. How would you ignore items that are already in the equipment/inventory, or deposit the items that aren't part of the necessary inventory/equipment? I've found multiple solutions but they all seem a bit overly difficult for something like this. Let me know what you think & thanks in advance, Neanel Quote Link to comment Share on other sites More sharing options...
gekkebakker Posted May 29, 2019 Share Posted May 29, 2019 Quote Link to comment Share on other sites More sharing options...
Neanel Posted May 29, 2019 Author Share Posted May 29, 2019 6 minutes ago, gekkebakker said: Thanks for the useful comment xoxo Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted May 29, 2019 Share Posted May 29, 2019 Really not quite sure what you're expecting here. Quote Link to comment Share on other sites More sharing options...
Gunman Posted May 29, 2019 Share Posted May 29, 2019 (edited) Umm I am not gonna spoon feed it all to you but try this building the logic of the codes with the steps it would take to make this happen. Example. If I was going to check if I had a iron scim equipped for a basic suicide combat script for like 10/10/10 melee stats. 1. Check if the iron scim is equipped. If so go to location and kill for 10/10/10 2. if not equip. equip it. (For some reason I feel I am spelling it equip wrong after looking at it so much...) 3. if not in inventory walk to nearest bank. 4.open bank. withdraw item. Then equip.Then walk and slay for 10/10/10 (and if not in the bank then logout) If you were asking for the api commands since I know the api list thing isn't very friendly to beginners. Remove the **** and insert what it tells you to and what you need. getEquipment().isWearingItem(EquipmentSlot.****the slot Weapon or Legs*****) getInventory().contains(****Item you wish. can use "" and put item name in between or the item id*****) getInventory().getItem(****same as contains****).interact(*****action like "Wear" or "Wield" also used for "Use" when using an item on something) // You will be using a lot of of differnt getBank() variations like getBank().open and getBank().contains() also don't forget to check to see if the item exists before withrdrawing it (getBank().Withdraw is the start pick which one you want). Hope this helped but I am not gonna give you the fully coded method for doing this. 1 I am lazy 2 probably better not to so it can help you learn Also I think you are over thinking it just deposit inventory and all equipment if it's not empty Or if a certain about of inventory slots isn't open. Then check for items and withdraw them and equip them if needed. Edited May 29, 2019 by Gunman 1 Quote Link to comment Share on other sites More sharing options...
liverare Posted May 29, 2019 Share Posted May 29, 2019 Figure out what you want. When the script starts, take note of what your stats are and create a list of items you can use and prioritise them by usefulness. Figure out what you need. You might not get what you want, but you'll get what you need. A dragon axe is better than an rune one, but if you don't have a dragon axe or if your woodcutting level isn't 61, then that rune axe is your best friend. Once your bot knows what it's got, what it's not got, and where it's at, you can plan for the bot to progress. Depending on the complexity, you may need to look into using a data-structure. It'll be a lot less code than having 20+ IF's for each axe, pick axe, etc. 1 1 Quote Link to comment Share on other sites More sharing options...
Neanel Posted May 29, 2019 Author Share Posted May 29, 2019 Both very helpful, thanks a lot! I am a beginner in the whole OSBot API so I should probably start by going through that. i was thinking of creating an array of Strings (or is Items better?) & then just using getBank.contains(item) in a for loop to withdraw, then another for-loop to interact with those items if they are equipment. Does that seem about right or am I forgetting something? Quote Link to comment Share on other sites More sharing options...
Elixar Posted May 30, 2019 Share Posted May 30, 2019 (edited) 7 hours ago, Gunman said: Umm I am not gonna spoon feed it all to you Then proceeds to spoon feed make a method to check if the bank isOpen() by using widgets Check if Bank is closed and items are in getInventory() You can use the API to find api.getInventory().contains("Iron Penis")) api.getInventory().interact("Equip", "Iron Penis"); Edited May 30, 2019 by Elixar 1 Quote Link to comment Share on other sites More sharing options...