Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Free Firemaking Script Please


    mrbankseed

    Recommended Posts

    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!

    Link to comment
    Share on other sites

    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;
        }
    }
     

    Link to comment
    Share on other sites

    • 3 weeks later...

    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.

    Link to comment
    Share on other sites

    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 account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.