Bego
07-02-2006, 09:17 PM
I dug this tutorial up that I wrote a long time ago, and it got lots of attention, because when I started SCAR, I had absolutely no previous programming experience, and I had to have tutors to learn because their was next to no tutorials for SCAR and the ones that their were didn't talk like I had no idea what a variable is, they expect you to know what everything means. I made this for COMPLETE noobs, like 12 year old people with no previous programming experience and alot of people learnt from this.
Of course, under those circumstances, within 2 months I could make a flawless shitty script, I'm a fast learner, but regardless, here is the tutorial. (This doesn't go in depth like Rs Monkeys but reading this, then his, would probably make a PERFECT combination, his doesn't explain everything and talk to you, it talks to himself and says things that are above people who have never seen or tried programming!)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.freewebs.com/scriptingtut/
In this tutorial you should learn all the basics in scripting, this took a while to make and is Copyright© Bego. Everytime it talks about something new it will be seperated by ----, === is a whole new catagory. When I put things that make no sense, like color it means they are that thing, (ex. color means you put the color there)
------------------------
Syntax
Ok, to start off, to make a script, you would make a name, right? The name HAS to have no spaces, so if you open up scar, you will most likely see this:
http://img328.imageshack.us/img328/717/beginscar0xb.png
Where it says program New;, you should make it say something relevent to what your doing, so if your making an autominer, go like this:
Program Autominer;
It has to have a semicolon after it, or else you will get an error. Moving on.
-------------------------------------
Includes
There are many different includes for SCAR, some of which are very helpful, such as Si.scar, and Squig.txt. Go to File > Download Includes and get all of them. Read through a couple of them, they will be in your includes folder which is most likely in C:\Program Files\SCAR 2.03\Includes. As you read through them you might notice things like:
Function GetStat(stat : String; top : Boolean) : Integer;
Don't let how complicated that looks fool you, its actually very simple. See the Function is nothing, it just tells SCAR what that is, in this case its a function. The Getstat is what you need to worry about. Theres most likely instructions on what each function/procedure does and how to use them. With Getstat this is what it says:
{^^^^^^^^^^^^^^^^^ GETSTAT ^^^^^^^^^^^^^^^^^^^^^^^^}
{Opens the stat panel If needed. The variable stat is the name Of the
stat your wanting To retrieve And If top is true it will get the current
stat, If its false it will get the max stat}
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^}
Function GetStat(stat : String; top : Boolean) : Integer;
Followed by a BUNCH of code (Thats a function in Squig.txt). All you would have to say in YOUR script would be something like this:
Getstat(<the stats name>, true)
And that will get the current number of the stat you specified.
In other things, their called PROCEDURES. While looking through an include you might find a procedure something like this for example:
{^^^^^^^^^^^^^^^^^ OPENSTATS ^^^^^^^^^^^^^^^^^^^^^^}
{Opens the stat panel}
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^}
Procedure OpenStats;
Thats simple. In your main script just type OpenStats; and that would open the stats tab if you were using this particular include.
Ok, I have explained to you just now what includes do and how to understand them, but right now I will teach you how to include them in your script. Its simple actually, right under your program Autominer; or whatever it is, put this:
{.include <include name>} (ex. {.include Si.scar} )
Simple right? Moving on.
------------------------------
Variables
The next thing you would have to do is declare the variables you are going to use. I know that sounds confusing, but I just made it sound like that for now. I will explain it. Variables like x and y hold numbers, and such. Example:
Findcolor(x,y,<color>,coordinates)
The x and y in there will save the coordinates of where it found the color.
You declare variables like this:
Var x,y
But thats not all. You can declare certain variables as Booleans, Strings, or Integers. Booleans meaning true or false. Strings meaning words. Integers meaning things like x and y.
To declare x and y as Integers you would have to go like this:
http://img397.imageshack.us/img397/592/var5fj.png
And that would declare them as integers. You put all that under your include. Moving on.
----------------------
Constants
Constants do not NEED to be used, but they are good for giving the user of the script flexability on what they are doing. Constants are things that stay the same throughout the whole script. A scripter might do something like this:
http://img328.imageshack.us/img328/5893/const3dh.png
You get colors by using the dibber in scar and putting it on the color and clicking, that should give you a bunch of numbers in the debug box below the main script.
You declare Constants by going like this:
Const
And to add things to the Const you would make things related to your script like this:
MonsterColor=453344;
You have to have a = and then the value (number, string, boolean) and then a semicolon. Why is this useful in a script you ask? For a user to put in the color of the monster, it would change the value in the big script itself, example:
Findcolor(x,y,MonsterColor,<coordinates>)
Moving on.
-------------------
Procedures
In your script you have to name your procedures to something relevant to what your doing. Since you've got your script set up up there, you now need to start scripting the actual script. This is what you do:
Procedure name; (ex. Procedure mine; )
Begin
http://img397.imageshack.us/img397/593/proc7ka.png
It has to have a semicolon, and after the procedure name, you have to have a Begin because that will tell the script that the procedure will then begin.
A procedure always has to end with this:
End;
The semicolon tells the script that your ending the PROCEDURE.
Moving on.
-----------------------
Making The Script Do What You Want
There are THOUSANDS of things that you can do, I will only name a couple basic things.
FINDCOLOR
Findcolor(x,y,color,cords,cords,cords,cords)
This is how that works. You put Findcolor(x,y, in your script, the x,y will save the coordinates of where it found the color, then the color of the thing your looking for, then you put coordinates searching in a box, so you would put top left corner coordinates, then bottom right, and that would search in a box. You get coordinates by using the dibber in SCAR then dragging it to the place and left clicking. That will come up with 2 three to one digit numbers. YOU HAVE TO ALWAYS HAVE THE SCREEN TARGETTED BY DRAGGING THE CROSSHAIRS TO THE RS SCREEN TO GET COORDINATES.
Example:
http://img397.imageshack.us/img397/3146/findcolor2qn.png
FINDCOLORSPIRAL
Findcolorspiral(x,y,color,cords,cords)
Thats a little bit different from Findcolor. It will search for the color from the coordinates you set outward until it finds it. Generally faster if your searching for something thats closer to the middle of the screen always.
http://img397.imageshack.us/img397/509/findcolorspiral0eq.png
[u]FINDCOLORTOLERANCE
Findcolortolerance(x,y,color,cords,cords,cords,cor ds,tol)
Thats a little bit different from Findcolor, but exactly the same except theres tolerance. Tolerance when its referring to color is lets say theres a color (340) and there was a bunch of similar colors around it such as 350, you would put the tolerance to 10 and it would search for colors 340 + 10, but normally you would set the tolerance to around 30 or 40.
http://img397.imageshack.us/img397/2196/findcolortolerance8lf.png
FINDCOLORSPIRALTOLERANCE
This uses FindColorSpiral but it has tolerance (read Findcolortolerance).
http://img397.imageshack.us/img397/336/findcolorspiraltolerance4gt.png
!!PROCEDURES FROM INCLUDES!!
MOUSEC
MouseC(x,y,1) -FROM SQUIG-
That will move the mouse human like to the coordinates you set. You can use x,y after you do a findcolor, for example:
Findcolor(STUFF)
MouseC(x,y,1)
That will click on the color. 1 is left click, 2 is right click, 0 is no click, meaning it will just move the mouse.
GAMETAB
Gametab(tab number) -FROM SI-
Will click on the specified gametab:
Gametab(4) = Inventory
Gametab(5) = Next
Ect.
CLICKTEXT
ClickText('text',cords,cords,cords,cords) -FROM SQUIG-
That will search for the text you put in on the RS screen in the coordinates you set then click on it. The coordinates are in a box. (See Findcolor) The text is CASE SENSITIVE.
MUCH MORE!
There are thousands of procedures, but I won't name them all, you will have to figure them out yourselves, by looking through the includes and in SCAR help.
Moving on.
---------------
The Different Types Of Ends
There are 3 different types of Ends, but only 1 type of Begin, weird eh?
End - Will end a begin in the middle of a procedure, for example (If (blah) Then Begin)
End; - Will end a procedure.
End. - Will end the script altogether.
Your ends always have to add up to how many begins you put.
Moving on.
-------------
The Main Loop
This is where you tell your script what exactly to do.
To start the main loop you don't need a procedure name, all you need is a Begin.
After all your procedures are done and your script does what you want, you need to put this:
Begin
main loop
End.
Your main loop can consist of ANYTHING. For example, if you were going to run Squig, you would have to put SetupSquig; in your main loop before anything else. Also if you wanted to repeat your procedures until a certain time you would do something like this:
Begin
Repeat
procedures
a:=a+1
Until(a=number or constant)
End.
Sounds complicated? Its really not! This is what that up there would do. It would repeat the procedures you named, and everytime it repeated all of them, it will add an 'a', and it would keep repeating UNTIL a= a number or a constant. Remember when I taught you wayyy up at the top about constants? Well yoiu could put something like LoadsToDo=2; in your const, and everytime it repeated the procedure, it would add an 'a', then when a=LoadsToDo, you can make it do what you want. But of course, if you used A, you would need to declare A as a variable (see Variables).
In most of my scripts, after a= whatever, I use a procedure in most includes called Logout;, that would log your character out of RuneScape. Then I do something like this:
Writeln('Loads to do reached, logged out')
End.
That would say the text in the dialogue box so the user knows whats going on and End. would end the script completely, once and for all.
So a pretty good main loop would look like this:
Begin
Repeat
procedures
a:=a+1
Until(a=loadstodo)
Logout;
Writeln('Loads to do done, logged out')
End.
Moving on.
----------------
Common Errors
Since I have taught you alot about scripting so far, you should hopefully know how to script. Now I will help you with some common frustrating errors of scripting.
Duplicate Identifier
That means that there is two of the same kind of variables. You are most likely using an include that already has the variables that you declared, just removed the duplicate variable from your script.
Invalid Parameters
You didn't make the procedure right. For example, MouseC, you need to go Mousec(x,y,1) but you only put MouseC(x,y), thats invalid.
BEGIN Expected In Script
Your missing a begin, most likely after your procedure name.
Period '.' Expected In Script
You are missing a period, most likely at the end of your script.
Runtime Error
You don't have an updated version of the include, or you didn't set up the include like your supposed to.
------------------
Statements
There are lots of things in SCAR that help tell about them. One of them is statements. Statements are things like and, if, else, then, is, not, to, or, and until.
Until would help you wait until whatever, if (something) then is what if and then is used for. Or is used for like lets say you wanted to find 2 colors, it can be findcolor and/or, also else means everything else, is means is it there, or something like that, and not means like not there.
================================================== ==============
Making The Script
In this TOTALLY new catagory, I will teach you actually how to make the script using an example. Hopefully by now you will know how to script, well now you will learn how to implement what you know in a script.
Getting started, ok, well you should already know how to script, open up SCAR, and delete everything thats in there. You done? Good. Now the first thing you should know is you have to make a program name first, right? We will be making a simple Autominer. So type something like this in SCAR:
Program Autominer;
Ok, now lets move on to the next part of scripting.
You will need to use an include, we will be using Si.scar in this script. You better know how to do this, if you don't, this is what you do:
{.include Si.scar}
Your whole script should now look like this:
Program Autominer;
{.include Si.scar}
If it isn't, change it. Moving on.
We will be using the variables x,y in this script, for Findcolor, so please hit enter twice after the include and type this:
Var x,y : Integer;
That will declare x and y as integer variables (I know, when I was first learning about variables I got lost, it takes a bit of practice). Your whole script should now look like this:
Program Autominer;
{.include Si.scar}
Var x,y : Integer;
If it doesn't, change it.
Moving on, we will now be actually telling the script what to do in procedures.
We are making a procedure that will mine the rock, simple right? Of course it is. This procedure is going to contain alot of what you learned, so pay attention. Press enter twice after the variables and type this:
Procedure minerocks;
Begin
Your whole script should now look something like this:
Program Autominer;
{.include Si.scar}
Var x,y : Integer;
Procedure minerocks;
Begin
The Begin after the procedure will tell SCAR that the procedure has begun.
Now we will get to REALLY telling SCAR what to do, this will start using actual procedures from Si.scar and built in ones in SCAR.
Under the begin, we will type this:
Findcolor(x,y,54323,5,5,515,340)
Mouse(x,y,1,1,true)
Don't worry, I'm not gonna lose you, I just decided to take two steps ahead this time. This is an explanation of what that does: The Findcolor will find the color (the numbers that I put after the x,y NOTE: That is not a real color) of the rock, and the 5,5 is the top left corner of the main screen and the 515 340 is in the bottom right, making the script search in a box for the color.
Mouse (PROCEDURE OF SI) will move the mouse to the color like a human, then left click. See, on Findcolor we have an x,y, that will save the coordinates that the script found the color of to them, then Mouse(x,y will move the mouse to the coordinates whereever they are. The 1,1 in Mouse is tolerance, that will either subtract 1 or +1 coordinate to the x,y for randomness, you can put this higher. The true means left click, false would make it right click.
This is what your whole PROCEDURE should look like:
Procedure minerocks;
Begin
Findcolor(x,y,54323,5,5,515,340)
Mouse(x,y,1,1,true)
Change it if it doesn't. Moving on to the next part.
Now under mouse, you will want it to wait while your mining the rock, right? I never have showed you this, but theres a function built in SCAR that allows you to set a wait time in MILLISECONDS. So right under the Mouse put this:
Wait(5000)
That will make the script wait for 5 seconds while you mine the rock. There are more accurate and better ways of actually knowing how to make the script know when the rocks gone, but since your most likely a newbie, I won't say.
Your whole procedure should now look like this:
Procedure minerocks;
Begin
Findcolor(x,y,54323,5,5,515,340)
Mouse(x,y,1,1,true)
Wait(5000)
Good, now you've got a functional autominer, now end this procedure.
That should mine the rocks until you got a full load and then keep going, to make it do something else you would have to add more, but that uses alot of what you know.
Your whole script should now look like this:
Program Powerminer;
{.include Si.scar}
Var x,y : Integer;
Procedure minerocks;
Begin
if(Findcolor(x,y,54323,5,5,515,340))then
begin
Mouse(x,y,1,1,true)
Wait(5000)
end;
End;
When using procedures that return a value, such as true, you should always use if and then statements!
That won't work as it doesn't have a main loop, but you should know how to add one.
Theres my tutorial, the rest is just information.
-----------------------
Links
http://www.fagex.net/ - Cheating community
http://www.sythe.org/ - Cheating community
http://www.kaitnieks.com/ - Cheating community/the creator of SCAR's website
http://www.dylock.net/scar/ - Official SCAR download site
----------------
Contact Me
AIM: begomyego
YIM: claytan2003
ICQ: 248642332
--------------
This guide was created by the scripter Bego of Fagex, Sythe, and many other cheating communities.
This is CopyRight© and any distribution of this guide without credits given to me I will take action. You may not edit/alter anything in this guide.
Of course, under those circumstances, within 2 months I could make a flawless shitty script, I'm a fast learner, but regardless, here is the tutorial. (This doesn't go in depth like Rs Monkeys but reading this, then his, would probably make a PERFECT combination, his doesn't explain everything and talk to you, it talks to himself and says things that are above people who have never seen or tried programming!)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.freewebs.com/scriptingtut/
In this tutorial you should learn all the basics in scripting, this took a while to make and is Copyright© Bego. Everytime it talks about something new it will be seperated by ----, === is a whole new catagory. When I put things that make no sense, like color it means they are that thing, (ex. color means you put the color there)
------------------------
Syntax
Ok, to start off, to make a script, you would make a name, right? The name HAS to have no spaces, so if you open up scar, you will most likely see this:
http://img328.imageshack.us/img328/717/beginscar0xb.png
Where it says program New;, you should make it say something relevent to what your doing, so if your making an autominer, go like this:
Program Autominer;
It has to have a semicolon after it, or else you will get an error. Moving on.
-------------------------------------
Includes
There are many different includes for SCAR, some of which are very helpful, such as Si.scar, and Squig.txt. Go to File > Download Includes and get all of them. Read through a couple of them, they will be in your includes folder which is most likely in C:\Program Files\SCAR 2.03\Includes. As you read through them you might notice things like:
Function GetStat(stat : String; top : Boolean) : Integer;
Don't let how complicated that looks fool you, its actually very simple. See the Function is nothing, it just tells SCAR what that is, in this case its a function. The Getstat is what you need to worry about. Theres most likely instructions on what each function/procedure does and how to use them. With Getstat this is what it says:
{^^^^^^^^^^^^^^^^^ GETSTAT ^^^^^^^^^^^^^^^^^^^^^^^^}
{Opens the stat panel If needed. The variable stat is the name Of the
stat your wanting To retrieve And If top is true it will get the current
stat, If its false it will get the max stat}
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^}
Function GetStat(stat : String; top : Boolean) : Integer;
Followed by a BUNCH of code (Thats a function in Squig.txt). All you would have to say in YOUR script would be something like this:
Getstat(<the stats name>, true)
And that will get the current number of the stat you specified.
In other things, their called PROCEDURES. While looking through an include you might find a procedure something like this for example:
{^^^^^^^^^^^^^^^^^ OPENSTATS ^^^^^^^^^^^^^^^^^^^^^^}
{Opens the stat panel}
{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^}
Procedure OpenStats;
Thats simple. In your main script just type OpenStats; and that would open the stats tab if you were using this particular include.
Ok, I have explained to you just now what includes do and how to understand them, but right now I will teach you how to include them in your script. Its simple actually, right under your program Autominer; or whatever it is, put this:
{.include <include name>} (ex. {.include Si.scar} )
Simple right? Moving on.
------------------------------
Variables
The next thing you would have to do is declare the variables you are going to use. I know that sounds confusing, but I just made it sound like that for now. I will explain it. Variables like x and y hold numbers, and such. Example:
Findcolor(x,y,<color>,coordinates)
The x and y in there will save the coordinates of where it found the color.
You declare variables like this:
Var x,y
But thats not all. You can declare certain variables as Booleans, Strings, or Integers. Booleans meaning true or false. Strings meaning words. Integers meaning things like x and y.
To declare x and y as Integers you would have to go like this:
http://img397.imageshack.us/img397/592/var5fj.png
And that would declare them as integers. You put all that under your include. Moving on.
----------------------
Constants
Constants do not NEED to be used, but they are good for giving the user of the script flexability on what they are doing. Constants are things that stay the same throughout the whole script. A scripter might do something like this:
http://img328.imageshack.us/img328/5893/const3dh.png
You get colors by using the dibber in scar and putting it on the color and clicking, that should give you a bunch of numbers in the debug box below the main script.
You declare Constants by going like this:
Const
And to add things to the Const you would make things related to your script like this:
MonsterColor=453344;
You have to have a = and then the value (number, string, boolean) and then a semicolon. Why is this useful in a script you ask? For a user to put in the color of the monster, it would change the value in the big script itself, example:
Findcolor(x,y,MonsterColor,<coordinates>)
Moving on.
-------------------
Procedures
In your script you have to name your procedures to something relevant to what your doing. Since you've got your script set up up there, you now need to start scripting the actual script. This is what you do:
Procedure name; (ex. Procedure mine; )
Begin
http://img397.imageshack.us/img397/593/proc7ka.png
It has to have a semicolon, and after the procedure name, you have to have a Begin because that will tell the script that the procedure will then begin.
A procedure always has to end with this:
End;
The semicolon tells the script that your ending the PROCEDURE.
Moving on.
-----------------------
Making The Script Do What You Want
There are THOUSANDS of things that you can do, I will only name a couple basic things.
FINDCOLOR
Findcolor(x,y,color,cords,cords,cords,cords)
This is how that works. You put Findcolor(x,y, in your script, the x,y will save the coordinates of where it found the color, then the color of the thing your looking for, then you put coordinates searching in a box, so you would put top left corner coordinates, then bottom right, and that would search in a box. You get coordinates by using the dibber in SCAR then dragging it to the place and left clicking. That will come up with 2 three to one digit numbers. YOU HAVE TO ALWAYS HAVE THE SCREEN TARGETTED BY DRAGGING THE CROSSHAIRS TO THE RS SCREEN TO GET COORDINATES.
Example:
http://img397.imageshack.us/img397/3146/findcolor2qn.png
FINDCOLORSPIRAL
Findcolorspiral(x,y,color,cords,cords)
Thats a little bit different from Findcolor. It will search for the color from the coordinates you set outward until it finds it. Generally faster if your searching for something thats closer to the middle of the screen always.
http://img397.imageshack.us/img397/509/findcolorspiral0eq.png
[u]FINDCOLORTOLERANCE
Findcolortolerance(x,y,color,cords,cords,cords,cor ds,tol)
Thats a little bit different from Findcolor, but exactly the same except theres tolerance. Tolerance when its referring to color is lets say theres a color (340) and there was a bunch of similar colors around it such as 350, you would put the tolerance to 10 and it would search for colors 340 + 10, but normally you would set the tolerance to around 30 or 40.
http://img397.imageshack.us/img397/2196/findcolortolerance8lf.png
FINDCOLORSPIRALTOLERANCE
This uses FindColorSpiral but it has tolerance (read Findcolortolerance).
http://img397.imageshack.us/img397/336/findcolorspiraltolerance4gt.png
!!PROCEDURES FROM INCLUDES!!
MOUSEC
MouseC(x,y,1) -FROM SQUIG-
That will move the mouse human like to the coordinates you set. You can use x,y after you do a findcolor, for example:
Findcolor(STUFF)
MouseC(x,y,1)
That will click on the color. 1 is left click, 2 is right click, 0 is no click, meaning it will just move the mouse.
GAMETAB
Gametab(tab number) -FROM SI-
Will click on the specified gametab:
Gametab(4) = Inventory
Gametab(5) = Next
Ect.
CLICKTEXT
ClickText('text',cords,cords,cords,cords) -FROM SQUIG-
That will search for the text you put in on the RS screen in the coordinates you set then click on it. The coordinates are in a box. (See Findcolor) The text is CASE SENSITIVE.
MUCH MORE!
There are thousands of procedures, but I won't name them all, you will have to figure them out yourselves, by looking through the includes and in SCAR help.
Moving on.
---------------
The Different Types Of Ends
There are 3 different types of Ends, but only 1 type of Begin, weird eh?
End - Will end a begin in the middle of a procedure, for example (If (blah) Then Begin)
End; - Will end a procedure.
End. - Will end the script altogether.
Your ends always have to add up to how many begins you put.
Moving on.
-------------
The Main Loop
This is where you tell your script what exactly to do.
To start the main loop you don't need a procedure name, all you need is a Begin.
After all your procedures are done and your script does what you want, you need to put this:
Begin
main loop
End.
Your main loop can consist of ANYTHING. For example, if you were going to run Squig, you would have to put SetupSquig; in your main loop before anything else. Also if you wanted to repeat your procedures until a certain time you would do something like this:
Begin
Repeat
procedures
a:=a+1
Until(a=number or constant)
End.
Sounds complicated? Its really not! This is what that up there would do. It would repeat the procedures you named, and everytime it repeated all of them, it will add an 'a', and it would keep repeating UNTIL a= a number or a constant. Remember when I taught you wayyy up at the top about constants? Well yoiu could put something like LoadsToDo=2; in your const, and everytime it repeated the procedure, it would add an 'a', then when a=LoadsToDo, you can make it do what you want. But of course, if you used A, you would need to declare A as a variable (see Variables).
In most of my scripts, after a= whatever, I use a procedure in most includes called Logout;, that would log your character out of RuneScape. Then I do something like this:
Writeln('Loads to do reached, logged out')
End.
That would say the text in the dialogue box so the user knows whats going on and End. would end the script completely, once and for all.
So a pretty good main loop would look like this:
Begin
Repeat
procedures
a:=a+1
Until(a=loadstodo)
Logout;
Writeln('Loads to do done, logged out')
End.
Moving on.
----------------
Common Errors
Since I have taught you alot about scripting so far, you should hopefully know how to script. Now I will help you with some common frustrating errors of scripting.
Duplicate Identifier
That means that there is two of the same kind of variables. You are most likely using an include that already has the variables that you declared, just removed the duplicate variable from your script.
Invalid Parameters
You didn't make the procedure right. For example, MouseC, you need to go Mousec(x,y,1) but you only put MouseC(x,y), thats invalid.
BEGIN Expected In Script
Your missing a begin, most likely after your procedure name.
Period '.' Expected In Script
You are missing a period, most likely at the end of your script.
Runtime Error
You don't have an updated version of the include, or you didn't set up the include like your supposed to.
------------------
Statements
There are lots of things in SCAR that help tell about them. One of them is statements. Statements are things like and, if, else, then, is, not, to, or, and until.
Until would help you wait until whatever, if (something) then is what if and then is used for. Or is used for like lets say you wanted to find 2 colors, it can be findcolor and/or, also else means everything else, is means is it there, or something like that, and not means like not there.
================================================== ==============
Making The Script
In this TOTALLY new catagory, I will teach you actually how to make the script using an example. Hopefully by now you will know how to script, well now you will learn how to implement what you know in a script.
Getting started, ok, well you should already know how to script, open up SCAR, and delete everything thats in there. You done? Good. Now the first thing you should know is you have to make a program name first, right? We will be making a simple Autominer. So type something like this in SCAR:
Program Autominer;
Ok, now lets move on to the next part of scripting.
You will need to use an include, we will be using Si.scar in this script. You better know how to do this, if you don't, this is what you do:
{.include Si.scar}
Your whole script should now look like this:
Program Autominer;
{.include Si.scar}
If it isn't, change it. Moving on.
We will be using the variables x,y in this script, for Findcolor, so please hit enter twice after the include and type this:
Var x,y : Integer;
That will declare x and y as integer variables (I know, when I was first learning about variables I got lost, it takes a bit of practice). Your whole script should now look like this:
Program Autominer;
{.include Si.scar}
Var x,y : Integer;
If it doesn't, change it.
Moving on, we will now be actually telling the script what to do in procedures.
We are making a procedure that will mine the rock, simple right? Of course it is. This procedure is going to contain alot of what you learned, so pay attention. Press enter twice after the variables and type this:
Procedure minerocks;
Begin
Your whole script should now look something like this:
Program Autominer;
{.include Si.scar}
Var x,y : Integer;
Procedure minerocks;
Begin
The Begin after the procedure will tell SCAR that the procedure has begun.
Now we will get to REALLY telling SCAR what to do, this will start using actual procedures from Si.scar and built in ones in SCAR.
Under the begin, we will type this:
Findcolor(x,y,54323,5,5,515,340)
Mouse(x,y,1,1,true)
Don't worry, I'm not gonna lose you, I just decided to take two steps ahead this time. This is an explanation of what that does: The Findcolor will find the color (the numbers that I put after the x,y NOTE: That is not a real color) of the rock, and the 5,5 is the top left corner of the main screen and the 515 340 is in the bottom right, making the script search in a box for the color.
Mouse (PROCEDURE OF SI) will move the mouse to the color like a human, then left click. See, on Findcolor we have an x,y, that will save the coordinates that the script found the color of to them, then Mouse(x,y will move the mouse to the coordinates whereever they are. The 1,1 in Mouse is tolerance, that will either subtract 1 or +1 coordinate to the x,y for randomness, you can put this higher. The true means left click, false would make it right click.
This is what your whole PROCEDURE should look like:
Procedure minerocks;
Begin
Findcolor(x,y,54323,5,5,515,340)
Mouse(x,y,1,1,true)
Change it if it doesn't. Moving on to the next part.
Now under mouse, you will want it to wait while your mining the rock, right? I never have showed you this, but theres a function built in SCAR that allows you to set a wait time in MILLISECONDS. So right under the Mouse put this:
Wait(5000)
That will make the script wait for 5 seconds while you mine the rock. There are more accurate and better ways of actually knowing how to make the script know when the rocks gone, but since your most likely a newbie, I won't say.
Your whole procedure should now look like this:
Procedure minerocks;
Begin
Findcolor(x,y,54323,5,5,515,340)
Mouse(x,y,1,1,true)
Wait(5000)
Good, now you've got a functional autominer, now end this procedure.
That should mine the rocks until you got a full load and then keep going, to make it do something else you would have to add more, but that uses alot of what you know.
Your whole script should now look like this:
Program Powerminer;
{.include Si.scar}
Var x,y : Integer;
Procedure minerocks;
Begin
if(Findcolor(x,y,54323,5,5,515,340))then
begin
Mouse(x,y,1,1,true)
Wait(5000)
end;
End;
When using procedures that return a value, such as true, you should always use if and then statements!
That won't work as it doesn't have a main loop, but you should know how to add one.
Theres my tutorial, the rest is just information.
-----------------------
Links
http://www.fagex.net/ - Cheating community
http://www.sythe.org/ - Cheating community
http://www.kaitnieks.com/ - Cheating community/the creator of SCAR's website
http://www.dylock.net/scar/ - Official SCAR download site
----------------
Contact Me
AIM: begomyego
YIM: claytan2003
ICQ: 248642332
--------------
This guide was created by the scripter Bego of Fagex, Sythe, and many other cheating communities.
This is CopyRight© and any distribution of this guide without credits given to me I will take action. You may not edit/alter anything in this guide.