Page 1 of 2 12 LastLast
Results 1 to 25 of 41

Thread: Total Scripting Technique Tutorial

  1. #1
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default Total Scripting Technique Tutorial

    Compliments to gerauchert for the suggestion. Borrowed some stuff from JAD's tutorial on fixing annoying errors.

    Dont forget to Rep++ me or Rank the Thread!

    Welcome to the scripting technique tutorial. I will explain how and when to use a certain item of scripting, like FailSafes, etc.

    I have to admit though. I probably wont be writing it ALL at once. So look out for the updates on the Horizon! This Tutorial works from the very basic at the start, to the more complex and SRL Member worthy at the end.

    Table of Contents


    • Basic Errors.
    • How to Begin a Script.
    • Variables and Constants
    • Descriptions!
    • Declare Players
    • Finding that Object.
    • Bitmaps.
    • Clicking.
    • Banking.
    • DTM's.
    • Using DTM's Efficiently.
    • Standards.
    • Anti-Ban.
    • Anti-Randoms.
    • Main Looping.



    Things to make your script appealing

    • Signatures
    • Progress Reports
    • Intoduction
    • Version History



    I hope to add alot more aswell, and hope to teach myself some stuff in the process!


    Onto the Tutorial.

    Part 1: Basic Errors

    Identifier Expected: A Begin without an End. A Repeat without an Until. An If without a Then.

    I'm sure alot of the people scripting out there have had this error many times. Identifier Expected is a very basic scripting mistake that people still make, even when they are SRL Members. It is basically where you write your script, but miss out vital parts. It's more annoying when you cant even realise where the error actually is!

    Say this was your current script:

    SCAR Code:
    procedure WalkToBank;
    begin
    if (FindSymbol(x, y, 'bank')) then
      begin
        Mouse(x, y, 2, 2, true);
        FFlag(0);
        Writeln('Got to bank');
    end;

    You would think, "Amazing - I made my first procedure" You press Compile. '[Error] (12595:4): Identifier expected'. Oh no, another post on the Scripting Help Forums about how you cant fix it at any cost. Just look. After "Writeln".. what is missing? Yes. The End. This is how it should look:

    SCAR Code:
    procedure WalkToBank;
    begin
    if (FindSymbol(x, y, 'bank')) then
      begin
        Mouse(x, y, 2, 2, true);
        FFlag(0);
        Writeln('Got to bank');
      end;
    end;

    Simple mistake, but ever so annoying.

    Invalid number of parameters Ok, a little more difficult, but again, not that hard to fix. When you first start a script, if you instantly include

    SCAR Code:
    {.include SRL/SRL.scar}

    then when you type a procedure, you get a little box come up when your typing, to tell you what to write, and more importantly, telling you how much should be in the brackets. Say you had this line:

    SCAR Code:
    if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7, 10) then

    You would think nothing is wrong, I mean, its how I followed that tutorial the other day? Well, it has one too many numbers, or parameters. That 10 shouldnt be there. The FindObjCustom procedure should look like this without any text or input data in it:



    See, it has 5 needed inputs, the X and the Y, The ['Text it should look for'], [The Colours] and the Tolerance.

    So 5, in our procedure up there, its 6? So take out that 10, and we have our line compiling correctly;

    SCAR Code:
    if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then



    Close round expected in script Simple again, but alot of people get this error and wonder how they cannot fix it!
    Look at this example:

    if
    SCAR Code:
    (FindColorSpiralTolerance(x, y, RockColor, 0, 0, 249, 179, Tol) then

    Now, You get that error and wodner.. I dont get it? Why doesnt it work. Well, look at the start. You have two brackets at the beginning, but only one at the end. To prevent this error it should look like this:

    SCAR Code:
    if (FindColorSpiralTolerance(x, y, RockColor, 0, 0, 249, 179, Tol)) then

    Semicolon (';') expected in script This happens alot to people. They forget to put a semi-colon in their script. I myself still sometiems do this.
    This is your current script:

    procedure WalkToBank;
    SCAR Code:
    begin
    if (FindSymbol(x, y, 'bank')) then
      begin
        Mouse(x, y, 2, 2, true)
        FFlag(0);
        Writeln('Got to bank');
      end;
    end;

    Now you compile and get this error, and your confused? Well, look at the Mouse line. See there is no Semi-Colon there? Well, this is what causes the error. It should look like this to be correct:

    SCAR Code:
    procedure WalkToBank;
    begin
    if (FindSymbol(x, y, 'bank')) then
      begin
        Mouse(x, y, 2, 2, true);
        FFlag(0);
        Writeln('Got to bank');
      end;
    end;


    Part Two: Beginning a Script

    Beginning a script is obviousley very important. Without it, a script wont work. To start a script, it is a very basic thing. All you have to do is this basically:

    SCAR Code:
    program ThisIsMyScriptName;

    Program - This script is basically a program? And With the bit after, try to make it relevant to your actually mean something. So if its a Varrock Miner, call it

    SCAR Code:
    program VarrockMiner;

    Draynor WoodCutter..

    SCAR Code:
    program DraynorMultiWoodCutter;

    Get the idea?

    Part Three: Variables and Constants

    Variables

    Then we have to declare our variables, not variables again explain themselves, something that is a variable, can constantly change. The variables in this case are the x and the y, the co-ordinates on the game screen. It is an "integer" as they are co-ordinates, which are numerical.

    SCAR Code:
    var x, y: integer;

    Constants

    The we include our constants. Constants are basically what they say they are, something that is ALWAYS the same, like RockColours, TreeColours, SMART Worlds, etc.

    SCAR Code:
    const
    RockColour1= 111111;
    RockColour2= 222222;

    These Rock Colours would be picked from the Rock You wish to mine, so Iron and Rune would be different, The example colours are obviousley false for any type

    Part Four: Descriptions

    Descriptions are important. They tell the user what to do on a script, but more importantly, help you to edit a script when you come to work again on a script. They are also useful for crediting procedures and adding little notes.

    Examples

    Telling the User what to do

    SCAR Code:
    //-->Loads<--\\

    Loads = 1; //How many loads per player before switching

    //--->SRL ID<---\\
    YourSRLId = '';
    YourSRLPassword ='';

    //--->Pin - Make same for ALL chars. If no Pin, leave blank<---\\
    YourPin = '';

    //SMART World\\
    SMARTWorld = 152; //What SMART World?


    {-------------------------------------------------------
                           Player Setup
    --------------------------------------------------------}


    procedure DeclarePlayers;
    begin

       HowManyPlayers := 2; //How many Players
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer :=0; //Starting Player

       Players[0].Name := ''; //UserName
       Players[0].Pass := ''; //Password
       Players[0].Nick := ''; // 3 - 4 NonCapital/No Spaced letters of your User
       Players[0].Active := True; // Is this player active?

    You see? It helps the user to enter what information he needs to do.

    Helping you Edit a script when you need too

    When your scripts start to get more complex, spacing and titles help you to find the procedure you are looking for. It is not difficult to put something like:

    SCAR Code:
    //---------------------------------ChopTree-----------------------------------\\
    So when you edit it, it is easy to find the procedure that you are looking for.

    Crediting and Adding Notes

    SCAR Code:
    procedure EntFinder; //By Yohojo - Modded by BobboHobbo
    var
      EX, EY: integer;
      FX, FY: integer;
      SafeEntWait: LongInt;
    begin
      if (not (LoggedIn)) then
      Exit;
      begin
        Status('Ent Checking')
          if
          (FindObjCustom(EX, EY, ['Willow'], [4690821], 7)) then
        begin
          MMouse(EX, EY, 0, 0)
            if FindColorTolerance(FX, FY, 55769, 85, 15, 115, 15, 20) then
          begin
            Status('Found Ent');
            MarkTime(SafeEntWait)
              repeat
              FTWait(5)
                FindNormalRandoms;
              if not (LoggedIn) then
                NextPlayer(False);
            until TimeFromMark(SafeEntWait) > 20000 + Random(5000);
          end;
        end;
      end;
    end;
    You can credit procedures, aswell as adding little notes to scripts to remind you what they do:

    SCAR Code:
    Procedure IsAxeBroke;
    begin
    if FindDTM(BrokenAxe, x, y, 547, 206, 734, 464) then
      begin
      if FindDTM(BrokenAxe, x, y, 547, 206, 734, 464) then
        begin
          ChooseOption('rop');       // Edit at next release to bank the broken axe
          BrokenAxes := BrokenAxes +1;
        end;
    For example.

    Part Five: Declare Players

    SCAR Code:
    procedure DeclarePlayers;
    begin
     
         HowManyPlayers := 1;  
         NumberOfPlayers(HowManyPlayers);
         CurrentPlayer:= 0
     
         Players[0].Name   := 'Username';
         Players[0].Pass   := 'Password';
         Players[0].Nick   := 'erna';
         Players[0].Active := True;
     
    end;

    Procedure DeclarePlayers tells us the name of the procedure that we are using. Begin starts the procedure [Every "Begin" has an "End", Every "Repeat" has an "Until" and Every "If" has a "Then" - Follow this and it should stop "Idenfitifer Expected"] How Many Players means how many players we are going to use, and Current player tells us which player to start with. Username, Password are pretty basic, but the Nickname HAS to be 3-4 letters of non-capital or without a space of your Username, like mine is. The Active = True tells us if the player is to be run in the script or not.

    Part Six: Finding That Object

    SCAR Code:
    procedure RockMining;
    begin
    if not LoggedIn then
      Exit;
      if (not (FindObjCustom(x, y, ['Mi', 'ne'], [RockColour1, RockColour2], 7))) then
        Wait(100+random(100));
        Tries := Tries + 1;
        if(Tries = 20)then
          begin
            Logout;
            Exit;
          end else
      if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
      repeat
        case (Random(2)) of
          1: Mouse(x, y, 4, 4,false);
             ChooseOption('ine');
          2: Mouse(x, y, 4, 4, True);
        end;
      until (InvFull)
    end;

    From the Start:

    SCAR Code:
    procedure RockMining;
    begin
    if not LoggedIn then
      Exit;

    We name our procedure, and then it begins. We have our first Fail Safe. If our character is not logged in, the script will exit.

    SCAR Code:
    if (not (FindObjCustom(x, y, ['Mi', 'ne'], [RockColour1, RockColour2], 7))) then
               Wait(100+random(100));
               Tries := Tries + 1;
               if(Tries = 20)then
               begin
                 Logout;
                 Exit;
               end else

    Well first, if it doesnt find the Object that says "Mine" when hovered over, including a Tolerance of 7, so it can search 7 pixels either side, it will wait 0.2seconds, add 1 to the number of tries, and try again. If it Tries 20 times with no success, it will logout your character, to stop you standing there like an idiot, and then exit the script, and Ends ELSE - IE, otherwise..

    SCAR Code:
    if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
      repeat
        case (Random(2)) of
          1: Mouse(x, y, 4, 4,false);
             ChooseOption('ine');
          2: Mouse(x, y, 4, 4, True);
        end;
      until (InvFull)
    end;

    If it actually finds the Rock to mine, it will repeat a random of these 2, it will hover over the rock and Choose "Mine" or it will automatically click on the rock, to make it more human like. It then ends the case, and the repeat goes with the until, like I said earlier, so it will repeat mining until it has a full inventory, then ends the procedure.

    Now the FindObjCustom is the procedure that finds objects for us, so it searches for the name of the thing, aswell as colours with a certain tolerance, and finds them on the x and y axis.

    Part Seven: Bitmaps

    Bitmaps are basically a string of code for a picture that you want SCAR to find. To make a Bitmap, you have to go to Tools and go to Picture to String, and you get this screen load up



    Open up the image you want. Dont make it too big, and make the background black, as the Picture to String wont pick up the black. You should get something resembiling this:

    SCAR Code:
    MMTREE := BitmapFromString(12, 11, 'beNpjYMAPVFQkgAhNUD9JyL' +
           '5AAo8uoAKIGqzKILJwBZjK4ArQlAHZuNRAlOFxmJsZZ5KfKH7PAhV' +
           'QRQ2ZAAD1bBqM');

    So it has a name, The Bitmap From String, and the dimensions. Then the code itself.

    To use this in the script you would just simple put:

    SCAR Code:
    if(FindBitmap(MMTREE, x, y) then

    BUT You MUST declare the MMTREE, or whatever bitmap name you have as a Variable integer, so our variable list would look like this:

    SCAR Code:
    var x, y, MMTREE: integer;



    Continuing with Part Eight Below....
    Jus' Lurkin'

  2. #2
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Part Eight: Clicking!

    There are many ways to click in SCAR. The most common is:

    SCAR Code:
    Mouse(x, y, 0, 0, true);

    Where the mouse will move to an object if it is found in a "FindObj" procedure or such, True meaning it will click, False meaning it wont click.

    This True/False balance is useful for making cases to make you more human like. For example if you had this procedure:

    SCAR Code:
    if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
      begin;
        Mouse(x, y, 4, 4,false);
        ChooseOption('ine');
      end;

    Now there is nothing wrong with that procedure, but you being human wouldnt always right click and choose "Mine" would you? So you can use the True/False to make your cases which mean that you can be more human like:

    SCAR Code:
    if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
      repeat
        case (Random(2)) of
          1: Mouse(x, y, 4, 4,false);
             ChooseOption('ine');
          2: Mouse(x, y, 4, 4, True);
        end;

    So sometimes it will move over the rock and choose the Mine, and other times it will just automatically click on the rock.

    You can also use ClickMouse, but apparently this is detectable and obsolete now, so we do not use it.

    Part Nine: Banking

    Copied from my Cutting/Banking Tutorial:

    SCAR Code:
    procedure Banking;
    begin
      if (InvFull) then
      begin
        MakeCompass('N')
        Wait (300 + random(160));
        OpenBankQuiet('db');
        if (PinScreen) then
        InPin(YourPin);
          if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then
        begin
         Mouse(x, y, 4, 3, false);
         ChooseOption('All');
        end;
         CloseBank;
         Wait(150 + random (278));
         MakeCompass('S');
      end;
    end;

    It begins by saying If(InvFull) so it will only bank if the inventory is full. It will make the compass face north, and wait about 460.

    SCAR Code:
    OpenBankQuiet('db');
        if (PinScreen) then
        InPin(YourPin);
    OpenBankQuiet is a little more laggy, but will open the bank more like a human would, and the 'db' stands for "Draynor Bank" so 'veb' would stand for "Varrock East Bank"

    if (PinScreen) then - this means that if the script picks up the Pin Screen then it will "InPin(YourPin)" so as enters your pin for you. (YourPin would be the constant we declared earlier.)

    SCAR Code:
    if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then

    This means that if looks for the colour 4155248(The willow logs) between the coordinates of your inventory which are the 4 numbers after, then means that it should do .... after the colour has been found.

    SCAR Code:
    begin
         Mouse(x, y, 4, 3, false);
         ChooseOption('All');
         end;

    This means it will begin the following. It looks for the colour, and when found it hovers over the willow log in the inventory, and chooses the option 'All' and then ends the part.

    SCAR Code:
    CloseBank;
         Wait(150 + random (278));
         MakeCompass('S');
      end;
    end;

    This Closes the bank after the logs have been deposited, waits about 400, and then makes the compass south ready for the walk back to the willows in my script. The ends again just end the procedure.

    Part Ten: DTM's

    Now, a DTM is part of any good SRL Members worth script. It means that you can find objects for walking, or even for making failsafes like I did, but shorter and more efficient than a Bitmap would. To make a DTM we have to go to Tools, then to DTM Editor. You should get this screen pop up:



    Then you click in the centre of the picture you are using, and branch lines out wards like this:



    Then you save the DTM, and open up a new page (Just go to File-->New)



    Once you have done that, Go to Test -> Find DTM, and open your saved DTM:





    If your DTM has worked, you should get something like this (If you get a little box pop up click "No")



    Then to get the code for a DTM go to "Open" and Reopen your DTM. Then go to "File" --> "DTM To Text". You will get something like this in your Debug box:

    SCAR Code:
    DTM := DTMFromString('78DA63E4666060106540011919D9609A11CA6' +
           '704A9614255131FAA83AA861F4888A0AA7171F1C454238DAA2638' +
           '2412D32E3435393979A86AD831D5949494A1AA6101126204D480C' +
           'C11445553515189AA861348F0A2AAA9ACAC4255C301245819D000' +
           '23AA1A901902A82ABCBD0351D580DC2289AAC6CDDD1B530D9ABFE' +
           'CED5D50D580DC2285DFEF0078731064');

    Now name it, declare it as an integer variable, and use it in the script.

    Part Eleven: Using DTM's Efficiently..

    Using DTM's efficiently is very important. It means that youcan find thing alot easier, but in smaller code then you would if you used a Bitmap. DTM's are alot faster then BMP's, and also take up less room.

    There are two ways to use a DTM:

    SCAR Code:
    if FindDTM(BrokenAxe, x, y, 547, 206, 734, 464) then

    or you can use:

    SCAR Code:
    if DTMRotated(BrokenAxe, x, y, 547, 206, 734, 464) then

    The FindDTM will look for a DTM between the coordinates that you set, but the DTM Rotated will look for a DTM without rotating, then will gradually increase rotation around 0 until it finds the DTM specified.

    So if you was using a DTM to find something in your inventory, then you would just use FindDTM, but if you was using a DTM to find something equipped (ForExample) it will Rotate around until it finds it.

    To load a DTM you need a simple procedure like this:

    SCAR Code:
    procedure LoadDTMs;
    begin

      DTM := DTMFromString('78DA63E4666060106540011919D9609A11CA6' +
           '704A9614255131FAA83AA861F4888A0AA7171F1C454238DAA2638' +
           '2412D32E3435393979A86AD831D5949494A1AA6101126204D480C' +
           'C11445553515189AA861348F0A2AAA9ACAC4255C301245819D000' +
           '23AA1A901902A82ABCBD0351D580DC2289AAC6CDDD1B530D9ABFE' +
           'CED5D50D580DC2285DFEF0078731064');
    end;

    Now in your MainLoop after you SetupSRL or whatever, you put "LoadDTMs;" like this in my main loop:

    SCAR Code:
    procedure SetupScript;
    begin
      SmartSetupEx(SMARTWorld, false, true);
      SetTargetDC(SmartGetDC);
      while not SmartReady do Wait(2000);
      SRLId := YourSRLId;
      SRLPassword:= YourSRLPassword;
      SetupSRL;
      ScriptID:= '687';
      Signature;
      DeclarePlayers;
      LoadDTMs; //Load DTMs is here.
      LoginPlayer;
    end;

    Part Twelve: Standards

    Standards are pretty good to have in a script. They make it look more appealing and make it easier to read. The basic standards are as follows:

    SCAR Code:
    begin
    if(blaa)then
      begin
        LogOut;
        Writeln('PlayerLogout')
      end;
    end.

    So 2 spaces forwards per begin and 2 spaces backwards per end.

    Im not too good at standards myself though, so this tutorial is good aswell: http://www.villavu.com/forum/showthr...?t=3293?t=3997.

    Part Thirteen/Fourteen: AntiBan & AntiRandoms

    From my Tutorial:

    Overview

    AntiRandoms, and less importantly AntiBan, are needed in any script to make it SRL Member quality [AntiRandoms for sure, AntiBan helps] and to stop it being flawed when Jagex sends out a random to stop us autoing. With the ability to sleep, logout randomly and switch players in SCAR, we can recude the amount of randoms, but ofcourse we still get them. AntiRandoms catch any randoms, save unsolvable ones [Mime, Maze, etc] and solve them.

    AntiBan stops robotic movements, and acts playerlike, 'checking' skills, pretending to log out, and occasionally does emotes aswell.

    Nicknames and their use with AntiRandoms

    You have probably seen this at the start of every script:

    SCAR Code:
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      Players[0].Name := 'Username';
      Players[0].Pass := 'Password';
      Players[0].Nick := 'ame';
      Players[0].Active := True;
     
    end;

    The important part here is the .Nick part. Enter a few letters of your username and SRL creates a mask of your nickname, and looks for it when a talking random pops up and gives you something.


    UsingAntiRandoms

    Since the release of SRL 4 Rev#14, the AntiRandoms procedure is pretty basic. All you have to do is setup a procedure following this:

    SCAR Code:
    procedure FindRandoms;
    begin
      LampSkill := 'theskill';
      FindNormalRandoms;
      if FindFight then RunAway('N',True,1,15000);
    end;

    LampSkill - Theskill is when you setup a script, ie, fletching, you set it to get the LampSkill fletching
    FindNormal Randoms - Finds the normal randoms.
    FindFight - If it finds a fight it runs away! Runs North, True ie, it will run north, up about 1 or 2, and waits 15 seconds.

    This is all you basically need now. I will explain how to use AntiRandoms later on.

    Using AntiBan

    When making a script, you need to have an AntiBan procedure, to do what the name says, stop you from being Banned! This is achievable by following something of this sort:

    SCAR Code:
    procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case Random(30) of
        1: RandomRClick;
        2: HoverSkill('Woodcutting', False);
        3: RandomMovement;
        4: BoredHuman;
        5: AlmostLogout;
        6: DoEmote(400 +Random(90));
      end;
    end;
    1) RandomRClick - Randomly Right clicks the mouse anywhere in the screen
    2) HoverSkill - Hovers over the skill declared in the ' ', but doesnt click on it[why it says false]
    3) RandomMovement - Randomly moves the mouse
    4) Bored Human - Moves the mouse around like someone who is bored would do.
    5) AlmostLogout - Clicks on logout, like someone who might have had enough of playing, and doesnt click, just hovers over the logout button
    6) Do Emote - Does an emote, with a 400-490 random chance.


    Using AntiBan & AntiRandoms:

    Say this is your script:

    SCAR Code:
    procedure DeclarePlayers;
    begin
     
       HowManyPlayers := 1; //How many Players
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer :=0; //Starting Player
     
       Players[0].Name := '';
       Players[0].Pass := '';
       Players[0].Nick := '';
       Players[0].Active := True;
     
     
    end;
     
    Procedure ChopTree;
    begin
      if not LoggedIn then
      Exit;
      MakeCompass('N');
      repeat
        if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
         begin
           Mouse(x,y,0,0,false);
           Wait(500+(random(150)));
           ChooseOption('hop')
           AntiBan;
           Writeln('Found Tree!');
                 
             end else
           Writeln('Tree Not Found!');
          AntiBan;
         AntiBan;
        AntiBan;
      until( InvFull )
    end;
     
    begin
       Chopping
    end.

    Now Random Finding happens well, when a Random Pops up, but you have to TELL your script to do AntiBan. Now notice how much AntiBan is in the above script. It AntiBans when chopping, like you do, move the mouse boredly etc, but also when it doesnt find the tree, it AntiBans until it does, or until the inventory is full.

    Part Fifteen: Main Looping

    From my tutorial

    SCAR Code:
    begin
      SetupScript;
      repeat
       WalkToWillow;
       ChopTree;
       AntiBan;
       WalkToBank;
       Banking;
       if (LoadsNum2=Loads) then
        begin
           NextPlayer(True);
           LoadsNum2 := 0;
           MakeCompass('S')
           Writeln('Players Switched successfully')
        end;
      until (false)
    end.

    So, a little more complicated then it seems.

    SCAR Code:
    begin
      SetupScript;
      repeat
       WalkToWillow;
       ChopTree;
       AntiBan;
       WalkToBank;
       Banking;

    IT begins by doing SetupScript, then Repeats the WalkToWillow, ChopTree, AntiBanning, Walking to the Bank and Banking.

    SCAR Code:
    if (LoadsNum2=Loads) then
        begin
           NextPlayer(True);
           LoadsNum2 := 0;
           MakeCompass('S')
           Writeln('Players Switched successfully')

    If the LoadsNum2 = The Loads we setup to do at the constants at the start, it will begin by Logging in the Next Player, making sure that this player is True, IE, it will always repeat. It makes the LoadsNum2 = 0 again so that it doesnt logout instantly, and makes the compass south, writing in the Debug box "Players switched sucessfully'"

    Things to make your script appealing

    There are a few ways to make your script look sexy and appealing, and also to provide information and make it look official. The first part is signatures:

    Part One: Signatures

    Go here and get your signature text made up: http://www.network-science.de/ascii/

    Now we can start our signature. It is pretty basic. Mine is like this:

    SCAR Code:
    procedure Signature;
     begin
       ClearDebug;
       wait(250 + random(30));
       writeln('   Torrents Willow Crusher&Banker V2.1    ');
       wait(250 + random(30));
       writeln(' _____                                _   ');
       wait(250 + random(30));
       writeln('(_   _)                              ( )_ ');
       wait(250 + random(30));
       writeln('  | |   _    _ __  _ __   __    ___  | ,_)');
       wait(250 + random(30));
       writeln('  | | / _`\ ( "__)( "__)/"__`\/" _ `\| |  ');
       wait(250 + random(30));
       writeln('  | |( (_) )| |   | |  (  ___/| ( ) || |_ ');
       wait(250 + random(30));
       writeln('  (_)`\___/ (_)   (_)  `\____)(_) (_) \__)');
       wait(500 + random(30));
     end;

    It begins, and ClearDeubg's, which means it clears the debug box from any previous information that was there. It then rolls down the signature (Try it in your SCAR). Mine rolls down because I didnt want it all appearing at once, but remove the waits and you can.

    Part Two: Progress Reports

    Progress reports are harder, but again not to difficult, this is mine:

    SCAR Code:
    procedure ToFProggy;
    begin
      ClearDebug;
      Writeln(',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,');
      Writeln('/\Please Post Progress Reports & Any problems /\ ');
      Writeln('/\      From Wherever you got the script      /\ ');
      Writeln('//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ ');
      Writeln('//\\Worked For: '        + TimeRunning + '     //\\');
      Writeln('//\\Did: '        + IntToStr(LoadsNum)+ ' Loads                            //\\');
      Writeln('//\\Broke: '        + IntToStr(BrokenAxes)+ ' Axes                           //\\');
      Writeln('//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ ');
      Writeln('//\\      Thanks for Using my Script :D     //\\ ');
      Writeln('```````````````````````````````````````````````');
    end;

    Now note it has IntToStr, which means it turns the integer number (So when it banks the LoadsNum gets a +1 in the script, declared as a variable) into a bit or readable text, and then my LoadsNum in brackets tells it what to get.

    Part Three: Introductions

    How are you going to know what to do without it? Your not. This is my introduction, but you can make it look however you want. All it has to do is explain what your script is for, how to run it, and where to set it up.

    SCAR Code:
    {//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\///
    |                       Draynor Willow Crusher & Banker                        |
    |                            By Torrent of Flame                               |
    |                       Scar 3.14          SRL 4.0 Rev 14                      |
    |                                 Version 2.0                                  |
    |                    Chops Willows at Draynor and Banks them                   |
    |                             Start from Draynor Bank                          |
    |                                 Start Logged Out                             |
    |                      Replacement axes in first 2 bank slots                  |
    |                             Axe equipped or in First slot                    |
    |                                                                              |
    |                             How Many Loads at line 25                        |
    |                           Setup Player at lines 87-115                       |
    |                                SRL Stats at 65-66                            |
    |                                  Bank Pin at 69                              |
    |                                SMART World at 71                             |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

    Finally, Part 4: Version History

    This helps to tell people what you have updated since the previous version, this again is pretty basic, but I thought I should include it. You can have brief notes like me, or have chunks of text explaining why every update took place:

    SCAR Code:
    {/\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.1 Includes                                                          |
    |                                  Anti-Ban                                    |
    |                                 Anti-Random                                  |
    |                            Working Walking (Lol :D)                          |
    |         Complete Revision of Script - Sorted Unnecissary codes and BMP's     |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.2 Includes                                                          |
    |    Essential Repairs for Banking - Willow DTM was invalid, WillowBMP added   |
    |                                 Banking Works!                               |
    |                         Main Loop Fixed - Repeats after banking              |
    |                                                                              |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.3 Includes                                                          |
    |                                  Fixed Banking                               |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.4 Includes                                                          |
    |                                   SRL Stats                                  |
    |                                  Multi-Player                                |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.5 Includes                                                          |
    |                               BankPin Compatibility                          |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.6 Includes                                                          |
    |                                A Few Failsafes!                              |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.7 Includes                                                          |
    |                                 Modified Anti-Ban                            |
    |                                      DTM's                                   |
    |                                  SMART (Finally!)                            |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\                                                                               |
    |Version 1.8 Includes                                                          |
    |                                   Willow DDTM                                |
    |                                   Axe Checker                                |
    |                                Broken Axe Checker                            |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 1.9 Includes                                                          |
    |                                 Fixed a few Bugs                             |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
    |Version 2.0                                                                   |
    |                                 Current Release!                             |
    //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\}


    Thanks for reading! Dont forget to Repp++ or Rank the Thread!
    Jus' Lurkin'

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I think his idea was different ways to solve the same problem, such as different dropping methods depending on whether you want speed or accuracy or maybe even re-doing your own SRL functions or procedures to better suit you (e.g. Make 'DropItemCus(i: Integer; DItem: String);' so that you check that you only drop certain items).
    It's still a nice tut though
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Ah. I like my idea of a very intensive Beginners tutorial

    Gera sparked my imagination. Im still going to thank him
    Jus' Lurkin'

  5. #5
    Join Date
    Feb 2007
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I can't wait for progress reports. Having problem with them...and dropping procedures...
    Free runescape members? Yes, for 1 cent a click go here!
    http://www.stats.srl-forums.com/sigs/1854.png
    Need a tester? I could test for you. PM me for details =)

  6. #6
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Gabe, In my Mining tutorial, my drop procedure was well, improvised. I dont even think its right :P

    Still, noone has said otherwise.

    But yeah, when I can be bothered to finish, I think this will be a good little Tutorial
    Jus' Lurkin'

  7. #7
    Join Date
    Feb 2007
    Posts
    111
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nah. Hy let me use his dropping procedure. Yay I actually changed things and learned alot from you and Hy by changing things. So yea I didn't completely rip your tut. So I could call it my own script? Different drop, proggies, SRL stats. Eh can I? Yea your dropping thing didn't work.
    Free runescape members? Yes, for 1 cent a click go here!
    http://www.stats.srl-forums.com/sigs/1854.png
    Need a tester? I could test for you. PM me for details =)

  8. #8
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Hah. Im not too proud of it :P
    Jus' Lurkin'

  9. #9
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I always wondered why people have such problems with dropping when it can be as simple as:
    SCAR Code:
    procedure DropFrom(SI: Integer);
    var
      i: Integer;
    begin
      for i := SI to 28 do
        DropItem(i);
    end;
    And that is as simple as a custom easy dropping can be Though they can get a lot more complex by adding up text checkers etc. and this isn't even using DTM's/Bitmaps
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  10. #10
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    nice tut....lol ur unstoppable like your on SRL 24/7...gota admit im addicted rite now to scripting my self...so THX for the TUT...im 1/4 done on my hopefully 1000+ lines of my first script...this tut shud help thx...btw u seem reli helpfull can i add u on msn?? and repp++

    edit: lol wait i cant rep u cuz u were the last person i repped lol i probli repped u lyk 5 times for different things now

  11. #11
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice tut! I hope you get a scripters cup soon, I envy you. -.-

    GET job!

  12. #12
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Haha. I wouldnt mind the a cup :]

    Thanks Evil

    Yeah, Add me on MSN, Im not too bothered.

    And yeah, I am on SRL all the time I can. Hey, Im 14 with a Social life and good education. I need to find something to level out the Sport Social/Heavy Gamer.

    This is Socially Nerdish
    Jus' Lurkin'

  13. #13
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    WOOOT cant wait for part 11 i need sooo badly!! =) in part 11 can u also PLZZ show how to use DDTM to help mapwalking because i've seen many top scripts and it would have a procedure saying "PathtoBank" and they would use a DTM editor apparently...PLZ and THXX A bunch hope you get the cup that you want so badd...

  14. #14
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Torrent of Flame View Post
    Haha. I wouldnt mind the a cup :]

    Thanks Evil

    Yeah, Add me on MSN, Im not too bothered.

    And yeah, I am on SRL all the time I can. Hey, Im 14 with a Social life and good education. I need to find something to level out the Sport Social/Heavy Gamer.

    This is Socially Nerdish
    lol wow i thot i was young..but hmm got a partner i guess yea im 14 too u pretty intelligent for a 14 yr old..

  15. #15
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    So I've been told. A Grades at a Grammar School. Go me.

    Im very up to date on the world around us aswell. =]
    Jus' Lurkin'

  16. #16
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    can some admin plz give this guy a turial cup?

    this looks very nice, understandfull for newbies

    GJ

  17. #17
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by MasterKill View Post
    can some admin plz give this guy a turial cup?

    this looks very nice, understandfull for newbies

    GJ
    Thanks Mate
    Jus' Lurkin'

  18. #18
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    I'll give you that cup if you promise to keep up the good work.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  19. #19
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    To difficult for me explain to me in more simpler words.

    procedure EntFinder; //By Yohojo - Modded by BobboHobbo
    Lol at that procedure.

  20. #20
    Join Date
    Aug 2007
    Location
    Indiana
    Posts
    63
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    very helpful... +reph):

  21. #21
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    XD. Thanks Wizzup? I will keep up the work.

    Thanks MasterKill for the recommendation!

    Bobbo, I dont get the explain it to me bit?

    And yeah, it was a credited procedure I used so like, yeah use that one :]
    Jus' Lurkin'

  22. #22
    Join Date
    Apr 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice good tutorial!

  23. #23
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    geez you get SRL Members and start busting tuts out of you ass left and right. I have a feeling you had these pre-made SRL membership and was waiting until you got in . jk

    keep up the good work man you are making good tuts for people who want to know how to make something and straight to the point.

    i still have yet to write a tut.

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  24. #24
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Haha. Im writing 1.3 Tutorials a Day apparently

    Yeah, I had all these written up. Ofcourse *shifty eyes *
    Jus' Lurkin'

  25. #25
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    (waits on part 11..the part that's guna save my lifee ...so lost with how to use them...and hopfully for part 12 u can show how to use DDTM's and how to use with mapwalkin..
    hmm so u got the cup? if yes ..hel yea u deseved it nd congratzz

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SCAR Scripting Tutorial
    By Starblaster100 in forum OSR Outdated Tutorials
    Replies: 83
    Last Post: 12-18-2011, 10:34 PM
  2. Aser's Tutorial for basic SCAR scripting.
    By Aser in forum OSR Outdated Tutorials
    Replies: 10
    Last Post: 03-12-2009, 01:43 AM

Posting Permissions

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