SRL Archive - Outdated Tutorials

Ultimate SCAR Begginer\Intermediate's Guide!Please Read


shaunthasheep

2006-05-28 20:57:53

A SCAR BEGGINERS GUIDE
_ :D I tried to cut it to the point, for noobs that dont like to read :D _

———–TABLE OF CONTENTS————
CHAPTER 1 - SYNTAX
CHAPTER 2 - VARIABLES/CONSTANTS
- HOW TO DEFINE THEM
CHAPTER 3 - FUNCTIONS
- FINDBITMAP
- FINDCOLOR
- INTTOSTR
- STRTOINT
- WAIT
- CLICKMOUSE
- SENDKEYS
- RANDOMS
- WRITELN
- CLEARDEBUG
- ISFKEYYDOWN
- SENDKEYSVB
- GETMOUSEPOS
- MOVEMOUSE
- HOLDMOUSE
- RELEASEMOUSE
- MOVEMOUSESMOOTH

CHAPTER 4 - OTHER FUNCTIONS[NOT BUILT IN SCAR]
- IsTextUp
- Sendkeyshuman
- InFight
- FlagPresent
- CheckChatMsg
- Clickhuman
- Takescreenshot

CHAPTER 5 - Touchups(Make You Script User Friendly)
- Reports
- Forms (Go To Chapter 6)

CHAPTER 6 - How To Add Forms/Get Them Running
- Designing them
- Adding them

CHAPTER 7 - Making your own Procedures/Functions
CHAPTER 8 - Some Script Tutorials
- Autoclicker
- Autotalker
- Chicken Fighter(Coming Soon)

CHAPTER 9 - ERRORS? SOLUTIONS HERE
- Click HERE
CHAPTER 10 - Run scar on 2+ Accounts
- Click HERE
CHAPTER 11 - A List Of Tutorials By Other People.
———————————————–


CHAPTER 1 - Syntax
The Syntax Of Scar Is

program New;
begin
end.

Name Your Program:
program New;
Change "New" To Your Program Name

Strings:
And When Telling Scar What A String Is, You Put The Text Between ' ' as so in this example
str = 'Text in here'


CHAPTER 2 - VARIABLES/CONSTANTS

VARIABLES
Strings:
Defining them
var
abc : string;
when abc = your string variable name

and use for this would be
abc := 'hi'


Integer:
Defining them
var
i : integer;
when i = your integer variable name
these are all whole numbers positive or negative

and use for this would be
i := 1 + 2
and you may add other integers into it like this
i = i + 1
or
i := num + 23

Operators for ints.
Multiply = *
Divide = /
Add = +
Subtract = -

Extended:

var
i : Extended;
when i = your extended variable name
these are decimals that are positive and negative

and use is
 i := i + 3.57
Boolean:

var
bln : boolean;

use
bln := True

Constants
Defining them
Const
abc = 'hi';
i = 1;
no defining types, that's it :D

CHAPTER 3 - Functions

ok the basic functions to find color and bitmap are

FindColor(var x,y: Integer; Color, xs, ys, xe, ye: Integer): Boolean;
FindBitmap(Bitmap: Integer; var x,y: Integer): Boolean;

FindColor:
From: The Rs Monkey
FindColor(var x,y: Integer; Color, xs, ys, xe, ye: Integer): Boolean;
var x,y = u well put to variables in there, they will be returned as the value of the the x,y position.
Color=Color your searching for, use the crosshairs to pick the color to get the number for that color and put it here
xs=Top left corner in what u r searching in(x coordinate)
ys=^^^^^^^^^^^^^^^^^^^^^^^^^(y coordinate)
xe=Bottom Right corner in what u r searching in(x coordinate)
ye=^^^^^^^^^^^^^^^^^^^^^^^^^^^^(y coordinate)
and if it is found it will return true
so
if(findcolor(x,y,21432,32,32,454,546)=True)then and so on.
a little pick on the coords

(xs,ys)__________
| |
| |
| |
|__________(xe,ye)



Find Bitmap:

From: The Rs Monkey
FindBitmap(Bitmap: Integer; var x,y: Integer): Boolean;

Bitmap=Picture u r looking for(lets explain this a bitmore)
first to get the picture go to script -> picture to string, once u do that and selected a picture, it will return as a string, copy that ALL down. and define the variable, variable as in "hi" in hi = BitmapFromString('dsnfsanihbgfuhidahbygsxihdjfi')
var x,y = u well put to variables in there, they will be returned as the value of the bitmap


Inttostr:

This will allow you to put an integer into a string
use
inttostr(i : integer) : string;

something like this:
abc := inttostr(i)

Strtoint:

This will allow you to put an string into a integer
use
strtoint(abc : string) : integer;

something like this:
i := strtoint(abc)

Wait:

wait(i : miliseconds);
waits a certain num of milliseconds
wait(1000)
that will wait for 1 second

Clickmouse:

Clickmouse(var x,y:integer; left : boolean);
will click at a certain position
use
Clickmouse(45,45,True)
that will left click at 45,45
to right click change True to false

Sendkeys:

sendkeys(s : string);
will send a letter(s) or word(s)
use
sendkeys('hi')
will type "hi", note, will type really fast.

Random:
random(i : integer) : integer;
will return random integer from the ranger you selected
say you put 6
will return random integer from 0-5, or 0,1,2,3,4,5(will choose one), or say random(6) + 1 will return from 1 - 6
use
random(6)

Writeln:
Writeln(s : string);
will put text in debug box
use
Writeln('hi')

Cleardebug:

will clear debug
use
Cleardebug;

IsFKeyDown
will return true if fkey is down
use
if isfkeydown(1)=true then
and so on.

SendKeysVb:
mostly used for enter.

SendKeysVb('{ENTER}',false)

Getmousepos:
will return x and y as the mouse pos
Getmousepos(x,y)

Movemouse:
will movemouse to coords
Movemouse(x,y)

HOLDMOUSE:
will hold left or right down starting at x,y
Holdmouse(x,y,true)
TRUE FOR LEFT CLICK
FALSE FOR RIGHT

RELEASEMOUSE:
will release left or right down starting at x,y (use with holdmouse function)
releasemouse(x,y,true)
TRUE FOR LEFT CLICK
FALSE FOR RIGHT

MoveMouseSmooth
moves mouse like human.
self explanatoy like everything else
use
movemousesmooth(45,45)

CHAPTER 4 - OTHER FUNCTIONS
IsTextUp:

This will check if the text is in the corner of the rs window, like Attack or Mine Or Take


Function IsTextAt3(x, y : Integer; S : String; Tolerance : Integer) : Boolean;
Var
a, b : Integer;
Begin
result:= IsTextInAreaEx(x - 2, y - 2, x + 2, y + 2, a, b, S, Tolerance, ChrCharsNormal, True, False, 0, 1, -1);
End;

Function IsTextUp(text : String) : Boolean;
Begin
result:= IsTextAt3(9, 9, text, 100);//reads text in corner of rs
End;

begin
ChrCharsNormal:= LoadChars2(AppPath + 'Charsrs22\'); //Loads rs characters from bitmaps
end.

use

if IsTextUp('Attack') = true then

Sendkeyshuman:
will send keys like a human would.

Procedure SendKeysHuman(text:String);
Var
a1 : Integer;
Begin
a1:= 1;
Repeat
wait(random(220) + 15);
sendkeys(copy(text, a1, 1));
a1:= a1 + 1;
Until a1 > length(text);
End;
Use is self explanitory if your reading this tutorial.

In Fight?:

Function InFight : Boolean;
Var
a, b : Integer;
Begin
If(findcolorspiral(a, b, 16728128, 215, 115, 330, 185))
Or(findcolorspiral(a, b, 192, 215, 115, 330, 185))Then
If(Poisoned= false)And(diseased= false)Then
result:= true;
End;
This Will Return True If You In A Fight:
if InFight = True Then
and so on.

FlagPresent
Checks if the flag is present on the minimap.

Function FlagPresent : Boolean;
Var
a, b, runescapeflag, runescapeflag2 : Integer;
Begin
result:= false;
runescapeflag := BitmapFromString(7, 7, 'z78DA3330200CDCDC' +
'8855835F25B21A5C2A31D560AAC4A50659257E35A49200AE7D3BF' +
'1');
runescapeflag2 := BitmapFromstring(2, 4,
'C656045D3311C656045D3311C656045D3311C656045D3311');
If(findbitmapin(runescapeflag, a, b, 555, 5, 735, 160))
Or(findbitmapin(runescapeflag2, a, b, 555, 5, 735, 160))Then
Begin
wait(50);
If(findbitmapin(runescapeflag, a, b, 555, 5, 735, 160))
Or(findbitmapin(runescapeflag2, a, b, 555, 5, 735, 160))Then
result:=true;
End;
FreeBitmap(runescapeflag);
FreeBitmap(runescapeflag2);
End;
to check if it is present
if Flagpresent = true then
… and so on.

Checkchatmsg
Checks last message in the chatbox and sees if it is the same as what u specified.

Function CheckChatMsg(Text: String) : Boolean;
Begin
Result:= IsTextAtEx(20, 415, Text, 40, ChrChatChars, False, True, 0, 1, 0);
End;


Clickhuman

Procedure ClickHuman(x, y : Integer; left : Boolean);
Begin
holdmouse(x, y, left);
wait(random(20) + 15);
releasemouse(x, y, left);
End;

Takescreenshot

Procedure TakeScreenShot(reason:String; number:Integer);
Begin
SaveScreenshot(apppath + 'scripts\' + reason + inttostr(number) + '.bmp');
writeln('Screenshot taken: ' + reason + ' #' + inttostr(number));
End;

CHAPTER 5 - Touch ups
Reports:
Use reports so user's can see what the script has been doing.
a report script would look something like this.


Procedure report;
begin
writeln('This is my Autominer')
writeln('Mined: ' + inttostr(numrocksmined))
writeln('End Report')
end;
this is a example of a simple report.

CHAPTER 6 - Making User Forms(for advanced)
1.Open Scar
2.Tools -> Form Editor…
3.Click and drag a button on the form.
and4.Save Form
5.Loadform
6.Stuff should appear in the debug box.
7.Delete Whats Is In scar(Program New; Begin End; Etc)
8.And Copy the stuff that appeared in the debug and paste it in the script.
Put those between Proecdure tags

Procedure Form1;
begin
//stuff here
end;
9.And Copy The Variables At The Bottom Of The Debug Box To The Top Of You Script.
10.Add this Button on click thingy in the stuff in the script
11.And Define this Procedure:
12.And At The Bottom of you script put this:

procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('Form1', v);
//Replace Form1 with the Procedure name you put the stuff between.
end;

procedure ShowFormModal;
begin
frmDesign.ShowModal;
//Replace frmDesign with the name of your form
end;

procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
13. And At The Bottom add

begin
SafeInitForm;
SafeShowFormModal;
end.
14. When Finished:

program New;
var
frmDesign : TForm;
Button1 : TButton;

procedure buttonclick(sender: TObject);
begin
Writeln('Button pressed!');
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 259;
frmDesign.Top := 132;
frmDesign.Width := 354;
frmDesign.Height := 254;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Button1 := TButton.Create(frmDesign);
Button1.OnClick:= @buttonclick;
Button1.Parent := frmDesign;
Button1.Left := 69;
Button1.Top := 61;
Button1.Width := 75;
Button1.Height := 25;
Button1.Caption := 'Button1';
Button1.TabOrder := 8;
end;

procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;

procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;

begin
SafeInitForm;
SafeShowFormModal;
end.
15. For More Info, on scar, press f1, or go to help->help, and scroll to the bottom of that page.

CHAPTER 7 - Making Procedures/Functions
Procedures - Runs a certain code, like clickmouse or writeln
Basic Syntax

Procedure Show;
begin
end;
or you can have them enter info

Procedure Fight(colorofprey : integer; eatfood : boolean);
begin
writeln('Looking for ' + inttostr(colorofprey))
//not really a fight function, just an example.
end;

Functions - returns values or booleans like findcolor = true or find bitmap
Basic Syntax

Function belowten(num : integer) : boolean;
begin
result:= false;
if(num < 10)then
result:= true;
end;


CHAPTER 8 - Making Your Own Scripts(Tuts)
Autoclicker:

program Autoclicker;
Const
Betweentime = 1; //Wait between each click in seconds.
var x,y:integer;
begin
repeat
getmousepos(x,y);
clickmouse(x,y,True);
wait((Betweentime * 1000) + random(300))
until(false)
end.
Ok We Put The Code Between Repeat and until(false) so this will run forever until the user stops it.
ok in the wait between each click we put
wait((Betweentime * 1000) + random(300))
between time is what the user wants to wait before clicks, we times it by 1000 to convert it to milliseconds, and we put random(300) milliseconds to make it more human like. that is pretty much it.

Autotalker:

program Autotalker;
Const
Whattosay = 'Hiyah';//What to type F1
begin
repeat
if(IsFKeyDown(1))then
begin
sendkeys(Whattosay);
SendKeysVb('{ENTER}',false);
end;
wait(300);//Keeps it from saying it more than once on one simple click,
//remove this and press f1 too see what i mean.
until(false)
end.
Selfexplanatory. IsFKeyDown Checks to see if the fkey is down.

CHAPTER 9 - ERRORS? SOLUTIONS HERE

- Click HERE

CHAPTER 10 - Run scar on 2+ Accounts

- Click HERE

CHAPTER 11 - A List Of Tutorials By Other People.

Typing Human By Sdcit
Variables By brownsymcard
Tut On Bitmaps By Jagex_Fagex
DTM Tut #1 [Text And Pictures] By yohojo8
Making A Powerminer By solemn wishes
Users.scar UsersManager.scar Tutorial!! By Rsn
Scar Beginners - Basics By XxKanexX
(Old Tutorial) - Basics By XxKanexX
(Old Tutorial) - Bitmap + Color Help By XxKanexX
(Old Tutorial) - Arrays By XxKanexX
Auto-Login By Pwnd
FindColorSpiral/FindObj Lesson By WhiteShadow
Bitmaps By XxKanexX
Making A Progress Report By WhiteShadow
Picking Colors By Sdcit
Making Scar Invisible By Goldrush(Scroll Down)
A Basic Script/Tut By Dankness
Auto coloring + DTM Tut #2 [Video] By ub3r |<1||3r
DTM + xs, ys, xe, ye By XxKanexX
Creating A From Bu Starblaster100
DTM Tut #3 [Video I Think] By Starblaster100
Scar Basic [Video] By ub3r |<1||3r
Using "Repeat" [Video I Think] By Pwnd
Progress Report [Video] By ub3r |<1||3r
Radialwalk and Linearwalk [Video] By ub3r |<1||3r
xs, ys, xe, ye By The Un-Renamed
Basic Tutorial for Beginner Scripters By Surajd
The Potato Responder :) By WT-Fakawi
A brief lesson on RadialWalk By WT-Fakawi
Fail-safes, repeat and loop tutorial By solemn wishes
Arrays By XxKanexX
How To Use And Save SRL Succesfully By Sdcit
Scar_Tutorial.exe By driger1592
How to use forms in SCAR effectively By mr.pali[Not Finished!]
Bitmaps By WhiteShadow
DRSARed By db_Cheater
Adding Randoms By WhiteShadow
How to run 2+ accounts on Scar By ReFLeX
Making An Auto-Login By ub3r |<1||3r
DTM Tut #4? By -fedexer-



———————————————————————————————————–
THANK YOU FOR READING THIS FAR, THATS THE END OF MY TUTORIAL, I WILL ADD STUFF ON REQUEST, JUST POST HERE.
NOTE: DONT REQUEST SCRIPTS HERE! AS THAT SAID, I WILL CONSIDER IT AS SPAM!

leader

2006-05-28 21:28:14

Nice, must have taken a while…

shaunthasheep

2006-05-28 21:29:34

i did it a while back, posted on 4 diffrent sites. decided to post here :D

The Un-Named

2006-05-28 22:10:29

Using paint? There is a text tool… ^.^

Janilabo

2006-05-29 05:17:04

Nice TRsM! You finally posted this to here, too. :D :p

Good job! ;)

Miitchyy

2006-05-29 08:12:20

very good nice job :)

torrent

2006-05-29 11:15:59

nic guide but im lost :(

Cheesehunk

2006-05-29 13:33:55

Good job!

J/w admins, why isn't Lig0rs Scar Tutoriol.exe stickied as well?:rolleyes:

shaunthasheep

2006-05-29 14:22:21

Thanx For The Sticky! :) Im Going to add a chapter 11 that has a list of all tutorials.

EDIT: FINISHED CHAPTER 11

goider

2006-05-30 09:54:21

very good, in detail, but i cannot make heads or tails of it, i know nothing of script language and only how scripts work, help?

edit: i figured out the click procedures and wait, that's about it, with that i made my first working script, thanks

Sjoe

2006-05-31 10:24:23

wow very nice, and thx for the virtual pc tut. But can't I use a win 98 ISO for that, or does it really needs a installer disc?

EDIT:nvm it worked, thx alot!!! I was struggling with virtual pc for like a month, now it finally worked :d

But I have problems with installing my internet on the virtual pc (I have one ethernet card and I can use 2 internet connections with my provider or something like that?)

shaunthasheep

2006-06-01 10:58:59

dont no about the above^^^ i have highspeed and my connect automatically. have wireless to so all i have to do is select a network range. cant help srry.

Avaphi

2006-06-02 15:08:33

Rs monkey, Check out your tutorial on cruel.net I posted on how to make it better ;) Hey but so far great tutorial…Maybe you and lig0r(Driger1592) can work together and let him use some of your info and together you could make his scar tut even better !

shaunthasheep

2006-06-02 16:06:57

lol yah i read that. ill update it. when i get to it. :o

driger1592

2006-06-02 16:23:15

Unfortunately, db_cheater, even StarBlaster's writing skills weren't what I wanted :p And in the later chapters I lacked, because I tried doing them too fast to get them out. I'm really looking for High quality writing ;) No offense, The_Rs_Monkey. Don't take it personally :p

WhiteShadow

2006-06-05 00:35:58

Really long, this seems very helpful to people.

Bokiniec

2006-06-28 02:25:18

Very nice tut!!!!! learn a few things

shaunthasheep

2006-06-28 11:59:50

Thanx, Note This Doesnt Cover Any SRL things… (Made before i Found out about srl)

wstephen4

2006-06-29 15:22:00

If I could suggest something it would be to make a download of the tutorial. Thanks for all of the information by the way.

// wstephen4

Infantry001

2006-06-29 21:42:47

awesome guide! it helped me (and still helps me) a lot! i think you should add a little more on color-finding.

Shaun.

2006-10-01 19:48:40

Very nice guide i stil dont get how to work how the var's and what ones we need to make a script =/

CamHart

2006-10-18 20:51:23

too bad the links all died lol

neo_welmeow

2006-10-22 02:51:57

very good tut, it help me out a bunch

Mod Mopar

2006-11-24 16:11:46

I don't understand anything of it … I allready readed Bebemycat2 's TUT on how to make a very first script, and i understand that fully:) But here, nothing =/ Can you also make an example of how to make a script with all these things? (Like in the Super-TUT of Bebemycat2 :p )

Pentti

2006-11-24 16:36:15

The_Rs_Monkey This is best tut's I've ever seen. Nice job! ;)

Billy Bobby8

2006-12-03 16:34:43

All links are dead :(

Buckleyindahouse

2006-12-29 13:29:40

Yea all of them are dead i wanted to learn about map walking.

[S]paz

2007-01-05 19:50:01

nice u rele got me understanding about forms thx

warlord94

2007-02-14 18:26:14

cool, liked it

JAD

2007-02-14 18:52:09

hmm.. i wish all the links weren't dead but I'd give that tut a 7 out of 10. no offense but it wasn't very descriptive, it helped me though because i had a basic understanding of what the things in the coding meant. good tut though, it helped me some. thanks.

King Monkfish

2007-04-09 09:34:03

Thanks but the link to other tutorials don't work… For me atleast…

steve claget

2007-04-11 12:10:29

WOW! Thanks for puting the time and effort into makeing such an exellent TUT. It has helped me alot, and im starting to make scripts now.

BeaconofBacon

2007-05-03 14:11:07

It's nice, but it doesn't go into as much detail into each command as I would have liked…Appreciated though.

wogboy12

2007-05-23 05:32:04

very nice !!!
thx alot for the guide

skibby

2007-05-25 09:45:35

very good

codx1

2007-05-28 06:06:37

Good tutorial.. is it still been updated? would be nice to see this one - Chicken Fighter(Coming Soon)

Rikje

2007-05-30 09:36:14

verry nice guid! it takes a while to read it all. but it was it worth. :D

shaunthasheep

2007-06-03 22:29:05

notice that this tut is over a year old now, no one use the Other functions, just use the ones in SRL. Thanks for reading too =)

WhoCares357

2007-06-04 01:55:57

That tut helped me lots when I first started scripting Scar. Thanks.

muffinman177

2007-06-07 20:52:28

It's as good as your beginner tut. :) The links at the bottom don't work though.

dialeyj2

2007-06-09 15:58:09

nice tut, im gonna check out the run scar on 2 + acounts :)

btw wut does the false at the end of "{enter}false" on the AtouTalker do?


EDIT: ok thanks

shaunthasheep

2007-06-10 12:28:43

when i made the tut i couldn't think of the char code for enter, so i used that, it sends enter.

btw SendKeys(chr(13)); is enter, im pretty sure =)

CheetahNub

2007-08-12 09:34:00

Damn this is a good guide.

I can't wait to go scrpit my own scripts when srl is updated.

I B X R

2008-02-20 00:28:25

Very nice tut, but Chapter 4 isn't really in depth, and that seems very important to amature scripters(like myself). A re-do of that chapter would help a lot of us out. You aren't going in depth by what you mean, it's like type this, and you don't tell us why we need it. Thanks

-I B X R

Laur€ns

2008-05-24 11:31:15

Since a while there is a text box in paint :) But anyways, good guide. But when I try to calculate something, it says indentifier expected, variable expected or colon expected :(

Chad Grimgravy

2008-08-23 12:18:05

EPIC!!!! nice tut, i get how to do it now

m4g3owns

2008-08-25 22:42:34

amazing. very good tutorial :D, very organized.

zos123

2008-09-26 21:26:33

Nice guide . I learned some things. All link to others guides are dead .
Could you re-do them please ?

tank phobia

2008-09-29 17:17:18

Didn't bother checking links to other guides as you had almost everything I was looking for.

Only question would be is that text search function which looked in the corner of the screen only capable of looking there or could you change the values and look anywhere you wanted on the screen?

EDIT: thanks for minimising the reading, you managed to explain everything with a minimum of words!

NCDS

2008-10-01 00:15:18

this guide is so old, if you used some of those functions now you would be banned within minutes.

designed by

2008-12-20 21:42:15

Nice this help me understand bitmaps clearer thank you

wabakoo420

2009-01-04 15:00:35

great tutorial

IronGummy Bear

2009-01-04 16:39:43

Wow! nice tut and very easy to follow. Helps alot

Einstein

2009-01-18 14:11:13

extreamly nice job! This helped me alot

Maninpink5

2009-02-07 04:08:57

Pretty good tut. Left me kinda lost, but so do most of the tuts. Trying to learn this whole thing, kinda hard. So far I've made a sorta selling script for GE

TRiLeZ

2009-02-21 19:56:01

I tested out the talking script and it doesn't press enter.
I have a talking script that works better.
TypeSend('Hello World');

I found it while looking in the SRL. Works nicely. :)

Nice Tutorial Though! Great Work!

savyrulez

2009-02-24 16:21:17

great tut!!!! now to start making my script =D

Semtex

2009-02-28 08:48:50

ohm, i didn't understand what you were doing and why. you dont explain so much. I hope you make a new and better one:)