shaunthasheep
05-29-2006, 12:57 AM
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 (http://cruels.net/viewtopic.php?t=1560)
CHAPTER 10 - Run scar on 2+ Accounts
- Click HERE (http://cruels.net/viewtopic.php?t=1638)
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:
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:
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' +
'8855835F25B21A5C2A31D560AAC4A50659257E35A49200AE7 D3BF' +
'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...
http://img131.imageshack.us/img131/3457/menu1sa.png
3.Click and drag a button on the form.
http://img131.imageshack.us/img131/6232/buttonclick0hb.png
andhttp://img131.imageshack.us/img131/7218/dragonform4na.png
4.Save Form
http://img91.imageshack.us/img91/5376/save5hx.png
5.Loadform
http://img131.imageshack.us/img131/249/loadform1bu.png
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.
http://img131.imageshack.us/img131/1717/copypastebody9su.png
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.
http://img107.imageshack.us/img107/4135/vars8na.png
10.Add this Button on click thingy in the stuff in the script
http://img131.imageshack.us/img131/8545/buttononclick9wm.png
11.And Define this Procedure:
http://img91.imageshack.us/img91/787/onclickprocedure5wc.png
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 (http://cruels.net/viewtopic.php?t=1560)
CHAPTER 10 - Run scar on 2+ Accounts
- Click HERE (http://cruels.net/viewtopic.php?t=1638)
CHAPTER 11 - A List Of Tutorials By Other People.
Typing Human By Sdcit (http://82.92.130.193/forums/showthread.php?t=194)
Variables By brownsymcard (http://82.92.130.193/forums/showthread.php?t=280)
Tut On Bitmaps By Jagex_Fagex (http://82.92.130.193/forums/showthread.php?t=353)
DTM Tut #1 [Text And Pictures] By yohojo8 (http://82.92.130.193/forums/showthread.php?t=663)
Making A Powerminer By solemn wishes (http://82.92.130.193/forums/showthread.php?t=73)
Users.scar UsersManager.scar Tutorial!! By Rsn (http://82.92.130.193/forums/showthread.php?t=355)
Scar Beginners - Basics By XxKanexX (http://82.92.130.193/forums/showthread.php?t=704)
(Old Tutorial) - Basics By XxKanexX (http://82.92.130.193/forums/showthread.php?t=749)
(Old Tutorial) - Bitmap + Color Help By XxKanexX (http://82.92.130.193/forums/showthread.php?t=750)
(Old Tutorial) - Arrays By XxKanexX (http://82.92.130.193/forums/showthread.php?t=751)
Auto-Login By Pwnd (http://82.92.130.193/forums/showthread.php?t=736)
FindColorSpiral/FindObj Lesson By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=612)
Bitmaps By XxKanexX (http://82.92.130.193/forums/showthread.php?t=703)
Making A Progress Report By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=1010)
Picking Colors By Sdcit (http://82.92.130.193/forums/showthread.php?t=76)
Making Scar Invisible By Goldrush(Scroll Down) (http://82.92.130.193/forums/showthread.php?t=514)
A Basic Script/Tut By Dankness (http://82.92.130.193/forums/showthread.php?t=1047)
Auto coloring + DTM Tut #2 [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1171)
DTM + xs, ys, xe, ye By XxKanexX (http://82.92.130.193/forums/showthread.php?t=748)
Creating A From Bu Starblaster100 (http://82.92.130.193/forums/showthread.php?t=1266)
DTM Tut #3 [Video I Think] By Starblaster100 (http://82.92.130.193/forums/showthread.php?t=1249)
Scar Basic [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1270)
Using "Repeat" [Video I Think] By Pwnd (http://82.92.130.193/forums/showthread.php?t=1273)
Progress Report [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1269)
Radialwalk and Linearwalk [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1296)
xs, ys, xe, ye By The Un-Renamed (http://82.92.130.193/forums/showthread.php?t=1284)
Basic Tutorial for Beginner Scripters By Surajd (http://82.92.130.193/forums/showthread.php?t=1350)
The Potato Responder :) By WT-Fakawi (http://82.92.130.193/forums/showthread.php?t=1310)
A brief lesson on RadialWalk By WT-Fakawi (http://82.92.130.193/forums/showthread.php?t=452)
Fail-safes, repeat and loop tutorial By solemn wishes (http://82.92.130.193/forums/showthread.php?t=1287)
Arrays By XxKanexX (http://82.92.130.193/forums/showthread.php?t=689)
How To Use And Save SRL Succesfully By Sdcit (http://82.92.130.193/forums/showthread.php?t=78)
Scar_Tutorial.exe By driger1592 (http://82.92.130.193/forums/showthread.php?t=1155)
How to use forms in SCAR effectively By mr.pali[Not Finished!] (http://82.92.130.193/forums/showthread.php?t=643)
Bitmaps By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=1283)
DRSARed By db_Cheater (http://82.92.130.193/forums/showthread.php?t=1592)
Adding Randoms By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=743)
How to run 2+ accounts on Scar By ReFLeX (http://82.92.130.193/forums/showthread.php?t=1157)
Making An Auto-Login By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=787)
DTM Tut #4? By -fedexer- (http://82.92.130.193/forums/showthread.php?t=1637)
-----------------------------------------------------------------------------------------------------------
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!
_ :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 (http://cruels.net/viewtopic.php?t=1560)
CHAPTER 10 - Run scar on 2+ Accounts
- Click HERE (http://cruels.net/viewtopic.php?t=1638)
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:
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:
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' +
'8855835F25B21A5C2A31D560AAC4A50659257E35A49200AE7 D3BF' +
'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...
http://img131.imageshack.us/img131/3457/menu1sa.png
3.Click and drag a button on the form.
http://img131.imageshack.us/img131/6232/buttonclick0hb.png
andhttp://img131.imageshack.us/img131/7218/dragonform4na.png
4.Save Form
http://img91.imageshack.us/img91/5376/save5hx.png
5.Loadform
http://img131.imageshack.us/img131/249/loadform1bu.png
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.
http://img131.imageshack.us/img131/1717/copypastebody9su.png
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.
http://img107.imageshack.us/img107/4135/vars8na.png
10.Add this Button on click thingy in the stuff in the script
http://img131.imageshack.us/img131/8545/buttononclick9wm.png
11.And Define this Procedure:
http://img91.imageshack.us/img91/787/onclickprocedure5wc.png
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 (http://cruels.net/viewtopic.php?t=1560)
CHAPTER 10 - Run scar on 2+ Accounts
- Click HERE (http://cruels.net/viewtopic.php?t=1638)
CHAPTER 11 - A List Of Tutorials By Other People.
Typing Human By Sdcit (http://82.92.130.193/forums/showthread.php?t=194)
Variables By brownsymcard (http://82.92.130.193/forums/showthread.php?t=280)
Tut On Bitmaps By Jagex_Fagex (http://82.92.130.193/forums/showthread.php?t=353)
DTM Tut #1 [Text And Pictures] By yohojo8 (http://82.92.130.193/forums/showthread.php?t=663)
Making A Powerminer By solemn wishes (http://82.92.130.193/forums/showthread.php?t=73)
Users.scar UsersManager.scar Tutorial!! By Rsn (http://82.92.130.193/forums/showthread.php?t=355)
Scar Beginners - Basics By XxKanexX (http://82.92.130.193/forums/showthread.php?t=704)
(Old Tutorial) - Basics By XxKanexX (http://82.92.130.193/forums/showthread.php?t=749)
(Old Tutorial) - Bitmap + Color Help By XxKanexX (http://82.92.130.193/forums/showthread.php?t=750)
(Old Tutorial) - Arrays By XxKanexX (http://82.92.130.193/forums/showthread.php?t=751)
Auto-Login By Pwnd (http://82.92.130.193/forums/showthread.php?t=736)
FindColorSpiral/FindObj Lesson By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=612)
Bitmaps By XxKanexX (http://82.92.130.193/forums/showthread.php?t=703)
Making A Progress Report By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=1010)
Picking Colors By Sdcit (http://82.92.130.193/forums/showthread.php?t=76)
Making Scar Invisible By Goldrush(Scroll Down) (http://82.92.130.193/forums/showthread.php?t=514)
A Basic Script/Tut By Dankness (http://82.92.130.193/forums/showthread.php?t=1047)
Auto coloring + DTM Tut #2 [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1171)
DTM + xs, ys, xe, ye By XxKanexX (http://82.92.130.193/forums/showthread.php?t=748)
Creating A From Bu Starblaster100 (http://82.92.130.193/forums/showthread.php?t=1266)
DTM Tut #3 [Video I Think] By Starblaster100 (http://82.92.130.193/forums/showthread.php?t=1249)
Scar Basic [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1270)
Using "Repeat" [Video I Think] By Pwnd (http://82.92.130.193/forums/showthread.php?t=1273)
Progress Report [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1269)
Radialwalk and Linearwalk [Video] By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=1296)
xs, ys, xe, ye By The Un-Renamed (http://82.92.130.193/forums/showthread.php?t=1284)
Basic Tutorial for Beginner Scripters By Surajd (http://82.92.130.193/forums/showthread.php?t=1350)
The Potato Responder :) By WT-Fakawi (http://82.92.130.193/forums/showthread.php?t=1310)
A brief lesson on RadialWalk By WT-Fakawi (http://82.92.130.193/forums/showthread.php?t=452)
Fail-safes, repeat and loop tutorial By solemn wishes (http://82.92.130.193/forums/showthread.php?t=1287)
Arrays By XxKanexX (http://82.92.130.193/forums/showthread.php?t=689)
How To Use And Save SRL Succesfully By Sdcit (http://82.92.130.193/forums/showthread.php?t=78)
Scar_Tutorial.exe By driger1592 (http://82.92.130.193/forums/showthread.php?t=1155)
How to use forms in SCAR effectively By mr.pali[Not Finished!] (http://82.92.130.193/forums/showthread.php?t=643)
Bitmaps By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=1283)
DRSARed By db_Cheater (http://82.92.130.193/forums/showthread.php?t=1592)
Adding Randoms By WhiteShadow (http://82.92.130.193/forums/showthread.php?t=743)
How to run 2+ accounts on Scar By ReFLeX (http://82.92.130.193/forums/showthread.php?t=1157)
Making An Auto-Login By ub3r |<1||3r (http://82.92.130.193/forums/showthread.php?t=787)
DTM Tut #4? By -fedexer- (http://82.92.130.193/forums/showthread.php?t=1637)
-----------------------------------------------------------------------------------------------------------
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!