PDA

View Full Version : Tutorial for the "Intermediate Scripter" with video aid.



Wanted
07-09-2008, 04:31 PM
TUTORIAL IS STILL BEING MADE AT THE MOMENT!

Hello and welcome to my tutorial for the intermediate scripter! Before proceeding, make sure that you have good confidence in what you know from the beginner tutorial (http://www.villavu.com/forum/showthread.php?t=23133) as for we are going to apply those skills for the rest of our scripting career and beyond.

I will lead off with a short explanation of the intermediate scripter, being an intermediate is much much different than being that of the beginner, you need to have a feel for SCAR, be able to turn your thoughts into code directly and think logic and use your own creativity.

I understand most come here from other tutorials, so I will outline what I will teach today.

*More types such as the Extended type.
*Math, some operators.
*More keywords.
*More about functions and procedures.
*More Color Finding techniques.
*Bitmaps.
*DTMs.
*Including.
*Scripting for runescape.
*Using SRL effectively. - Text handling, chat box, global constants.
*Intermediate level looping.
*Intermediate level logic. -Fail safes ect..
*Anti-Randoms, Anti-Ban.
*Constructing an SRL script.
*Using SRL Stats.
*More math, radians/ degrees ect..
*Map walking.
*Dynamic DTMs (DDTMs)
*Types.
*Arrays.
*Introduction to forms.
*More standards.

By the end of this tutorial you should be able to create working runescape scripts and even be good enough to release them in the SRL scripts section, and apply for SRL membership (you would need to create a good neat script though). The only thing you need to do is read this tutorial, practice, then start testing and developing scripts.

I'm going to start us off by showing you some more data types (Data types are basically types of data, such as strings, Integers, Booleans...) there are many many different kinds of data types (you can even make your very own! I'll show you later in the tutorial). Some of you may be doubting that since you have only learned whole numbers SCAR can't handle decimal points! Well this isn't true, but we are going to learn a new data type.

Extended - Data type used for all real numbers positive and negative, example : 0, 1.5, -100.67, 100.3333

declaring is as such:

const
Money = 5.31;

var
E: Extended;

To convert,

Round(E: Extended): Integer;
FloatToStr(E: Extended): string;
StrToFloat(S: string): Extended;
StrToFloatDef(S: string; Def: Extended): Extended;

Extended and Integers are both numeric values that we can perform math on.

+ - Addition, used to mathematically add two numeric values together, or in strings it performs as a joiner. Examples

2 + 2 = 4
3.56 + 965.1 = 968.66
'Hello ' + 'World!' = 'Hello World!'

- - Subtraction or negative sign, when used as subtraction is used simply 4 - 2 = 2 but when used as negative used as (-2 + -4) ect.. Examples

4 - 2 = 2
600.1 - 0.2 = 599.8

* - Multiplies two numeric values together.

2 x 8 = 16
2.4 x 5.6 = 13.44
-2 x 5 = -10

Note: Bitwise operations are faster than these operators, but they will not be explained until the advanced tutorial.

Now while still learning our operators, we are going to learn two new key words and a few commands.

div - Key word used to divide numbers while removing the remainder.
Here is an example of removing the remainder:

5 div 2 = 2
10 div 3 = 3

mod - Key word used to divide numbers and return the remainder.
Here is an example of returning the remainder:
5 mod 2 = 1
14 mod 3 = 2

mod can be very useful to find certain patterns that I will describe later on in the looping portion of the tutorial.

Here are some general functions that you can find more of by pushing F1 in SCAR the pressing CTRL+F and search for math

function Sqrt(e : Extended): Extended;
Returns the square root of e.

function Sqr(X: Extended): Extended;
Returns X² or X*X.

function Round(e: Extended): LongInt;
Rounds and converts floating point number to integer.

Note: When using Round you may be able to avoid that if use div instead of the normal divide sign "/".

Here's a few more operators that you may find useful

Less < Than
Greater > Than
Greater or equal >= To
Lesser or equal <= To

<
>
<=
>=

We'll look at some more math functions later in the tutorial.

Ok, so we've learned a few key words thus far I'm going to introduce a few new ones.

case - keyword used to simplify a list of if then statements.

of - for this use (cases) we're going to use it right after what we are casing...

Here is an example of why case is so useful, let's say we wanted to do something but there would be 5 choices and we wanted to choose one randomly. Ok well easy we would just do:

var
Choice: Integer;

begin
Choice := Random(5);
if (Choice = 0) then
WriteLn('Apples');
if (Choice = 1) then
WriteLn('Oranges');
if (Choice = 2) then
WriteLn('Grapes');
if (Choice = 3) then
WriteLn('Bananas');
if (Choice = 4) then
WriteLn('Cherrys');
end.

Well now don't you think that is a little repetitive and unnecessary? Calling the equals operator, the if Boolean operator and the then expecter over and over again? Lets use case to simplify it.

begin
case (Random(5)) of
0: WriteLn('Apples');
1: WriteLn('Oranges');
2: WriteLn('Grapes');
3: WriteLn('Bananas');
4: WriteLn('Cherrys');
end;
end.

Ah ok cool, we can use case now but guess what, we can make it even less repetitive by using a string variable!

var
RandomFruit: string;

begin
case (Random(5)) of
0: RandomFruit := 'Apples';
1: RandomFruit := 'Oranges';
2: RandomFruit := 'Grapes';
3: RandomFruit := 'Bananas';
4: RandomFruit := 'Cherrys';
end;
WriteLn(RandomFruit);
end.

That's just a brief display of what you can do with the case keyword.

Next up is try, except, and finally.

Now these are basically used if something might fail and cause your script to crash let me show you the source code for StrToIntDef, StrToFloatDef and StrToBoolDef.

function StrToIntDef(S: string; Def: Integer;): Integer;
begin
try
Result := StrToInt(S);
except
Result := Def;
end;
end;

function StrToFloatDef(S: string; Def: Extended): Extended;
begin
try
Result := StrToFloat(S);
except
Result := Def;
end;
end;

function StrToBoolDef(S: string; Def: Boolean): Boolean;
begin
try
Result := StrToBool(S);
except
Result := Def;
end;
end;

As you can see in each example it attempts to make a normal conversion and lets say we tried to convert 'Hello' into and Integer, well that's not going to work! Hello isn't a number! So we set the result default on the except clause. then we wrap it all up with an end. If we wanted to we could do

except
WriteLn('ERROR! Setting to defualt!');
Result := Def;
finally
WriteLn('Conversion complete');
end;

I supposed finally doesn't serve much of a purpose because you could just put right that after end; but I use it anyways so it makes the code seem more documentary and easy to understand.

Well I introduced making procedures and functions in the last tutorial but I didn't go into much depth because it might of scared you off :-P. One thing I didn't mention in my beginner tutorial was stuff about the Result variable and custom variables.

Result is only in functions and referrers to the output of the entire function for example:

FindColor(var X, Y: Integer; Color, XS, YS, XE, YE): Boolean;

This means that the FindColor's function's Result variable would be a Boolean, when making a function to set the result variable it's rather easy:

function ItsRainning: Boolean;
begin
Result := False;
end;

You can see that Result protains to the function's main output, just for fun :-P

function ItsRainning: Boolean;
begin
Result := CheckWeather('Rain');
end;

CheckWeather (imaginary function) would be written as

function CheckWeather(WhatToCheck: string): Boolean;

One other thing I didn't mention was if you wanted to add more custom output variables, this is similar to the var X, Y in FindColor because X and Y must be variables!

procedure ThreeRandomNumbers(var A, B, C: Integer; Range: Integer);
begin
A := Random(Range);
B := Random(Range);
C := Random(Range);
end;

Fairly simply, for now I'm only going to talk about one more thing concerning functions and procedures, localized variables!

procedure Something;
var
I: Integer;
B: Boolean;
S: string;
E: Extended;
begin
end;

You can do it the same exact way as with global variables such as

program New;

var
I: Integer;

begin
end.

That can be used anywhere in the script, but Localized variables are much faster but can only be used in the function or procedure!

In my beginner tutorial I mentioned 1 FindColor function, the simple and most basic one of course...FindColor! There are many many more color finding functions! Just open SCAR Press F1 then ctrl+F and type in color. You will see there is loads of color finding functions!

The first one I want you to look at is FindColorTolerance, now the reason it's called FindColorTolerance is because it can find a color that is similar to another color with a certain tolerance! This is most useful if the color you are looking for can change slightly, you need to use some tolerance (to find tolerance you will need to test multiple different tolerances until you find one that works consistently) Now then the syntax:

function FindColorTolerance(var X, Y: Integer; Color, XS, YS, XE, YE: Integer; Tolerance: Integer): Boolean;
Works like the regular FindColor function but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.

This is useful for RuneScape because most colors in runescape change.

The next I want you to look at is FindColorSpiral

function FindColorSpiral(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean;
Find color in box specified by xs, ys, xe, ye but start from x,y.

FindColorSpiral is usually butt loads faster than FindColor because most colors may move a lot in a certain area (specified by xs, ys, xe, ye) but they are usually close to the same spot every time (like the center of the client) so here is an example of how to set FindColorSpiral to search starting from the coordinate 100, 100

var
X, Y: Integer;

begin
X := 100;
Y := 100;
if (FindColorSpiral(X, Y, 255, 0, 0, 200, 200)) then
MoveMouse(X, Y);
else
WriteLn('Color not found!');
end;

So it would start from 100, 100 and search for the color spiraling outwards.

The last one I want you to look at for now is

function FindColorSpiralTolerance(var x, y: Integer; color, xs, ys, xe, ye: Integer; Tolerance: Integer): Boolean;
Works like the regular FindColorSpiral but with a tolerance parameter for finding any similar color. Tolerance is used to find a color in range of the color you are looking for. The greater color range you want, the higher the tolerance parameter should be.

Combine FindColorSpiral and FindColorTolerance and you have FindColorSpiralTolerance (one of the most commonly used color finders I would recommend for the intermediate scripter for runescape)

X := 100;
Y := 100;
FindColorSpiralTolerance(X, Y, TheColor, X1, Y1, X2, Y2, Tolerance);

Note: To test tolerance simply put in 1 for Tol and see if it finds the color, then switch worlds and test to see if it finds the color, if it fails increase it to 2 and keep repeating until you find a tolerance that consistently works.

Next up is the wonderful (laggy lol) world of bitmaps!

A bitmap is a picture, a small arrangement of colors that are directly next to eachother. Note: bitmaps may be laggy always make them as small as possible. You are probably wondering how to make bitmaps considering there is no obvious tool in SCAR such as the eyedropper for you to use. Instead we are going to need to learn how to use screen shots, cropping, bitmap to string, loading, finding, and freeing (from memory). All just for bitmaps, let's start by making a simple screen shot (some of you may have a Prt Scr button, if it works use that instead but if it doesn't just follow the first step below by using SCAR's screen shot tool).

I'm going to get a picture of some coal in my inventory (Tools -> SaveScreenShot):

http://img90.imageshack.us/img90/4609/savescreenshotbc7.gif

Now lets open the picture in paint: (Tools -> Explorer folder -> SCAR Folder -> scr.bmp -> open with... -> paint.

http://img175.imageshack.us/img175/9413/openinpaintly0.gif

Once in paint lets crop the image down to just the coal so we can work on it easier:

http://img410.imageshack.us/img410/5812/croplolzh6.gif

http://img515.imageshack.us/img515/9524/cropscrtocoalzj9.gif

Lets zoom in so we can really see what we're doing:

http://img404.imageshack.us/img404/8536/zoominzj4.gif

I'm going to crop out a very thin slice for us to search for and make any parts of the picture that could change black such as the inventory in the background

http://img89.imageshack.us/img89/3382/coaltobitcropyh0.gif

Now we need to crop it down to it's own file and save it:

http://img135.imageshack.us/img135/1897/savecoalty0.gif

Notice how there wasn't anything in the picture that wasn't the slice we got out, there was no extra white space ect...

Now we need to convert that bitmap into a string so SCAR can load it.

http://img209.imageshack.us/img209/1417/picturetostringhw2.gif

Alright now you have some code you can use

Coal := BitmapFromString(17, 2, 'beNozV7XWVwSiMDfDKA+jBD+zl' +
'ACL3AhbIAlkMzAwMoAAo5yciL6evLGxEhBpacrYGysDEVB9rL cJUF' +
'lWmE1xrGN6sBVQF1yLiooEXIs5ADnHE9M=');

Lets make a new procedure:

program BitMapExample;

procedure FindCoal;
var
Coal: Integer;
begin
Coal := BitmapFromString(17, 2, 'beNozV7XWVwSiMDfDKA+jBD+zl' +
'ACL3AhbIAlkMzAwMoAAo5yciL6evLGxEhBpacrYGysDEVB9rL cJUF' +
'lWmE1xrGN6sBVQF1yLiooEXIs5ADnHE9M=');
end;

begin
FindCoal;
end.

Alright, so far our custom procedure doesn't do anything more than Load the Coal into memory, what we need to do is actually find the coal, so we are going to need to use a bitmap finding function from pressing F1 and searching with ctrl+F for bitmap, now we decided that FindColorSpiralTolerance worked best for color, well it does, but for bitmaps, Spiraling is a bit weird so we're just going to use FindBitmapToleranceIn:

function FindBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer): Boolean;
Works like FindBitmapIn but with a tolerance parameter for finding any similar colored bitmap. Tolerance is used to find a colored bitmap in range of the bitmap you are looking for. The greater color range you want, the higher the tolerance parameter should be.

Now then I am going to introduce how to include SRL very quickly:

program New;

{.Include SRL\SRL.SCAR}

begin
SetUpSRL;
end.

That is your most basic SRL script, I save it as my default script by going File -> Save as default so it will load it up when I start a new script.

Now let's apply this to our bitmap script:

program BitMapExample;

{.Include SRL\SRL.SCAR}

procedure FindCoal;
var
Coal: Integer;
begin
Coal := BitmapFromString(17, 2, 'beNozV7XWVwSiMDfDKA+jBD+zl' +
'ACL3AhbIAlkMzAwMoAAo5yciL6evLGxEhBpacrYGysDEVB9rL cJUF' +
'lWmE1xrGN6sBVQF1yLiooEXIs5ADnHE9M=');
end;

begin
SetUpSRL;
FindCoal;
end.

Well we still need to find our bitmap so let's fill out the Bit Map finding function:

FindBitMapToleranceIn(Coal,

since Coal is our bitmap

FindBitMapToleranceIn(Coal, X, Y,

since X and Y must be variables

FindBitMapToleranceIn(Coal, X, Y, MIX1, MIY1, MIX2, MIY2

because those are constants included in SRL to box the inventory:

Note: Main Screen box : MSX1, MSY1, MSX2, MSY2
Mini-Map Screen box: MMX1, MMY1, MMX2, MMY2
Chat Box Screen box :MCX1, MCY1, MCX2, MCY2
Center of the Main screen: MSCX, MSCY
Center of the Mini-Map: MMCX, MMCY
Center of the Inventory: MICX, MICY
Center of the chatbox: MCX, MCY.

FindBitMapToleranceIn(Coal, X, Y, MIX1, MIY1, MIX2, MIY2, 20);

because I normally use tolerance 20 for inventory bitmaps :-P

Now let's add this to our procedure, infact let's change our procedure to a function:

program BitMapExample;

{.Include SRL\SRL.SCAR}

var
X, Y: Integer;

function FindCoal(var X, Y: Integer): Boolean;
var
Coal: Integer;
begin
Coal := BitmapFromString(17, 2, 'beNozV7XWVwSiMDfDKA+jBD+zl' +
'ACL3AhbIAlkMzAwMoAAo5yciL6evLGxEhBpacrYGysDEVB9rL cJUF' +
'lWmE1xrGN6sBVQF1yLiooEXIs5ADnHE9M=');
Result := FindBitMapToleranceIn(Coal, X, Y, MIX1, MIY1, MIX2, MIY2, 20);
end;

begin
SetUpSRL;
FindCoal(X, Y);
end.

Now let's add some logic to it and move the mouse over it using the SRL human like move mouse command - MMouse!

Let me quickly explain MMouse first:

MMouse(XCoord, YCoord, RandomXRange, RandomYRange);

It's that simple so I'd put in about 3 for the random range and since we are using the variables X and Y put in X and Y for the first two.

Also, we need to Free our bitmap from memory so at the bottom of our function add FreeBitMap(Coal);

And for testing the script for runescape lets add a FindRS; command that will specify the runescape client for us and an activateclient command so it will bring it to the front and ooo... let's add cleardebug to make it clean up the debug box and some wait time to give the window a second to come to the front: Your script should end up like this:

program BitMapExample;

{.Include SRL\SRL.SCAR}

var
X, Y: Integer;

function FindCoal(var X, Y: Integer): Boolean;
var
Coal: Integer;
begin
Coal := BitmapFromString(17, 2, 'beNozV7XWVwSiMDfDKA+jBD+zl' +
'ACL3AhbIAlkMzAwMoAAo5yciL6evLGxEhBpacrYGysDEVB9rL cJUF' +
'lWmE1xrGN6sBVQF1yLiooEXIs5ADnHE9M=');
Result := FindBitMapToleranceIn(Coal, X, Y, MIX1, MIY1, MIX2, MIY2, 20);
FreeBitMap(Coal);
end;

begin
SetUpSRL;
ClearDeBug;
FindRS;
ActivateClient;
Wait(2000);
if (FindCoal(X, Y)) then
MMouse(X, Y, 3, 3)
else
WriteLn('Did not find coal!');
end.

log into Runescape and see if it will find the coal in your inventory (note use your script with your bitmap, not mine!!)

Here is a video of my script run:

http://img299.imageshack.us/img299/239/scriptrunageap7.gif

Cool it works!

The next thing I am going to introduce is DTMs or Deformable Template Models . Remember when I was talking about what bitmaps are I said "an arrangement of colors that are directly next to eachother" will in a DTM it's an arrangement of colors but the can be spread out! DTMs are much faster, easier to make, faster to find, much much less laggy and CPU usage. These are only the name a few advantages using DTMs and weren't not getting into making them dynamic (yet, will talk about that later in the tutorial) well to make a DTM, we are going to use SCAR's DTM editer, but we are going to need a picture first, fortunately we still have scr.bmp from our coal bitmap making so we will just use that. Take a screen shot of some coal and do this:

http://img530.imageshack.us/img530/3325/opendtmediterns5.gif

Let me first explain a little more how DTMs work, there is a Main color in a DTM usually at the center called the Main Point, it is the master color that when we find a DTM is the pixel that returns the coordinates, the rest of the points are called subpoints that are a certain distance from the Main Point. Now stupidly of Jagex, they made most items outlined with a black line, the color of that black line does not change even after switching worlds ect... so we can use it for our subpoints, for the Main Point we can simply put it in the center of the object and turn the tolerance up to maximum 255:

http://img145.imageshack.us/img145/4104/makeadtmdb9.gif

Lets save our DTM then do a test with the DTM editers DTM finding tester:

http://img295.imageshack.us/img295/459/savedtmow6.gif

Ok cool, it should find it, let's convert it to text!

http://img89.imageshack.us/img89/2558/dtmtotextva2.gif

Alright, now we have some actually usable code!

Coal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');

Now we need to adapt our Bitmap script to use DTMs instead of bitmaps, first we need to replace

Coal := BitmapFromString(17, 2, 'beNozV7XWVwSiMDfDKA+jBD+zl' +
'ACL3AhbIAlkMzAwMoAAo5yciL6evLGxEhBpacrYGysDEVB9rL cJUF' +
'lWmE1xrGN6sBVQF1yLiooEXIs5ADnHE9M=');

with

Coal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');

Next we need to replace our bitmap finding function with a DTM finding function

function FindDTM(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Integer;

This is pretty easy, everything is exactly the same only we no longer need to use tolerance and we need to use it with a DTM instead of a bitmap which we already replaced.

Last but not least, change our FreeBitMap to FreeDTM.

The new script looks like this:

program DTMExample;

{.Include SRL\SRL.SCAR}

var
X, Y: Integer;

function FindCoal(var X, Y: Integer): Boolean;
var
Coal: Integer;
begin
Coal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');
Result := FindDTM(Coal, X, Y, MIX1, MIY1, MIX2, MIY2);
FreeDTM(Coal);
end;

begin
SetUpSRL;
ClearDeBug;
FindRS;
ActivateClient;
Wait(2000);
if (FindCoal(X, Y)) then
MMouse(X, Y, 3, 3)
else
WriteLn('Did not find coal!');
end.

For now, that's it for DTMs.

Now I bet your wondering about the whole SRL including thingie, will now its time to look at including.

Many of years ago (not really, like 2 lol) there were the petty include wars between famous scripts at the time Kaitnieks. Now from all these includes emerged SRL - SCAR Resource Library or SCAR RuneScape Library. SRL is made by professional scripters to make your job one heck of a lot easier. SRL includes anti-randoms, anti-banning, human like functions for mouse and keyboard, as well as commonly used helpful runescape directed commands. First basic thing about including, including goes right after the program naming but before everything else. Here is a brief look at that:

{Script info and
instructions}

program Naming;

{.Include SRL\SRL.SCAR}

function SomeFunctions: Boolean;
begin
Result := False;
end;

begin
SetUpSRL;
//Main loop.
end. //end of file

you can see the script goes in a standardized order.

You might want to find a copy of the latest SRL manual as for it is a tool that I myself use all of the time as do many scripters find very helpful.

Note: The SRL manual is located Tools -> Explorer folder -> Includes -> SRL -> SRL manual (compiled Html file).

Now then, the next most important thing to know about SRL is calling SetUpSRL; without doing this your script will screw up really fast. So do not forget to call SetUpSRL; before you do anything that uses it in your script! You only need to call it once, but it must be called!

The 3rd most important thing is the SRL player array, without this SRL would be cool and all but scripts would only run for a few hours at most. The SRL player array allows you to rotate players! So your script can run much much longer! Now here is a procedure you will see in every single SRL script today, it's called declare players (unless your script has a form, we'll get to that later) now then here is as simple as a declare players as you can get:

program BasicSRLTemplate;

{.Include SRL\SRL.SCAR}

const
NumOfPlayers = 2;
StartPlayer = 0;

procedure DeclarePlayers;
begin
NumberOfPlayers(NumOfPlayers);
CurrentPlayer := StartPlayer;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active := True;
end;

begin
ClearDeBug;
SetUpSRL;
DeclarePlayers;
FindRS;
ActivateClient;
Wait(2000);
repeat
LogInPlayer;
if (not (LoggedIn)) then
Break;
NextPlayer(LoggedIn);
until (False);
WriteLn('No more active players!');
TerminateScript;
end.

Now you can add more players simply by doing:

program BasicSRLTemplate;

{.Include SRL\SRL.SCAR}

const
NumOfPlayers = 4;
StartPlayer = 0;

procedure DeclarePlayers;
begin
NumberOfPlayers(NumOfPlayers);
CurrentPlayer := StartPlayer;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active := True;

end;

begin
ClearDeBug;
SetUpSRL;
DeclarePlayers;
FindRS;
ActivateClient;
Wait(2000);
repeat
LogInPlayer;
if (not (LoggedIn)) then
Break;
NextPlayer(LoggedIn);
until (False);
WriteLn('No more active players!');
TerminateScript;
end.

We'll look at the whole "Break" thing later in the tutorial.

You just need to change the numbers between Players[Here] and change the const NumberOfPlayers = This;

Now, this script won't do anything more than log your players in and out over and over again, but you can easily build off of this!

We'll come back to this later, let's take a look at some SRL commands

LogInPlayer; - Call this after calling DeclarePlayers; to log in the current player.

MMouse(X, Y, RandomX, RandomY); Used to move the mouse to X, Y with a certain random range.

Mouse(X, Y, RandomX, RandomY, True); Used to move the mouse to X, Y with a certain random range and then left click if True, or right click if False.

Some text handling functions:

function ChooseOption(Text: string); this is used to choose an option as shown below (Note: you need to right click first before using to bring up the ChooseOption menu.

http://img512.imageshack.us/img512/4471/chooseoptiontt0.gif

Now if we wanted a script to do that we would mod part of our coal finding script to do this:

replace

if (FindCoal(X, Y)) then
MMouse(X, Y, 3, 3)
else
WriteLn('Did not find coal!');

with

if (FindCoal(X, Y)) then
begin
Mouse(X, Y, 3, 3, False);
Wait(200 + Random(100));
ChooseOption('Examine');
end
else
WriteLn('Did not find coal!');

It is very important to add that Wait because the options list will not come up instantly!

now our script should look like this:

program ExamineCoalExample;

{.Include SRL\SRL.SCAR}

var
X, Y: Integer;

function FindCoal(var X, Y: Integer): Boolean;
var
Coal: Integer;
begin
Coal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');
Result := FindDTM(Coal, X, Y, MIX1, MIY1, MIX2, MIY2);
FreeDTM(Coal);
end;

begin
SetUpSRL;
ClearDeBug;
FindRS;
ActivateClient;
Wait(2000);
if (FindCoal(X, Y)) then
begin
Mouse(X, Y, 3, 3, False);
Wait(200 + Random(100));
ChooseOption('Examine');
end
else
WriteLn('Did not find coal!');
end.

Next on our list is GetUpText and IsUpText, these two functions are used to get/ check text in the upper right hand corner of the runescape screen, this is useful because when we move the mouse over a lot of things in runescape it shows text i up in that corner!

http://img254.imageshack.us/img254/3958/isuptextfh6.gif

If we know what the text is, then we can know if our mouse is really in the right place! So let's apply this to some logic and our script!

if (FindCoal(X, Y)) then
begin
MMouse(X, Y, 3, 3);
Wait(200 + Random(100));
if (IsUpText('Coal')) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Wait(200 + Random(100));
ChooseOption('Examine');
end;
end
else
WriteLn('Did not find coal!');

You can see I put waits between some things because runescape isn't instant! also you will notice GetMousePos(X, Y) what this does is records the mouse's current position because we know if we have the text up that the mouse is in a good position, then we right click that position wait shortly and Choose the option Examine.

Next up is something I like to call game responding confirmers, these basically tell us that what ever we did in runescape actually worked. An example of this would be BankScreen: Boolean; if it returns True then we know for sure that the bank is open and that we didn't just click on it and have runescape not respond. Another good confirmer is InChat, what InChat does is checks text from that chat box:

http://img296.imageshack.us/img296/7296/getchatwb1.gif

what we could use to check to see if runescape responded is InChat('non-renewable'); now let's apply this to our script:

if (FindCoal(X, Y)) then
begin
MMouse(X, Y, 3, 3);
Wait(200 + Random(100));
if (IsUpText('Coal')) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Wait(200 + Random(100));
ChooseOption('Examine');
Wait(1000 + Random(500));
if (not (InChat('non-renewable')) then
WriteLn('RuneScape did not respond!');
end
else
WriteLn('Did not find coal text!');
end
else
WriteLn('Did not find coal!');

We'll come back later to make these new things we just learned even more useful later in the tutorial.

For now I am going to explain something that I briefly mentioned earlier... Global SRL constants!

Let's say, instead of everyone trying to remember the edge points to make boxes of the main game screens, why not just make them constants!? Well that's what SRL did, we here below will show picture and describe all of the SRL game screen constants:

http://img527.imageshack.us/img527/6601/runescapeclientby4.png

Those are the exact lines used by SRL as of Dec 24th 2007. Note: Measures are exact!

To use them it's pretty simple, let's say you wanted to find a color on the main screen:

FindColor(X, Y, Color, MSX1, MSY1, MSX2, MSY2);

on the mini-map:

FindColor(X, Y, Color, MMX1, MMY1, MMX2, MMY2);

in the inventory:

FindColor(X, Y, Color, MIX1, MIY1, MIX2, MIY2);

or even in the chat box:

FindColor(X, Y, Color, MCX1, MCY1, MCX2, MCY2);

You can see how these would be very very useful for scripting runescape!

Getting around to more complex looping, I have introduced only one type of loop the"repeat until" loop. There are 4 other types of looping:

for/ do
while/ do
goto/ label
procedure(s) calling themselfs or other procedures to form loops ect...

in this tutorial I'm only going to explain for/ do loops and while/ do loops because the others do not serve an efficient purpose, but if you want you can look them up on your own (gee! who'd ever thought I could do that :-P)

while/ do loops - similar to repeat/ until loops, while/ do loops work the opposite way instead of repeating until a condition is true, they repeat while a condition is true. Now the biggest question here is: how do you know which to use (while/do or repeat/ until), well this can be decided 1 of two ways:

The first way would be that you used repeat/ until because you would want to run the code in the loop at least once no matter what because the loop is not broken until the end. Now in while/ do loops the condition is checked before any code is run and each and every time before a new loop cycle is started.

The second way to decide is if it is more efficient to use while/ do loop because it would be more simplistic to just write

while (True) do
WriteLn('Hi!');

than

repeat
WriteLn('Hi!');
until (False);

because you could sum it all up on two lines without breaking any standard coding rules, but then again if you had to do more than one thing it would be most efficient to do repeat/ until because wouldn't need to use a begin/ end; clause:

while (True) do
begin
WriteLn('Hi!');
Wait(100);
end;

is less efficient than

repeat
WriteLn('Hi!');
Wait(100);
until (False);

for/ do loops

these are very very handy and efficient loops the first way to use it is using it with to:

for I := 0 to 5 do
WriteLn(IntToStr(I));

That will write in numbers 0 - 5, you could change it though to do for say... 3 - 60:

for I := 3 to 60 do
WriteLn(IntToStr(I));

Notice how it increases the variable used directly after for each time up to the number after to starting from the number before 2. What if we wanted to go in reverse order? We would use downto:

for I := 60 downto 3 do
WriteLn(IntToStr(I));

don't forget your begin end; clause if you need to do more than one thing:

for I := 1 to 5 do
begin
WriteLn(IntToStr(I));
Wait(100);
end;

I briefly showed you one of the loop operators in the SRL log in example script, Break; now Break is used to... well... break the loop! It can be used for all the types of loops that I showed you:

repeat
WriteLn('Hello!');
Wait(100);
if (Bored) then
Break;
until (False);

while (True) do
begin
WriteLn('Hello!');
Wait(100);
if (Bored) then
Break;
end;

for I := 0 to 100 do
begin
WriteLn('Hello');
Wait(100);
if (Bored) then
Break;
end;

Very simple, you can even call it all by itself, just put a Break; in there ;)

Next up is Continue; this only for for for/ do loops and it's used to skip a certain loop:

for I := 0 to 5 do
begin
if (I = 4) then
Continue;
WriteLn(IntToStr(I));
end;

You will notice it won't write out '4' because it skips it in the loop cycle with Continue; but it still gets to 5 because it does not end the loop like Break; does.

I wanted to show you four things earlier I did not mention with the case thing.

The first thing was, case works for more than just integers, here is an example of it being used for a string:

case (Weather) of //Weather is a string ;-)
'Sunny': WriteLn('Cool, good weather!');
'Rainy': WriteLn('Ah shit, bad weather!');
'Cloudy': WriteLn('Crap, it could rain =(');
end;

the second thing was the else operator:

case (Weather) of //Weather is a string ;-)
'Sunny': WriteLn('Cool, good weather!');
'Rainy': WriteLn('Ah shit, bad weather!');
'Cloudy': WriteLn('Crap, it could rain =(');
else
WriteLn('Hmmm, unique weather!');
end;

the third thing was the ability to use begin and end within these case statements:

case (Weather) of //Weather is a string ;-)
'Sunny': begin
WriteLn('Cool, good weather!');
Wait(100);
end;
'Rainy': begin
WriteLn('Ah shit, bad weather!');
Wait(100);
end;
'Cloudy': begin
WriteLn('Crap, it could rain =(');
Wait(100);
end;
else
begin
WriteLn('Hmmm, unique weather!');
Wait(100);
end;
end;

lastly was the ability to combine multiple things using a comma to basically make an or statement, this script below will use a for do loop and continue to skip a certain list of numbers:

var
I: Integer;

begin
for I := 0 to 100 do
case I of
1, 4, 6, 7, 24, 67, 81, 95, 99: Continue;
else
WriteLn(IntToStr(I));
end;
end.

var
I: Integer;

begin
for I := 0 to 100 do
case I of
1, 4, 6, 7, 24, 67, 81, 95, 99: Continue;
else
WriteLn(IntToStr(I));
end;
end.

Now moving on to utilizing our new loop making skills, SRL text functions, and previous knowledge so we can make even more advanced logic, also called failsafes!

Now Fail Safes are designed to make your script run longer! What we do is combine logic, loops, and SRL text stuff to make our functions and procedures more likely to accomplish the task at hand: for example let's say part of this failed:

if (FindCoal(X, Y)) then
begin
MMouse(X, Y, 3, 3);
Wait(200 + Random(100));
if (IsUpText('Coal')) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Wait(200 + Random(100));
ChooseOption('Examine');
Wait(1000 + Random(500));
if (not (InChat('non-renewable')) then
WriteLn('RuneScape did not respond!');
end
else
WriteLn('Did not find coal text!');
end
else
WriteLn('Did not find coal!');

Couldn't we do something to that to make it try to search again by looping or add some stuff that would help it run more efficiently with our loops, logic, and text functions? Well first let's take a look at our FindCoal function:

function FindCoal(var X, Y: Integer): Boolean;
var
Coal: Integer;
begin
Coal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');
Result := FindDTM(Coal, X, Y, MIX1, MIY1, MIX2, MIY2);
FreeDTM(Coal);
end;

notice how when you call FindCoal it loads the coal into memory then frees it again? Now is it all necessary to load and free more than once in a loop? No! It isn't so we are going to load the Coal once before our loops and free it once at the end of our loops, and for that we are going to need to make an entirely new function and get rid of FindCoal since that is the only way to do it.

lets start off with a fresh new script:

program ExamineCoal;

{.Include SRL\SRL.SCAR}

procedure SetUpScript;
begin
SetUpSRL;
ClearDeBug;
FindRS;
ActivateClient;
Wait(2000);
end;

function ExamineCoal: Boolean;
begin
end;

begin
SetUpScript;
if (not (ExamineCoal)) then
WriteLn('function ExamineCoal failed!');
end.

Now lets add the coal DTM:

function ExamineCoal: Boolean;
var
DTMCoal: Integer;
begin
DTMCoal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');
end;

Now lets add our DTM finder and our local variables:

function ExamineCoal: Boolean;
var
DTMCoal, X, Y: Integer;
begin
DTMCoal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');
FindDTM(DTMCoal, X, Y, MIX1, MIY1, MIX2, MIY2);
end;

Next I'm going to add a bunch of stuff then explain it:

program ExamineCoal;

{.Include SRL\SRL.SCAR}

procedure SetUpScript;
begin
SetUpSRL;
ClearDeBug;
FindRS;
ActivateClient;
Wait(2000);
end;

function ExamineCoal: Boolean;
var
DTMCoal, X, Y, I, II, III: Integer;
begin
DTMCoal := DTMFromString('78DA630C6662609066644006FA7AF20CFF8 13' +
'448F43F10300602D5F0A1AA81C8C248209D04542346404D2C 508D' +
'3201350140359A04D4B800D5C81150E30554238A5F0D007EE 308A' +
'0');
for I := 0 to 9 do
begin
if (FindDTM(DTMCoal, X, Y, MIX1, MIY1, MIX2, MIY2)) then
for II := 0 to 9 do
begin
MMouse(X, Y, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Coal')) then
begin
GetMousePos(X, Y);
for III := 0 to 9 do
begin
Mouse(X, Y, 0, 0, False);
Wait(200 + Random(100));
if (ChooseOption('Examine')) then
begin
Wait(1000 + Random(500));
if (InChat('non-renewable')) then
begin
Result := True;
WriteLn('Chat box text found, examination confirmed!');
end
else
WriteLn('Did not find chat box text, re-attempting choose option...');
end
else
WriteLn('Did not find choose option selection, re-attemping right click...');
end
else
WriteLn('Did not find "IsUpText" in the upper left corner, moving mouse around...');
end
else

end;

begin
SetUpScript;
if (not (ExamineCoal)) then
WriteLn('function ExamineCoal failed!');
end.

TUTORIAL STILL BEING MADE!!!

Wanted
07-09-2008, 04:32 PM
Reserved.

Wanted
07-09-2008, 04:43 PM
Spot 3 of 3 reserved.

Claymore
07-09-2008, 09:25 PM
FIRST!
Wow! If this is just one part of the Tutorial, GOD KNOWS what the 2nd and 3rd part will be.

I already learn all of the above, but the image of the MS, MI, MC one was really helpfull to me. infact i saved it incase i need help. ZOMG! i hope the next 2 parts will be released.

Maybe teach us (or just me) how to use TPA, like FindObjTPA. Because i have been told that function will surely get my Willow Chopper/banker script to chop willow more efficintly.

Timer
07-09-2008, 10:54 PM
Nice!

Laur€ns
07-10-2008, 03:42 PM
WOW. Massive tut.

Scaper
07-11-2008, 09:00 PM
wow man one nice ass tut god knows what the rest is gunna be like but know i can see what ya got that cup for ;)

nice tut man rep++

BobboHobbo
07-12-2008, 07:01 AM
Holy shiiiiiiiiiiit! Very nice!!!!!!

Claymore
07-12-2008, 07:25 AM
lol bobbohobbo , shit ain't holy...


But anyways i have a question, when i use a BitMap, is it true that Scar cant detect Black so scripters can use AutoColorThis(BitMap, etc...).

Wanted
07-13-2008, 05:54 AM
lol bobbohobbo , shit ain't holy...


But anyways i have a question, when i use a BitMap, is it true that Scar cant detect Black so scripters can use AutoColorThis(BitMap, etc...).

Um SCAR can detect black but uses it in bitmaps (when I say black I mean decimal number is 0) in bitmaps is used as a mask so that that part of the bitmap can be dynamic and adapt to any color with out it effecting the search (like if the background changed ect...)

Maybe I'm not quite sure what you're asking....

Anyways, @everyone! I'm working very hard to complete the tutorial and I am very busy in real life right now. SO I will try and get that out as soon as possible.

-IceFire

Rubix
07-13-2008, 05:23 PM
i suggest putting in chapter title type things, and i cant wait for TPA, need to learn them for my miner

Wanted
07-23-2008, 03:22 AM
i suggest putting in chapter title type things, and i cant wait for TPA, need to learn them for my miner

Ok, I'll add those.

Part 2 is almost done.

Rubix
07-23-2008, 08:05 PM
w00t hope array's might be in part 2

arc036
08-09-2008, 04:27 AM
thx for all the info, im folowing your tut all the way, cuz i like the way you go into detail

rep++

sink998
10-09-2008, 01:11 AM
Thanks man cant way to you go over forms.
and about forms does anyone know a way or tut that explains how after you press start of a form your script searches for a color(findcolor(b, bl, 555, 5, 5, 5, 5);
will click I get a run time exeption!!!! well hopefully icefire knows the answer

anonymity
10-20-2008, 04:44 AM
Hey, thanks for all of the info... I can't wait to see what else you are going to be posting up. Thanks and good luck to us all.

elobire
11-02-2008, 03:03 PM
neither the bitmap or DTM's will work for me i have done the same as in this tutorial but used my own DTM?

RuneItBack2Front
11-25-2008, 12:40 AM
I feel like I was just learning how to walk and now I can run a marathon. Very well written and easy to understand. I can actually do something usefull in script.

Rubix
11-25-2008, 02:26 AM
Are you ever going to put part 2 up?

Wanted
11-27-2008, 02:52 AM
Are you ever going to put part 2 up?

Yea I stopped working everything SCAR related for a while so it never came out but now I'm back so I should have p2 out in less than a week for sure.

mrpickle
12-03-2008, 02:07 AM
Dude, You rock. This visual aids helps much. Others have it, but it's often not the absolute complete thing.


RE{P!

Smarter Child
12-25-2008, 08:49 PM
Is a Part 2 going to come out>?

I'm looking forward to map walking and TPA's especially since your visual Aid really helps the viewer understand it in a format that anybody can understand.:p

Repped~

matthewbeauman
01-09-2009, 06:49 PM
Wow Man Very Informative. Must sat all the time and effort put into this, well lets just say it is very legendary of you. Thanks Rep ++ !

mazo1
02-24-2009, 08:37 PM
Ok great tut but i have no idea what u are writing ok i learnt the basic one from your frist tut but i missed out alot of steps coz u kept on saying not for runescape ok please go back and make heading say for runescape or not since im just willing to script runescape and your driving my head crazy lol the tut sounds good and stuff but is very confusing coz you have bits in bracket saying (do not use for runescape) and then you dont put in heading to say use for runescape you get me?

Wanted
02-25-2009, 05:39 AM
Ok great tut but i have no idea what u are writing ok i learnt the basic one from your frist tut but i missed out alot of steps coz u kept on saying not for runescape ok please go back and make heading say for runescape or not since im just willing to script runescape and your driving my head crazy lol the tut sounds good and stuff but is very confusing coz you have bits in bracket saying (do not use for runescape) and then you dont put in heading to say use for runescape you get me?

The idea of the tutorial is to teach you concepts, some of the concepts are applied to runescape... just look through some already made scripts and you'll see what I mean.

Vital
02-25-2009, 04:56 PM
This is the best SCAR/SRL guide I ever read at forums here and others. ty!!

mazo1
02-25-2009, 05:21 PM
The idea of the tutorial is to teach you concepts, some of the concepts are applied to runescape... just look through some already made scripts and you'll see what I mean.


Ok one more thing see when i make my dtm i get my code like this:


DTM := DTMFromString('78DA6314656060E0634001293116609A11C A6' +
'79402124C0C688011558D12901026A0861B48481050C30A24 7809' +
'A81100126CF8D5000028E601C9');

btw im makeing a mage cutter but anyways when i get that i stick it under begin and compile and i get failed at line 14 coz thats were i put the dtm ikno thats not it ikno i need to add integer but im makeing sure see if i get error at that stage when compileing what have i done wrong?

Ron
05-30-2009, 12:08 AM
You made a small mistake with div.



div - Key word used to divide numbers while removing the remainder.
Here is an example of removing the remainder:

5 div 2 = 4
10 div 3 = 3


5 div 2 = 2


program New;
begin
ClearDebug;
WriteLn( IntToStr( 5 div 2 ) );
end.


Here are some suggestions.
- You can also add an else to a case statement.
- Instead of taking a screenshot, pasting it in paint, saving it, and then loading it into scar, you can instead hit the Print Screen button, click on Tools > Picture to String, and then hit the button paste.

Nice tutorial. Keep up the good work!

~Ron

Wanted
07-16-2009, 11:05 AM
You made a small mistake with div.



5 div 2 = 2


program New;
begin
ClearDebug;
WriteLn( IntToStr( 5 div 2 ) );
end.


Here are some suggestions.
- You can also add an else to a case statement.
- Instead of taking a screenshot, pasting it in paint, saving it, and then loading it into scar, you can instead hit the Print Screen button, click on Tools > Picture to String, and then hit the button paste.

Nice tutorial. Keep up the good work!

~Ron

I didn't catch that div thing thanks!

Not everyone's print screen key button works so I did the noob-proof way... I figured if anyone got that far they would be smart enough to do their own ways. I did have an else statement in the case with the weather one, I guess I didn't explain it very well though.

If you notice anything else don't hesitate to leave a reply! Thanks again Ron.

I'm working on part two still, seeing as it is massive... for all you patient people out there I don't know how long it's going to take but I can say progress is good. :)

Zyt3x
07-17-2009, 04:34 AM
Woah, that is awesome! Good job!

Rubix
07-17-2009, 04:42 AM
So when will part 2 be done? XD

Cartmann
09-07-2009, 10:24 PM
Vote for *STICKY*!
I find the "then expect" part abit confusing thouge :S?

Sabzi
09-07-2009, 10:48 PM
Vote for *STICKY*!
I find the "then expect" part abit confusing thouge :S?

I try to make it more clearly(haven't read the tutorial, though).

After try you place the actual thing you are trying to do. This thing is often something that can fail and cause a runtime error. So when it would cause a runtime error the script jumps to the except part and will do that so no runtime error.
The finally part can be skipped like this:
try
something;
except end;
would work. If the thing we tried doesn't work we won't do anything.
The finally part will be always executed no matter what happens.

Correct me if I'm wrong, please.

Wanted
09-07-2009, 10:55 PM
Yes try and except is for run time errors and isolating them or fixing them.

lordsaturn
06-08-2010, 07:22 PM
Bump... Would like to see this completed :)

Matsetst
06-08-2010, 11:49 PM
Bump... Would like to see this completed :)

This is a tutorial which I can understand ;) dont know if it still works this way ?

Ace257
07-06-2010, 07:13 AM
thank you this tut helped a lot! :)

Tickyy
08-07-2010, 10:49 PM
I would give you an expert tutorial writer cup :p... fantastic job dude. Even now i learned something :redface:, would love to see it Finished:D.

E: How did you make these gifs? I know how to make some short ones, but this looks like a video ^^

apx900
08-11-2010, 01:04 PM
Epic tutorial dude!! cant wair till the next 2 parts

Yush Dragon
08-12-2010, 11:48 PM
Nice Tutorial ;)
waiting to see more :D

live4evil
08-16-2010, 10:10 PM
Cmon guys its been 2 years he shall NEVER finish it!

Yush Dragon
08-17-2010, 10:02 PM
Lmao xD
still maybe he will :o
hope so :P

litoris
08-28-2011, 07:25 PM
*Sorry, massive gravedigging but I just saw the OP post somewhere :P*
The bitmap stuff explained here will work with Simba, right?

Wanted
08-28-2011, 08:32 PM
*Sorry, massive gravedigging but I just saw the OP post somewhere :P*
The bitmap stuff explained here will work with Simba, right?

There's no reason I can think of that it wouldn't.

Sax
10-13-2012, 06:25 PM
I know he got banned but is there any continuation of this tutorial or a similar tut?

Zyt3x
10-13-2012, 06:33 PM
Doubt it, but there's still other great tutorials out there who can teach you basically the same stuff :)

NKN
10-13-2012, 06:34 PM
That Gravedig...

Zyt3x
10-13-2012, 06:36 PM
That Gravedig...It's in the Outdated Tutorial section, so I recon it doesn't really matter

litoris
10-13-2012, 06:39 PM
I know he got banned but is there any continuation of this tutorial or a similar tut?

I actually remember learning from this tut when starting to learn scripting. If you are clear with msot of teh things explained here, you should start to examine people's scripts. Reading through even outdated scripts is good for learning if they are commented well.

Other than that, I suggest you read this DTM tut (http://villavu.com/forum/showthread.php?t=77691), it covers a lot, and then just try to make a script! Start off slowly at first, like try to find items in the inventory and click them, then move onto the main screen and try finding rocks for example. There are lots of tuts in these sections.

Sax
10-14-2012, 04:21 PM
I actually remember learning from this tut when starting to learn scripting. If you are clear with msot of teh things explained here, you should start to examine people's scripts. Reading through even outdated scripts is good for learning if they are commented well.

Other than that, I suggest you read this DTM tut (http://villavu.com/forum/showthread.php?t=77691), it covers a lot, and then just try to make a script! Start off slowly at first, like try to find items in the inventory and click them, then move onto the main screen and try finding rocks for example. There are lots of tuts in these sections.

thank you . i have actually read many tuts including that one and I have started to make some inventory and bank examining scripts and I think I need to start to make some scripts that actually do something useful. Currently Im trying to get more experience by reading TPAs and CTS tuts and then Ill try to make my own script.

Rezozo
10-14-2012, 04:26 PM
thank you . i have actually read many tuts including that one and I have started to make some inventory and bank examining scripts and I think I need to start to make some scripts that actually do something useful. Currently Im trying to get more experience by reading TPAs and CTS tuts and then Ill try to make my own script.

GL bro! You already probably know more than me about scripting here lol.
If you do need help though, feel free to ask anyone but me :)
JK :P