[Guide]RsBot[ENG/GER]

05/08/2009 00:41 gerble93#1
HI! It's me gerble93, and this IS the newest version!

Before I begin I want to explain what RSBot is:
RSBot is a Runescape bot, that has precompiled script that allows it to automatically do things for you, such as, woodcut and bank, fish and bank, mine and bank, make money, level your self. and everything else.

Download:
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

SVN URL:
svn://dev.powerbot.org/rsbot/trunk

READ ME
After you watched the first video, please scroll down to the bottom and watch the second video!

Also press the Spoiler here:

Part 1:

Video Guide:

JDK Guide:


Quote:
Picture Guide:

Step 1:
Go to you internet browser:
[Only registered and activated users can see links. Click Here To Register...]

Step 2:
In you Address Bar type in:
HTML Code:
rsbot
[Only registered and activated users can see links. Click Here To Register...]

Step 3:
It Should take you to their website:
[Only registered and activated users can see links. Click Here To Register...]

Step 4:
Press Download:
[Only registered and activated users can see links. Click Here To Register...]

Step 5:
Press save:
[Only registered and activated users can see links. Click Here To Register...]

Step 6:
Open it from where ever it's located:
[Only registered and activated users can see links. Click Here To Register...]

Step 7:
Press Free or Members:
[Only registered and activated users can see links. Click Here To Register...]

Step 8:
Before you login press view, then account:
[Only registered and activated users can see links. Click Here To Register...]

Step 9:
Press Add Account, enter Username, Password, and Bank Pin If you have one, then press add:
[Only registered and activated users can see links. Click Here To Register...]

Step 10:
Press Save account, and login and get started!
[Only registered and activated users can see links. Click Here To Register...]
Part 2:
How to add Scripts to RSbot
Video Guide:

Guide:
1) Make sure you have downloaded and installed the latest JDK SE from [Only registered and activated users can see links. Click Here To Register...] (JDK 6 Update 16). If you are running a relatively new computer, it might be running 64-bit windows rather than the typical 32-bit version. In this case you must select "Windows x64" rather than "Windows" when downloading the JDK. If you are not sure which version of Windows you have, you can easily find out using the following guide: [Only registered and activated users can see links. Click Here To Register...].

2) Open up RSBot (the .jar file that you have downloaded from **********) if you have not done so before. If you have opened it before, then you do not have to open it up again (although you can if you want to), simply make sure that you have opened it AT LEAST ONCE since you downloaded it.

3) RSBot will have created some folders for you in your Documents folder. Open up "Documents" ("My Documents" on Windows XP) and open up the folder "RSBot". Within here you will see a folder called "Scripts".

4) Download the script you want and as save it into the scripts folder. Here is how to do so:

Some scripters will give you a link to the script, which you can click on to download it. In this case, as long as you download the ".java" file, you simply have to move it into the "Scripts" folder in your "RSBot" folder. Otherwise, if the code itself is posted on the forums, you need to copy it all and paste it into a new Notepad document (Start > All Programs > Accessories > Notepad). Near the top of all that code (below all the lines that start with 'import') you will see the words 'public class xxxxx extends Script'. The xxxxx will be the name of the script. Save the file as xxxxx.java (this is case sensitive!).

Example:

Code:
import org.rsbot.bot.Bot;
import org.rsbot.event.events.ServerMessageEvent;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.event.listeners.ServerMessageListener;
import org.rsbot.script.Constants;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.RSInterface;
import org.rsbot.script.wrappers.RSObject;

import java.awt.*;
import java.util.ArrayList;
import java.util.Map;

@ScriptManifest(authors = { "Squirrels" }, category = "Woodcutting", name = "Squirrels Chop And Drop Global Edition", version = 1.0)
public class GlobalChopAndDrop extends Script implements PaintListener, ServerMessageListener {

    //log id's
    private final int[] Reg = new int[] { 1278, 1276, 1282, 1286};
    private final int[] Oak = new int[] { 1281};
    private final int[] Willow = new int[] { 5553, 5552, 5551, 1308};
    private final int[] Maple = new int[] { 1307};
    private final int[] Yew = new int[] { 1309};
    private final int[] Magic = new int[] { 1306};
    private final int[] Teak = new int[] { 9036};
    
    //Logs etc that should be dropped.
    private final int[] DropItems = new int[] { 1511, 1513, 1515, 1517, 1519, 1521, 6333 }; 
    
    private int CurrentState = 0;
    private int chopped = 0;
    private int trades = 0;
    private long lastTrade;
    private long startTime;
    
    private int[] tree;
    private String CurrentChop;
    
    public GlobalChopAndDrop() {
        lastTrade = System.currentTimeMillis();
    }

    public String getScriptDescription( ) {
        String html = "";

        html += "<html>n";
        html += "<body>n";

        html += "<font size='5' color='green'>";
        html += "<center><h2>Global Chop And Drop</h2></center>n";
        html += "</font>";
        html += "<b>Made By: </b>Squirrels<br/>";
        html += "<b>Version: </b>1.0<br/><br/>";
        html += "<center><b>Start by any tree and start the script.</b></center>";
        html += "<center><b>Choose what tree you would like to cut and press start.</b></center>";
        html += "<p><center>Tree to cut: ";
        html += "<select name='log'>";
        html += "<option>Regular";
        html += "<option>Oak";
        html += "<option>Willow";
        html += "<option>Maple";
        html += "<option>Teak";
        html += "<option>Yew";
        html += "<option>Magic";
        html += "</select>";
        html += "<br />";
        html += "<br />";
        html += "<br />";
        html += "<br /></center></p>";
        html += "</body>n";
        html += "</htmln";

        return html;
        }
    public boolean onStart(Map<String, String> args) {
        startTime = System.currentTimeMillis();
        CurrentChop = (args.get("log"));
     
        if (args.get("log").equals("Regular")) {
            tree = Reg;
            }
        if (args.get("log").equals("Oak")) {
               tree = Oak;
           }

        if (args.get("log").equals("Willow")) {
               tree = Willow;
           }

        if (args.get("log").equals("Maple")) {
               tree = Maple;
           }

        if (args.get("log").equals("Yew")) {
               tree = Yew;
           }

        if (args.get("log").equals("Magic")) {
               tree = Magic;
           }
        if (args.get("log").equals("Teak")) {
            tree = Teak;
        }
        
        log.info("-");
           log.info("--");
           log.info("--");
           log.info("Squirrels Global Chop And Drop Activated we are currently chopping " + CurrentChop + ".");
           log.info("--");
           log.info("--");
           log.info("-");
           
        return true;
    }

    public void onRepaint(Graphics g) {
        if (isLoggedIn()) {
            long millis = System.currentTimeMillis() - startTime;
            long hours = millis / (1000 * 60 * 60);
            millis -= hours * (1000 * 60 * 60);
            long minutes = millis / (1000 * 60);
            millis -= minutes * (1000 * 60);
            long seconds = millis / 1000;
            // 173 and 80 decide width and height respectively
            int topX = 515 - 190, topY = 337 - 80, x = topX + 5, y = topY + 5;
            g.setColor(new Color(0, 100, 0, 100));
            g.fill3DRect(topX, topY, 515 - topX, 337 - topY, true);
            g.setColor(Color.green);
            g.drawString("Runtime: " + hours + "h " + minutes + "min "
                    + seconds + "sec.", x, y += 15);
            g.drawString("Choped " + chopped + " " + CurrentChop + " Logs.", x, y += 15);
            g.drawString("Currently Chopping " + CurrentChop + ".", x, y += 15);
            g.drawString("Been traded " + trades + " times.", x, y += 15);

        }
    }

    public void onFinish() {
        Bot.getEventManager().removeListener(PaintListener.class, this);
    }

    public int loop() {
        try {
            switch (CurrentState) {
                case 0:
                    if (isInventoryFull()) {
                        CurrentState = 1;
                    } else if (getMyPlayer().getAnimation() == -1) {
                        RSObject nearTree = getNearestObjectByID(tree);
                        if (atTree(nearTree, "Chop Down")) {
                            wait(random(3000, 4000));
                        }
                    }
                    break;
                case 1:            
                    while (inventoryContainsOneOf(DropItems)) {
                        clickInventoryItem(DropItems, "Drop");
                    }
                    CurrentState = 0;
                default:
                    break;
            }
        } catch (Exception e) {

        }
        return antiBan();
    }

    //AntiBan thanks to Epic_
    public int antiBan() {
        final int ranNo = random(0, 15);
        int angle;
        switch (ranNo) {
            case 1:
                 angle = getCameraAngle() + random(-90, 90);
                   if (angle < 0) {
                    angle = 0;
                }
                      if (angle > 359) {
                        angle = 0;
                }
                setCameraRotation(angle);
            case 2:
                moveMouse(random(0, 650), random(0, 400));
                  return random(200, 400);
            case 3:
                if (getCurrentTab() != Constants.TAB_INVENTORY) {
                     openTab(Constants.TAB_INVENTORY);
                         return random(200, 400);
                }
            case 4:
                moveMouse(random(0, 700), random(0, 500));
                  return random(200, 400);
            case 5:
                angle = getCameraAngle() + random(-90, 90);
                  if (angle < 0) {
                    angle = 0;
                }
                     if (angle > 359) {
                       angle = 0;
                }
                setCameraRotation(angle);
        }
        return random(200, 450);
    }


    public boolean clickInventoryItem(int[] itemIDs, String option) {
        if (getCurrentTab() != TAB_INVENTORY
                && !RSInterface.getInterface(INTERFACE_BANK).isValid()
                && !RSInterface.getInterface(INTERFACE_STORE).isValid()) {
            openTab(TAB_INVENTORY);
        }
        int[] items = getInventoryArray();
        java.util.List<Integer> possible = new ArrayList<Integer>();
        for (int i = 0; i < items.length; i++) {
            for(int j = 0; j < itemIDs.length; j++) {
                if (items[i] == itemIDs[j]) {
                    possible.add(i);
                    break;
                }
            }
        }
        if (possible.size() == 0) {
            return false;
        }
        int idx = possible.get(random(0, possible.size()));
         Point t = getInventoryItemPoint(idx);
         moveMouse(t, 5, 5);
        long waitTime = System.currentTimeMillis() + random(50, 250);
        boolean found = false;
        while (!found && System.currentTimeMillis() < waitTime) {
            wait(15);
            if ((getMenuItems()).get(0).toLowerCase().contains(
                    option.toLowerCase())) {
                found = true;
            }
        }
        if (found) {
            clickMouse(true);
            wait(random(150, 250));
            return true;
        }
        clickMouse(false);
        wait(random(150, 250));
        return atMenu(option);
    }

    public void serverMessageRecieved(ServerMessageEvent e) {
        String CM = e.getMessage();
        if (CM.contains("You get some ")) {
            chopped++;
        }
        if (CM.contains("wishes to trade with you") && lastTrade < System.currentTimeMillis() - 5000) {
            sendText(getResponse(), true);
            trades++;
            lastTrade = System.currentTimeMillis();
        }
    }

    private String getResponse() {
        int rand = random(0, 5);
        switch (rand) {
            case 0:
                if (trades <5){
                 return "nty";
                }
            case 1:
                if (trades <5){
                 return "no";
                }
            case 2:
                if (trades <5){
                 return "no ty";
                }
            case 3:
                if (trades <5){
                 return "nop";
                }
            case 4:
                if (trades <5){
                 return "no thx";
                }
        }
        return "";
    }


}
You would save the script above as GlobalChopAndDrop.java

5) Go back to your "RSBot" folder and click "Compile-Scripts". This will convert all your scripts into .class files (which RSBot will be able to load in). If you pasted the script correctly, you will now see that the script has been added when you go to File > Run Script. There is no need to restart RSBot, as the scripts will be loaded in every time you do File > Run Script.

If you paste a script in incorrectly, then RSBot will not load in some of your other scripts. If this happens delete the .java file and try again or contact the author of the script.

You should be good to go now, and able to add any script you want. However, if you are having problems, perhaps the following section of answers to frequently asked questions will help you out.

FAQs:

1) When I compile I get the following:


Code:
Note: scriptsGlobalChopAndDrop.java uses or overides a deprecated API.
Note: Recompile with -Xlint:deprecation for details
Answer: You can ignore any lines with 'Note:' at the beginning. This is just a note to scripters. This file has compiled fine. Some scripts will give these notes, most will not.

2) When I compile I get the following:


Code:
ScriptsGlobalChopAndDrop.java:284: reached end of file while parsing
}
^
1 error
Answer: You have not copied the script correctly. Make sure you copy everything. You have probably missed out a '}' at the end of the script.

3) When I compile I get the following:


Code:
Path file does not exist. Please run RSBot and try again.
Answer: Open up RSBot (the .jar) and compile again.


GER:
[Only registered and activated users can see links. Click Here To Register...]
05/08/2009 01:03 Foolsgold#2
Looks clean, Thanks

Why you not update it in one thread?
05/08/2009 01:35 gerble93#3
Because this is a new one,
And the title might mess people up?
05/09/2009 07:54 xzodi06#4
hmm, shud it just not be better to give the homepage link?.. and guides on their homepage :D

PS: For those who did use svn versio and hav problm with playing, try to update it again without compiling, did work well for me :D
05/09/2009 14:41 gerble93#5
this is the legit link,
I wouldn't post anything with viruses
05/09/2009 20:19 DudeWhereIsMyCar159#6
i got a message saying "Could not find the main class. Program will exit." i get that whenever i try running play-free....what should i do?
05/09/2009 22:16 gerble93#7
Can you please send me a ss?
05/09/2009 22:21 suboy#8
lil question whats a RS Bot never used one
05/09/2009 22:46 gerble93#9
It is a different client for runescape,
It is still connected to normal Runescape.
But it allows you to rune bots, like woodcutting
mining. etc!
05/09/2009 23:01 DudeWhereIsMyCar159#10
How do you take a screenshot?
05/09/2009 23:42 gerble93#11
Above the Insert button on your keyboard, is there somthing like this:
[Only registered and activated users can see links. Click Here To Register...]

Press that, the open paint.
And press paste!
05/10/2009 00:18 DudeWhereIsMyCar159#12
heres the picture
05/10/2009 00:23 DudeWhereIsMyCar159#13
i cant fix the blurry... =[
05/10/2009 00:58 gerble93#14
Please don't Double post.
Make a new folder on your desktop;
And right click on the rsbot, and extract it to that folder, then clean;
then complite;
and play free..
05/10/2009 04:39 nildesita#15
beautiful..