Results 1 to 4 of 4

Thread: Findcolor works, Findcolortolerance doesnt. Help please.

  1. #1
    Join Date
    Nov 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Findcolor works, Findcolortolerance doesnt. Help please.

    Okay when I use "Findcolor" in my script, it works - but when I use Findcolortolerance it just moves the mouse between 5 pixels very fast and does nothing... incase you're wondering - im making an oak chopper / seller.

    Its only 10-20% done, and this is my first script.

    Also should I use the FindObj function instead? I wanted to use Findcolorspiraltolerance but it just wont work, neither would findcolortolerance..

    Heres my script if ur wondering - please give me advice on how I can make it better aswell :P
    SCAR Code:
    program OaksGotPwned;
    {.include SRL/SRL.Scar}

    const
         Shop = 2709391; // color of the pot of the general shop in minimap
         OakColor = 3105112; // color of the oak leaves, pick any color

    var
     x, y :integer;     // do not touch this

    /////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////

    procedure Signature;
    begin
      ClearDebug;
      writeln('Oaks Got Pwned! OMGZORZ!!!!!!!!!!!!!');
      writeln('This Script has been made by r3dr4g0n');
      writeln('Please do not distribute without permission');
      writeln('You can edit my script to make your own,')
      writeln('just give me credit');
      writeln('ENJOY THE SCRIPT!');
      wait(3000 + random(750));
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    procedure FaceNorth;
    begin                     //  Sets up your
         MakeCompass('N');    //  compass and
         HighestAngle;        //  highest angle
         MouseSpeed:=15;      // <--- this is your mouse speed, change it if you know what your doing
         Gametab(4);
    end;


    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////

    Function CutOak: Boolean;
    begin
      repeat
         if(Findcolortolerance(x, y, OakColor, 140, 3, 515, 337, 60)) then
         begin
              MMouse(x, y, 5, 5);
              Wait(100 + random(50));
              if IsUpText('ak') then
              begin
                Mouse(x, y, 0, 0, True);
                Result := True;
              end;
         end;
      until (result)
    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    procedure WalkItOut;
    begin

    end;

    //////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////

    begin
         Activateclient;    // minimizes scar and opens RS
         SetupSRL;
         Signature;
         Wait(100+random(100));        // waits 3 seconds before doing anything
         FaceNorth;         // faces in the right direction
            repeat
              CutOak;            // starts cutting oak
              Findnormalrandoms;
              Wait(1500+random(1500));
            until (InvFull);
              if InvFull then
              WalkItOut;   // walks to shop when ur inven is full
    end.

    OH yeah and my CutOak procedure, I dont understand most of it some guy fixed it for me. I dont understand why we write "Boolean" and what the "Result:=True" and "until(result)" mean ....

  2. #2
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You should post one topic to get help on your specific script that way its alot easier to keep track of people who are helping you.

    Dont just look for a color, use the FindObjEx

    function FindObjEx(var x, y: Integer; ObjText: String; x1, y1, x2, y2, Color, Tol, MinXDist, MinYDist, WaitPerCheck: Integer; Spiral: Boolean): Boolean;
    SCAR Code:
    If (FindObjEx(x,y,'Oak',273,58,418,271,4285541,0,7,7,300,false))then

    4285541 is used oak color.

    That way, it will look for the color on your screen and then checks if it is "Oak". If it is continue with your procedure with chopping / looking for ents.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  3. #3
    Join Date
    Sep 2007
    Location
    Canada Eh
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what version of scar you have? i think the new one had a bug with that function did it not?

  4. #4
    Join Date
    Nov 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh that explains it. ive got the newest

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 08-18-2008, 02:45 AM
  2. FindColorTolerance
    By sjlou in forum OSR Help
    Replies: 7
    Last Post: 09-16-2007, 08:31 PM

Posting Permissions

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