Hello And Welcome To My Little Guide TO Help you make your First script 
Chapters :
1.Script Outline
2.walking
3.Object And NPC finding
______________
CHAPTER 1 :
This is a blank and most basic script. A new script must follow this format for it to be able to compile. It must implement all methods here.
Thanks For ~ Alex ~ for The Skeleton !
___________________________________________
Chapter 2 :
walking
Making a script walking from location to location is easy in RsBot. Because it has the ability to read data from the client it can use Tiles for walking. In this tutorial I'm going to be showing you how to create an RSTilePath and use that to walk to a location.
Firstly I'm going to create a blank script
Now we will declare a new array of tiles. If you do not understand what an array is I suggest you Google it
.
(
Now we need to get the tiles we want. To do this load up RsBot and start a bot. Ensure that player position is selected as the debug menu. You can see your players' current coordinates printed on the applet. Collect some coordinates and note them down. Here is a list that I've collected:
3222,3219
3235,3223
3230,3231
3221,3239
3215,3243
These are a series of waypoints from lumbridge castle to the general store. Now we will add these to our array of RSTiles.
Now we will create a new variable, a RSTilePath. The parameters for a RSTile path are as follows: RsTilePath myPath = new RsTilePath(RSTile[],script);
Congratulations, you've just created your first path! Now I'm going to show you how to use this for walking, which is extremely simple.
Something to note is that when walking a path an InterruptedException can be thrown, you must encapsulate your code in a try/catch block. Here is an example of it in a script:
Chapter 2 DONE !
________________________________-
Chapter 3
Object & Npc finding
These two topics are very similar so I decided to include them in the same tutorial.
The ability to find objects on screen instantaneously has been a key factor to RSBot's success. An object is model displayed in the client, for example a door or a bank booth. Each of these have a unique ID. When you log into RS through RSBot and turn on the object debug you will see white text displaying a number over every object. RSBot can use these ID's to scan all the objects on screen and find the one you are looking for. Open a blank script.
Now I'm going to intorduce you to a new class; the RSObject class. Lets attempt to find a bank booth at Draynor Bank. First of all we need to log into RSBot and ensure that the 'Object' option is enabled in the debug drop down menu. Now go to Draynor Bank and look at the number on top of the open bank booth. You should see that its 2213. We can now create a new RSObject for this object
Now we've created a new RSObject we can use it to find the object on screen. In order to do this we must use the atObject method, like so.
If you run that it will right click the bank booth and click quickly.
Now on to NPC's. NPC finding is similar to Object finding. They both have unique ID's however you can also find an NPC via it's name rather than it's ID. Try this,
In eclipse you can then type 'man.' and the intelli-sense will show you all the methods within the RSNPC class. For instance you can do man.getAnimation(); or man.getHP();
In order to click a NPC you can use the atNPC method as follows,
Try experimenting with these methods, especially with the RSNPC class. They are very powerful and you can do a lot with them.
Thats all and sorry its too short ill try to get more
Credits for ~alex~ The orignal Creater
Chapters :
1.Script Outline
2.walking
3.Object And NPC finding
______________
CHAPTER 1 :
This is a blank and most basic script. A new script must follow this format for it to be able to compile. It must implement all methods here.
Code:
import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.script.wrappers.*;
public class blank extends Script{
public String getName() {
return "Basic Script";
}
public String getAuthor() {
return "~alex~";
}
public double getVersion() {
return 0;
}
public boolean onStart(String[] args) {
return true;
}
public int loop() {
return 0;
}
}
Thanks For ~ Alex ~ for The Skeleton !
___________________________________________
Chapter 2 :
walking
Making a script walking from location to location is easy in RsBot. Because it has the ability to read data from the client it can use Tiles for walking. In this tutorial I'm going to be showing you how to create an RSTilePath and use that to walk to a location.
Firstly I'm going to create a blank script
Now we will declare a new array of tiles. If you do not understand what an array is I suggest you Google it
(
Code:
RSTile[] myTile = new RSTile[]{};
Now we need to get the tiles we want. To do this load up RsBot and start a bot. Ensure that player position is selected as the debug menu. You can see your players' current coordinates printed on the applet. Collect some coordinates and note them down. Here is a list that I've collected:
3222,3219
3235,3223
3230,3231
3221,3239
3215,3243
These are a series of waypoints from lumbridge castle to the general store. Now we will add these to our array of RSTiles.
Code:
RSTile[] myTiles = new RSTile[]{new RSTile(3222,3219),new RSTile(3235,3223),
new RSTile(3230,3231),new RSTile(3221,3239),new RSTile(3215,3243)};
Now we will create a new variable, a RSTilePath. The parameters for a RSTile path are as follows: RsTilePath myPath = new RsTilePath(RSTile[],script);
Code:
RSTilePath myPath = new RSTilePath(myTiles,this);
Congratulations, you've just created your first path! Now I'm going to show you how to use this for walking, which is extremely simple.
Code:
myPath.walkToEnd();
myPath.walkToStart();
Something to note is that when walking a path an InterruptedException can be thrown, you must encapsulate your code in a try/catch block. Here is an example of it in a script:
Code:
import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.script.wrappers.*;
public class walking extends Script {
RSTile[] myTiles = new RSTile[] {
new RSTile(3222, 3219),
new RSTile(3235, 3223), // We declare a new array of RSTile and
// populate it with the waypoints
new RSTile(3230, 3231), new RSTile(3221, 3239),
new RSTile(3215, 3243) };// for our path.
RSTilePath myPath = new RSTilePath(myTiles, this); // We declare a new
// RSTilePath and tell
// it to use the tiles
// stores in 'myTiles'
public String getName() {
return "Basic Script";
}
public String getAuthor() {
return "~alex~";
}
public double getVersion() {
return 0;
}
public boolean onStart(String[] args) {
return true;
}
public int loop() {
try {
myPath.walkToEnd();
myPath.walkToStart();
} catch (Exception e) {
log("An error occured whilst walking");
}
return -1;
}
}
Chapter 2 DONE !
________________________________-
Chapter 3
Object & Npc finding
These two topics are very similar so I decided to include them in the same tutorial.
The ability to find objects on screen instantaneously has been a key factor to RSBot's success. An object is model displayed in the client, for example a door or a bank booth. Each of these have a unique ID. When you log into RS through RSBot and turn on the object debug you will see white text displaying a number over every object. RSBot can use these ID's to scan all the objects on screen and find the one you are looking for. Open a blank script.
Now I'm going to intorduce you to a new class; the RSObject class. Lets attempt to find a bank booth at Draynor Bank. First of all we need to log into RSBot and ensure that the 'Object' option is enabled in the debug drop down menu. Now go to Draynor Bank and look at the number on top of the open bank booth. You should see that its 2213. We can now create a new RSObject for this object
Code:
RSObject bankBooth = new findObject(2213);
Now we've created a new RSObject we can use it to find the object on screen. In order to do this we must use the atObject method, like so.
Code:
public int loop() {
atObject(bankBooth, "quickly");
return 0;
}
If you run that it will right click the bank booth and click quickly.
Now on to NPC's. NPC finding is similar to Object finding. They both have unique ID's however you can also find an NPC via it's name rather than it's ID. Try this,
Code:
public int loop() {
RSNPC man = getNearestNPCByName("Man");
return 0;
}
In eclipse you can then type 'man.' and the intelli-sense will show you all the methods within the RSNPC class. For instance you can do man.getAnimation(); or man.getHP();
In order to click a NPC you can use the atNPC method as follows,
Code:
RSNPC man = getNearestNPCByName("Man");
atNPC(man, "Attack");
Try experimenting with these methods, especially with the RSNPC class. They are very powerful and you can do a lot with them.
Thats all and sorry its too short ill try to get more
Credits for ~alex~ The orignal Creater
