mrbankseed 0 Posted March 7, 2023 To a generous coder in this community, May you please develop a free script for progressive firemaking in the grand exchange? I think this would be very helpful for noobies like me. I would be happy to help you create accounts for testing. Thank you!
mrbankseed 0 Author Posted March 8, 2023 This is as far as I got with ChatGPT: package Firemaking; import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.methods.container.impl.bank.Bank; import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.methods.walking.impl.Walking; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Timer; import java.awt.*; @ScriptManifest( name = "Fire making", description = "Burns logs at the Grand Exchange", author = "This could be you", version = 1.3, category = Category.FIREMAKING, image = "" ) public class Main extends AbstractScript { private final Timer timer = new Timer(); private static final String[] LOGS = {"Magic logs", "Yew logs", "Maple logs", "Willow logs", "Oak logs", "Logs"}; @Override public void onPaint(Graphics g) { g.setColor(Color.CYAN); g.setFont(new Font("Arial", Font.BOLD, 16)); g.drawString("Time Elapsed: " + timer.formatTime(), 20, 20); } @Override public int onLoop() { try { // Check if any logs are in the inventory and withdraw if needed boolean foundLogs = false; for (String log : LOGS) { if (Inventory.contains(log)) { foundLogs = true; break; } } if (!foundLogs) { Task.withdrawLogs(); } // Move to the fire-making area if not already there if (foundLogs && !Task.isInFireMakingArea()) { Walking.walk(Areas.FIRE_SPACE.getRandomTile()); sleep(1000, 2000); sleepUntil(() -> Walking.getDestinationDistance() < 3, 5000); } // Burn logs if in the fire-making area and not already on a fire if (foundLogs && Task.isInFireMakingArea()) { if (Task.isFireUnderPlayer()) { // Move to a new random tile within the fire-making area Walking.walk(Areas.FIRE_SPACE.getRandomTile()); } else { // Burn the first available log in the inventory for (String log : LOGS) { if (Inventory.contains(log)) { int firemakingLevel = getSkills().getRealLevel(Skill.FIREMAKING); if ((log.equals("Magic logs") && firemakingLevel < 75) || (log.equals("Yew logs") && firemakingLevel < 60) || (log.equals("Maple logs") && firemakingLevel < 45) || (log.equals("Willow logs") && firemakingLevel < 30) || (log.equals("Oak logs") && firemakingLevel < 15) || (log.equals("Logs") && firemakingLevel < 1)) { continue; // Skip burning the log if firemaking level is too low } if (Bank.isOpen()) { Bank.close(); } Task.burnLogs(log); break; } } } } } catch (Exception e) { // Handle any exceptions that occur during script execution log("Error occurred: " + e.getMessage()); e.printStackTrace(); } // Return the number of milliseconds to wait until the next loop iteration return 745; } }
mittanl 1 Posted March 29, 2023 I'm very new to scripting and just pushed my first script today. But i like the challenge. Add me on discord MittaNL#0575 so we can talk about it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.