Page 1 of 7 123 ... LastLast
Results 1 to 25 of 166

Thread: Ultimate Noob Tutorial!

  1. #1
    Join Date
    May 2006
    Location
    Sask, Canada
    Posts
    62
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Exclamation Ultimate Noob Tutorial!

    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:



    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:

    Code:
    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:

    Code:
    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:

    Code:
    {^^^^^^^^^^^^^^^^^          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:

    Code:
    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:

    Code:
    {^^^^^^^^^^^^^^^^^          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 in[u]cludes 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:

    Code:
    {.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:

    Code:
    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:

    Code:
    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:



    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:



    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:

    Code:
    Const
    And to add things to the Const you would make things related to your script like this:

    Code:
    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:

    Code:
    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:

    Code:
    Procedure name;  (ex. Procedure mine; )
    Begin


    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:

    Code:
    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

    Code:
    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:



    FINDCOLORSPIRAL

    Code:
    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.



    FINDCOLORTOLERANCE

    Code:
    Findcolortolerance(x,y,color,cords,cords,cords,cords,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.




    FINDCOLORSPIRALTOLERANCE

    This uses FindColorSpiral but it has tolerance (read Findcolortolerance).



    !!PROCEDURES FROM INCLUDES!!

    MOUSEC

    Code:
    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:

    Code:
    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

    Code:
    Gametab(tab number)
    -FROM SI-

    Will click on the specified gametab:

    Gametab(4) = Inventory
    Gametab(5) = Next
    Ect.

    CLICKTEXT

    Code:
    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?

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    {.include Si.scar}
    Your whole script should now look like this:

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    Procedure minerocks;
    Begin
    Your whole script should now look something like this:

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    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:

    Code:
    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.

  2. #2
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    good guide! very detailed, great for noobs like me

  3. #3
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice, this will help alot of people! (: I like the pictures.

  4. #4
    Join Date
    Apr 2006
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well Done Bego

    Good Contribution
    Oldgen.

  5. #5
    Join Date
    Feb 2006
    Location
    MS Paint
    Posts
    252
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great tut .

    However the webstie background is a bit annoying with all of the bulldozers .
    No room for thoughts.

  6. #6
    Join Date
    Sep 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice to see a familiar face here

    great guide bego! I learned a whole lot

  7. #7
    Join Date
    Sep 2006
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Thanks

    I learned so much about SCAR from reading this, now onto more andvanced tuts YAY! =D

  8. #8
    Join Date
    Oct 2006
    Posts
    702
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    very nice guide, it taught me alot about scar. one suggestion is to add a section about how to put a script together.

  9. #9
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    awesome i learned tons

  10. #10
    Join Date
    Nov 2006
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great TUT . Hoping to learn to script soon

  11. #11
    Join Date
    Nov 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wowzer bowzers, pretty awesome dude! I think i might try and script a little more often now, you inspired me

  12. #12
    Join Date
    Nov 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    awesome tut dude..now maybe more people will learn to script..even thought i retired in RSC you kind of inspired me.

  13. #13
    Join Date
    Nov 2006
    Location
    Belgium
    Posts
    110
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    I don't understand anything of it ...

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

  14. #14
    Join Date
    Dec 2006
    Posts
    249
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Very nice,

    Cheers getting to grips with scripts now

  15. #15
    Join Date
    Dec 2006
    Posts
    374
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank this tut is awsome! i learn more everyday! thanks!

  16. #16
    Join Date
    Dec 2006
    Location
    San Jo, Cali
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great work!! Got me going.
    http://img141.imageshack.us/img141/6...ats2jk5fx8.png
    There are currently 10.0 blackmarks out of 10 on this account
    You are permanently banned --- Rest In Peace

  17. #17
    Join Date
    Dec 2006
    Location
    San Jo, Cali
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I tried running your script but it wouldn't compile all I got was:

    [Error] (3419:1): Unexpected end of file

    I assumed it was because your script doesn't end with 'End.' but it ends with two 'End;' So I figured the last one was suppose to be 'End.' and that you had made a small error but then I tried running it again and all I got was:

    [Error] (3419:4): Semicolon (';') expected

    So I guess it wants both the semicolon and the period.... lame.
    http://img141.imageshack.us/img141/6...ats2jk5fx8.png
    There are currently 10.0 blackmarks out of 10 on this account
    You are permanently banned --- Rest In Peace

  18. #18
    Join Date
    Dec 2006
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Cool, but... (Sorry to ruin your 100% positive replies)
    I think it would be more helpful if you had screenies of the whole current process after each step.
    So from program New;
    to end.

    Good overall though, keep it up.

  19. #19
    Join Date
    Jan 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hey this is a brilliant tutorial. thanks alot it really helped me understand the set up for scar i'll be bookmarking for when i'm done reading and decide to try to code something.

  20. #20
    Join Date
    Jan 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for the tut i will learn from it =)

  21. #21
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    read this guide first dont know how to other guides are going to be but this one is pretty good thnx for the start

  22. #22
    Join Date
    Mar 2007
    Location
    MN
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    NICE guide, I learned alot about scripting, but i dont really understand the colorspiral and toletrance, that whole section...

  23. #23
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    bego shut up
    im young and my scripts arent cr@p.
    whatever

  24. #24
    Join Date
    Apr 2007
    Posts
    59
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice guide man helped alot, keep it up.

  25. #25
    Join Date
    Apr 2007
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    awesome guide it taught me the basics of scripting
    ...

Page 1 of 7 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Ultimate Noob Tut
    By insanomano in forum OSR Intermediate Scripting Tutorials
    Replies: 11
    Last Post: 02-01-2009, 02:19 PM
  2. Ultimate form tutorial
    By jhildy in forum OSR Advanced Scripting Tutorials
    Replies: 9
    Last Post: 02-21-2008, 05:07 PM
  3. Noob script ideas for a noob scripter
    By 13lacknova in forum First Scripts
    Replies: 7
    Last Post: 09-30-2007, 01:01 AM
  4. Please requesting the ultimate tutorial runner
    By RudeBoiAlex in forum RS3 Outdated / Broken Scripts
    Replies: 3
    Last Post: 03-09-2007, 01:59 AM
  5. Hey, welcome the ultimate noob
    By Archmage in forum Who Are You ? Who ? Who ?
    Replies: 0
    Last Post: 10-08-2006, 11:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •