Results 1 to 19 of 19

Thread: Drawing in SMART, TPAs, and More For Beginners! (Old School)

  1. #1
    Join Date
    Mar 2014
    Posts
    21
    Mentioned
    2 Post(s)
    Quoted
    6 Post(s)

    Lightbulb Drawing in SMART, TPAs, and More For Beginners! (Old School)

    Drawing in SMART, TPAs, and More For Beginners!
    (Old School)



    Introduction
    This tutorial is meant for the Old School Runescape beginner or intermediate tutorials section, unfortunately, I'm not qualified to post there, but knowing this tutorial will come in handy for someone I decided to post it here.
    *UPDATE* Thank You masterBB for moving it!

    This Tutorial started out as a tutorial for teaching people how to draw in SMART on old school, but in trying to make it as newbie friendly as I could, it ended up taking on a life of its own.

    Inspiration
    The inspiration for this guide came from the section in the The Mayors All-In-One RS3 and SRL6 Scripting Tutorial on TPoints, TPAs, ATPAs, and drawing in SMART, but instead, this will be written for use with the Old School Runescape include, as opposed to SRL-6 and RS3 include.

    The Mayors(Extremely Helpful) All-In-One RS3 and SRL6 Scripting Tutorial can be found here:
    http://villavu.com/forum/showthread.php?t=107757

    I highly recommend everyone at the very least read through The Mayors guide, even if you don't plan on scripting for RS3, most of it is basic principles that are applicable to both RS3 and old school.

    A special thanks to @Frement for answering my question on the forum which led to this tutorial!
    http://villavu.com/forum/showthread.php?t=108795

    Note: This tutorial is mainly a collection of what I have discovered by reading around the forum, or patterns and recurring themes that I have noticed when scripting myself. If anyone sees anything that is inaccurate or should be changed, let me know!

    Why Is Drawing in SMART Important?
    Drawing in SMART is essentially another debugging tool, like the debug box in Simba, it will help give you a better idea of what your script is doing and why it's doing it.

    I'm still a beginner myself so I'm still finding new ways to implement this functionality, but one big way this will help you, is it will allow you to create much more advanced custom object detection.

    Without being able to use SMART Graphics to draw in SMART, there's no way to really see what Simba sees when it's looking for colors in Runescape, all you may see is your mouse moving around like crazy with no real pinpoint indication of what it sees that's making it do that.

    By being able to draw in SMART, you have the ability to mark everywhere Simba finds the color you're looking for.

    This allows you to better test what works when looking for the object you need, and what you need to do to remove all the false positives.

    The possibilities are really only limited to your imagination!

    Table of Contents
    Introduction
    Inspiration
    Why Is Drawing in SMART Important?
    Lets Get Started
    How to Load the SMART Include
    TPoints
    SMART Login
    Mark Tpoint
    What's Going on in This Script?
    Creating a Variable
    Using IntToPoint / Setting the Value for our Variable
    Drawing a TPoint in SMART
    Running It
    TPAs TPointArrays
    What Are TPAs?
    The Current State of Documentation
    My First Attempt at Creating Documentation
    Lets Use Find Colors Tolerance!
    Putting it Together
    WriteLn
    Drawing a TPA in SMART
    Putting it Together
    Better Color Selection
    Running CTS2 Color Finding
    ATPAs Array of TPAs
    Putting it Together
    Final Thoughts

    Let's Get Started


    How to Load the SMART Include
    First things first, the Old School Include does not have any functions or procedures for drawing in SMART like the SRL-6 include does, so we need to load up the SMART Graphics include by adding this SmartGraphics include to the top of your script:

    Simba Code:
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}

    This will add SmartGraphics to your Functionlist:

    As you can see we now have all kinds of procedures beginning with SMART_ these will be what we will use to draw in the SMART Client on Runescape, but first we need something to actually mark in the game, which is the perfect opportunity to visually learn the basics about TPoints, TPoint Arrays (TPA) and ATPAs.

    TPoints

    Honestly I don't know what the T stands for in TPoint, but a TPoint is just 1 specific Point anywhere that you select using an x and y coordinate.

    (It's so simple it's almost hard to explain without feeling like I'm over complicating it) I think Tpoints are best explained Visually.

    Lets mark a TPoint using SMART Graphics.

    SMART Login
    First Get Your Script Ready to login with SMART, it should look something like this:

    Simba Code:
    program LearnToDraw;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;                //how many players
      NumberOfPlayers(HowManyPlayers);   //Number of players using howmanyplayers as a const
      CurrentPlayer := 0;                //Current player

      Players[0].Name    := ''; //username
      Players[0].Pass    := ''; //password
      Players[0].Nick    := ''; //3-4 letters of your username, no caps or first letter
      Players[0].Active  := true; //Active or not BOOLEAN true or false
      Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      Players[0].LampSkill := SKILL_MINING;
    end;

    begin
      ClearDebug();
      DeclarePlayers;
      setupsrl;
      LogInPlayer;
    end.
    Mark Tpoint
    Now you're ready to get started marking your Tpoint:

    Simba Code:
    procedure MarkTPoint();
    var
      oneLonelyDot: Tpoint; //can name oneLonelyDot anything, it just needs to be a Tpoint

    begin
      oneLonelyDot := IntToPoint(273, 287);{What we've done here is use the IntToPoint function
      (found in the OSR include under simba) to create a Tpoint. Then we set oneLonelyDot
      to represent that newly created Tpoint. The x and y coordinates needed to create a
      Tpoint are set to 273 and 287 so this is where the Tpoint will be created}


      SMART_DrawDot(false, oneLonelyDot, 16711680); {This is where we tell SMART to draw us
      our oneLonelyDot on the screen as well as what color he should be!}


    end;

    begin
      ClearDebug();
      DeclarePlayers;
      setupsrl;
    //  LogInPlayer; I dont need to login to mark the point
      MarkTPoint();//Lets mark that tpoint
    end.
    What's Going on in This Script?
    Creating a Variable
    First we created a variable:
    Simba Code:
    var
      oneLonelyDot: Tpoint;
    Before we do anything, we need to give Simba what I like to think of as a hypothetical "storage box" to store values in. We do this in the var (short for variable) section of the script. This gives Simba the ability to hold on to values for us so we can use them whenever we tell Simba we want to use them.

    The "storage box" we give Simba to hold a value can only hold 1 kind of value, so a "storage box" that is made for holding integers can't hold strings, Tpoints, TPAs etc. The way we tell Simba what kind of value we want our "storage box"(officially referred to as a variable) to hold is by using a : (colon).

    If we don't give Simba a "storage box" to hold values in, there is no way that we can use those values anywhere else in the script.
    Ex. Finding where a certain color is located on the screen is pretty useless if we don't have the ability to ask our script to recall the location of where that color was found. By using variables we have the ability to recall the location of a color, then move our mouse to, then click on that location.

    So as you can see in the script above, I named my "storage box" oneLonelyDot, and I set it as a "storage box" that will hold a TPoint by using a :

    You can create "storage boxes" in the var or const section of your script.

    var or variable "storage boxes" can be switched out with a different value any time you want, for example, you can say, for now I want you to hold onto the integer 1, then later in the script you can tell it to hold onto the integer 2 and it will remove the integer 1 from the "storage box" and hold onto 2 instead.

    Whereas with a const or constant, you can only have 1 value that can't be changed out for another value.

    Chances are, if you're reading this you probably know a lot of this, but it doesn't hurt to go over the basics.

    Note: I used "storage box" to refer to variables or constants in this tutorial, but you should always refer to them as variables or constants depending on which one you're using. I just used the term "storage boxes" to help you better mentally visualize their functionality and put it in quotes to emphisis that that's not really what they're called.

    Let's move on...
    Using IntToPoint / Setting the Value for our Variable
    Then we created a TPoint and told Simba to hold onto our TPoint in our oneLonelyDot variable. And all that took is 1 line.
    Simba Code:
    oneLonelyDot := IntToPoint(273, 287);
    The function we use is IntToPoint. When we click on IntToPoint in the Functionlist, here's what Simba says at the bottom (under the debug box):


    Simba Code:
    function IntToPoint(x, y : integer) : TPoint

    What this means is we need to put in an x and y value that is an integer (this x and y coordinate will indicate where we want our point to be), then this function will take the input of that x and y and output a TPoint for us to use. This is what people mean when they say a function returns something, in our case it is returning a TPoint, as opposed to a procedure that doesn't return anything.

    Then we need a way to tell Simba, "hey, I want to take the Tpoint that function is going to return, and store it in this Variable." We will be using the := to tell Simba to do that, it should look something like this:

    Simba Code:
    NameOfVariable := ('ValueIWantToStore');

    If we didn't give Simba the hypothetical "box" we talked about earlier by adding oneLonelyDot to the var section of our script, then when we tell Simba to store the value, it would give you an error indicating that it doesn't have a box to store the value in.

    Or in Simba terms:

    "Identifier expected at line..."
    Drawing a TPoint in SMART
    Ok, so now that we created a Point with IntToTpoint, and told Simba we want to refer to that TPoint as oneLonelyDot by using := ,now lets display that TPoint in SMART with the SMART_DrawDot procedure.

    Simba Code:
    SMART_DrawDot(false, oneLonelyDot, 16711680);

    When you click on SMART_DrawDot in the Simba Functionlist it says at the bottom:

    Simba Code:
    Procedure SMART_DrawDot(Clear: Boolean; Point: TPoint; Color: TColor)

    As you can see, this is a procedure so nothing will be returned. If you look there's no :integer :boolean etc. at the end after the closing ) like a function would have telling you what it's going to return.

    So all we need to do to make this function work is insert a Boolean, TPoint, and a TColor.

    As you probably know, for a Boolean you would either enter True or False, but what are you saying true or false to?

    Also it says Clear, but what does that mean?

    Without good documentation you will need to either, guess and test, look around the forums, double click the function and guess based on the code displayed, or ask in the IRC to find out.

    This is, in my opinion, the biggest downfall of using Simba for old school. There is no official documentation!

    Luckily the old school include is based very largely off of SLR-5 which does have some documentation kicking around that can be found here: http://docs.villavu.com/srl-5/srlref.html

    But all in all, most of the Documentation isn't really written with the newbie in mind making for a much steeper learning curve.

    In my opinion, good documentation should give you the ability to teach yourself, which I feel the current documentation doesn't really accomplish.

    So my next project plan is to put together some unofficial newbie friendly documentation with some of the more commonly used functions.

    Luckily SRL5 documentation actually has some pretty good documentation for drawing in smart that can be found here: http://docs.villavu.com/srl-5/paintsmart.html

    so if you check out that link and head on down to SMART_DrawDot, you'll see:
    "Draws a single colored dot (Color) at the set point (Point) on the SMART canvas. Will clear the SMART canvas if set to do so (Clear)."

    Alright so now we're getting somewhere!

    so lets look at this again:

    Simba Code:
    Procedure SMART_DrawDot(Clear: Boolean; Point: TPoint; Color: TColor)

    for the boolean: it doesn't really matter if we clear the canvas or not, so true of false, either should be fine.
    for the TPoint: we'll be using the TPoint we told Simba to hold onto in our oneLonelyDot variable.
    Then for the Color: you can use any color you want, to get a color I just used Simba's color picker tool and grabbed a blue and input that value.

    That's how I ended up with:
    Simba Code:
    SMART_DrawDot(false, oneLonelyDot, 16711680);
    Running It
    Now that We have the whole thing, now all we need to do is add MarkTPoint(); to the main loop and we're good to go. Also I didn't want SMART to log me in so I commented out log in player so Simba skips over logging me in when going through the main loop.

    Here's the whole completed script:

    Simba Code:
    program LearnToDraw;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;                //how many players
      NumberOfPlayers(HowManyPlayers);   //Number of players using howmanyplayers as a const
      CurrentPlayer := 0;                //Current player

      Players[0].Name    := ''; //username
      Players[0].Pass    := ''; //password
      Players[0].Nick    := ''; //3-4 letters of your username, no caps or first letter
      Players[0].Active  := true; //Active or not BOOLEAN true or false
      Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      Players[0].LampSkill := SKILL_MINING;
    end;

    procedure MarkTPoint();
    var
    oneLonelyDot: Tpoint; //can name oneLonelyDot anything, it just needs to be a Tpoint

    begin
      oneLonelyDot := IntToPoint(273, 287);{What we've done here is use the IntToPoint function
      (found in the OSR include under simba) to create a Tpoint. Then we set oneLonelyDot
      to represent that newly created Tpoint. The x and y coordinates needed to create a
      Tpoint are set to 273 and 287 so this is where the Tpoint will be created}


      SMART_DrawDot(false, oneLonelyDot, 16711680); {This is where we tell SMART to draw us
      our oneLonelyDot on the screen as well as what color he should be!}


    end;

    begin
      ClearDebug();
      DeclarePlayers;
      setupsrl;
    //  LogInPlayer; I don't need to login to mark the point
      MarkTPoint();//Lets mark that tpoint
    end.

    Run it and here's what we get!



    I'm not sure if you can see that little 1px by 1px blue dot there, I circled it in red to help you find it. Nope that's not dust on your screen, that my friends is SMART marking a TPoint.

    I know, I know, pretty awesome, just try to contain your excitement

    Sarcasm aside, we're going to use what we learned to create an army of those little TPoints to actually do some extremely useful stuff.

    Now drawing Tpoints is not the best use of Tpoints. Tpoints are better used for picking the spot you want to click on and things of that nature.

    Being that the focus of this tutorial is drawing in SMART, let's move on to groups of TPoints also known as TPAs.

    TPAs TPointArrays
    What Are TPAs?

    A Tpoint Array commonly referred to as a TPA, is just a fancy way of saying more than one Tpoint.

    What the T stands for still eludes me.

    TPAs can be extremely useful for telling you anywhere Simba finds a color and anything else that requires you to find multiple points on the screen.

    Instead of manually inputting a TPoint like we did earlier with the Tpoint, for this portion of the tutorial we are going to use a function that outputs miltiple Tpoints also known as a TPoint Array.

    The function we are going to use for this is FindColorsTolerance, make sure you don't use FindColorTolerance as that will only give us 1 point.

    FindColorsTolerance is part of the standard Simba include (don't think that's what it's actually called) anyways, these are all the functions you can use without adding any includes to the top of your script, they can also be used with both OSR and RS3. the documentation for most of the standard include can be found here:
    http://docs.villavu.com/simba/refere...html#scriptref

    So let's check out: http://docs.villavu.com/simba/script...olorstolerance
    The Current State of Documentation
    Here's one thing that has led to some of my thoughts about the current state of the documentation.

    So if we look at FindColorsTolerance, we've got this:

    function FindColorsTolerance(var pts: TPointArray; col, x1, y1, x2, y2, tol: Integer): Boolean;

    then for a description we have:

    "FindColorsTolerance returns true if at least one point was found. A point is found if it is within the given tolerance range tol of the given colour col and inside the box defined by x1, y1, x2, y2. Whether or not a color is within the tolerance range is determined by the Colour tolerance mode. It searches from the top left to the bottom right and will find all matching points in the area."

    Alright, so what it does talk about isn't too bad, but the problem lies in that the function returns more than just a Boolean, and doesn't even mention the TPointArray Sitting there and what that's all about.

    If you didn't know how to use this function before reading this description, it would be extremely difficult for you to figure out how to use this function properly just based on this description alone.

    If it weren't for @YoHoJo s and @The Mayor s awesome tutorials, I wouldn't have the slightest clue how to use it.

    I do have to cut some slack though, as I'm sure writing documentation is no easy task.

    So we can move on with this tutorial, I'm going to start a little draft for the first function that is going to go into my unofficial documentation:
    My First Attempt at Creating Documentation

    FindColorsTolerance

    Simba Code:
    function FindColorsTolerance(var pts: TPointArray; col, x1, y1, x2, y2, tol: Integer): Boolean;

    Functions Description

    The FindColorsTolerance function is used to find colors in the Color+Tolerance range you specify, within an area you specify. This Function will return a Boolean of True or False depending on whether or not your color has been found, as well as a TPointArray of everywhere your color has been found.

    Inputs Description:

    pts: TPointArray; The name of the variable where you would like to store the TPointArray of where colors have been found
    Col: Integer; The color you would like to look for
    x1, y1: Integer; Coordinates of the top left corner of your search area (box)
    x2, y2: Integer; Coordinates of the bottom right corner of the area (box)
    tol: Integer; The color tolerance range of colors you are looking for. must be an integer 0-255 0 being your exact color, 255 being all colors.

    Example:

    Simba Code:
    var
      myTPA: TPointArray;

    begin
      if FindColorsTolerance(myTPA, 4664632, 4, 4, 515, 337, 10) then
      begin
        WriteLn('Found The Color');
      end;
    end.

    notes:
    FindColorsTolerance is a multi-output function. With Functions only being able to have 1 official result, the other results need to be stored in a variable that you add to the input field, in the above example I used myTPA.
    Lets Use Find Colors Tolerance!
    Alright, so lets use this to do a little drawing in SMART!

    We're going to use SMART to Color some West Varrock bankers.

    First Lets fill out FindColorsTolerance(var pts: TPointArray; col, x1, y1, x2, y2, tol: Integer)

    1. The TPointArray is just going to be a variable we make to hold onto the TPA for us, I named mine tPointGang.

    2. let's grab the color of some Varrock West bankers using Simba's color picker.
    I got a nice dark purple with the value 4991801.

    3. Then we need to set the area you want to search. You can use the Simba Constants MSX1, MSY1, MSX2, MSY2, these stand for Main Screen X1 Y1 X2 Y2. These are just constants Simba added in that contain the top left coordinates and bottom right coordinates of the main screen so you don't have to remember them off the top of your head.

    Those coordinates are 4, 4, 515, 337, so for x1, y1, x2, y2 you can input either 4, 4, 515, 337, or MSX1, MSY1, MSX2, MSY2, they both mean the exact same thing to Simba, but I believe the standard is to use MSX1, MSY1, MSX2, MSY2 but I feel like seeing the coordinates written out help those who are a bit newer, better understand what's going on.

    In fact, if you search for MSX1, MSY1, MSX2 and MSY2 in the functionlist search box in Simba you will see:
    MSX1 = 4
    MSY1 = 4
    MSX2 = 515
    MSY2 = 337

    4. Then for tolerance I just put in 10 as more of a guess, I would say Tolerance is more of a guess and check kind of deal (for now anyways, soon we'll move on to better, more accurate ways) to see what works good. Too high of a tolerance and Simba will begin to find colors that are not what you're looking for. Too low of a tolerance and with Runescape's tendency to constantly change colors to a minor degree, and your function won't find any colors at all.

    So what I've got with all that is:

    Simba Code:
    FindColorsTolerance (tPointGang, 4991801, 4, 4, 515, 337, 10);
    Putting it Together
    Now here's what I put in simba to put that all together:

    Simba Code:
    var
      tPointGang: TPointArray;

    begin
      if FindColorsTolerance(tPointGang, 4991801, 4, 4, 515, 337, 10) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
      end;

    end;

    If you check out the function example:
    Simba Code:
    FindColorsTolerance(var pts: TPointArray; col, x1, y1, x2, y2, tol: Integer): Boolean;
    You'll see that little Boolean at the end.

    What this means is that we can put FindColorsTolerance in an if then conditional statement, and what this will do is:
    if FindColorTolerance returns a True (that it did in fact find a color) then it will run the code you place after the then.

    However, if FindColorsTolerance returns false, in other words, it did not find the color, Simba will skip over:
    Simba Code:
    begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
      end;


    Alright so lets move on to what the rest of the code means
    WriteLn


    Simba Code:
    WriteLn('Found The Color Now Lets Draw That TPA!');

    As you probably know, WriteLn just outputs what you tell it to in the debug box so your script talks to you, it's a way of knowing whether or not the script found the color, because if it didn't find the color, our If Then statement would cause Simba would skip over the WriteLn, but if it did find it, then it's going to write "Found The Color Now Lets Draw That TPA!" in the debug box.
    Drawing a TPA in SMART

    Simba Code:
    SMART_DrawDots(tPointGang);

    Remember how we used SMART_DrawDot to draw our 1 TPoint earlier? well the Simba procedure for drawing multiple TPoints, also known as a TPA, is SMART_DrawDots.... with an s on the end..... crazy stuff right?

    Well actually it is a little bit different.

    SMART_DrawDot gave us the ability to clear the screen and set a color of our dots, but SMART_DrawDots does not have that functionality

    Fear not however, for those of you who have a need to clear the screen and set a color for your little dots, there is a solution. SMART_DrawDotsEx does have those functionalities! I'm guessing the Ex at the end stands for Extended or Extended Functionality, either way, it gives you the power to clear the screen and make all those little TPoints any color you want.
    Putting it Together
    After adding MarkTPointArray(); to the main loop, here's what we've got:

    Simba Code:
    program LearnToDraw;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;                //how many players
      NumberOfPlayers(HowManyPlayers);   //Number of players using howmanyplayers as a const
      CurrentPlayer := 0;                //Current player

      Players[0].Name    := ''; //username
      Players[0].Pass    := ''; //password
      Players[0].Nick    := ''; //3-4 letters of your username, no caps or first letter
      Players[0].Active  := true; //Active or not BOOLEAN true or false
      Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      Players[0].LampSkill := SKILL_MINING;
    end;

    procedure MarkTPointArray();
    var
      tPointGang: TPointArray;

    begin
      if FindColorsTolerance(tPointGang, 4991801, 4, 4, 515, 337, 10) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
      end;

    end;

    begin
      ClearDebug();
      DeclarePlayers;
      setupsrl;
      LogInPlayer;
      MarkTPointArray();
    end.


    Then when I ran it.



    Honestly it did much better finding the bankers than I thought it would considering that it was a shot in the dark with the color Tolerance and it's using CTS1.
    Better Color Selection
    So how can we make this work better?

    Were going to use an awesome tool called Auto Color Aid. I'm not going to go into the specifics of how to use ACA because @YoHoJo already put together an awesome tutorial that you can find here:
    http://villavu.com/forum/showthread.php?t=71074

    If you've never used ACA check out that video tutorial now, then come back here and I'll show you how to implement it in your script for drawing with smart.

    So if you have used ACA , you know CTS2, or Color Tolerance Speed 2 is much more accurate at finding colors than the default CTS1 that Simba is set to use. The reason for this has a lot to do with the 2 extra values of HueMod and SatMod.

    As a little heads up, we're not going to use any of the auto-generated functions from ACA, we're going to be implementing the values into our script ourselves manually.

    But how do we go about adding HueMod, SatMod and HSL tol into FindColorsTolerance if there is nowhere to input
    them?

    For that, all we need is the assistance of 2 simple procedures...
    SetColorToleranceSpeed, and SetColorspeed2Modifiers.

    to change the default ColorToleranceSpeed from the default CTS1 Simba is using to CTS2, just add this to your script:
    Simba Code:
    SetColorToleranceSpeed(2);

    Once you set your script to Use CTS2, it's going to be looking for those HueMod and SatMod Values.

    So to set the HueMod and SatMod, you just need to add the SetColorspeed2Modifiers procedure to your script:
    SetColorspeed2Modifiers(huemodifier, saturationmodifier: Extended);

    For those of you who don't know, an extended value is just an integer that can use decimal places. So for this example, you will just take the HueMod and SatMod values for ACA and input them here like so:
    Simba Code:
    SetColorSpeed2Modifiers(0.12, 0.53);


    Then the HSL Tolerance will just go into the tolerance input of FindColorsTolerance.
    Running CTS2 Color Finding
    so now we've got:
    Simba Code:
    procedure MarkTPointArray();
    var
      tPointGang: TPointArray;

    begin
      SetColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.12, 0.54);

      if FindColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
      end;

    end;

    And we get something like this:
    (I surpassed my 5 attachments per post so I don't think I can add anymore images, so just ignore the colored squares and that's what the CTS2 FindColorTolerance showed me. We'll go over the colored squares in the next section)



    As you can probably see, now we're getting somewhere, but lets take it a step farther with ATPAs.

    *Update* Resetting CTS Values
    As you can see, what we have works perfectly well, there is one flaw however that I completely overlooked, and a big thanks to The Mayor for pointing it out to me!

    What we have right now is the scripting equivalent to adjusting the drivers seat in someone else's car, then not readjusting it to how it was before you messed it all up. Or even worse, leaving the toilet seat up when there's a female in the house!

    What's this outrageous act of scripting indecency you ask?

    Not Resetting the CTS and Color Speed Modifiers!

    What happened is in the previous section we used:
    Simba Code:
    SetColorToleranceSpeed(2);
    SetColorSpeed2Modifiers(0.12, 0.54);

    To change our CTS and Hue and Sat Mods.

    The problem lies in the fact that Simba already had some values stored for CTS, Hue Mod and Sat Mod, and in order to restore order and balance to our script, we should really turn those values back to their defaults when we are done using them, as these values will remain whatever you change them to for the life of your script.

    So there are multiple ways to do this...

    By default Simba should be using CTS 1 and the Color Speed Modifiers should both be set to 0.2
    so when you're done searching for a color you could just add this to your script:

    SetColorToleranceSpeed(1);
    SetColorSpeed2Modifiers(0.2, 0.2);

    And that should work just fine, however, there is a much more professional way to do it.

    Say for whatever reason the default values changed or you didn't know them off of your head.

    There is a way to tell Simba to reset to default by grabbing the default values and holding them in a variable, then resetting to those defaults by using those variables.

    So of course first thing we have to do is add those variables that will hold onto the original values, I named mine OGCTS, OGHueMod and OGSatMod:

    Simba Code:
    var
      OGCTS: Integer;
      OGHueMod, OGSatMod: Extended;

    In order to grab the default values we just need to use:
    function GetToleranceSpeed():integer
    and
    procedure GetColorspeed2Modifiers(var hue,sat : extended);

    As you can see GetToleranceSpeed is a function so it will return an integer of whatever our CTS is currently set to, so just add this to your script to set OGCTS to the current color tolerance speed:

    Simba Code:
    OGCTS := GetColorToleranceSpeed();

    The GetColorSpeed2Modifiers procedure may look a little more complicated, this is just because it needs to give us 2 values so instead of making it a function, they decided to make it a procedure that will grab the values of the current hue and sat mod and put them into whatever variables you decide to put in the input, so for this example I put in OGHueMod and OGSatMod so it looks like this:

    Simba Code:
    GetColorspeed2Modifiers(OGHueMod, OGSatMod);

    And when I run that line of code it will store the current Hue Mod and Sat Mod into OGHueMod and OGSatMod.

    While that may all sound a little complicated written out, getting the orginal Hue and Sat mod is as easy as adding:

    Simba Code:
    OGCTS := GetColorToleranceSpeed();
    GetColorspeed2Modifiers(OGHueMod, OGSatMod);

    To the top of your script.

    Important: in order to make sure this stores the Simba defaults, you need to make sure you run those 2 lines before you make any changes to the CTS or Color Speed Modifiers.

    If you grab the CTS and Color Speed Modifiers after you make changes, as you can probably guess, you would get the values of the changes you made as opposed to the original values.

    So now that we have all of the original values stored in our variables, here's how we reset the CTS and Color Speed Modifiers to their original values.

    Simba Code:
    SetColorToleranceSpeed(OGCTS);
    SetColorSpeed2Modifiers(OGHueMod, OGSatMod);

    I'm sure you can probably guess that you would replace OGHueMod, OGSatMod and OGCTS with whatever you decided to name your variables.

    So lets take a look at this in action based on our script in the previous section:

    Simba Code:
    procedure MarkTPointArray();
    var
      OGCTS: Integer;
      OGHueMod, OGSatMod: Extended;

      tPointGang: TPointArray;

    begin
      //begin grabbing original values
      OGCTS := GetColorToleranceSpeed();
      GetColorspeed2Modifiers(OGHueMod, OGSatMod);
      //end grabbing original values
     
      //begin changing CTS and Color Speed Modifiers values
      SetColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.12, 0.54);
      //end changing values
     
     
      //Begin using new CTS2 values
      if FindColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12) then
      //End Using CTS2 Values, I can reset values now
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
      end;
     
      //Begin Resetting Values to original I like to do it at end of procedure as personal preference
      SetColorToleranceSpeed(OGCTS);
      SetColorSpeed2Modifiers(OGHueMod, OGSatMod);
      //End Resetting values they are now set to the Simba defaults

    end;

    I feel like written out that looks much more complicated then it actually is, but once you begin implementing it in your own scripts it will make a lot more sense.

    Alright so now we can move on to ATPAs
    ATPAs Array of TPAs
    Array of TPointArrays better known as ATPAs.

    What we created in the previous section is just 1 big huge TPA, if we divide that big TPA into multiple smaller TPAs,
    we have then created an Array of TPAs or ATPA.

    For our example, we're going to give each banker their very own TPA!

    To do this we're going to use the TPAtoATPAEx function:
    TPAtoATPAEx(const TPA: TPointArray; w, h: Integer): T2DPointArray;

    So for this, we're going to put in our current TPA, a max width and height we want our new TPAs to be and it will give us a T2DPointArray.

    Simba Code:
    TPAtoATPAEx(tPointGang, 30, 40);

    A T2DPointArray is the official value name for an ATPA. So when declaring what kind of variable your ATPA's variable is going to be, you will put in T2DPointArray, not ATPA, Simba has no clue what an ATPA is.

    So in case you didn't guess already, we're going to need to add an ATPA (T2DPointArray) to our variables in order to give Simba a "storage box" to hold our ATPA in. I'll just call it ATPA, but you can call it anything you would like to :

    Simba Code:
    var
      tPointGang: TPointArray;
      ATPA: T2DPointArray;

    Then we'll need to set our ATPA variable to the ATPA that TPAtoATPAEx function is going to return.
    If you remember from earlier in the tutorial, this is done using the old := we talked about earlier in the tutorial.

    Simba Code:
    ATPA := TPAtoATPAEx(TPA, 30, 40);

    So now that we have created our ATPA, We'll want to see what it looks like by drawing in smart.
    We'll do this using SMART_DebugATPA:
    SMART_DebugATPA(Clear: Boolean; ATPA: T2DPointArray);

    So we'll set true of false to whether or not we want SMART to clear everything that is currently on the screen (not too important for us right now, true if you want it to clear our TPA dots off the screen or False if you want it to keep them), then we add in our new ATPA variable to tell Simba and SMART the ATPA we want SMART to draw for us.

    So it should look something like this:

    Simba Code:
    SMART_DebugATPA(False, ATPA);
    Putting it Together
    So if we put all that together, here's what we've got:

    Simba Code:
    procedure MarkTPointArray();
    var
      tPointGang: TPointArray;
      ATPA: T2DPointArray;

    begin
      SetColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.12, 0.54);

      if FindColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
        ATPA := TPAtoATPAEx(tPointGang, 30, 40);
        SMART_DebugATPA(False, ATPA);
      end;

    end;

    And here's what the completed script looks like:

    Simba Code:
    program LearnToDraw;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;                //how many players
      NumberOfPlayers(HowManyPlayers);   //Number of players using howmanyplayers as a const
      CurrentPlayer := 0;                //Current player

      Players[0].Name    := ''; //username
      Players[0].Pass    := ''; //password
      Players[0].Nick    := ''; //3-4 letters of your username, no caps or first letter
      Players[0].Active  := true; //Active or not BOOLEAN true or false
      Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      Players[0].LampSkill := SKILL_MINING;
    end;

    procedure MarkTPointArray();
    var
      tPointGang: TPointArray;
      ATPA: T2DPointArray;

    begin
      SetColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.12, 0.54);

      if FindColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
        ATPA := TPAtoATPAEx(tPointGang, 30, 40);
        SMART_DebugATPA(False, ATPA);
      end;

    end;

    begin
      ClearDebug();
      DeclarePlayers;
      setupsrl;
      LogInPlayer;
      MarkTPointArray();
    end.

    And then when we run it:



    As you can see, each banker gets their own unique box that you can move your mouse to, to click on them.

    The real power of this comes from the fact that in a way it gives simba the ability to recognize the size of objects.

    For example, now when someone walks in with hair with the same color as the banker you're looking for, you can use something like the FilterTPAsBetween procedure to remove any TPA that has a length less than 30.
    Final Thoughts
    That's just etching the surface of the capabilities Tpoints, TPAs, ATPAs, and Drawing in SMART will give you.

    Being that this tutorial has surpassed the 4000 word mark I think I'm gonna wrap it up here.

    If you want to take things to the next level, I highly recommend you play with the TPA functions that can be found here:

    http://docs.villavu.com/simba/scriptref/tpa.html

    As well as the SMART Drawing functions you can find here:

    http://docs.villavu.com/srl-5/paintsmart.html

    No tutorial will teach you as much as you'll learn by trying things out for yourself.

    I hope you guys learned half as much from reading this tutorial as I did from writing it.

    ~Mystery Muffin~
    Attached Images Attached Images
    Last edited by MysteryMuffin; 05-06-2014 at 06:28 PM.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Awesome work man. rep+
    There used to be something meaningful here.

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by MysteryMuffin View Post
    []This tutorial is meant for the Old School Runescape beginner or intermediate tutorials section, unfortunately, I'm not qualified to post there.
    Moved.
    Working on: Tithe Farmer

  4. #4
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    This appears to be a beautiful guide and while Im not sure of its contents (since I don't do anything with OSRS nor with Simba tbh).

    I read through a good portion of it an a lot of what I read seem very well written, and I like the snarky little comments and the almost commentary of explaining what you are doing.

  5. #5
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Awesome tut! You may want to have a bit about resetting the CTS and modifers to default after you search for the colour. If you don't, all the other colour finding stuff in your script (including SRL functions) will use those CTS and modifiers and won't work properly. I think the T stands for type

  6. #6
    Join Date
    Mar 2014
    Posts
    21
    Mentioned
    2 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    You may want to have a bit about resetting the CTS and modifers to default after you search for the colour.
    First off I'm pretty pumped you read my tutorial.

    While Coh3n's tutorial was extremely helpful, your all All in One Tutorial is the one that really brought everything together for me, and with a little more first hand experience writing my own tutorial, I have all that much more respect. yours must have taken at least a month to write! Where's the donate button?

    Anyway, back to the business...

    Setting the CTS and color modifiers was something I found out by chance when messing around and trying to figure out how the ACA generated functions worked. Honestly I was surprised it actually worked that easily, I should have known there was a catch.

    (That must be why they don't let me post in the Runescape tutorial sections )

    I like to try to figure things out for myself, before asking around, so here's the solution I came up with for resetting the values.

    First I figured I had to figure out what the default values are, so I slapped together this simple little script:

    Simba Code:
    program new;
    {$I SRL-OSR/SRL.Simba}
    var
      CTS: integer;
      Hue: extended;
      Sat: extended;

    begin
      ClearDebug();

      CTS := GetColorToleranceSpeed();
      GetColorspeed2Modifiers(Hue, Sat);

      WriteLn('Color Tolerance Speed: ' + IntToStr(CTS));
      WriteLn('Hue: ' + ToStr(Hue));
      WriteLn('Sat: ' + ToStr(Sat));
    end.

    which gave me:

    Color Tolerance Speed: 1
    Hue: 0.2
    Sat: 0.2
    Successfully executed.

    I was a little surprised, I was thinking the Hue and Sat mods would be 0.0 instead of 0.2

    So I tested out adding this to the script:

    Simba Code:
    SetColorToleranceSpeed(1);
    SetColorSpeed2Modifiers(0.2, 0.2);

    So here's what the full script I came up with based on the one in the tutorial (It appears to work)

    Simba Code:
    program LearnToDraw;
    {$DEFINE SMART}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}

    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 1;                //how many players
      NumberOfPlayers(HowManyPlayers);   //Number of players using howmanyplayers as a const
      CurrentPlayer := 0;                //Current player

      Players[0].Name    := ''; //username
      Players[0].Pass    := ''; //password
      Players[0].Nick    := ''; //3-4 letters of your username, no caps or first letter
      Players[0].Active  := true; //Active or not BOOLEAN true or false
      Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      Players[0].LampSkill := SKILL_MINING;
    end;

    procedure MarkTPointArray();
    var
      tPointGang: TPointArray;

    begin
      SetColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.12, 0.54);

      if FindColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
      end;


      SetColorToleranceSpeed(1); //Reset the CTS
      SetColorSpeed2Modifiers(0.2, 0.2);//Reset the Hue and Sat Mods

    end;

    begin
      ClearDebug();
      DeclarePlayers;
      setupsrl;
      LogInPlayer;
      MarkTPointArray();
    end.

    Do you think this is a good solution or is there a better way to do it?

    Seriously thanks for the feedback and looking over the tutorial, being a newbie it's super helpful to have someone who knows what they're doing look it over for the little things I overlook with my inexperience.

    You're kinda my hero

  7. #7
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    p := Point(50, 50);

    Is exactly the same as

    p := intToPoint(50, 50);

    I like point() more, but it's all personal preference.

  8. #8
    Join Date
    Sep 2008
    Posts
    754
    Mentioned
    8 Post(s)
    Quoted
    275 Post(s)

    Default

    Very nice tutorial, you've placed a lot of effort into it and i applaud you for that.
    Well done!.

    As Mayor have said, it's best to reset color modifiers after using them:

    Simba Code:
    // Resetting Color correctly.
    procedure MarkTPointArray();
    var
      tPointGang: TPointArray;
      ATPA: T2DPointArray;
    begin
      SetColorToleranceSpeed(2);   // We set our Color Modifiers.
      SetColorSpeed2Modifiers(0.12, 0.54);
      if FindColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SetColorToleranceSpeed(1);   // We re-set our color modifiers to the default
        SetColorSpeed2Modifiers(0.2, 0.2); // CTS1, Hue/Sat 0.2 is default.
        SMART_DrawDots(tPointGang);
        ATPA := TPAtoATPAEx(tPointGang, 30, 40);
        SMART_DebugATPA(False, ATPA);
      end;
      SetColorToleranceSpeed(1);   // And maybe we didn't find colors? we wanna reset anyway.
      SetColorSpeed2Modifiers(0.2, 0.2);
    end;

    While the above works, here is a better way to write the procedure.. It's easier:

    Simba Code:
    //Easier way to reset colors with fail safe check.
    procedure MarkTPointArray();
    var
      tPointGang: TPointArray;
      ATPA: T2DPointArray;
      X,Y:integer;
    begin
      SetColorToleranceSpeed(2);   // We set our Color Modifiers.
      SetColorSpeed2Modifiers(0.12, 0.54);
      FindColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12); // It searches for the Color using TPA to store the data with the color set.
      SetColorToleranceSpeed(1);   // If it finds it, then it's stored, reseting the color now can be done safely without effecting the result.
      SetColorSpeed2Modifiers(0.2, 0.2); // CTS1, Hue/Sat 0.2 are the default.
       if (length(tPointGang) > 0) then  // If the TPA is larger than 0 (I.E it was found) then it will say it found our color
        WriteLn('Found The Color Now Lets Draw That TPA!, And Its Length is:  ' + IntToSTr(Length(TpointGang)))
      else  exit;  // It will safely exit with the colors reset if it wasn't found!.
      If MiddleTPAEx(tPointGang, x, y) Then
      WriteLn('TPAs Middle point X is '+IntToStr(x)+', And the middle point Y is '+IntToStr(y));  // tells us exactly where the point is on Smart
      SMART_DrawDots(tPointGang);  //Draws our dots on smart!.
      TPAtoATPAExWrap(tPointGang, 30, 40, ATPA); // ATPA := TPAtoATPAEx(tPointGang, 30, 40);, it's usually better to use Wrappers since they work around bugs/leaks.
      SMART_DebugATPA(False, ATPA);    // Debugs our ATPA on Smart.
    end;

    This is a pretty well detailed guide, good job on that!. I think you can add a few more links to it (just throwing it out there, but i think i did a good job here explaining how to use ACA :P.

    And @MysteryMuffin, best way to use mention is with the tags

    MENTION] Insert Brackets and name goes here! /MENTION]
    ^ and not @ name , don't worry i've done that mistake as well.

    Really good job, i hope to see more from ya buddy! repped 4 sure.
    Quit gaming

  9. #9
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Yea like that, but by doing it that way you are always resetting the CTS to 1. That might be a problem when your CTS is not 1 to begin with. It's common to assign the current CTS to an integer var and then reset it to that after.

    Simba Code:
    procedure markTPointArray();
    var
      CTS: Integer;
      tPointGang: TPointArray;
    begin
      CTS:= GetColorToleranceSpeed();

      setColorToleranceSpeed(2);
      setColorSpeed2Modifiers(0.12, 0.54);

      if findColorsTolerance(tPointGang, 4729655, 4, 4, 515, 337, 12) then
      begin
        WriteLn('Found The Color Now Lets Draw That TPA!');
        SMART_DrawDots(tPointGang);
      end;

      colorToleranceSpeed(CTS);
      setColorSpeed2Modifiers(0.2, 0.2);

    end;

    SRL6 is way better because it does this for you
    Last edited by The Mayor; 05-06-2014 at 03:30 AM. Reason: Dat English

  10. #10
    Join Date
    Sep 2008
    Posts
    754
    Mentioned
    8 Post(s)
    Quoted
    275 Post(s)

    Default

    True, always best get the current CTS state and reset it to the temporary CTS :-).

    Also, is it possible to add auto re-setting to color Modifiers to OSRS'S pascal based include? (i'll check out SRL6 now, even though i don't play RS3 at all!).
    Quit gaming

  11. #11
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by samerdl View Post
    True, always best get the current CTS state and reset it to the temporary CTS :-).

    Also, is it possible to add auto re-setting to color Modifiers to OSRS'S pascal based include? (i'll check out SRL6 now, even though i don't play RS3 at all!).
    Just overloads:
    if(findColorTolerance(x, y, 4729655, MSX1, MSY1, MSX2, MSY2, 10, colorSetting(2, 0.12, 0.5))) then
    Working on: Tithe Farmer

  12. #12
    Join Date
    Sep 2008
    Posts
    754
    Mentioned
    8 Post(s)
    Quoted
    275 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    Just overloads:
    if(findColorTolerance(x, y, 4729655, MSX1, MSY1, MSX2, MSY2, 10, colorSetting(2, 0.12, 0.5))) then
    Been checking lape for the past few days, overloading is pretty cool but can't be passed with Pascal as interpreter .
    Anyway, back on topic - good guide hope to see more from you .
    Quit gaming

  13. #13
    Join Date
    Dec 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    I got this error

    Exception in Script: Runtime error: "The bitmap[-1] does not exist" at line 32, column 28 in file "C:\Simba\Includes\SRL-OSR\SRL\misc\SmartGraphics.simba"

  14. #14
    Join Date
    Mar 2014
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Exception in Script: Runtime error: "The bitmap[-1] does not exist" at line 32, column 28 in file "C:\Simba\Includes\SRL-OSR\SRL\misc\SmartGraphics.Simba"
    can someone help?

  15. #15
    Join Date
    Aug 2013
    Posts
    230
    Mentioned
    1 Post(s)
    Quoted
    114 Post(s)

    Default

    Thanks for the Tutorial. It was a nice read.

  16. #16
    Join Date
    Mar 2014
    Posts
    21
    Mentioned
    2 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Unfold View Post
    Thanks for the Tutorial. It was a nice read.
    Thanks for reading it and taking the time to post, it means a lot.

    I just reread it myself, it's hard to believe all that stuff was new to me 2 and a half months ago with how second nature it feels now.

  17. #17
    Join Date
    Mar 2014
    Posts
    21
    Mentioned
    2 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Hakker View Post
    Exception in Script: Runtime error: "The bitmap[-1] does not exist" at line 32, column 28 in file "C:\Simba\Includes\SRL-OSR\SRL\misc\SmartGraphics.Simba"
    can someone help?
    I'm sure you've already moved on past this, so this is more for people who might run into the same problem in the future.

    Without seeing the script you tried to run, this is a complete shot in the dark as I can't attempt to reproduce the error, but here goes.

    If I open up C:\Simba\Includes\SRL-OSR\SRL\misc\SmartGraphics.Simba and go to line 32 here's what we're working with:

    Simba Code:
    {$IFDEF LAPE}
      SetPersistentMemoryBitmap(SMART_Canvas.getIndex(), SmartDebugArray(smartCurrentTarget), 765, 503);// line 32
      SMART_Canvas.drawClear(0); //clear it in case of previous usage
      {$ELSE}
      SetPersistentMemoryBitmap(SMART_Canvas.index, SmartDebugArray(smartCurrentTarget), 765, 503);
      SMART_Canvas.FastDrawClear(0); //clear it in case of previous usage

    I'm guessing {$IFDEF LAPE} means if you're using the Lape interpreter.

    I'm thinking that means the only way you would get an error on line 32 of SmartGraphics.Simba is if your interpreter was set to Lape.

    For Old School, (which this tutorial caters to) your interpreter should be set to PascalScript.

    If none of that makes any sense to you:

    Open up Simba > Click on script > Interpreter > PascalScript

    and run your script again and see if you get any errors.
    Last edited by MysteryMuffin; 07-20-2014 at 04:44 PM.

  18. #18
    Join Date
    Mar 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great work, thanks for sharing!

  19. #19
    Join Date
    Jan 2013
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default

    Awesome work man. Definitely helped me out.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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