Results 1 to 8 of 8

Thread: AutoColor issues.

  1. #1
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default AutoColor issues.

    Im trying to use AutoColor(srl_TreeColor) and I occationally run into an error

    colortree := AutoColor(srl_TreeColor);

    results in Math error at line 239 in color.scar, function GetColorArrayInfo.

    the line is

    Result[i][ii][2] := Result[i][ii][2] / h;
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  2. #2
    Join Date
    May 2011
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I can't seem to produce the same error you are having. Could you possibly post the script or send it to me through e-mail?
    Need help with a problem?

    Email: jerryt.srl@gmail.com

  3. #3
    Join Date
    Mar 2006
    Location
    Behind you
    Posts
    3,193
    Mentioned
    61 Post(s)
    Quoted
    63 Post(s)

    Default

    You have the Script

    Simba Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--                 AutoColorFinding Routines                   --//
    //-----------------------------------------------------------------//
    // * procedure SetupAutoColors;
    // * function LoadColorArray(Which: Integer): TIntegerArray;
    // * function LoadAutoColor(which: Integer; var theAC: TAutoColorInfo): Boolean;
    // * function AutoColorEx(which: Integer): TAutoColorInfo;
    // * function AutoColor(which: Integer): Integer;
    //-----------------------------------------------------------------//

    { const AutoColor Constants;
      Description: Constants representing the different types of AutoColors }

    const
      srl_AutoColorCount   = 13;
        srl_VarrockRoadColor   = 0;
        srl_LumbridgeRoadColor = 1;
        srl_FaladorRoadColor   = 2;
        srl_AlKharidRoadColor  = 3;
        srl_DarkDirtRoadColor  = 4;
        srl_LightDirtRoadColor = 5;
        srl_SandColor          = 6;
        srl_WaterColor         = 7;
        srl_SwampWaterColor    = 8;
        srl_LadderColor        = 9;
        srl_RockColor          = 10;
        srl_MineRockColor      = 11;
        srl_TreeColor          = 12;

    ~BraK

    "Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."

  4. #4
    Join Date
    May 2011
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, Brak.

    I need to take a look at his script to see what is causing the problem.
    Need help with a problem?

    Email: jerryt.srl@gmail.com

  5. #5
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Code:
    function gettrees(var ptr: TPoint): boolean;
    var
      tpatree, tpatreebest: TPointArray;
      atpatree: array of TPointArray;
      i, colortree: Integer;
      ptree: TPoint;
    begin
      result := false;
      if not LoggedIn then exit;
      ptr := point(-1, -1);
      colortree := AutoColor(srl_TreeColor);
      findColorsTolerance(tpatree, colortree, mmx1, mmy1, mmx2, mmy2, 15);
      DebugTPA(tpatree, 'a');
      wait(2000);
      if high(tpatree) = 0 then writeln('nope');
      FilterPointsPie(tpatree, 180, 265, 10, 70, mmcx, mmcy);
      DebugTPA(tpatree, 'mmtrees');
      atpatree := SplitTPA(tpatree, 15);
      for i := 0 to high(atpatree) do
        if high(atpatree[i]) > high(tpatreebest) then
          tpatreebest := atpatree[i];
      DebugTPA(tpatreebest, 'tpatree');
      if length(tpatreebest) < 1 then
        exit;
      writeln('a')
      ptr := MiddleTPA(tpatreebest)
      result := true;
    end;
    I just tried the function with colour 0 instead of AutoColoring, and I didnt get the error, but Im standing in draynor bank. Tried it with AutuColor and it did it again.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  6. #6
    Join Date
    May 2011
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Could you send me the full script to examine? I am still not getting any error.

    Is this a script you wrote, or did someone else write this?
    Need help with a problem?

    Email: jerryt.srl@gmail.com

  7. #7
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    edit: nvm its working now o_O, maybe my shits just going crazy.

    I'd rather not, but if I dont work it out Ill post it here. Im just reworking an old script and thats the only new procedure.

    If anyones having this same error, http://villavu.com/forum/showpost.ph...1&postcount=16 FindTreeColor still works (haha after 2 years )
    Last edited by noidea; 06-07-2011 at 03:39 AM.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  8. #8
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    "Math Errors" are typically when you divide by the wrong type or zero.. but divide by zero is said as such.. I'm wondering if it was NaN or something similar? Perhaps I did not initialize the variables correctly.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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
  •