SRL Archive - Outdated Tutorials

Your Guide to the SRL-Member's rank


Cazax

2008-03-15 20:02:15

Your Guide to the SRL-Member's rank

Contents:
- Things you must have to know
- Things that help you for a 'yes'
- Obvious things you have to know
- Using them

Things you must have to know

- DTM's
- BMP's = optional
- RadialWalk(can be others like rrw, rwex, etc) -optional
- Failsafes = important
- Multi Players
- Anti Ban
- Anti Randoms
- Cases, Arrays, FindingColors
- Standards


Things that help you for a 'yes'

- DDTM's
- Path(WalkPath, TPA walking)
- TPA's
- Forms-with multiplayers could be fine



Obvious things you have to know

-You have to use SRL.
{.include srl/srl.scar}

- Do not use MoveMouseSmooth/MoveMouseSmoothEx/ClickMouse or any other than srl mouse mover's.
Mouse(x, y, mousex, mousey, clickmouse : boolean);

MMouse(x, y, mousex, mousey);
// just examples

- A main loop.
program new;
{.include srl/srl.scar}

procedure Example(text : string);
begin
Writeln(text);
MMouse(random(500), random(500), 100, 100);
end;

begin // here
SetupSRL;
Example('here is the main loop');
end.

- You must have to apply with a script for RS(runescape).

- Don't apply with a leeched script.

- The script must have to be at least 90% of your work, if you are using a function of another guy, credit him.

- If you get rejected, wait at least 2-4 weeks for another application.



Using them

- DTM's
You can use a DTM for an item in your inv, for the bankers, etc…

1.- Take a pic of the item you want to use as DTM

2.- go to SCAR > Tools > DTM Editor…

3.- Load your pic

4.- Click on the center, then start clicking around the black outline of the item

5.- File > DTM to Text

6.- A string will appear in the debug box.

7.- Paste them in your script

8.- Test it!

a DTM should look like this:
DTM := DTMFromString('A4D64F65S4G684SG65S4G65SG465SG4D5641V5D4G85S4G8SD4G165DS4G56G');// Just an example


program New;
{.include srl/srl.scar}
var
x, y, Log : Integer; // you can change the name
Procedure DTMExample;
begin
Log := DTMFromString('A4D64F65S4G684SG65S4G65SG465SG4D5641V5D4G85S4G8SD4G165DS4G56G');// Just an example
end;

begin
SetupSRL;
ActivateClient;
DTMExample;
if FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2) then// here we are finding for the DTM, MIX's and MIY's are the inv coords for searching
begin
Mouse(x, y, 5, 5, True);
Writeln('yay');
end else
Writeln('nooo');
end.

also, you can 'free' the DTM from the the memory.
FreeDTM(dtmname : integer);

Example:

program New;
{.include srl/srl.scar}
var
x, y, Log : Integer;
Procedure DTMExample;
begin
Log := DTMFromString('A4D64F65S4G684SG65S4G65SG465SG4D5641V5D4G85S4G8SD4G165DS4G56G');
end;

begin
SetupSRL;
ActivateClient;
DTMExample;
if FindDTM(Log, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, True);
Writeln('yay');
FreeDTM(Log);// here
end else
Writeln('nooo');
FreeDTM(Log);// and here
end.

if you free DTMs your script will be be smoother and will not cause memory leaks.

how to count items with DTM's:
CountItemsDtm('inv', DtmName : integer) : integer; 
(doesnt count stackables)
this one count stackables:

AmountDtm('inv', DtmName : integer): Integer;


- BMP's
if you are going to make a BMP, try to make it smallest as possible or else, it will lag. You can use Bmp's for items, or something like the 'Click Here to Continue' button.

1.- The same as the DTM but instead of using the DTM Editor… you are going to enter to 'Picture to String…'.


2.- Load the pic.

3.- press 'OK'

4.- Paste the string in the debug box to your script.


The same applies for BMPs, you can free it using:
FreeBitmap(bmpname : integer);

how to count items in the inv with bmp's:
CountItemsBmp('inv', BmpName, Tol : integer): integer;

with stackables:
AmountBmp('inv', BmpName, Tol : integer): integer;

- RadialWalk(or other)
here, I'll be using 'RadialWalk':

RadialWalk(thecolor, startradial, endradial, radius, Xmod, Ymod : integer): boolean;

the best way for 'thecolor' in RadialWalk is using autocoloring functions (EDIT: This does not applies for recent SRL revisions. Use AutoColor(srl_VarrockRoadColor)!):

//  » function  FindWaterColor: Integer;                                            | by Tarajunky
// » function FindRoadColor: Integer; | by Tarajunky
// » function FindVarrockRoadColor: Integer; | by Tarajunky
// » function FindFallyRoadColor: Integer; | by Tarajunky
// » function FindRockColor: Integer; | by Tarajunky
// » function FindStoneColor: Integer; | by Tarajunky
// » function FindDirtRoadColor: Integer; | by Tarajunky
// » function FindBridgeColor: Integer; | by Tarajunky
// » function FindLadderColor: Integer; | by Tarajunky
// » function AutoColorThis(Bitmap, MaxTol, X1, Y1, X2, Y2:Integer) : integer; | by Sumilion

Remember colors change so you need to get it again everytime.

the 'startradial' and 'endradial' are:

an example:
RadialWalk(255, 0, 360
if you want to search the read square I put there, you need to know the 'radius' ;)

'radius':
The distance of the color from the center of the minimap to click, the number must be betweeen 0-70.

'Xmod,Ymod':
numbers between -1, 1. Read Zephyr's fury walking tut for more info: http://www.villavu.com/forum/showthread.php?t=19162?#post241494.html

RadialWalk(FindRoadColor, 0, 360, 65, 1, 1);
but wait, remember that RadialWalk returns a boolean so an efficient example could be:
if RadialWalk(FindFallyRoadColor, 0, 360, 65, -1, 1) then
Writeln('We are at fally')
else
Writeln('we arent at fally');

just remember to use autocoloring functions :spot:

EDIT: Now you can use RadialWalkTolerance!

I forgot to say, RadialWalk has FFlag(10) inside it, so it's not necessary to add:
if RadialWalk(FindRoadColor, 0, 360, 65,  0, 1) then Flag;

- Failsafes
They are always needed.

one way could be:
if FindColor(bla) then
begin
Writeln('something');
end else // here
bla
end else; works as end; and else

or you can use:
else, and else, {$else}
they are the same except they doesn't work as end;

the most used:
if (not(LoggedIn)) then Exit;
people use it at the start of a procedure/function to check if the player is really logged in

Another way:
procedure FindTree;
var
x,y,Time,NotFound : Integer;
begin
MarkTime(Time);
repeat
if FindObjCustom(x, y, blabla) then
begin
Mouse(x, y, 3, 3, True);
Exit;
end else
NotFound := +1;
until (TimeFromMark(Time) <= 10*10*10*10) or (NotFound = 5);
end;

See?

- Multi Players
They are easy, just declare players:

Procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 letters of your Username
Players[0].Active := True; // Auto with this char?

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;

end;

and remember to logout and set the activity to false if SRL couldn't solve the random:
if FindNormalRandoms then 
If Not LoggedIn Then
begin
Writeln('Found unsolvable random');
NextPlayer(False);
end;

- Anti Ban
Remember people gets bored sometimes, so antiban makes your script gets bored too! :
procedure AntiBan;
begin
if (not(LoggedIn)) then
Exit;
case random(40) of

0: SleepAndMoveMouse(1232+random(857));
1: HoverSkill('woodcutting', False);
2: begin
DoEmote(1+random(17));
wait(2546+random(165))
GameTab(1 +random(5))
Gametab(4)
end;
3: MMouse(random(250), random(250), 10, 10);
4: PickUpMouse;
5: begin
GameTab(1 + Random(12));
wait(1000+random(1000));
GameTab(4);
end;
end;
end;
Try using functions and procedures that simulate human behavior (like chaning tabs randomly, examining objects, etc).

- Anti Randoms
It's so easy to solve a random with SRL included!

FindNormalRandoms;

How to know when SRL couldn't solve a random:
if FindNormalRandoms then 
If Not LoggedIn Then
begin
Writeln('Found unsolvable random');
NextPlayer(False);
end;

- FindNormalRandoms; will look for all randoms and solve them.

- FindFight; When you randomly get a fight
EDIT: No longer applies - but you can get fight from highway men too


- Cases, Arrays, FindingColors

Cases:

case random(40) of
0: bla
1: bla
2 : begin blabla; bla2; end;
end;

Antiban procedures normally use that.


program new;
{include srl/srl.scar}
const
whattotype = '1'; // 1 if you want to type hello, 2 for bye, and 3 for how r u

procedure Typethem;
begin
case (whattotype) of
'1': TypeSend('hello');
'2': TypeSend('bye');
'3': TypeSend('how r u');
end else
Writeln('the options are: 1, 2 and 3 only');
end;

begin
SetupSRL;
ActivateClient;
Typethem;
end.

Arrays:

procedure hi;
words : Array[0..4] of string;
begin
words[0] := 'hi';
words[1] := 'bye';
words[2] := 'sup';
words[3] := IntToStr(im bored);
words[4] := FloatToStr(10*3)
end;

or

procedure hi;
words : array of string;
i : Integer;
begin
SetLength(words, 2);
for i:=0 to High(words) do
begin
words[i] := 'this will apply for every string';
end;
end;
:D

- Finding Colors:

There are many ways for that, you can use TPA's, FindObjCustom, FindColorTolerance/FindColorSpiralTolerance, etc…
but, never use FindColor or FindColorSpiral.

if FindColorTolerance(x, y, 1515661, MSX1, MSY1, MSX2, MSY2, 15) then
begin
Writeln('found it');
Mouse(x, y, 5, 5, True);
...

That's all, you find the color, store the coords in x and y, and then you click it.

-Standards
They are needed for any script, so people will understand/read you script without burning their eyes.

a script without standards:
program new;
procedure do;
begin
Writeln('sup');
MMouse(random(500),25,100,200))
Disguise('i dont know standards');
repeat
writeln(IntTOSTR(RANDOM(100000)));
until (false);
end;

begin
do;
end.

a script with standards:
program new;
{include SRL\SRL.scar}
var
x, y, LogDTM, LogBMP : integer;

procedure LoadDTM;
begin
LogDTM := DTMFromString('bla');
end;

procedure LoadBMP;
begin
LogBMP := BitmapFromString(10,10,'bla');
end;

begin
SetupSRL;
ActivateClient;
LoadDTM;
if FindDTM(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, True);
FreeDTM(LogDTM');
end else
LoadBMP;
if FindBitmap(x, y, LogBMP) then
begin
Mouse(x, y, 5, 5, True);
FreeBitmap(LogBMP);
end else
Writeln('couldnt find log!);
end.

rules :

-
var
x,y : integer;// did you see two white spaces?

-
begin
writeln('Skip two spaces');
end.

-
case of
0: bla
end;
same.

More and more to learn from:

-DDTM's
YoHoJo's DDTM Tut - http://www.villavu.com/forum/showthread.php?t=12584

DDTM's and their uses - by Cut em2 it - http://www.villavu.com/forum/showthread.php?t=26968

-Path
A guide to the noteworthy &#8220;WalkPath(0);&#8221; -by footballdjs-http://www.villavu.com/forum/showthread.php?t=25712

-TPA's
ObjectFinding using TPointArray-by negaal-http://www.villavu.com/forum/showthread.php?t=26006

.:The Almighty TPA Tutorial:. -by n3ss3s- http://www.villavu.com/forum/showthread.php?t=21786

-Forms

http://www.villavu.com/forum/showthread.php?t=17966
http://www.villavu.com/forum/showthread.php?t=17196
http://www.villavu.com/forum/showthread.php?t=23850
http://www.villavu.com/forum/showthread.php?t=12000
http://www.villavu.com/forum/showthread.php?t=1101
http://www.villavu.com/forum/showthread.php?t=15209
http://www.villavu.com/forum/showthread.php?t=13520
http://www.villavu.com/forum/showthread.php?t=3664
http://www.villavu.com/forum/showthread.php?t=24998
http://www.villavu.com/forum/showthread.php?t=
http://www.villavu.com/forum/showthread.php?t=12360
http://www.villavu.com/forum/showthread.php?t=14077
http://www.villavu.com/forum/showthread.php?t=13618
http://www.villavu.com/forum/showthread.php?t=13806
http://www.villavu.com/forum/showthread.php?t=11176
http://www.villavu.com/forum/showthread.php?t=1616
http://www.villavu.com/forum/showthread.php?t=3688
http://www.villavu.com/forum/showthread.php?t=3709
http://www.villavu.com/forum/showthread.php?t=3660

Harry

2008-03-15 20:04:18

DANG that is a HUGE tut!

Repped, looks VERY nice!

Cazax

2008-03-15 20:05:41

From: Hy71194
DANG that is a HUGE tut!

Repped, looks VERY nice!


Woot! fast reply and thx ;)

JAD

2008-03-15 20:10:07

Hmm… A walking script isn't even required to get you into members. I made a power miner for my app and got all yes's. So maybe put walking in the things that help for a 'yes' section. :)

Good tut though. Congrats on the second guide that teaches people what they need to know to become a srl member ;)

Cazax

2008-03-15 20:12:32

From: JAD
Hmm… A walking script isn't even required to get you into members. I made a power miner for my app and got all yes's. So maybe put walking in the things that help for a 'yes' section. :)

Good tut though. Congrats on the second guide that teaches people what they need to know to become a srl member ;)


instead on changing radialwalk to things that help you for a 'yes' i can put *opcional*.

EDIT: Done, and im eating chocolate cookies, do you want some ;)?

JAD

2008-03-15 20:38:11

From: Cazax
instead on changing radialwalk to things that help you for a 'yes' i can put *opcional*.

EDIT: Done, and im eating chocolate cookies, do you want some ;)?


Sure, send them to me: [email]runescapemacro@hotmail.com[/email]

:p

and (sorry to correct you on your spelling) you may want to change that to "optional" :)

Cazax

2008-03-15 20:40:57

From: JAD
Sure, send them to me: [email]runescapemacro@hotmail.com[/email]

:p

and (sorry to correct you on your spelling) you may want to change that to "optional" :)


ya you own me, btw im sending the cookie now.

are you going to print the cookie and eat it :p?

JAD

2008-03-15 22:38:44

From: Cazax
ya you own me, btw im sending the cookie now.

are you going to print the cookie and eat it :p?


I didn't know you could eat cookies. We are talking about the cookies that are saved to your computer each time you visit a site, right? :p

drizzt

2008-03-15 23:10:13

i saw two small things wrong..
1. in the example of a script with standards, you have a major string error.
2.uhh, i forgot, but it's wrong, i'll re-figure it out and edit.
EDIT: got it, it's in an example of a failsafe.
if (not(LoggedIn) then Exit;
//should be
if not(LoggedIn) then Exit;
overall, great and useful tut, maybe will help some of the poopy lookin' apps around these days

Cazax

2008-03-16 09:33:44

From: drizzt
i saw two small things wrong..
1. in the example of a script with standards, you have a major string error.
2.uhh, i forgot, but it's wrong, i'll re-figure it out and edit.
EDIT: got it, it's in an example of a failsafe.
if (not(LoggedIn) then Exit;
//should be
if not(LoggedIn) then Exit;
overall, great and useful tut, maybe will help some of the poopy lookin' apps around these days


added, thx.

XcanadamanX

2008-03-16 20:43:26

you spelled Standards wrong. forgot the last d. overall good tut though.

Torrent of Flame

2008-03-17 16:13:43

:D Nice. If this was out before JAD's I would have used this one :]

Cazax

2008-03-17 16:20:52

From: XcanadamanX
you spelled Standards wrong. forgot the last d. overall good tut though.


added though i was writting too fast, thanks :).

Lancelot074

2008-03-17 19:12:38

Yay, I have all of this stuff in my new script, I hope I'll get in soon.

Cazax

2008-03-17 19:28:19

From: lancelot074
Yay, I have all of this stuff in my new script, I hope I'll get in soon.


remember to wait 2-4 weeks :)

Wade007

2008-03-19 18:29:52

Wow, that is a huge tut! Thanks for the help. I will try applying for members soon!
Repped.

Cazax

2008-03-19 19:29:19

From: Wade007
Wow, that is a huge tut! Thanks for the help. I will try applying for members soon!
Repped.


Great im helping people with their appliements :)


btw, i won tut writter cup :D

Syurba

2008-03-22 07:19:47

That looks really complicated for me =(

Cazax

2008-03-22 13:10:52

From: Syurba
That looks really complicated for me =(


Dont spam, if this is complicated, go and read begginer tuts.

DeSnob

2008-04-05 13:13:58

thank you for telling me about how to enter =] im working on an ess miner currently, im going to add in everything like DTMS and radialwalk to make sure i might get accepted

BKNYKavkaz

2008-04-27 16:06:51

Wow + repped. Helped me get link to a good DDTM & TPA tuts. Will be very useful to others though, great TUT. I got the rest down, just perfecting script now.

Magiic

2008-07-09 16:35:16

whoa thats big but it's useful but it does look like you'd have to really understand the scripting language, which i don't oh well, over to the TuT's section

Narcle

2008-07-09 17:48:36

Something that helps with a 'yes' and I think most people would agree. Is to have a good attitude and don't be flaming people etc. Common courtesy helps for a 'yes' in getting into members imo.

Oh and badass tut, I don't think I could type that long and make a tut like this lol.
:o

Lycan Fenrir

2008-07-10 11:06:02

Good guide, thanks :)

Ghostman

2008-07-26 15:55:48

Nice Tut and a very long one

Repped

carlover

2008-08-09 19:17:55

I just read over your very helpful tut and I mostly got the jist of it. Looking into the other tuts u listed for more detail. Thanks so much for this tut. I really wanna get members and i am thinking of making an essence miner that will go to the G.E. and sell your ess when you get a specific amout of ess. Would that be hard? Help would be appreciated..not alot. And please don't steal my idea everyone.

game over

2010-06-05 21:19:44

Great work :)

mrpickle

2010-06-06 12:40:26

Hmm, I kinda need a tut for one more thing.

Where to find the will to start scripting once I learned it all.

Craig`

2010-06-06 13:01:02

From: mrpickle
Hmm, I kinda need a tut for one more thing.

Where to find the will to start scripting once I learned it all.


the will to start scripting? well that doesn't sound right.
programming is fun, that's why we do it; if you aren't motivated for making scripts then maybe you shouldn't be here?

also, if you have learned "it all" (..you won't learn it all) programming would be very simple and you could express yourself clearly in code.

fair enough learning new things and not understanding them at first may seem dull, and you may need will for that, but meh.

craiggles.

mrpickle

2010-06-06 17:15:12

I like the problem solving, but not the repetative nature of coding. Programming to me seems like an RPG game, fun to lv and interact with the environment and players, but boring after awhile from repeated series of actions.

Cazax

2010-06-07 11:22:35

This one is very old, I fixed some errors I found. I think people still can learn from this, but there must be newer ones.

mrpickle

2010-06-07 11:28:57

I've finished cohn's tuts :), he got some nice ones.