Results 1 to 14 of 14

Thread: Scar Beginners - Basics

  1. #1
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default Scar Beginners - Basics


    -------------------------------------------------------

    Heres a tutorial from back in the day of Kaitnieks. I found it amongst some hidden files. Remember, everything might not be up to date as it was written in mid/late 2005. Enjoy!

    -------------------------------------------------------


    Welcome To XxKanexX's Super Basics Tutorial!

    Hey, welcome to my tutorial. I'm writing this from a persons view whom knows nothing about scar and has never heard of pascal, Step by step, every detail. (Only some procedures and functions though, I'm not going to go through every bit of detail lol.)..

    Starting Of!
    OK, to start of. Open Scar, When you open scar you should see this:
    Code:
    program New;
    begin
    end.
    This is just the basic elements. program New; This is your programs name, Change "New" to whatever name you want your program to be.

    Always add a semicolon ( ; ) after the name to tell the script that that is the end of your scripts name. begin Tells the compiler that the script has just began, the coding of your script goes between "begin" and "end." end. Tells the compiler that you have ended the script, Make sure to always put a fullstop. If you are making a procedure then you end it with a semicolon ( ; ), that will be explained later in the tutorial.

    Now, i'm going to explain what scars environment and most important buttons and features are. During your scar scripting you will need to pick colors. To do this, you simply click the eye dropper. Your pointer should change and a small yellow box with numbers will be in it. To Pick Colors: You move the mouse to the spot where the color is, in the square in the yellow box it will show whatever color your cursor is on. If its on the color you want, Click the mouse.

    Something like this should show up : "Color Picked: 16777215 at (416, 259)" This means that you have picked color "16777215" at the co-ordinates of "X = 416 and Y = 259". Picking Co-ordinates: ( X + Y ) This is just like picking a color. Click on the eyedropper located in scar. Move the cursor to where you want to pick the co-ordinates. ( Say if you wanted to move the mouse to that position ). Then click. Something like this should show up : "Color Picked: 16777215 at (416, 259)". Now, the X co-ordinate is the first number(s) before the commer.

    In this case, X is "416" And Y is "259" . If you put after begin and before end.
    Code:
     Movemousesmooth(416, 259)
    This would move the mouse to that position. Before picking colors or X + Y co-ordinates Make sure that you have selected the client of where your scripting. This can be done be clicking the crosshairs in scar ( Crosshairs look like a circle with a line going down, then across ). This tells scar that the script is aimed for that window.

    If you dont use the crosshairs and try to pick colors or choose co-ordinates it will come up with wrong co-ordinates. When you do select the client with the crosshairs it changes the co-ordinates to the clients dimensions. Play Button, Pressing this button will tell scar to play the script that you have written.

    When a script has begun it will show in the debug box "Successfully compiled" Stop button, Pressing this will tell scar to stop any script running, when it has stopped it will show in the debug box "Successfully executed". Pause Button Pauses the script running. Open from web : Will open a website from scar that has useful and working scripts.

    Silent Mouse: Silent mouse can be very dangerous when scripting in scar on runescape. You are most likely to get banned. Silent mosue moves the mouse to the location invisably. Therefor, Jagex will ban you because it is impossible to move the mouse in that way. To turn silent mouse of Click "Tools", If silent mouse is ticked, click it to untick it. If its not ticked, leave it.

    If you find your script is playing up at any time, check to see if its on, otherwise you will be left puzzled. New Project This, if clicked, is able to combine various scripts into 1 file that scar can open up and save. It can be accessed in "File" then "New Project".

    Easiest Functions + Procedures

    Code:
    Movemousesmooth(x, y);
    This will move the mouse SMOOTHLY across the screen to the desired co-ordinates. ( For more information
     on Co-ordinates scroll up and look for "X + Y Co-ordaintes"
    
    MoveMouse(x, y);
    This is the same as "Movemousesmooth" BUT it moves the mouse directly there, from wherever your cursor
     position is at. As movemousesmooth moves the mouse there by following a line to the co-ordinates.
    
    Clickmouse(x, y, left);
    This will click the mouse at the desired X + Y co-ordinates. If left is true it will left click the mouse, if it is false
     it will right click the mouse.
    
    Holdmouse(x, y, left);
    Holds the mouse at the desired X + Y Co-ordinates. If left is true will left click hold, if left is false will right click
     hold.
    
    Releasemouse(x, y, left);
    This is in relashion to "Holdmouse". If will release the mouse click at the desired x + y co-ordinates. If left is 
    true then will release left click, if left is false will release the right click.
    
    Writeln('Text');
    The script above would write into the Debug box ( The white box below scar, kind of like an output box to 
    show the results.) Text. Whatever "Text" is changed to it will write into the Debug Box. Make sure you have
    the 2 [ ' ] 's before and after your text.
    
    Status('Text');
    This will change the status bar to whatever is between the two [ ' ] 's.
    
    Getmousepos(x, y);
    Gets the cursors position it is currently at. You will have to declare variables for it to save in, Read below 
    for details on variables.
    
    SendKeys('Text');
    Will send what is in between the [ ' ] 's to the active client.
    
    SendKeysSilent('Text');
    Will send whatever is between the [ ' ] 's to the client selected with the crosshairs.
    
    Wait(time);
    Will wait however many Milliseconds you put in the brackets before continueing. The wait is ran in 
    Milliseconds, which means if you put "Wait(1000)" It would wait 1 second. "Wait(3000)" Would wait 3
    Seconds. "Wait(500)" Would wait 500 Milliseconds ( Half of 1 second ). And so on..
    
    SendArrowSilent(Number);
    Will send an arrow key depending on the number in between the brackets to the selected client. If there
    is a "0" in between the brackets it will send the up arrow key, if there is a "1" will send the right arrow key, if
    there is a "2" will send the down arrow key, if there is a "3" will send the left arrow key.
    
    GetKeyCode('key');
    Will get the code of the key in between the [ ' ] 's. Example:
    writeln(inttostr(getkeycode('a'))) Will write the key code for "a". Explanation on what inttostr means below.
    
    Inttostr
    This stands for "Integer To String". Integers and Strings are variables, more explaned below. This means if 
    you put something like  Writeln(9 + 2)  It wouldnt work because writeln is dependant on whatever it 
    writes to be a string ( A string is a word / phrase. ) - ( An integer is a Positive or negitive number ). So you 
    would have to do :  writeln(inttostr( 9 + 2 ))  So it converts the integers to a string, therefore writeln 
    recognizes them as a string and can write them in!
    
    Strtoint
    Stands For "String To Integer". This is the same as Inttostr But will convert an String to an Integer.
    ( A string is a word / phrase. ) - ( An integer is a Positive or negitive number ) You could use this like 
    so :  writeln(inttostr(strtoint('1')))  This would write "1" because it is first converting the Integer
    that string to int makes into a string by using inttostr.  Writeln(Inttostr(Strtoint('1'))) . "IntToStr"
    (Integer To String) Will Make The Integer That Strtoint (String To Integer) has created. So basically strtoint
    made '1' an integer but then inttostr made the integer back into a string therefore making it writeable by
    writeln!
    
    IsFunctionKeyDown(Key);
    This could be used like so : If(Isfunctionkeydown(1))Then Writeln('Control is Down!') . This means
    that if the function key down "1" (control) is down it will writeln ( Write into the Debug Box ) "Control Is 
    Down!". Change Inbetween the brackets to either. 0 = Shift, 1 = Control, 2 = Alt, 3 = Left Shift, 4 = Left Control,
    5 = Left Alt, 6 = Right Shift, 7 = Right Control, 8 = Right Alt. So If(Isfunctionkeydown(6))Then 
    Writeln('Right Shift Is Down!')Would, if the right shift is down, writeln ( Write into the debug Box)
    "Right Shift Is Down!". Basically IsFunctionKeyDown(Key); just returns with true or false if that key
    is down.
    
    IsFKeyDown(Number);
    If the F Key that is inbetween the brackets is down it will return true if its not down it will return false. 
     If(IsFKeyDown(1))Then Writeln('F1 IS DOWN!')  This means if F1 is down it will writeln ( Write into the Debug Box)
    "F1 IS DOWN!". To change F Keys they go from 1 to 12 So  If(IsFKeyDown(3))Then Writeln('F3 IS DOWN!') 
    This would, If F3 was down ( Told the script it was F3 by putting a 3 inbetween the brackets of IsFKeyDown(3); )
     It would writeln ( Write into the Debug Box ) "F3 IS DOWN!"
    
    IsKeyDown('Key');
    This could be used like so: If(IsKeyDown('a'))Then Writeln('A Is Down.'). So if A was down it would writeln
    ( Write into the debug Box ) "A Is Down." This could be done with any key ( Except F Keys, Ctrl Keys..Etc ).
    
    IsArrowDown(Arrow);
    This will, if the arrow key specified is down, result with true. Meaning that if i did : If(isarrowdown(1))then 
    writeln('Omg Right Arrow Is Down!') It would, if the right arrow is down, Writeln ( Write into the debug Box ) 
    "Omg Right Arrow Is Down!". Key Values: "0" Will send the up arrow keys, "1" will send the right arrow key,
    if there is a "2" will send the down arrow key, if there is a "3" will send the left arrow key.
    
    GetColor(x, y)=Color
    You will need to understand about X + Y Co-ordinates and How to pick colors before using this function. Read 
    the top couples of paragraphs for more information. OK Now, this function returns with, if the color is found at 
    the co-ordinates, true. Example : If(Getcolor(0, 0)=0)Then Writeln('Black Was Found At 0, 0') This means
    that if it finds the color "0" ( Black ) at the co-ordinates 0, 0 ( Top left corner of any client ) then it will writeln 
    ( Write in debug Box ) "Black Was Found At 0, 0".
    
    AppPath
    This will return with the location of where scar is installed. Example : Writeln(Apppath)  This will Writeln 
    ( Write in the debug Box ) The location. For most people it would be " C:\Program Files\SCAR 2.03\ ".
    
    AddToReport('Text');
    This will add to the report box whatever is between the [ ' ] 's. This can be opened by clicking the 2 notes 
    overlapping each other with the tiny tiny pencil at the top. When you put the cursor over it it should say 
    "Toggle Report Box".
    
    Changereportwidth(100);
    This would change the reports width the 100.
    
    ClearReport;
    Would clear the report Box of any text.
    
    PlaySound(SoundName);
    This would be complicated to do. This will play a sound with its determined location. If the sound was in scars 
    folder you would do : PlaySound(AppPath+'Sound Name.wav'); Will play the sound thats in scars folder. :)
    If you were to include it the sound and script into a zip folder so other people could here it would have to put the 
    location of the zip and the file (sound) name.
    
    GetStatus;
    Will return with whatever is on the status bar. Example: 
     
    Status('Hello');
    Writeln(GetStatus);
    
    This would writeln ( Write into the debug Box ) "Hello". Because the status bar is Hello.
    
    SaveScreenshot(Name);
    saves a screenshot of the client with the Name you have put in. If you did this: SaveScreenShot(AppPath+'Hello.bmp'),
    It would save into scars folder with "Hello.." as a bitmap file.
    
    GetPage(Page);
    Will get a pages source. Example :  Writeln(GetPage('http://www.google.com')) Would writeln 
    ( Write in the debug Box ) Googles Source. Well, only most of it, It can't fit it all. Make sure you have 
    'Http://' or whatever is the start of the webpage. 'www.google.com' wouldn't work.
    
    OpenWebPage(Url);
    Will open the web page in between the brackets, Openwebpage('http://www.google.com');
    
    ActivateClient;
    Will activate the client that has been specified with the Crosshairs.
    Variables

    Variables are a definate need in so many scripts. They declare values that can be used. The types are: Integer, String, Boolean, Byte. They are the 4 main ones. To Tell the script we're putting in variable we, before any procedure, functions or begin put:
    Code:
    Var
    INTEGERS

    Code:
    Var
    A : Integer;
    This tells the script that A Is an integer. to make more than 1 integer we put a commer after every one. Example:
    Code:
    Var
    A, B, C : Integer;
    Now we make A, B and C know something in a script.
    Code:
    Var
    A, B, C : Integer;
    
    Begin
    A := 1;
    B := 2;
    C := 3;
    End.
    So this is saying that A is 1, B is 2 and C is 3.
    Now we can give an example of calling them:
    Code:
    Var
    A, B, C : Integer;
    
    Begin
    A := 1;
    B := 2;
    C := 3;
    Writeln('A Is: '+Inttostr(A));
    Writeln('B Is: '+Inttostr(B));
    Writeln('C Is: '+Inttostr(C));
    End.
    This would say in the debug box, A Is: 1, B Is: 2, C Is: 3. Inttostr(A) Means that its making the Integer A into a string. Because writeln can only recognize strings. So basically "Writeln('A Is: '+Inttostr(A));" Translated, Means "Writeln('A Is : 1')". But without Inttostr(A) it will not recognize a, it be like doing: "Writeln('A Is : '+A) Same with B. Integers can also be words. Like so:
    Code:
    Var
    Kane : Integer;
    And its all the same asewll, Just instead of putting say
    Code:
    A := 1;
    Youd Put
    Code:
    Kane := 1;
    STRINGS

    Strings are the same as Integers. But they are declared like so:
    Code:
    Var
    Kane : String;
    Multiple Strings:
    Code:
    Var
    Kane, Kane2 : String;
    Now using them in a script:
    Code:
    Begin
    Kane := 'Hello.';
    Kane2 := 'Hello2';
    End.
    Strings can be a phrase / sentace or word.. Unlike integers, strings dont need Inttostr when being used in something that requires a string; Example:
    Code:
    Var
    Kane, Kane2 : String;
    
    Begin
    Kane := 'Hello.';
    Kane2 := 'Hello2';
    Writeln('Kane = '+Kane)
    Writeln('Kane2 = '+Kane2)
    End.
    This would write Kane = Hello. And Kane2 = Hello2. Because thats what i have declared them as. When a string needs to be changed into an Integer we use Strtoint instead of Inttostr Like an integer to string would need. Example, ( I will be making a string = '1' and then converting it into a positive number ( 1 ).
    Code:
    Var
    A : Integer;
    Kane : String;
    
    Begin
    Kane := '1';
    A := Strtoint(Kane);
    Writeln('A = '+Inttostr(A))
    End.
    This will convert the string Kane into an Integer in a. And then it will writeln A = 1 because we are then converting the integer back to a string so that writeln can recognize it.

    BOOLEANS
    All the same basically.
    Code:
    Var
    Kane : Boolean;
    This means the 'Kane' variable could only be True or false. example:
    Code:
    Var
    x, y : Integer;
    Kane : Boolean;
    
    Begin
    If(getcolor(x, y)=0)then Kane := True Else Kane := False;
    If(Kane=True)Then Writeln('Found The Color!');
    End.
    This means that if it finds the color then Kane = True, Then if the colors found it will writeln 'Found the color'. If its not found Kane will equal False ( Kane := False X and Y Have to be declared as integers aswell.

    BYTES
    Bytes are basically numbers from 1 - 10. Could be used like integers aswell, but just for small numbers.
    Code:
    Var
    Kane : Byte;
    This declares Kane as a byte.
    Code:
    Var
    Kane : Byte;
    
    Begin
    Kane:=1;
    Writeln('Kane = '+inttostr(Kane))
    End.
    This will say in the debug Box : 'Kane = 1'

    Procedures

    Procedures are very very useful in scripts, and are easy to learn aswell. TO add a procedure:
    Before the Begin and End ( Also known as " The Main Loop " ) in your script you put :
    Code:
     Procedure #AnyName;
    . Procedures are like sections of the script that can be called upon for many different reasons. Now you put Begin after the procedure and its name like so:
    Code:
    Procedure #AnyName;
    Begin
    OK Now you put a script after the begin, im going to put a writeln function. And i am also going to name the procedure Write1, this can be changed to anything.
    Code:
    Procedure Write1;
    Begin
    Writeln('Hello, This is procedure 1.')
    Now we end it
    Code:
    Procedure Write1;
    Begin
    Writeln('Hello, This is procedure 1.')
    End;
    Notice that its A SEMICOLON and not a full stop. You can do as many as these as you want. To call upon a procedure you put it in the Main loop, like so:
    Code:
    Begin
    Write1; //Calls Write1!
    End.
    Here is the full code:
    Code:
    Procedure Write1;
    Begin
    Writeln('Hello, This is procedure 1.')
    End;
    
    Begin
    Write1; //Calls Write1!
    End.
    This would write 'Hello, This is procedure 1.'). You can make as many procedures as you want and call them all from the main loop. They can be used in scripts in many ways. Heres 1 example:
    Code:
    Procedure SayFound;
    Begin
    Writeln('Found It!.')
    End;
    
    Begin
    If(Getcolor(x, y)=0)then SayFound;
    End.
    Seeee!.. Now, thats not all procedures can do. Procedures can also let you see your own variables in them. Read variables above to find out more about variables. Example about setting your own:
    Code:
    Procedure Name1(S : String);
    Begin
    Writeln(S)
    End;
    Here, when in the main loop, you'd have to do when its called upon
    Code:
    Begin
    Name1('Text')
    End.
    This would writeln ( Write into the debug box ) 'Text'. Because S Is declared in the brackets and then its called upon to say in the writeln feature. (Line 3 of the procedure). you can also do things like:
    Code:
    Procedure Name(See : Boolean);
    A Boolean can only be True or false. Example of a boolean script:
    Code:
    Procedure Name(LookForColor : Boolean);
    Begin
    If(LookForColor = True)Then
    If(getcolor(x, y)=0)Then Writeln('Found Color.')
    End.
    Then you could put in the main loop:
    Code:
    Begin
    Name(True)
    End.
    That would tell the procedure, yes i want to look for the color, and then if found would writeln 'Found Color.'

    Using Integers:
    Code:
    Procedure Name1(Typee : Integer);
    begin
    if(typee=1)then writeln('Type = 1')
    if(typee=2)then writeln('Type = 2')
    End;
    Then in the main loop:
    Code:
    begin
    Name1(1)
    end.
    This would writeln "Type = 1". because we set the integer as 1.

    -------------------------------------------------------

    I hope you learnt something new. Please don't hesitate to ask questions, i'll be here to help

    Everything in this tutorial was written by XxKanexX

    -------------------------------------------------------

  2. #2
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Reserved. <3 SRL

  3. #3
    Join Date
    May 2006
    Location
    In a galaxy far far away...
    Posts
    60
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Heh, thought i recognised this.

    Even though i still have completely no idea how to script (i would like to learn, and im supposed to be taking computng for a level :S), i printed this off ages ago, when you first made it on kaitnieks.

    I have the whole thing in a poypocket in my draw

    Although i didnt understand a fair bit of it, it did help me to run scripts better (even though i havent found a script that works perfectly yet.)

    It is a good tut, worth a read definately

  4. #4
    Join Date
    Oct 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow thats 1 ownage tutorial

  5. #5
    Join Date
    Aug 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  6. #6
    Join Date
    Feb 2006
    Location
    Aussie
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah yes.. i remember that.. was it really only last year that kaitnieks closed?

    looks as good as ever, maybe if you get time, convert it to srl? although i think most of it is just scar is it not? with no include stuff? maybe just add the basic SRL stuff to it then.

  7. #7
    Join Date
    Oct 2006
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    God!? If that's basic... I don understand some parts... I really want to learn Scar, pascal & progamming languages... They are just too hard...

  8. #8
    Join Date
    Jun 2006
    Location
    Finland, Heinola
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmmhm i should try to make something with this, like autologin. Thanks, simple and short

  9. #9
    Join Date
    Dec 2006
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, love the guide =D helpt out sooo much~

  10. #10
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    great tutorial kane! i didn't learn much because i have just read like 3 tuts that tell me these things, but this might be the most descriptive one lol.

  11. #11
    Join Date
    Aug 2007
    Location
    Edgeville
    Posts
    178
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  12. #12
    Join Date
    Jun 2007
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ooh, nice tut and good one, I enjoy it alot!

  13. #13
    Join Date
    Oct 2007
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    nice tut (bump)

  14. #14
    Join Date
    Jan 2009
    Location
    Northern C.A.
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great tut, helped me understand alot. Made my own typing script for web pages

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Ultimate Scar Basics
    By Waddo in forum Outdated Tutorials
    Replies: 6
    Last Post: 11-25-2009, 12:22 PM
  2. The Beginners HandBook
    By Waddo in forum OSR Outdated Tutorials
    Replies: 4
    Last Post: 06-11-2009, 09:26 PM
  3. How to: Beginners English
    By Kiloch in forum Other Guides
    Replies: 24
    Last Post: 01-20-2009, 03:26 PM
  4. Everything (Or Most Of What) Beginners Need To Know
    By Pure1993 in forum Outdated Tutorials
    Replies: 34
    Last Post: 11-24-2008, 07:36 PM
  5. Scar Basics - (Old Tutorial).
    By XxKanexX in forum Outdated Tutorials
    Replies: 6
    Last Post: 11-05-2007, 09:55 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
  •