PDA

View Full Version : The Basics Tutorial



Richard
02-22-2008, 09:21 PM
The Basics Tutorial

Note: I recomend that you read the "How To Auto" section before reading this.

Contents:

1: When you open up SCAR

2: Procedures

3: Basic Functions

4: Logging in Players

5: Giving extra information to the user



When you open up SCAR

When you first open up SCAR you will get something that looks like this:
program New;
begin
end.

The "program New;" should be the very first thing in your script, it is the name of your script (or program), you should change the "new" bit to something that is relavent to your script, but it MUST NOT have any spaces. The "begin" is the beginning of you program, known as the "main loop", this will do the set functions/procedures in the set order. This will always be near the end of your script. The "end." is the end of your script, this will be the very last thing in your script. The "." means that the script will terminate when it gets to this point. The peices of the program are put inbetween the "begin" and "end.".


Procedures

These are basically little mini programs in your script that you will put into you main loop so your main loop doesn't get over crowded. They are shown quite similarly to how SCAR is shown when opened up:

Procedure New;
Begin
end;

Like at the beginning you rename the new to something relavent with that procedure. You may notice that the "end" has a semicolon( ; ) instead of a fullstop at the end of it. This means that when it gets to the end it justs ends the procedure, not the whole script. Like the main loop the functions go inbetween the begin and end.


Basic Functions

This is where you can get SCAR to actually do things. I will only tell some of the most basic functions to get you started but if you want more advanced procedures then go to the intermediate sections in the tuts.

Mouse Movement
Mouse(X, Y, X2, Y2);
This will mouse the mouse to the coordinates of X and Y will the randomness of X2 and Y2. To get certain coordinates just use the colour-picker and it will tell you the coordinates of where you clicked. Usually you would use about 5 in the X2 and Y2 as that is a good enough off-put (well, I think so).

Waiting
Wait(time + random(time));
This will wait the set time before moving onto the next functions. Put the time you want to wait in the first "time" in milliseconds (1/1000 of a second) and the random time in the second "time" bit.

Writing in Debug box
WriteLN('Text here');
This will type the text you put in the place where the "Text here is" and you must always have to apostrophes either side of the text.

Writing on Runescape
TypeSend('Text here');
This will type the text you specify in the "Text here" bit into the client you are using.


Logging in Players

This next bit is where you can get you script to log in your player. But to do this you will next to tell SCAR the username and password of your account(s). You normally do this by having a procedure that declares the players, and you do it normally like this.
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;


Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Nickname';
Players[0].Active := True;
end;

I think you can tell that the Name and Pass is where you put your name and pass. The Nick bit is how SCAR searches for randoms, you put in 3 letters in from your username that are all together, cant have spaces and it can't have the first letter of your name in it. The Active bit shows whether you are using this account of not, True means yes, False means no.

The next bit you need it to have LoginPlayer near the begining of you main loop, before you do the bit where you are logged into runescape. What you should include before that is "ActivateClient" this will activate the client so you don't have to switch windows.

If you want to add an area for a certain ammount of loads for example you would put

Players[0].Integers[0] := 0;

But you would change the 0 to another number if you had more than 1 of them

Its pretty much the same thing if you want something to do with writing, you just change the integers bit to strings

Players[0].Strings[0] := '';

And like with integers, you would change the last number to some other number if you had more than 1 of them


Giving extra info to the user

To give extra information to the user is quite simple, you can either use the curly brackets {} or you 2 or more slashed. Doing either of these means that SCAR will not include that writing into the script, it will basically ignore them and move on.

Example of brackets:

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;


Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Nickname';
Players[0].Active := True;
{This is where you put in you playe information for the script}
end;

Example of slashes
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;//How many players you are using
NumberOfPlayers(HowManyPlayers);//Leave this please
CurrentPlayer := 0;//Starting player


Players[0].Name := 'Username';//Username here
Players[0].Pass := 'Password';//Password here
Players[0].Nick := 'Nickname';// 3 letter of you name here
Players[0].Active := True;//Whether you are using this player
end;

See? Giving extra information is pretty simple and very useful.




Thanks for reading my tut and I hope that it helped you begin you first script!

Cazax
02-22-2008, 09:27 PM
Will help others http://i248.photobucket.com/albums/gg164/cazax/happy.jpg

You should explain more becouse when you start scripting , you dont understand nothing.

Richard
02-22-2008, 09:28 PM
I though I woudn't need to explain that much more because they should read the "How To Auto" section first.

Cazax
02-22-2008, 10:10 PM
I though I woudn't need to explain that much more because they should read the "How To Auto" section first.

Some people start reading at begginer tuts not at how to auto :p

Richard
02-22-2008, 10:17 PM
I shall add a bit at the top to direct them :p

Naum
03-03-2008, 04:57 PM
Good tut dude richard.
+rep!

Richard
03-03-2008, 06:21 PM
Thanks Naum, I though this was going unnoticed... thanks for rep and I think I've given enough out so I can give it back like I wanted to a while ago :D

EDIT: I have :)

Richard
03-13-2008, 05:38 PM
68 views and only 2 different people havre replied, both of which already know this...

Torrent of Flame
03-13-2008, 06:02 PM
Same with me and my Guide to chopping/banking.


And in all fairness Dude, there is alot of tutorials explaining this stuff aswell.

Maybe people just go for the popular TUT's

Ashur2Good
03-14-2008, 07:49 AM
Nice guide, but i picked this up

WriteIn, isnt it writeln? :P


-Ashur

Richard
03-15-2008, 05:15 PM
It is writeln, thats what I wrote

WhoCares357
03-15-2008, 05:22 PM
Mouse(X, Y, X2, Y2);

Should be either MMouse(x, y, x2, y2) or Mouse(x, y, x2, y2, button).

To be honest, the tutorial is a little too simple. I think that you ended too quickly with the DeclarePlayers; procedure. After all, if someone doesn't know how to script, they should learn how to script first and how to script with SRL in mind second.

Still, any tutorial is welcome. It may help someone. Thanks for writing it.

Richard
03-15-2008, 07:22 PM
Should be either MMouse(x, y, x2, y2) or Mouse(x, y, x2, y2, button).

To be honest, the tutorial is a little too simple. I think that you ended too quickly with the DeclarePlayers; procedure. After all, if someone doesn't know how to script, they should learn how to script first and how to script with SRL in mind second.

Still, any tutorial is welcome. It may help someone. Thanks for writing it.

I was just running over the basic stuff, I'll add on the DeclarePlayers now if you think it needs more then.