SRL Archive - OSR Beginner Scripting Tutorials

How to script for a RSPS - Beginner level


rj

2013-01-06 15:38:54

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

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:

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:

 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:

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:
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
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:

if FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5) then
begin

So now your script should look like:

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 :D. 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:

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:

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:

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:

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:

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:

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:

FreeBitmap(Drop);



—–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:

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!

rj

2013-01-06 15:39:55

MAKING A GOOD WRITELN/EASY TO USE SCRIPT

This section I will cover how to make your script easy to use for yourself and other people, and also how to make it look better and more informative. I am first going to start off with user input, unfortunately i cannot teach you how to use a T-form, and even if I could i think it is to complicated for the purpose of a short script. I will be teaching you how to use input query so the script will stop when X amount of resources are collected or it could be used for other things.

First off here is the code for input query:

If (InputQuery('Enter Time between Herb clean', 'Enter time[In Miliseconds]:' , HerbWait)) Then

HerbWait is the variable it edits, which would be declared as a global variable (string) at the start of the script.


This would look like:



Now to use this, above it asks how many milliseconds the user wants to wait inbetween clicks and they enter a number. that number is then saved a string. in order to use it for it's purpose which is to wait we have to convert it to a integer like this:

StrToInt(HerbWait)

So an example of me using this would be:

Wait((StrToInt(HerbWait)+1)  + Random(50));

Now there more we can do with input query, we can also make the user input how many they want to clean:

If (InputQuery('How many herbs would you like to clean', 'Enter Amount:' , HowManyClean)) Then

This would be right after the input query above, and then in the repeat part of the script you can add this:

repeat
WithDrawHerbs;
until (StrToInt(HowManyClean)) <= HerbsCleaned;

This repeats the script until all the herbs are cleaned.


Now you are probalbly wondering 'how do i make a good writeln' Well, first you better know how to properly count how many logs are cut or how many fish are fished. there is a simple way to do this:

1) Declare a variable as a integer
HerbsCleaned:Integer;

2) Now in order to add to that variable you just use the code

IncEx(HerbsCleaned, 1);

3) In order for it to calculate correctly, make it add to the variable after the item is dropped or banked, so in my cleaning procedure when ever the herb is clicked it adds 1 to the herbscleaned variable:

if FindDTM(GrimyWeed, x, y, 652, 212, 685, 460) then
begin
mmouse(x, y,1,1);
Wait((StrToInt(HerbWait)+1) + Random(50));
ClickMouse(x, y, mouse_Left);
IncEx(HerbsCleaned, 1);
Wait((StrToInt(HerbWait)+1) + Random(50));

One more then before I teach you how to make a halfway decent writeln, to add a decent timer, add this in the repeat part of your script:

SetScriptProp(SP_WriteTimeStamp, [True]);

This will have the time to the left of the Writeln.

Now, what you have been waiting for, how to make a decent writeln. First off, the point of a Writeln is for you or the user to check the script and see what it's doing, it's progress, and how long it's been running. You want to make the Writeln as easy to read as possible, here are a few examples, and remember always add "ClearDebug;" before each writeln otherwise it spams the debug box and looks straight up tacky


[0:00:18]: ******************************
[0:00:18]: Officer Barbrady HerbCleaner Version 1.0
[0:00:18]: Status: Cleaning herbs . . .
[0:00:18]: Herbs Cleaned:5 |995 Left|
[0:00:18]: Herblore XP Earned:5000
[0:00:18]: ******************************

Source:
 ClearDebug;
status := ('Storing Herbs.');
Writeln(Officer Barbrady HerbCleaner Version 1.0');
Writeln('Status: ' + Status + '.');
Writeln('Herbs Cleaned:' + IntToStr(HerbsCleaned) + ' |'
+ IntToStr(StrToInt(HowManyClean)-HerbsCleaned) + ' Left|');
Writeln('Herblore XP Earned:' + Tostr(HerbsCleaned*931));


—————————————————————————–

[0:00:18]:********************************
[0:00:18]:Officer Barbrady Potion Drinker Version 2.2
[0:00:18]:Status:Withdrawing Potions
[0:00:18]:Potions Drank:100
[0:00:18]:Goal:[5000]|4900 Left to drink| [0%]
[0:00:18]:********************************

Source:(This one is a bit complicated haha)
ClearDebug;
status := ('Storing Potions');
Writeln('********************************')
Writeln('Officer Barbrady Potion Drinker Version 2.2')
Writeln('Status:' + status + '');
Writeln('Potions Drank:' + IntToStr(PotsDrank) + '');
WriteLn('Goal:' + '[' + HowManyDrink + ']' + '|'
+ IntToStr(StrToInt(HowManyDrink)-PotsDrank) + ' Left to drink| ['
+ IntToStr(Round(PotsDrank * 1.0 / StrToInt(HowManyDrink)*100)) + '%]');
Writeln('********************************')



—————————————————————————–


[0:00:18]**********************************
[0:00:18]Officer Barbrady IRON MINER 1.12')
[0:00:18]Status:Mining . . .
[0:00:18]Ores mined:1
[0:00:18]XP gained:1000
[0:00:18]Smoked rocks:0
[0:00:18]**********************************

Source:
ClearDebug;
status := ('Dropping ores.');
WriteLn('**********************************')
WriteLn('Officer Barbrady IRON MINER 1.12')
Writeln('Status: ' + status)
Writeln('Ores mined:' + IntToStr(Round(oremined)))
Writeln('XP gained:' + IntToStr(Round(oremined*1050)))
Writeln('Smoked rocks:' + IntToStr(Round(smokes2)))
WriteLn('**********************************')



As you can see all these Writeln's are easy to read, informative, and have a couple extra features such as % finished. To make a status for your script visit this thread:http://villavu.com/forum/showthread.php?t=94915
A good way to save space is to write a Procedure for the writeln and call it everytime you want to update. For example, I have the writeln Procedure here:
Procedure WriteDebug;
begin
ClearDebug;
Writeln('*****************************');
Writeln('Status:' + Status + '');
Writeln('Spice steals:' + IntToStr(Stole_Spice) + '');
Writeln('Ruby steals:' + IntToStr(Stole_Ruby) + '');
Writeln('Runs:' + IntToStr(Runs) + '');
WriteLn('Goal:' + '[' + How_Steal + ']'
+ '|' + IntToStr(StrToInt(How_Steal) - Steals)
+ ' Left to steal| ['
+ IntToStr(Round(Steals * 1.0 / StrToInt(How_Steal) * 100)) + '%]');
Writeln('*****************************');
end;

And when I want to update it I just do:

WriteDebug;

This is pretty much it, theres not much more I can teach you about this since the source is above.

rj

2013-01-06 15:42:45

Basic walking

- Reconstructing

I'm going to be honest I am not very good at walking and I only know of 1 way to do it so I will teach you the most I know. This walking method is semi-reliable if you are going to be clicking 1 point on the minimap, but for walking long distances I would not advise it AT ALL.

This walking method is called DTM walking (I think?) The command for walking with the method is this:


ClickDTMRotatedIn(DTM_1, MMX1,MMY1, MMX2,MMY2, -Pi, Pi, Pi/30, [], mouse_Left);

Looks complicated right? Not really, now first off copy this basic script to test it out:

program Test;
{$I srl/srl.simba}
var
DTM_1:integer;
begin
MouseSPeed := 15;
DTM_1 := DTMFromString('mQwAAAHicY2ZgYFjLxMBQDsQngLgCyLcHYn8gLs/PY8isngum+YF8GGZEwkAAADWpB1U=');



ClickDTMRotatedIn(DTM_1, MMX1,MMY1, MMX2,MMY2, -Pi, Pi, Pi/30, [], mouse_Left);
Wait(2500);
while (IsMoving) do
wait(100);

FreeDTM(DTM_1);
end.

Chances are it did not do anything, well that is because you have to make a DTM of were you want to walk on the minimap. So open up the DTM editor and make a DTM of were you want to walk. When you make it, make sure you use a high tolerance (15-20) and pick a central point and then spots that won't be walked on like this:


Next, in the DTM editor click "show matching DTM's and you will see red markers over the matching DTM's like so:


Make sure that it shows plenty of matching DTM's otherwise the bot will not be able to find the spot next time you try. Now click print DTM and replace the DTM in the code to the one you just made. Now hit run and it should walk to that spot on the minimap! You have now learned basic walking! I only advise you to use this if your going to be walking 1 - 2 clicks on the minimap it is NOT a very reliable way to walk.


Closing

This concludes the tutorial, overall scripting for a RSPS is challenging because you have to make your own functions or just use a unreliable script, I hope this helped you. If you have any suggestions, or think something needs to be worded better or have a grammar mistake please state it below

DannyRS

2013-01-06 16:11:13

From: rjj95

Here is the code that will Find a Color:

 FindColorTolerance(X, Y, COLOR, XStart, YStart, XEnd, YEnd, 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 which you want to find the color inside.


Think this part is better worded like this so its less confusing for new Scripter's?

Haven't read the rest yet but Good Job ;)

rj

2013-01-06 16:12:49

From: DannyRS
Think this part is better worded like this so its less confusing for new Scripter's

Haven't read the rest yet but Good Job ;)


thanks lol didn't know how to word it :p

Matsetst

2013-01-06 18:46:23

omg i fuckng love you ! this is just what i needed :p

Smoeltje

2013-01-07 06:45:44

Looks neat, i'll be studying this after im done with the main scripting tutorial for simba.

SDK

2013-01-10 04:59:18

Thanks this helped me start :)

Pew

2013-01-11 23:49:32

Eagerly awaiting the TPA guide as the other ones don't make a lot of sense. Great work so far, wish this was here when I started would have saved me a lot of messing around.

Pootisman

2013-01-13 16:27:45

All the numbers and x and y and everything is very complicated , could you please simplify it?

jmu2

2013-01-14 01:13:15

Great guide, it is really helping me out so far.

edit: i fixed my problem :D

gstar

2013-01-14 17:29:27

FindColorTolerance(X, Y, COLOR, X, Y, X2, Y2, TOL)

how do you gain the X,Y,X2,Y2 values?

FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5)

rj

2013-01-14 19:12:22

From: gstar
FindColorTolerance(X, Y, COLOR, X, Y, X2, Y2, TOL)

how do you gain the X,Y,X2,Y2 values?

FindColorTolerance(X, Y, 10336, 277, 169, 326, 218, 5)

Using the pick color you get the top left coords and the bottom right coords.


@pew going to add tapas later

TuSaliHai

2013-01-22 15:50:46

I followed the very first part of your tutorial, but whenever I hit run, it does nothing and tells me it executed successfully.

Elip007

2013-01-22 18:17:56

From: TuSaliHai
I followed the very first part of your tutorial, but whenever I hit run, it does nothing and tells me it executed successfully.


Make sure you add the Procedure into the Main Loop. Also make sure your colors and other information is correct. RSPS are tricky to script for, but once you figure out whats what, it isn't that bad.
Good luck on figuring out how to make it work!

TuSaliHai

2013-01-22 19:47:40

From: Elip007
Make sure you add the Procedure into the Main Loop. Also make sure your colors and other information is correct. RSPS are tricky to script for, but once you figure out whats what, it isn't that bad.
Good luck on figuring out how to make it work!


That's exactly what it needed, thank you!

kyleinkman

2013-01-22 19:54:10

great guide, i found a couple helpful tips for scripting on normal rs in here too :)

lilsaint20

2013-01-24 19:21:24

From: Elip007
Make sure you add the Procedure into the Main Loop. Also make sure your colors and other information is correct. RSPS are tricky to script for, but once you figure out whats what, it isn't that bad.
Good luck on figuring out how to make it work!


I made sure the procedure was in the main loop. All my colors are right, but it still wont do anything but successfully execute. I made sure to even target the client. Tried websites as well on 3 different browsers. please help?
the only difference is i made mine into a power miner.

rj

2013-01-25 19:11:25

From: lilsaint20
I made sure the procedure was in the main loop. All my colors are right, but it still wont do anything but successfully execute. I made sure to even target the client. Tried websites as well on 3 different browsers. please help?
the only difference is i made mine into a power miner.


Can we see the code?

rj

2013-01-25 19:16:57

updated with TPA's Writeln's and dropping methods.

Elip007

2013-01-25 19:39:46

From: lilsaint20
I made sure the procedure was in the main loop. All my colors are right, but it still wont do anything but successfully execute. I made sure to even target the client. Tried websites as well on 3 different browsers. please help?
the only difference is i made mine into a power miner.


You should upload the code so we could help you out that way.
Make sure you have "SetUpSRL;" That can be a problem if you don't have it.

kylepwnz777

2013-01-27 16:47:10

Very helpful thanks

Dormik

2013-02-02 16:39:31

Very helpfull! Can you create a tutorial on how to NOT use static coords? I've seen that in some scripts they used the DTM editor to do this, can you tell how? I'd really appreciate it! Thanks!

rj

2013-02-02 23:30:28

From: Dormik
Very helpfull! Can you create a tutorial on how to NOT use static coords? I've seen that in some scripts they used the DTM editor to do this, can you tell how? I'd really appreciate it! Thanks!


What do you mean not use static coords…

Dormik

2013-02-03 09:32:41

From: rjj95
What do you mean not use static coords…


I mean walking using DTM.
Q[1] := DTMFromString('mwQAAAHic42RgYKhlYmCoA+JKIK4A4moovwmIG4C4EYhrgeqagbiRAcKuAOJyIK4C4jogbgLi5ERlhu6OPDiOS1ZmSExTBovHRSqCxf4D1fETwIxEYDgAAPZSFOM=');

And then making a procedure with it;

procedure WalkToSomething;
begin
If FindDTMRotated(Q[1], X, Y, 0, 0, 0, 0, -Pi/4, Pi/4, Pi/60, aFound) Then
Begin
Mouse((X - 5), (Y + 15), 6, 10, True);
Repeat
Wait(50 + Random(25));

Until FindDTMRotated(Q[0], X, Y, 0, 0, 0, 0, -Pi/4, Pi/4, Pi/60, aFound);
end;

rj

2013-02-03 09:54:43

From: Dormik
I mean walking using DTM.

And then making a procedure with it;


Not the best way to walk but ill add it later

Dormik

2013-02-03 15:21:17

Okay thanks man! ='D

Schnauzer

2013-02-03 19:19:39

Thanks, I had formal experience with pascal from a class but this has taught me how to utilize it for my purpose.

Sjoe

2013-02-03 19:30:06

From: Schnauzer
Thanks, I had formal experience with pascal from a class but this has taught me how to utilize it for my purpose.


One of the few new members who don't post a leeching question on their first post and goes straight to the tutorials!
Bravo.

Dormik

2013-02-07 10:58:22

When do you have time to make the walking tutorial? :')

rj

2013-02-07 20:44:22

From: Dormik
When do you have time to make the walking tutorial? :')


Tbh it's not even worth adding but when I have time I will

Dormik

2013-02-08 01:55:33

From: rjj95
Tbh it's not even worth adding but when I have time I will


Thanks mate! =')

Gh0stt

2013-02-09 03:43:56

Hey, I am running into this error:
Exception in Script: Unable to find file 'srl/srl.simba'

With this line: {$i srl/srl.simba}

I don't seem to have the files that are used for srl.simba or something :(

What should I do?

Chris!

2013-02-09 03:57:31

From: Gh0stt
Hey, I am running into this error:
Exception in Script: Unable to find file 'srl/srl.simba'

With this line: {$i srl/srl.simba}

I don't seem to have the files that are used for srl.simba or something :(

What should I do?


Have you fully installed SRL and Simba? Follow this guide: http://villavu.com/forum/forumdisplay.php?f=351

Gh0stt

2013-02-09 04:43:58

From: Chris!
Have you fully installed SRL and Simba? Follow this guide: http://villavu.com/forum/forumdisplay.php?f=351


Silly me, I tried to update it the first time I ran it but it must have failed. I restated the program and tried again and it was successful this time.

Thanks for the quick reply and help anyway! Good to know this forum is active! :)

rj

2013-02-09 10:45:23

added basic walking

Dormik

2013-02-09 11:16:09

What does this do? Is it a failsafe?
If (TimeFromMark(Counter) > 5000) Then

rj

2013-02-09 11:20:19

From: Dormik
What does this do? Is it a failsafe?


Yes, if it cannot find it after 5 seconds then it will break the loop

Gh0stt

2013-02-09 20:39:36

Hello, I am trying to get your program to click a large piece of grey ground just for a test but when I do this nothing happens at all :(

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 5395034, 217, 128, 217, 128, 5) then
begin
mmouse(x, y,1,1);
wait(1000);
ClickMouse(X, Y, mouse_Left)

// mmouse(x, y,1,1);
// wait(1000);
// ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.


Just to clarify:
X, Y, 5395034, 217, 128, 218, 127, 5

The 217 & 128 are where I want the mouse to click
& the 218 & 127 are like the peramiters of the 'box' that I want the mouse to click in? Right?

Sorry for the noob questions. :)


Other than that.. What am I doing wrong?

Thanks for the help.

Chris!

2013-02-09 21:19:02

From: Gh0stt
Hello, I am trying to get your program to click a large piece of grey ground just for a test but when I do this nothing happens at all :(

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 5395034, 217, 128, 217, 128, 5) then
begin
mmouse(x, y,1,1);
wait(1000);
ClickMouse(X, Y, mouse_Left)

// mmouse(x, y,1,1);
// wait(1000);
// ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.


Just to clarify:
X, Y, 5395034, 217, 128, 218, 127, 5

The 217 & 128 are where I want the mouse to click
& the 218 & 127 are like the peramiters of the 'box' that I want the mouse to click in? Right?

Sorry for the noob questions. :)


Other than that.. What am I doing wrong?

Thanks for the help.


You didn't call your procedure ClickTree; in your mainloop.

Give this a whirl:

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;

begin
if FindColorTolerance(X, Y, 5395034, 217, 128, 217, 128, 5) then
begin
mmouse(x, y,1,1);
wait(1000);
ClickMouse(X, Y, mouse_Left)

end;
end;

begin
SetupSRL;
ClickTree;
end.

Gh0stt

2013-02-09 21:56:39

From: Chris!
You didn't call your procedure ClickTree; in your mainloop.

Give this a whirl:

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;

begin
if FindColorTolerance(X, Y, 5395034, 217, 128, 217, 128, 5) then
begin
mmouse(x, y,1,1);
wait(1000);
ClickMouse(X, Y, mouse_Left)

end;
end;

begin
SetupSRL;
ClickTree;
end.


Ah yes, Thanks. I did try calling the ClickTree process but it was in the wrong place.

I tried your code, it still did the same thing. But now knowing that it should work I tried something else. (This is what I get for having a old crappy computer D:)
I noticed that the game would freeze as the script was being compiled, so it was starting to run the script as the game was frozen, that was making that stuff up.

Anywho, I just added another wait(2000); above the mmouse and now it works! (With your help too!)
Thanks once again Chris!

Dormik

2013-02-12 15:52:45

When I use something like this:
If (P06_IsUpTextMultiCustom(['Harpoon','arpoon', 'rpoon'])) Then
begin
mouse(x,y,1,1,mouse_left);
end;

Then it won't click it. It doesn't give errors or something. What am I doing wrong?

rj

2013-02-12 17:54:23

From: Dormik
When I use something like this:

Then it won't click it. It doesn't give errors or something. What am I doing wrong?


Did you do SetupSRL; and SetupP06; ?

Dormik

2013-02-13 02:40:09

From: rjj95
Did you do SetupSRL; and SetupP06; ?


You dont need to use SetupSRL;, do you? I thought it was only for real runescape

rj

2013-02-13 16:43:31

From: Dormik
You dont need to use SetupSRL;, do you? I thought it was only for real runescape


If I don't add it then Uptext doesn't work for me for some odd reason idk about anyone else.

Namedontcare

2013-02-19 16:21:53

Program DeskThiever;
{$i srl/srl.simba}

Procedure ClickDesk;
var
X,Y: Integer;

begin
if FindColorTolerance(X, Y, 1356303, 363, 121, 363, 121, 5) then
begin
mmouse(x, y, 1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;

begin
SetupSRL;
ClickDesk;
end.



_____________________________________________________________

It is successfully executing but not doing anything, could someone please tell me what is wrong?

rj

2013-02-20 19:28:18

From: Namedontcare
_____________________________________________________________

It is successfully executing but not doing anything, could someone please tell me what is wrong?



First off comment out SetupSRL; you won't need it you just need to include it, second off make sure:

363, 121, 363, 121,)
Forms a box around the area you want to search, also pick a good color, and a decent tolerance.

Juicy Day

2013-03-01 14:00:30

I'm rather new to Simba and I'm wondering how I can check if the inventory is full or not when scripting for RSPS's? (do you have some sort of tip?)
Also, many of the functions are only usable when scripting for RS right? For example OpenBank etc.
Thanks in advance!

rj

2013-03-01 16:13:35

You can us count colors

Procedure InterfaceReady;
var
X, Y,Count: Integer;
begin
Count := CountColorTolerance(128, 6, 345, 496, 458, 15);
Writeln('Interface:' + IntToStr(Count));
End;
Begin
InterfaceReady;
End.

Kozs

2013-03-02 23:03:20

From: rjj95
You can us count colors

Procedure InterfaceReady;
var
X, Y,Count: Integer;
begin
Count := CountColorTolerance(128, 6, 345, 496, 458, 15);
Writeln('Interface:' + IntToStr(Count));
End;
Begin
InterfaceReady;
End.



@ rjj95
I want to click a bank booth and I have this code

Program SmithingRune2h;
{$i srl/srl.simba}
Procedure ClickBank;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 1065811, 256, 155, 256, 155, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.

THe problem is the script does not click the bank booth, idk why

rj

2013-03-03 10:05:11

Are you searching in the right area?

Kozs

2013-03-03 22:01:39

From: rjj95
Are you searching in the right area?


What do you mean?

rj

2013-03-03 22:03:25

Are the course correct?

Kozs

2013-03-03 22:17:34

From: rjj95
Are the course correct?


I believe so yes, but I didn't get a square or anything like you did….

Could you refer to this topic please!

http://villavu.com/forum/showthread.php?t=97750

rj

2013-03-18 16:41:15

Added text/include stuff

g ked

2013-07-14 08:26:13

Hmmm, my bitmaps don't seem to be being found… would you mind helping here?
var
Drop:Integer;
Procedure DropLog;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 7370637, 555, 214, 727, 459, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Right)
wait(450);
if FindBitmapToleranceIn(Drop, X, Y, 555, 214, 727, 459, 145) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
end;



Begin
MouseSpeed := 15;
Drop := BitmapFromString(134, 8, 'meJztlc0NwyAMhRkk9x66REfshV' +
'0yQdZqo1iyXP88W0ClHoo4OA48Yz4DfT/6frTWttu9X/ZpLO+P54u' +
'6+qS4Y2pjc9fqWIV5zW6IzGcKiKj+J1InQrY6Na4T+O06rWGRRSij' +
'rKO5oCSAM40bKaSLAZryMyXSrib/nk1ufuSPaolGSg/b7FezIj8Y4' +
'0aXbfu8POtx+ZdVtrXnriHKpUKEA6WnCd976el2b7MZu16foEIA/U' +
'peaRUpgkUiHOt7RIZ3xkXpElFns7hLKfFiXvX1/xqRGVteHaCvPYM' +
'LiXC1yEfZfTVkOmCk9deJuKUO6h/PjShgHaAZxVUjcaxIk/wyxBtU' +
'a9Z+');
Droplog
FreeBitmap(Drop);
SetupSRL;
end.

rj

2013-07-14 10:25:21

From: g ked
Hmmm, my bitmaps don't seem to be being found… would you mind helping here?
var
Drop:Integer;
Procedure DropLog;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 7370637, 555, 214, 727, 459, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Right)
wait(450);
if FindBitmapToleranceIn(Drop, X, Y, 555, 214, 727, 459, 145) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
end;



Begin
MouseSpeed := 15;
Drop := BitmapFromString(134, 8, 'meJztlc0NwyAMhRkk9x66REfshV' +
'0yQdZqo1iyXP88W0ClHoo4OA48Yz4DfT/6frTWttu9X/ZpLO+P54u' +
'6+qS4Y2pjc9fqWIV5zW6IzGcKiKj+J1InQrY6Na4T+O06rWGRRSij' +
'rKO5oCSAM40bKaSLAZryMyXSrib/nk1ufuSPaolGSg/b7FezIj8Y4' +
'0aXbfu8POtx+ZdVtrXnriHKpUKEA6WnCd976el2b7MZu16foEIA/U' +
'peaRUpgkUiHOt7RIZ3xkXpElFns7hLKfFiXvX1/xqRGVteHaCvPYM' +
'LiXC1yEfZfTVkOmCk9deJuKUO6h/PjShgHaAZxVUjcaxIk/wyxBtU' +
'a9Z+');
Droplog
FreeBitmap(Drop);
SetupSRL;
end.


Make sure the bitmap is 24-bit when you saved it and make sure its searching in the right area

g ked

2013-07-14 18:00:47

Wow, come to find out, i was merely a few pixel out of the bitmap's range. Almost quit but finally got it!
Now my problem is entering text when im "buying x" from a shop. Mind helping me on that one? :)

rj

2013-07-14 18:57:18

From: g ked
Wow, come to find out, i was merely a few pixel out of the bitmap's range. Almost quit but finally got it!
Now my problem is entering text when im "buying x" from a shop. Mind helping me on that one? :)


SendKeys('25');

chief herb

2013-07-25 00:36:21

From: Officer Barbrady
Are you searching in the right area?


yo heres what i have so far, basically the script will turn uncut dragstones into ammys i just nned some help with it stopping at 27.

Program DTM;
{$i srl/srl.simba}
var
Dragon:Integer;
Chisel:Integer;
c:Integer;
Procedure ClickStone;
var
X,Y:Integer;
begin
if FindDTM(Dragon, x, y, 554, 230, 732, 479) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;

end;

Procedure ClickChisel;
var
X,Y:Integer;
begin
if FindDTM(Chisel, x, y, 554, 230, 732, 479) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;
end;


Begin
SetUpSRL;
Dragon := DTMFromString('mbQAAAHicY2VgYFBnYWAwB2ItIDYBYkMg3snEwHACincB8SEg9mTOZTBgcmfwYM5iMGLyYXBmTmFAB6xAzIgFgwEANUAH8Q==');
Chisel := DTMFromString('mbQAAAHicY2VgYIhnYWBIAuJYIA4D4mAg3sLEwLAViHcD8RkgPgXEepqaDIba2gyqiooMvtrMDJ4azAzYACMWDAYAXd0IBw==');
repeat
Clickstone;
repeat
begin
c := c + 1;
until (c = 27);//will click 27 times
end;
ClickChisel;
until
FreeDtm(Dragon);
FreeDtm(Chisel);
end.

Le_don

2013-07-25 22:29:17

From: chief herb
yo heres what i have so far, basically the script will turn uncut dragstones into ammys i just nned some help with it stopping at 27.

Program DTM;
{$i srl/srl.simba}
var
Dragon:Integer;
Chisel:Integer;
c:Integer;
Procedure ClickStone;
var
X,Y:Integer;
begin
if FindDTM(Dragon, x, y, 554, 230, 732, 479) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;

end;

Procedure ClickChisel;
var
X,Y:Integer;
begin
if FindDTM(Chisel, x, y, 554, 230, 732, 479) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;
end;


Begin
SetUpSRL;
Dragon := DTMFromString('mbQAAAHicY2VgYFBnYWAwB2ItIDYBYkMg3snEwHACincB8SEg9mTOZTBgcmfwYM5iMGLyYXBmTmFAB6xAzIgFgwEANUAH8Q==');
Chisel := DTMFromString('mbQAAAHicY2VgYIhnYWBIAuJYIA4D4mAg3sLEwLAViHcD8RkgPgXEepqaDIba2gyqiooMvtrMDJ4azAzYACMWDAYAXd0IBw==');
repeat
Clickstone;
repeat
begin
c := c + 1;
until (c = 27);//will click 27 times
end;
ClickChisel;
until
FreeDtm(Dragon);
FreeDtm(Chisel);
end.


I would have read your code but it wasn't in
tags - please post in those as it makes your programs more readable.

chief herb

2013-07-26 01:29:17

yo here

Program DTM;
{$i srl/srl.simba}
var
Dragon:Integer;
Chisel:Integer;
c:Integer;
Procedure ClickStone;
var
X,Y:Integer;
begin
if FindDTM(Dragon, x, y, 554, 230, 732, 479) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;

end;

Procedure ClickChisel;
var
X,Y:Integer;
begin
if FindDTM(Chisel, x, y, 554, 230, 732, 479) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;
end;


Begin
SetUpSRL;
Dragon := DTMFromString('mbQAAAHicY2VgYFBnYWAwB2ItIDYBYkMg3s nEwHACincB8SEg9mTOZTBgcmfwYM5iMGLyYXBmTmFAB6xAzIgF gwEANUAH8Q==');
Chisel := DTMFromString('mbQAAAHicY2VgYIhnYWBIAuJYIA4D4mAg3s LEwLAViHcD8RkgPgXEepqaDIba2gyqiooMvtrMDJ4azAzYACMW DAYAXd0IBw==');
repeat
Clickstone;
repeat
begin
c := c + 1;
until (c = 27);//will click 27 times
end;
ClickChisel;
until
FreeDtm(Dragon);
FreeDtm(Chisel);
end.

chief herb

2013-07-26 01:30:18

From: Le_don
I would have read your code but it wasn't in
tags - please post in those as it makes your programs more readable.


i did it check it out plzz

rj

2013-07-26 10:34:00

@chief herb I would advise you to do a for loop:

for i := 0 to 26 do

// stuff here

So that applied in your main loop would be:

repeat
for i := 0 to 26 do // this will repeat the next line 27 times
Clickstone;
ClickChisel;
until (false);
FreeDTM(Dragon);
FreeDTM(Chisel);
end.

If you want to see what count it was on, then you would have to use begin and end after the loop because it is doing more then 1 line like so:

repeat
for i := 0 to 26 do // this will repeat the things inside of begin and end 27 times
begin
Writeln('Count ' + ToStr(i));
Clickstone;
end;
ClickChisel;
until (false);
FreeDTM(Dragon);
FreeDTM(Chisel);
end.

azzamate

2013-07-29 04:16:11

What do I add to my script after I have implemented your function, all I have is your function substituted with my font file name. What do i do now, I'm trying to use the custom font for uptext to find a magic tree then click it.

chief herb

2013-07-31 20:45:02

@Officer Barbrady

ive never used them before and my bad



please hurry with tpa rewrite yo:) <3

rj

2013-07-31 20:47:08

@chief herb Use mention tags please instead of quoting a massive block lol

 [mention][/mention] 

Leekeleek

2013-08-04 00:21:26

I'm trying to code a stall stealer on a server called ultimatescape. Problem is, no matter how hard I try to get the coordinates right..
I can't get it to click. Will you help me?

Itankbots

2013-08-04 02:23:00

From: Leekeleek
I'm trying to code a stall stealer on a server called ultimatescape. Problem is, no matter how hard I try to get the coordinates right..
I can't get it to click. Will you help me?


If you would post your script or atleast some of the code . we will be able to help, but we can't help unless you show us the problem really :P

Does it just need to Click one spot? You using mousebox? or Colour or TPA's? We need to know stuff like that. Post some code and i can try to help :)

Leekeleek

2013-08-04 13:55:47

I'm using colour, I want it to click a stall. I don't think I'm putting in the coordinates properly. I get the colour after the X and Y, and then I put the two coordinates underneath,
then I go to the spot right next to it and put the other 2 X Y coordinates and nothing happens once I execute. I have to rewrite it cause I deleted it, I got mad cause it didn't work but it was only the script skeleton in the tutorial changed a tiny bit :P

rj

2013-08-04 13:57:40

From: Leekeleek
I'm using colour, I want it to click a stall. I don't think I'm putting in the coordinates properly. I get the colour after the X and Y, and then I put the two coordinates underneath,
then I go to the spot right next to it and put the other 2 X Y coordinates and nothing happens once I execute. I have to rewrite it cause I deleted it, I got mad cause it didn't work but it was only the script skeleton in the tutorial changed a tiny bit :P


FindColorTolerance(x, y, color, X1, Y1, X2, Y2, TOL)

X1 and Y1 are the x and y coords of the top left corner
X2 and Y2 are the x and y coords of the bottom right corner

can you also post some code that your using?

Leekeleek

2013-08-04 14:25:41

yeah one second i'll edit this hold up i'll remake it. I'm going to try to use ACA

Leekeleek

2013-08-04 14:32:43

Program StealStall;
{$i srl/srl.simba}
Procedure ClickStall;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 9464458, 169, 298, 192, 310, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.

Leekeleek

2013-08-04 16:42:09

K forget about above code.
How come this isn't looping properly what I have written now.
I can't get the shit to stop. I coded this absolute garbage up without the tutorial because I couldn't understand how to properly put the coordinates in..
I tell it to only click 28 times, and it just goes on forever. Is there a easier way of looping it until inventory is full?

program LeekSpice;
{$define sr15}
{$loadlib sps}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
i: Integer;
c: Integer;
Procedure StealSpice;
var
x, y: Integer;
begin
FindColorTolerance(x, y, 1095691 , MSX1, MSY1, MSX2, MSY2, 5);
Mouse(x, y, 0, 0, True);
end;

Begin
SetUpSRL;
repeat
for i := 0 to 27 do
StealSpice;
until (false);
end.

rj

2013-08-04 17:02:21

From: Leekeleek
K forget about above code.
How come this isn't looping properly what I have written now.
I can't get the shit to stop. I coded this absolute garbage up without the tutorial because I couldn't understand how to properly put the coordinates in..
I tell it to only click 28 times, and it just goes on forever. Is there a easier way of looping it until inventory is full?

program LeekSpice;
{$define sr15}
{$loadlib sps}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
i: Integer;
c: Integer;
Procedure StealSpice;
var
x, y: Integer;
begin
FindColorTolerance(x, y, 1095691 , MSX1, MSY1, MSX2, MSY2, 5);
Mouse(x, y, 0, 0, True);
end;

Begin
SetUpSRL;
repeat
for i := 0 to 27 do
StealSpice;
until (false);
end.


It's doing it infinite times because you have

repeat
for i := 0 to 27 do
StealSpice;
until (false);
end.

repeat until false

that's a infinite loop

Leekeleek

2013-08-04 19:07:38

one last question.

 if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5)

would that be the same for actual coordinates with bitmap, the MSX1, MSY1 etc.
Or does it only work for colours? Because I can't get my bitmap clicking to work. Its a trade option, so
I can't use colour. All my bitmaps are freed, everything compiles correctly with no errors, just the bitmap isn't found.

Procedure FindStore;
var
x, y: Integer;
begin
if FindColorTolerance(x, y, 1454656, MSX1, MSY1, MSX2, MSY2, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Right)
wait(450);
if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
end;

rj

2013-08-04 19:10:39

From: Leekeleek
one last question.

 if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5)

would that be the same for actual coordinates with bitmap, the MSX1, MSY1 etc.
Or does it only work for colours? Because I can't get my bitmap clicking to work. Its a trade option, so
I can't use colour. All my bitmaps are freed, everything compiles correctly with no errors, just the bitmap isn't found.

Procedure FindStore;
var
x, y: Integer;
begin
if FindColorTolerance(x, y, 1454656, MSX1, MSY1, MSX2, MSY2, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Right)
wait(450);
if FindColorTolerance(martin, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
end;


Your not using the right function to find a bitmap. It's FindBitmapToleranceIn(martin, x, y, X1, Y1, X2, Y2, TOL) I would suggest 100-150 for the tolerance. Also you don't need to wait 450, you can wait around 100-200 to be much faster

Leekeleek

2013-08-04 19:18:44

From: Officer Barbrady
Your not using the right function to find a bitmap. It's FindBitmapToleranceIn(martin, x, y, X1, Y1, X2, Y2, TOL) I would suggest 100-150 for the tolerance. Also you don't need to wait 450, you can wait around 100-200 to be much faster


How small should the bitmap be? It is for sure a 24 bitmap, I'm saving it properly, the string is correct..
it still won't click trade.

rj

2013-08-04 19:24:10

From: Leekeleek
How small should the bitmap be? It is for sure a 24 bitmap, I'm saving it properly, the string is correct..
it still won't click trade.


Can you show me a screeny of what your trying to click? It's hard to explain in words

Leekeleek

2013-08-04 19:31:23

From: Officer Barbrady
Can you show me a screeny of what your trying to click? It's hard to explain in words




Thanks again dude.

I have it looking like this.

rj

2013-08-04 19:37:01

From: Leekeleek

Thanks again dude.

I have it looking like this.


Cut out the top and bottom and side and get more width, like this:


- Make sure it's in 24-bitmap format
- Make sure you declare it and free it
- Make sure you use a tolerance of 100-150
-Use the correct client dimensions, MSX1, MSY1, MSX2, MSY2 are for the latest Runescape and probably won't be the same for the RSPS. You want to enter in the coords of the top left corner for example:


and the bottom right corner for example:


Leekeleek

2013-08-04 19:39:38

From: Officer Barbrady
Cut out the top and bottom and side and get more width, like this:


- Make sure it's in 24-bitmap format
- Make sure you declare it and free it
- Make sure you use a tolerance of 100-150
-Use the correct client dimensions, MSX1, MSY1, MSX2, MSY2 are for the latest Runescape and probably won't be the same for the RSPS. You want to enter in the coords of the top left corner for example:


and the bottom right corner for example:



Declaring it is? like declaring that its a integer?
Or did I miss a step. Its freed. I'll let you know how it works out.

rj

2013-08-04 19:42:29

From: Leekeleek
Declaring it is? like declaring that its a integer?
Or did I miss a step. Its freed. I'll let you know how it works out.


ehh did you read the part of the guide on bitmaps? :/

Leekeleek

2013-08-04 19:44:46

From: Officer Barbrady
ehh did you read the part of the guide on bitmaps? :/


Yeah I did. I got it working haha, sorry I just didn't mean what you meant by declare.

I definitely am interested in learning more :) well I'm done bugging you for now!

rj

2013-08-04 19:46:48

From: Leekeleek
Yeah I did. I got it working haha, sorry I just didn't mean what you meant by declare.

I definitely am interested in learning more :) well I'm done bugging you for now!


Anytime

Leekeleek

2013-08-05 01:13:18

From: Officer Barbrady
Anytime


How do I check when inventory is full? Quick example?

rj

2013-08-05 09:53:32

From: Leekeleek
How do I check when inventory is full? Quick example?


It's a bit tricky for a beginner tbh :d

The Killer

2013-08-05 09:57:47

From: Officer Barbrady
It's a bit tricky for a beginner tbh :d


Not really, take the required functions from srl5, then just change cords and possibly colours (it uses the black outline) and it should work fine.

Also with the mine rock why not make your own font set: http://villavu.com/forum/showthread.php?t=60451 ?

rj

2013-08-05 10:01:43

From: The Killer
Not really, take the required functions from srl5, then just change cords and possibly colours (it uses the black outline) and it should work fine.

Also with the mine rock why not make your own font set: http://villavu.com/forum/showthread.php?t=60451 ?


Not making a font set just to click 1 option lol

The Killer

2013-08-05 11:28:11

From: Officer Barbrady
Not making a font set just to click 1 option lol


Why not? its good practise to use reliable methods, and you could probably get away with just doing a few letters :P (and not to mention you could try the eoc and 07 current fonts since they may work.

Leekeleek

2013-08-07 03:36:21

From: Officer Barbrady
Not making a font set just to click 1 option lol




program LeekSuperKebabs;
{$define sr15}
{$loadlib sps}
{$i srl/srl.simba}
{$i sps/sps.simba}

var
i:Integer;
martin:Integer;
Superkebab:Integer;
InvKebab:Integer;
SK:Integer;
WalkDTM:Integer;

Procedure StealKebab;
var
x, y: Integer;
begin
FindColorTolerance(x, y, 3304784 , 7, 11, 746, 491, 5);
Mouse(x, y, 0, 0, True);
wait (500);
end;

Procedure FindStore;
var
x, y: Integer;
begin
if FindColorTolerance(x, y, 7625091, 7, 11, 746, 491, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Right)
wait(250);
if FindBitmapToleranceIn(martin, x, y, 7, 11, 746, 491,100) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
wait(4000);
end;
end;
end;


Procedure SellKebabs;
var
x, y: Integer;
begin
if FindDTM(SK, x, y, 557, 217, 733, 462) then
begin
mmouse(x, y,1,1);
clickmouse2(mouse_Right);
wait(3000);
if FindBitmapToleranceIn(Superkebab, x, y, 7, 11, 746, 491,100) then
begin
mmouse(x, y,1,1);
wait(1500);
ClickMouse(X, Y, mouse_Left)
end;
end;
end;

Procedure CloseDat;
var
x, y: Integer;
begin
if FindColorTolerance(x, y, 5268590, 7, 11, 746, 491, 5) then
begin
mmouse(x, y,1,1);
wait(1000);
ClickMouse(X, Y, mouse_Left)
ClickDTMRotatedIn(WalkDTM, 7, 11, 746, 491, -Pi, Pi, Pi/30, [], mouse_Left);
Wait(2500);
while (IsMoving) do
wait(100);
end;
end;


Begin
SetUpSRL;
SK := DTMFromString('mWAAAAHicY2FgYMhgYmBIA+JsIE4CYh5GBgZBIOYHYm4gXjUhnmFSdRAY75mfycAJ1IOMGdEwCAAApx4IJg==');
WalkDTM := DTMFromString('mQwAAAHicY2ZgYAhlYmCIgOIoID8aiCOAWGc3F8OW1SsYNGdxM4gA+TDMiISBAAD2lwYh');




MouseSpeed := 15;

Superkebab := BitmapFromString(141, 8, 'meJzVVkkOwjAM5CG5c+ANlThz5G' +
'Vc+Asv4FsQNaplvEymbVSJyIc0zNiJx7aYbvdyvlR7vt7VTvOqn7L' +
'JTPBmn2HC87ravpoPcX18qvFXGmsSfTh4A35aZJLskUReJu/Wc0O6' +
'POcwaf5CpkypMNuMTGVpgYzbDgE9VEqfmF/bZ0YhwSaTDAu42hC6K' +
'5NXyg+oVTKFbrVM4hbQwzc2fLg3ucXneq5m6RVAN0R2VRLPy5SllN' +
'xjmcygK3O7MfTwjaP2YN4aAO82lJvBr5XJpNT8xxgiE0/fLwdoDRC' +
'xm3O+EpirdmWS8s7kkIW7zEvj8eV37ulwYQetzQnIVdYaoDCy+bmt' +
'y3bKZIpcs0xD8TIZbuY2Gzu6eg0GlDQYVqY7SJl0wWBXTOjuVUP7A' +
'nmyz6w=');

martin := BitmapFromString(52, 10, 'meJzNVEkSgDAI4yHePfhe/+IL/B' +
'bq1CICpsv0YIdDiRmMTSoRrdt+FuU1zUtHyZBKPjFfpfge6Rg7Uhu' +
'zaX+lzRbUltpUhmNA/wgPCT31GyEAbRI/3YaaSYUW88N03UHXSLY7' +
'1GbuhT4HoMHgwOviXcDa/OFUavAf0qqteG5hIJv24L80StuXp/V4q' +
'zbxVNL40EIX3qsbB28xyAH+k8Vm');

InvKebab := BitmapFromString(31, 14, 'meJydktsrBGEYxslMM5dr17VDDi' +
'XnLefNWSvHJESbtLW0NDkLISESUlIipZRCSolSLsSFcuHChf/Hb+Y' +
'b09q141BPb8/3zfv+9pl31u2pc38qNiameuZAcd4r8TeK41Lui1Mc' +
'p6rzQXU+qa5nDDeyP04ekPSKOGqSMmUeFcc5s137D56RHVDJyfnur' +
'3Dv8hkQwTeZhkymJsljkjKrVzloMA2j9zvvGWxYvaia3hfkSHiRf7' +
'Fl+7Zp40p1vamuFzNwUMfCJKSQCR+QjJ5XvTnh3Xf4CPxbsgWnoX7' +
'pFNUtnqDmzWsLqzOFNEPAP5fWunPXuH5Zu3AcuZBQOMCauSPaqHwC' +
'XhPh+TnGkY4Nmsn1rxN/Qx6x52ixLTjAysk9gcUwVa5tUVHF+C433' +
'IsejuJpaXDNwlrk3NLqSDjNAiJmGSwOLJUMrmBQ2fAGDVQ8lzwq7J' +
'+3CRwGZ4RZEQkjxgt80+6+WQwN4oYjlzarCEsexicbHkh+70Rup4b' +
'yukfxVHxOx1DkKuzhFt8KDA1OZrMfZbUFstsHqfjfrMJmP5AJCRla' +
'hteXVtuVXt+D7P8V0TKH8UPJqVUdSWVNKZ5W+1UI8o9wwef1RWawi' +
'SXef68iGj9Uf13FB6maRU0=');

repeat
for i := 0 to 110 do
begin
StealKebab;
end;
until (true);
Findstore;
SellKebabs;
CloseDat;

FreeBitmap(Superkebab);
FreeBitmap(martin);
FreeBitmap(InvKebab);
FreeDTM(SK);
FreeDTM(WalkDTM);
end.
I was away for a couple days so didn't have time to figure it out, but this ended up working just as well. My very last problem I promise you sir :p Is there any possible way you could edit this
so the entire thing loops? As in I mean the script restarts again once all methods are completed, like once everything is executed it starts back at StealKebab, then does everything else, then repeats from start over and over? I know its just repeat and then until (false); I have that there but how do I do it for the entire script.

Also any links for beginners to look at :)

sureshot12345

2013-08-29 16:14:10

alright, this is my second attempt at making a script. I'm working on making a ess miner out of it eventually. the clicking of the ess rock works fine, but once i try and add in the walking the script compiles still but just does absolutely nothing.. what haven't i done?



Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 9539991, 316, 144, 350, 170, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
var
DTM_1:integer;
begin
MouseSpeed := 15;
DTM_1 := DTMFromString('mWAAAAHicY2FgYIhmYmCIBOJYII4CYlWgmCYQawGxEhDH6vLAsbudCwM/AypgRMMgAAAMqgSw');

ClickDTMRotatedIn(DTM_1, MMX1,MMY1, MMX2,MMY2, -Pi, Pi, Pi/30, [], mouse_Left);
Wait(2500);
while (IsMoving) do
wait(100);

FreeDTM(DTM_1);
end.

begin
MouseSpeed := 15;
SetupSRL;
ClickTree;
end.

rj

2013-08-29 20:20:32

From: sureshot12345
alright, this is my second attempt at making a script. I'm working on making a ess miner out of it eventually. the clicking of the ess rock works fine, but once i try and add in the walking the script compiles still but just does absolutely nothing.. what haven't i done?


try changing the MMX1 vars to the coords of the minimap

grasshopper1494

2013-11-04 16:41:54

This is so awesome, I'm gonna try.

Kozs

2013-11-12 15:08:46

From: Officer Barbrady
try changing the MMX1 vars to the coords of the minimap


At the start of the tutorial my script says this

'THEN' expected at line 9
Compiling failed.


Heres my code

Program MineOre;
{$i srl/srl.simba}
Procedure ClickOre;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.

rj

2013-11-12 15:10:17

From: Kozs
At the start of the tutorial my script says this

'THEN' expected at line 9
Compiling failed.


Heres my code

Program MineOre;
{$i srl/srl.simba}
Procedure ClickOre;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.

add then after if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)

Kozs

2013-11-12 18:24:11

From: Officer Barbrady
add then after if FindColorTolerance(X, Y, 1120043, 241, 177, 244, 178, 5)




no compiler errors but it does not do anything when I run. Just says successfully executed.

rj

2013-11-12 20:48:47

From: Kozs
no compiler errors but it does not do anything when I run. Just says successfully executed.



Because you never called it in your main loop

Begin
MouseSpeed := 15;
SetupSRL;
end.

should be

Begin
MouseSpeed := 15;
SetupSRL;
ClickOre;
end.

Kozs

2013-11-14 20:14:30

From: Officer Barbrady
Because you never called it in your main loop

Begin
MouseSpeed := 15;
SetupSRL;
end.

should be

Begin
MouseSpeed := 15;
SetupSRL;
ClickOre;
end.


Still, no work.

rj

2013-11-14 20:34:27

From: Kozs
Still, no work.


then your not searching in a area were the color is? I don't know, because
From: Kozs
Still, no work.

doesn't tell me the problem

Unlucky

2013-12-02 20:13:57

Hi, I've been looking everywhere and trying to get my own script working on a private server. I followed this guy but when I define the SLR like you did, I get this error and I'm not sure how to fix it. "Exception in Script: File "srl/srl.simba" not found at line 2, column 5" for this line of code

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;

It works on rs3 for with this code
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}

But I don't have the experience to find out how to fix the {$i srl/srl.simba} code so I can auto in a private server.
Please help, I am very interested in scripting but I lack experience, and ty for the guide. I learned a lot and the only problem I have is this.

rj

2013-12-02 22:28:16

From: Unlucky
Hi, I've been looking everywhere and trying to get my own script working on a private server. I followed this guy but when I define the SLR like you did, I get this error and I'm not sure how to fix it. "Exception in Script: File "srl/srl.simba" not found at line 2, column 5" for this line of code

Program ChopTree;
{$i srl/srl.simba}
Procedure ClickTree;

It works on rs3 for with this code
program new;
{$DEFINE SMART}
{$i srl-6/srl.simba}

But I don't have the experience to find out how to fix the {$i srl/srl.simba} code so I can auto in a private server.
Please help, I am very interested in scripting but I lack experience, and ty for the guide. I learned a lot and the only problem I have is this.

It's because Simba no longer comes with SRL5, thus you need to download it from here: https://github.com/SRL/SRL-5 and extract it to c:/simba/includes

I'll have to update the guide for SRL6.. or maybe I might write a general rsps include

Unlucky

2013-12-03 01:55:29

From: Officer Barbrady
It's because Simba no longer comes with SRL5, thus you need to download it from here: and extract it to c:/simba/includes

I'll have to update the guide for SRL6.. or maybe I might write a general rsps include


I extracted the file to the folder you mentioned but I still get the same error. I am guessing I have to change what {$i srl/srl.simba} says to something different? I am not sure what to change it to though, this is my first time trying to script. If you could please help me and tell me what I change what to define the SRL as it would help me fix my problem. Ty.

spokas

2014-01-04 08:16:37

Does this tutorial still works ?

rj

2014-01-04 11:04:06

From: spokas
Does this tutorial still works ?


Somewhat

it will be updated soon

spokas

2014-01-04 13:23:23

From: Officer Barbrady
Somewhat

it will be updated soon


How can i contact with you? I have few questions.

rj

2014-01-04 13:37:54

From: spokas
How can i contact with you? I have few questions.


here

shagonas

2014-03-25 08:52:46

Program ChopTree;
{{$i srl/srl.simba}
Procedure ClickTree;
var
X,Y:Integer;
begin
if FindColorTolerance(X, Y, 14456, 500, 239, 326, 218, 5) then
begin
mmouse(x, y,1,1);
wait(250);
ClickMouse(X, Y, mouse_Left)
end;
end;
Begin
MouseSpeed := 15;
SetupSRL;
end.



Exception in Script: Unknown declaration "mmouse" at line 9, column 5
Exception in Script: Unknown declaration "mmouse" at line 9, column 5


Im getting mouse errors could you help me, im new. I'll study programming in the futue so i would love to get some help

Chrispyme

2014-04-05 16:43:13

Okay, so I have been noticing in all scripts about the {$i srl/srl.simba} code, and I always get an error Exception in Script: File "srl/srl.simba" not found at line 3, column 5 was wondering why I am getting it, and how to prevent it in the future. Any help?

Got it, needs to be
{{$i srl/srl.simba}

Powerbee

2014-06-24 16:51:33

From: Robert
here


Love the tutorial. Can you write some lines about using SMART for rsps? That would be awesome :).

Regards

Cody44

2014-06-30 17:18:21

Not completely sure what has gone wrong, do you have any tips for me here?
[ATTACH=CONFIG]23472[/ATTACH]

Turpinator

2014-06-30 17:31:05

From: Cody44
Not completely sure what has gone wrong, do you have any tips for me here?
[ATTACH=CONFIG]23472[/ATTACH]


you have no 'main' loop.
so you need to add a
begin
procedure and func calls go here;
end.

Cody44

2014-07-01 11:49:59

Okay I fixed it so that everything is executing succefully… But now when I click start nothing happens. It starts and ends in a fraction of a second.

Program Walking;
{$I srl/srl.simba}
var
WalkTo:integer;
Procedure Walk;
begin
ClickDTMRotatedIn(WalkTo, 1425, 7, 1413, 116, -Pi, Pi, Pi/30, [], mouse_Left);
Sleep(2500);
while (IsMoving) do
wait(100);
end;
Begin
SetUpSRL;
WalkTo := DTMFromString('mWAAAAHicY2FgYChiZmCoAOJ8ZgibmZGBgYURQrMDcXx4CIOPkzJDfEQYg5eDAgM6YETDIAAAM3wFZw==');
FreeDTM(WalkTo);
end.

Turpinator

2014-07-01 13:07:29

From: Cody44
Okay I fixed it so that everything is executing succefully… But now when I click start nothing happens. It starts and ends in a fraction of a second.


Program Walking;
{$I srl/srl.simba}
var
WalkTo:integer;

Procedure Walk;
begin
ClickDTMRotatedIn(WalkTo, 1425, 7, 1413, 116, -Pi, Pi, Pi/30, [], mouse_Left);
Sleep(2500);
while (IsMoving) do
wait(100);
end;

Begin
SetUpSRL;
WalkTo := DTMFromString('mWAAAAHicY2FgYChiZmCoAOJ8ZgibmZGBgYURQrMDcXx4CIOPkzJDfEQYg5eDAgM6YETDIAAAM3wFZw==');
Walk;
FreeDTM(WalkTo);
end.

Cody44

2014-07-01 13:57:54

From: Turpinator
Program Walking;
{$I srl/srl.simba}
var
WalkTo:integer;

Procedure Walk;
begin
ClickDTMRotatedIn(WalkTo, 1425, 7, 1413, 116, -Pi, Pi, Pi/30, [], mouse_Left);
Sleep(2500);
while (IsMoving) do
wait(100);
end;

Begin
SetUpSRL;
WalkTo := DTMFromString('mWAAAAHicY2FgYChiZmCoAOJ8ZgibmZGBgYURQrMDcXx4CIOPkzJDfEQYg5eDAgM6YETDIAAAM3wFZw==');
Walk;
FreeDTM(WalkTo);
end.

What exactly did you change? And it still seems to just idle :/

This is extremely frustrating.. It's taking me more than 5 days to make a simple script that fishes and banks in catherby.. & I can't seem to find the current resources to learn it properly, I believe I should use OP's RSPS includes instead of Simba's as I am scripting for the RSPS Alotic, but I wouldn't know how to even use his include :/

Cody44

2014-07-08 19:30:19

Thanks alot for the help guys… :fiery:

divinephil

2014-08-19 10:25:50

Thanks dude! I'm going to try my utter best to get half decent in this haha!

Ultimatescape2ftw

2014-11-14 07:29:42

This guide is very informative, but when I look at it i see nothing but a jumble of words. For a basic beginner, I need to find out how to make a US2 Rocktail fishing bot on donator island. Could anyone help with this? I know nothing of Pascal language or scripting. Detailed instructions would be nice! :)

KeepBotting

2014-11-14 07:40:08

From: Ultimatescape2ftw
This guide is very informative, but when I look at it i see nothing but a jumble of words. For a basic beginner, I need to find out how to make a US2 Rocktail fishing bot on donator island. Could anyone help with this? I know nothing of Pascal language or scripting. Detailed instructions would be nice! :)


You may find it worth your while to go over YoHoJo's beginner tutorials: https://villavu.com/forum/showthread.php?t=67691 and https://villavu.com/forum/showthread.php?t=69179

NKN

2014-11-14 07:41:39

From: Ultimatescape2ftw
This guide is very informative, but when I look at it i see nothing but a jumble of words. For a basic beginner, I need to find out how to make a US2 Rocktail fishing bot on donator island. Could anyone help with this? I know nothing of Pascal language or scripting. Detailed instructions would be nice! :)


I'd go here first.
https://villavu.com/forum/showthread.php?t=58935

Ultimatescape2ftw

2014-11-14 10:24:46

Download link for Simba?

Kyle

2014-11-14 10:27:42

From: Ultimatescape2ftw
Download link for Simba?


https://villavu.com/ and click on Simba?

rj

2014-11-16 19:15:18

Yea this guide is outdated because SRL-5 isn't used anymore and there are much better methods of doing some of this stuff

wedmarco

2015-10-11 22:03:04

Very helpful tutorial! thank you!