pupperonius 0 Posted January 10 Writing something as a personal / learning project and integrating multiple skills into one "AIO". When I got to handling Melee i'm having a slight issue. My Bank.count("coins") >= cost * (Anything I can put here) seems to always want to default to Mithril instead of Rune which the account im testing it on has the requirements for. public boolean Find_Gear() { // Define gear requirements by level using a HashMap Map<String, Object[]> gearByLevel = new HashMap<>(); gearByLevel.put("Rune", new Object[]{40, 40, new int[]{1333, 1079, 1113, 1163, 1201}, "Rune Scimitar", 15000}); gearByLevel.put("Mithril", new Object[]{20, 20, new int[]{1329, 1071, 1121, 1159, 1197}, "Mithril Scimitar", 3000}); gearByLevel.put("Iron", new Object[]{1, 1, new int[]{1323, 1067, 1115, 1153, 1191}, "Iron Scimitar", 2000}); // Sort tiers from highest to lowest priority for (Map.Entry<String, Object[]> entry : gearByLevel.entrySet()) { String tier = entry.getKey(); Object[] data = entry.getValue(); int attackLevel = Skills.getRealLevel(Skill.ATTACK); int defenceLevel = Skills.getRealLevel(Skill.DEFENCE); int[] itemIds = (int[]) data[2]; String weaponName = (String) data[3]; int cost = (int) data[4]; // Check level requirements if (attackLevel >= (int) data[0] && defenceLevel >= (int) data[1]) { if (Bank.isOpen()) { if (Bank.contains(itemIds)) { // Withdraw and equip if gear is already in the bank withdrawAndEquipGear(itemIds); return true; } else if (Bank.count("Coins") >= cost * 5) { // Ensure enough coins for all items // Purchase and equip gear if sufficient gold is available purchaseAndEquipGear(itemIds, weaponName, cost); return true; } else { script.log("Not enough coins for " + tier + " gear."); } } else { openBankAndRetry(); } } else { script.log("Requirements not met for " + tier + " gear. Checking next tier..."); } } return false; } I can give the account 10m gold and it'll still try to buy mithril gear. Just curious if something is wrong here? Don't wanna slam it into chatGPT because it spits out some garbled dumb stuff.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now