Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9195795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:42:27+00:00 2026-06-17T21:42:27+00:00

I’m working on a script for a program and I’m trying to add a

  • 0

I’m working on a script for a program and I’m trying to add a feature where if the client detects a certain string being sent, and does an action specified in response.

Here is my question, I’m trying to get it so that when it says anything with “here” in it, then it will move to a new array of tiles! So, is there a way where I can make the script go to the next array if the message is sent?

Here is my code, and i will explain my question better below it:

@ScriptDetails(author = "iSully", category = "Firemaking", description = "Burns Your  Willow Logs So You Don't Have To!", name = "iFire - Willows", version = 1.1)
public class iFire extends Script implements Painter, LoopTask {

private static int logs;
private static final int tinderbox = 591;
private int loopCounter = 0;
private static final int fire = 2732;
private static final int ID_BANKBOOTH = 2213;
private FontMetrics FONTMETRICS = null;
private final Timer RUNTIME = new Timer();
private String STATE = "";
private int Burnt = 0;
private int XP = 0;
public boolean guiWait = true;
gui g = new gui();

Tile[] toFire1 = new Tile[] { new Tile(2722, 3493, 0),
        new Tile(2725, 3489, 0), new Tile(2725, 3485, 0),
        new Tile(2734, 3486, 0) };

Tile[] fire1ToBank = new Tile[] { new Tile(2711, 3486, 0),
        new Tile(2716, 3484, 0), new Tile(2721, 3486, 0),
        new Tile(2725, 3489, 0), new Tile(2722, 3493, 0) };

Tile[] toFire2 = new Tile[] { new Tile(2721, 3493, 0), new Tile(2723, 3488, 0), new Tile(2720, 3484, 0), 
        new Tile(2715, 3483, 0), new Tile(2710, 3483, 0), new Tile(2708, 3483, 0) };

Tile[] toFire3 = new Tile[] { new Tile(2722, 3493, 0), new Tile(2725, 3489, 0), new Tile(2721, 3486, 0), 
        new Tile(2716, 3485, 0), new Tile(2711, 3485, 0), new Tile(2706, 3485, 0), 
        new Tile(2706, 3484, 0) };

Tile[] fire3ToBank = new Tile[] { new Tile(2683, 3484, 0), new Tile(2688, 3484, 0), new Tile(2695, 3484, 0), 
        new Tile(2701, 3484, 0), new Tile(2706, 3484, 0), new Tile(2711, 3485, 0), 
        new Tile(2716, 3485, 0), new Tile(2721, 3485, 0), new Tile(2724, 3489, 0), 
        new Tile(2721, 3493, 0) };

Tile[] fire2ToBank = new Tile[] { new Tile(2680, 3482, 0), new Tile(2686, 3482, 0), new Tile(2691, 3482, 0), 
        new Tile(2696, 3484, 0), new Tile(2701, 3485, 0), new Tile(2706, 3485, 0), 
        new Tile(2711, 3485, 0), new Tile(2716, 3485, 0), new Tile(2721, 3485, 0), 
        new Tile(2723, 3490, 0), new Tile(2721, 3493, 0) };

Tile[] toFire4 = new Tile[] { new Tile(2721, 3493, 0), new Tile(2724, 3489, 0), new Tile(2721, 3485, 0), 
        new Tile(2716, 3484, 0), new Tile(2711, 3484, 0), new Tile(2708, 3485, 0) };

Tile[] fire4ToBank = new Tile[] { new Tile(2682, 3484, 0), new Tile(2688, 3484, 0), new Tile(2695, 3484, 0), 
        new Tile(2700, 3484, 0), new Tile(2705, 3483, 0), new Tile(2710, 3483, 0), 
        new Tile(2716, 3483, 0), new Tile(2721, 3482, 0), new Tile(2722, 3487, 0), 
        new Tile(2721, 3492, 0), new Tile(2720, 3493, 0) };

private ArrayList<Strategy> strategy = new ArrayList<Strategy>();

protected boolean onExecute() {
    strategy.add(new a1());
    provide(strategy);
    g.setVisible(true);

    while (guiWait == true) {
        BotGUI.log("Starting up....");
        sleep(10000);
    }
    return (true);
}

public void paint(Graphics g) {
    if (FONTMETRICS == null) {
        FONTMETRICS = g.getFontMetrics();
        RUNTIME.start();
    }
    drawGradientText(g, "Runtime: " + RUNTIME.getElapsedTime(), 15, 200,
            Color.red);
    drawGradientText(g, "State: " + STATE, 15, 218, Color.red);
    drawGradientText(g, "Logs Burnt: " + Burnt + "", 15, 236, Color.red);

}

public class a1 extends Strategy {

    public boolean isValid() {
        BotGUI.log("Script Started!");
        return true;

    }

    public void run() {
        Camera.setPitch(true);

    }
}

protected void onFinish() {
    BotGUI.log("Script Stopped! Thanks for using iFire by iSully!");
    BotGUI.log("Please leave feedback on the Parabot forum");
}

public int loop() {
    bank();
    toFire1();
    lightFires();
    toBank1();
    bank();
    toFire2();
    lightFires();
    toBank2();
    bank();
    toFire3();
    lightFires();
    toBank3();
    bank();
    toFire4();
    lightFires();
    toBank4();
    loopCounter++;
    return 1000;
}

void toBank1() {
    STATE = "Walking To Bank";
    Path path = new Path(fire1ToBank);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(fire1ToBank).traverse();
        }
    }

}

void toBank2() {
    STATE = "Walking To Bank";
    Path path = new Path(fire2ToBank);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(fire2ToBank).traverse();
        }
    }

}

void toFire1() {
    STATE = "Walking To Burning Path #1";
    Path path = new Path(toFire1);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(toFire1).traverse();
            if(toFire1.equals(2732)){
                toFire2();
            }
        }
    }

}

void toFire2() {
    STATE = "Walking To Burning Path #2";
    Path path = new Path(toFire2);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(toFire2).traverse();
        }if(toFire2.equals(2732)){
            toFire3();
        }
    }

}
void toBank3() {
    STATE = "Walking To Bank";
    Path path = new Path(fire3ToBank);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(fire3ToBank).traverse();
        }
    }

}

void toFire3() {
    STATE = "Walking To Burining Location #3";
    Path path = new Path(toFire3);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(toFire3).traverse();
        }if(toFire3.equals(2732)){
            toFire4();
        }
    }

}

void toFire4() {
    STATE = "Walking To Burining Location #4";
    Path path = new Path(toFire4);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(toFire4).traverse();
        }if(toFire4.equals(2732)){
            toFire2();
        }
    }

}

void toBank4() {
    STATE = "Walking To Bank";
    Path path = new Path(fire4ToBank);
    while (!path.hasReached()) {
        while (!Players.getMyPlayer().isMoving()) {
            Walking.getPath(fire4ToBank).traverse();
        }
    }

}

void closeBank() {
    if (Walking.isRunEnabled() == false) {
        Time.sleep(1000); // 1600
        Mouse.hop(460, 41);
        Time.sleep(500); // 900
        Mouse.click(460, 41, true);
        Time.sleep(500); // 1000
    }
}

void bank() {
    GameObject bankBooth = GameObjects.getNearest(ID_BANKBOOTH);
    if (!bankBooth.isOnScreen()) {
        Camera.turnTo(bankBooth);
    }

    while (!Bank.isOpen()) {
        bankBooth.interact("Use-quickly");
        Time.sleep(2000);
    }

    while (!Inventory.isFull()) {
        Bank.withdraw(logs, 27);
        Time.sleep(500);
    }

}

private boolean isLighting() {
    return Players.getMyPlayer().getAnimation() != -1;
}

void lightFires() {
    STATE = "Lighting Fires";
    while (Inventory.contains(logs)) {
        if (isLighting() == false) {
            Inventory.getItem(tinderbox).interact("Use");
            Inventory.getItem(logs).interact("Use Tinderbox with");
            Burnt++;
            Time.sleep(3000);
        } else {
            Time.sleep(4500);
        }
    }

}

void useRun() {
    if (Walking.isRunEnabled() == false) {
        Time.sleep(1000);
        Mouse.hop(710, 485);
        Time.sleep(500);
        Mouse.click(710, 485, true);
        Time.sleep(1000);
        Mouse.hop(625, 270);
        Time.sleep(500);
        Mouse.click(625, 270, true);
        Time.sleep(500);
        Mouse.hop(650, 185);
        Time.sleep(1000);
        Mouse.click(650, 185, true);
        Time.sleep(random(750, 1250));
    }
}

public void drawGradientText(Graphics g, String text, int x, int y, Color c) {
    Graphics2D g2 = (Graphics2D) g;
    Color color3 = new Color(51, 51, 51, 205);
    Font font1 = new Font("Arial", 0, 12);
    g.setFont(font1);
    FONTMETRICS = g.getFontMetrics();
    Rectangle textBox = new Rectangle(x, y - g.getFont().getSize(),
            (int) FONTMETRICS.getStringBounds(text, g).getWidth() + 8,
            (int) FONTMETRICS.getStringBounds(text, g).getHeight() + 5);
    Paint defaultPaint = g2.getPaint();
    g2.setPaint(new RadialGradientPaint(new Point.Double(textBox.x
            + textBox.width / 2.0D, textBox.y + textBox.height / 2.0D),
            (float) (textBox.getWidth() / 2.0D),
            new float[] { 0.5F, 1.0F }, new Color[] {
                    new Color(color3.getRed(), color3.getGreen(), color3
                            .getBlue(), 175),
                    new Color(0.0F, 0.0F, 0.0F, 0.8F) }));
    g.fillRect(textBox.x, textBox.y + 12, textBox.width, textBox.height);
    g2.setPaint(defaultPaint);
    g.setColor(Color.WHITE);
    g.drawRect(textBox.x, textBox.y + 12, textBox.width, textBox.height);
    g.setColor(Color.WHITE);
    g.drawString(text, x + 4, y + 15);
    for (int i = 0; i < text.length(); i++) {
        if (Character.isDigit(text.charAt(i))) {
            g.setColor(new Color(255, 255, 255));
            g.drawString("" + text.charAt(i),
                    x + FONTMETRICS.stringWidth(text.substring(0, i)) + 4,
                    y + 15);
        }
    }
}

public class Timer {
    long millis;

    /**
     * Starts the timer
     */
    public void start() {
        millis = System.currentTimeMillis();
    }

    /**
     * Resets the timer
     */
    public void reset() {
        millis = 0;
    }

    /**
     * Determines if timer is running
     * 
     * @return <b>true</b> if timer is running
     */
    public boolean isRunning() {
        return millis != 0;
    }

    /**
     * Generates string based on HH:MM:SS
     * 
     * @return String
     */
    public String getElapsedTime() {
        long elapsedTime = System.currentTimeMillis() - millis;
        String format = String.format("%%0%dd", 2);
        elapsedTime = elapsedTime / 1000;
        String seconds = String.format(format, elapsedTime % 60);
        String minutes = String.format(format, (elapsedTime % 3600) / 60);
        String hours = String.format(format, elapsedTime / 3600);
        String time = hours + ":" + minutes + ":" + seconds;
        return time;
    }

    /**
     * Calculates Experience per hour based on timer
     * 
     * @param Gained
     *            experience
     * @return Experience per hour
     */
    public int getEXPHour(int xpgained) {
        return (int) ((xpgained) * 3600000D / (System.currentTimeMillis() - millis));
    }

}

public void messageRecieved(String message) {
    if (message.toLowerCase().contains("burn")) {
        Burnt++;
        if(message.toLowerCase().contains("here")){

        }
    }
}

Okay, so in my script, i have multiple arrays that are the same except for one number, example: toFire1, toFire2, toFire3, toFire4, fire1ToBank, fire2ToBank, fire3ToBank, fire4ToBank. Now, what I wan’t the script to do is, in the method “public void messageRecieved” (at the bottom), I wan’t it to move to the next tile array list that I have. What kind of operator would I use to make it move on to the next array? Keep in mind, this script run’s in a loop so I can’t just make it go to lets say, from toFire1, onto toFire2 every time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:42:28+00:00Added an answer on June 17, 2026 at 9:42 pm

    In Java, I would use a multi-dimensional array. So, instead of using:

    Tile[] toFire1 = ...
    Tile[] toFire2 = ...
    Tile[] toFire3 = ...
    

    I would suggest using this instead:

    Tile[][] toFire = {{ new Tile(2722, 3493, 0), new Tile(2725, 3489, 0), new Tile(2725, 3485, 0), new Tile(2734, 3486, 0)},  // was toFire1
                       { new Tile(2721, 3493, 0), new Tile(2723, 3488, 0), new Tile(2720, 3484, 0), new Tile(2715, 3483, 0), new Tile(2710, 3483, 0), new Tile(2708, 3483, 0) }, // was toFire2
                       { new Tile(2722, 3493, 0), new Tile(2725, 3489, 0), new Tile(2721, 3486, 0), new Tile(2716, 3485, 0), new Tile(2711, 3485, 0), new Tile(2706, 3485, 0), new Tile(2706, 3484, 0) }} // was toFire3
    

    and so on for the other one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.