Results 1 to 5 of 5

Thread: a lil help with 2 things

  1. #1
    Join Date
    May 2007
    Location
    in the forest
    Posts
    190
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default a lil help with 2 things

    1) howcome I get a
    [Runtime Error] : Exception: Access violation at address 006D5701 in module 'scar.exe'. Read of address 00000030 in line 239 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar

    everytime My script detects a random?

    also

    do you think this autocoloring function I made is adequite?
    SCAR Code:
    {*******************************************************************************
    function function MyAutoColor: Integer;
    By: Tazzin44
    Description: autocolors whatever you need just remember to declare the variable
                 ColorToFind in the procedure/function you are using this in
                 ColorToFind is, simply put the color you need to autocolor.
    *******************************************************************************}



    function MyAutoColor: Integer;
    var
      I, C2, Red, Green, Blue,RMGH, RMGL, RMBH, RMBL, TestColor: Integer;
      TP: TPointArray;

    begin
      FFlag(0);  //waits to be safe
      FindColorsSpiralTolerance(MMCX, MMCY, TP, ColorToFind, MMX1, MMY1, MMX2, MMY2, 60); //searches for the color from the center out
      C2 := High(TP);
      for I:=0 to C2 do
      begin
        if rs_OnMinimap(TP[i].x,TP[I].y) then // checks to see if the color is on the minimap
          begin
            TestColor := GetColor(TP[I].x,TP[I].y);
            ColorToRGB(TestColor, Red, Green, Blue);
            RMGH := ((Red - Green) + 4);
            RMGL := ((Red - Green) - 4);
            RMBH := ((Red - Blue) + 4);
            RMBL := ((Red - Blue) - 4);
            if InRange((Red - Green),RMGH, RMGL) then
              if InRange((Red - Blue),RMBH,RMBL) then
                 if GetColor(TP[I].x + 2, TP[I].y + 2) = TestColor then
                    if GetColor(TP[I].x + 1, TP[I].y + 1) = TestColor then
                      if GetColor(TP[I].x, TP[I].y + 2) = TestColor then
                        if GetColor(TP[I].x + 2, TP[I].y) = TestColor then
                          if GetColor(TP[I].x, TP[I].y + 1) = TestColor then
                            if GetColor(TP[I].x + 1, TP[I].y) = TestColor then
                              if GetColor(TP[I].x + 2, TP[I].y + 1) = TestColor then
                                if GetColor(TP[I].x + 1, TP[I].y + 2) = TestColor then
                                   begin
                                     Result := TestColor;
                                     Writeln('The Color you are looking for = '+IntToStr(Result));
                                     exit;
          end;
        end;
      end;
      WriteLn('Color could NOT be Found!');
      Result := 0;
      Exit;
    end;

    if not how can it be improved?

    the goal of it is to take any color and autocolor it, to remove the need for a single autcolor for each color
    At sea with the navy - not very active

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    For your AntiRandom problem, do you have a " Lambskill := 'whatever'; " anywhere? Line 239 is for the Lamp bitmap. As for your autocoloring, Idk. Sorry.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Most things need their own autocolor... because they have different rgb maxs and minimums.

  4. #4
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your autocolor function wouldn't work because you are always comparing the same color. You would have to compare the tescolor and the color in the current point. But, if the range between them is bigger than 4 in any RGB value, it won't work. I suggest you grabbing all the differences and check for the more near range. Good luck.


  5. #5
    Join Date
    May 2007
    Location
    in the forest
    Posts
    190
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure AntiRandoms; //checks for Randoms

    begin
      if not LoggedIn then Exit;
      FindNormalRandoms;
      LampSkill := 'Woodcutting';
      if FindFight then RunAway('N',True,1,15000);
    end;

    yeh the lampskill is set... should i do it differently?
    should I take it out of the procedure and make it a const?
    At sea with the navy - not very active

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with 2 things...
    By ShapeShifter in forum OSR Help
    Replies: 4
    Last Post: 11-10-2007, 07:39 PM
  2. bot not doing the things i want
    By 12 beau 12 in forum OSR Help
    Replies: 26
    Last Post: 06-21-2007, 09:07 AM
  3. am i seeing things...
    By Dark_Sniper in forum Discussions & Debates
    Replies: 6
    Last Post: 05-17-2006, 02:01 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
  •