Hello, I am Officer Barbrady I can currently script for RSPS's (Finally finished this guide March 18th lol). Now some SRL people may ask "why?" Well, botting is botting, and if a task is boring enough then, well it needs to be done!
(some parts of this guide are being re-written)
Credits:[Multiple people in different areas of tutorial]
@
Flight TPA function
@
DannyRS Project 2006 Include + GetText Function + like 500 other things
@
Sin Helped me with something.. I forgot
@
NKN Helping me with stuff
@
Le Jingle Helping me with stuff
@
SjoekeloeHelping me with stuff
NOTE: You will have to know some basic scripting knowlege because I will not be going over the bare basics, this is just a guide on how to bot on servers in general.
I suggest you visit @
YoHoJo's tutorials:
Tutorial #1Tutorial #2
Older SRL People: let me know if I missed anything in this tutorial
Most tutorial's on here are directed towards botting on Runescape. This means that a lot of the srl include will be unusable for the private server you want to bot on.
I am going to come out and say it, I am not expert scripter, no benland10 but I can help you start out your way to botting on a RSPS to do what ever task you need to be done!
Table of contents
- Introduction
- Clicking a color
- Using bitmaps
- Using DTM's
- Making a good Writeln
- Basic Walking -
More to Come
- Closing words
----Introduction----
First off we always want to include SRL just so we can use mmouse because you never know if a server can detect mouse jumping AND it just looks better. Also, you may think 'Oh it's just a RSPS I don't need to add fail-safes' WRONG. On a private server, chances are someone sees you standing around in a area for 15 hours they are going to call a mod and ban you unlike in Runescape were you would just be reported and chances are you won't be banned. Second off, Bitmaps are your friend, To be honest you can't make a decent script without them or with the help of fonts
----Clicking a color----
If you are completely new to scripting then you will want to start here. Using static coords are just not good enough to I will teach you how to click a color incase you don't already know how. I would advise you read some basic tutorials on the pascal language before getting started here.
First we are going to want to define SRL
Simba Code:
Program ChopTree;
{$i srl/srl.simba}
Begin
SetupSRL;
end.
Next make a procedure and define X and Y for simba to store were it finds the colors:
Simba Code:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
end;
Begin
SetupSRL;
end.
here is the code that will click a color:
Simba Code:
FindColorTolerance(X, Y, COLOR, X, Y, X2, Y2, TOL)
The first X and Y is were the script will store the variables that we will use to position our click, the XStarts and YStarts are the Co-Ords of the screen range were you want to find the color inside.
now you want to click a color. So in my example I am going to use a maple tree because it has some nice unique colors(and it's good XP hehe)
Use the color picker a select a nice unique color (like the red) like so:
Now put the color in the code above were a put color, and use the color picks to pick the coords to were you want to search for that color. So if i wanted to find the color 10336 in this box:
The color finding code would look like:
Simba Code:
FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5)
the 5 at the end is the tolerance, so it will be more easy to find the color because the colors are always changing in the cleint whether it is on purpose or not.
So far, your script:
Simba Code:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5)
end;
Begin
SetupSRL;
end.
Find the color 10336 in that area of the screen above with a tolerance of 5.
Now we want the script to click it!
This is simple, After the find color code, you add this
Simba Code:
mmouse(x, y,1,1); // moves the mouse to were the colot is found
wait(250); // waits one fourth of a second
ClickMouse(X, Y, mouse_Left)// clicks
Congratz! You have now made a script that clicks a color!
Now we want to add some failsafes. So were you see find color tolerance add a if before it and then after it and on the next line add begin like so:
Simba Code:
if FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5) then
begin
So now your script should look like:
Simba Code:
Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.
what the script now does is,sets the mouse speed to 15, finds the color 10336 in the selected area, and if it does not find it then it does not move or click the mouse.
-----Using bitmaps-----
Bitmaps are great for botting on private servers. Why? Because you don't have acess to the SRL uptext NOOB
. Anyway here is how you can use bitmaps to click on a image.But first I will go over were to use, and not to use bitmaps.Bitmaps are for more precise clicking for more static area such as well.. options
BAD PLACES TO USE BITMAPS:
- For clicking a object such as a tree, there are a million better ways to do this
- For clicking a item in the inventory, leave this to DTM's
- For check for a HP bar in combat
GOOD PLACES TO USE BITMAPS
- To choose the drop option on a object
- To choose any option on a NPC or Object
- If DTM's are not accurate enough for clicking an item (such as getting super attack 3's confused with super attack 4's)
- To check if the character is logged in
Lets get started, first you have to define a variable in which the bitmap will be stored. So I am going to do this here, I will be using dropping a maple log as an example:
Simba Code:
Program BitmapExample;
var
Drop:Integer;
Begin
end.
So your probably asking ' how do I get a bitmap' well, anybody with a IQ above 7 can do this so here are the easy steps:
1) Find the bitmap you want to click and take a screenshot using print screen. I will do this by right clicking a maple log and clicking print screen. Make sure you don't hover over the option overwise it will mess it up.
2) Paste the screenshot into paint and select the area you want to click like so:
Select the area and paste it into paint, my bitmap looks like this:
Next, save it, but make sure you save it as A 24 BITMAP IMAGE LIKE SO:
Now we want to convert this to a bitmap using simba so go to tools --> Bitmap conversion like so:
Next go to open, find the file, and hit ' To String ' simba will output a bunch of random letters and numbers in the debug box. Mine looked like:
Simba Code:
Bmp := BitmapFromString(97, 7, 'meJzNVNsNgDAIZJD+96NLOKI/7uI' +
'ErqWNTRoCPfo0kfBBzkPgSut8OM4rOhE5H9b6tt9FH6vVmztTSziX' +
'KMXJBUGABq6b1IHWEGmLRka5vfwqjiSi1/jXaFwNhKMmE5MjOc64y' +
'EK4wUHVh2sJEcTgaMfs2F5142T1OANxVaL2/9hbxMt9J5E+wd5xuL' +
'bLJcqb/weJZuJsjRdtYBvRy6M5RabGV100vSF2ri2R4PNuqz08aX+' +
'C5w==');
Next, you want to add this into your script in the main execution (Atleast thats how I do it) like so:
Simba Code:
Program BitmapExample;
var
Drop:Integer;
Begin
Drop := BitmapFromString(97, 7, 'meJzNVNsNgDAIZJD+96NLOKI/7uI' +
'ErqWNTRoCPfo0kfBBzkPgSut8OM4rOhE5H9b6tt9FH6vVmztTSziX' +
'KMXJBUGABq6b1IHWEGmLRka5vfwqjiSi1/jXaFwNhKMmE5MjOc64y' +
'EK4wUHVh2sJEcTgaMfs2F5142T1OANxVaL2/9hbxMt9J5E+wd5xuL' +
'bLJcqb/weJZuJsjRdtYBvRy6M5RabGV100vSF2ri2R4PNuqz08aX+' +
'C5w==');
end.
Now you want simba to click on it, the code to find bitmaps is:
Simba Code:
FindBitmapToleranceIn(BITMAP, X, Y, X1, Y1, X2, Y2, TOL)
So add that in the procedure, but add failsafes like you did with color so it would look like:
Simba Code:
Program BitmapExample;
{$i srl/srl.simba}
var
Drop:Integer;
Procedure DropLog;
var
X,Y:Integer;
begin
if FindBitmapToleranceIn(Drop, X, Y, 561, 226, 738, 484, 145) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
Drop := BitmapFromString(97, 7, 'meJzNVNsNgDAIZJD+96NLOKI/7uI' +
'ErqWNTRoCPfo0kfBBzkPgSut8OM4rOhE5H9b6tt9FH6vVmztTSziX' +
'KMXJBUGABq6b1IHWEGmLRka5vfwqjiSi1/jXaFwNhKMmE5MjOc64y' +
'EK4wUHVh2sJEcTgaMfs2F5142T1OANxVaL2/9hbxMt9J5E+wd5xuL' +
'bLJcqb/weJZuJsjRdtYBvRy6M5RabGV100vSF2ri2R4PNuqz08aX+' +
'C5w==');
DropLog;
end.
Now, as you noticed this did not drop the log, because it could not find the bitmap because the log was not right clicked, so make the script right click the log, search for the bitmap and click it, like so:
Simba Code:
Program BitmapExample;
{$i srl/srl.simba}
var
Drop:Integer;
Procedure DropLog;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 605787, 561, 226, 738, 484, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Right)
wait(450);
if FindBitmapToleranceIn(Drop, X, Y, 561, 226, 738, 484, 145) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
end;
Begin
MouseSpeed := 15;
Drop := BitmapFromString(97, 7, 'meJzNVNsNgDAIZJD+96NLOKI/7uI' +
'ErqWNTRoCPfo0kfBBzkPgSut8OM4rOhE5H9b6tt9FH6vVmztTSziX' +
'KMXJBUGABq6b1IHWEGmLRka5vfwqjiSi1/jXaFwNhKMmE5MjOc64y' +
'EK4wUHVh2sJEcTgaMfs2F5142T1OANxVaL2/9hbxMt9J5E+wd5xuL' +
'bLJcqb/weJZuJsjRdtYBvRy6M5RabGV100vSF2ri2R4PNuqz08aX+' +
'C5w==');
DropLog;
FreeBitmap(Drop);
end.
Make sure you always free your bitmaps, otherwise your computer will clog up:
-----Using DTM's-----
DTM's are just like bitmaps, and are by far the most useful thing when finding a object in the inventory. You may be thinking: Wow, why would I use a DTM when I can use color? Well sometimes colors can be mixed up and you can get a lot of matching colors and not be able to find your object accurately.Lets say you wanted to drink super attack 4's so then you can use them to make extreme attacks, with pure color there would be no way to tell the difference between a super attack 3 and a super attack 4. You can see that here,the matching colors are in red (tolerance of 7):
As you can see, the bot would be clicking the super attack 3's thinking they are 4's. This is were DTM's come in handy, here is a picture if I use DTM's(matching DTM's in red):
As you can see DTM's are a lot more accurate then just using color. Now I will teach you to use DTM's, by the way using them is the script is almost the same as bitmaps!
First off, to use DTM's you have to enable the DTM editer like so:
Now that we have that enabled, open it up by going to tools ----> DTM editor:
At the top go to image---> Load cleint image.
Now create some points for the DTM! But make sure you change the tolerance otherwise your DTM won't work good:
Example:
Your almost done!
Next, at the top press 'DTM' and then press 'Print DTM' You should get a bunch of random letters and numbers in the debug box. Now we are going to need these later to add to your script:
Now your mind be wondering 'wut how i use dtm in my script'? Well it's simple just like Bitmaps, here is a example, you have to declare the DTM name as a integer,and you have to free it:
Simba Code:
Program DTM;
{$i srl/srl.simba}
var
BlueCharm:Integer;
Procedure ClickCharm;
var
X,Y:Integer;
begin
if FindDTM(BlueCharm, x, y, 554, 230, 732, 482) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;
end;
Begin
SetUpSRL;
BlueCharm := DTMFromString('mggAAAHicY2NgYHBjYmDwAGI/IPYGYgco/gmU+8wAof9D8VcgFhEQYCia2IWBOYFy2DAjDgwBAPOxD8M=');
ClickCharm;
FreeDtm(BlueCharm);
end.
Congratulations! You have hopefully learned how to click a DTM!