Results 1 to 3 of 3

Thread: Find Netles--function

  1. #1
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Find Netles--function

    ok i need help with this procedure , i want it to look for nettles 9 times and if it doesn't find them i want it to say 'Tree one' and the result to be 1, if it does i want it to say 'tree two' and result := 2.(dnt worry about the colorsz i have an array at the top etc.) But the problem is that no matter what i do (if(Findobj3(etc)),FindObj3,(If(FindColorTolerance )),Findcolortolerance, it always looks for the nettles more than once for each line.

    for example if i put
    SCAR Code:
    If(FindObj3(etc...blah,blah,blah))then
    then it will looks for the nettles continually for that line not just once.
    anyways this is the procedure that i came put with

    SCAR Code:
    function FTC : integer;
    var H : integer;
    begin
      begin
        repeat
        for i := 1 to 5 do
        If(FindColorTolerance(NettlesCoordx,NettlesCoordy,NettlesColor[I],46,117,394,245,10)then
        begin
        wait(100);
        MMouse(Nettlescoordx,Nettlescoordy,0,0);
        If(IsUpText('ick'))then
          begin
          result := 2;
          Writeln (' Tree Number 2 ');
          exit;
          end;
        end;
         
        for i := 1 to 5 do
        If(not(FindColorTolerance(NettlesCoordx,NettlesCoordy,NettlesColor[I],46,117,394,245,10)))then
          begin
            H := H + 1;
          end;
        until(H = 9);
      end;
      begin
        If (H < 2) then
          begin
          result := 1;
          writeln('Tree number 1 ');
          end;
      end;
    end;

    procedure GetTreeNumber;
    begin
      TreeNumber := FTC;
    end;

    Join the fastest growing merchanting clan on the the net!

  2. #2
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    can any1 help?

    Join the fastest growing merchanting clan on the the net!

  3. #3
    Join Date
    Jul 2006
    Location
    NY
    Posts
    371
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here, I think this is what your looking for. It will look for a nettle color 9 times. If it finds it any of the 9 times, it will say tree number 2, then the result will be 2, and exit the procedure. If it doesnt find it in the 9 times its going to be looking for it, it will say tree number 1 and the result will be 1. All you need to do is set up your colors.
    SCAR Code:
    function nettlef: integer;
    var
      i, c: integer;
      nettle: array[0..4] of integer;
    begin
    //--color arrays----------
      nettle[0] := 0;
      nettle[1] := 0;
      nettle[2] := 0;
      nettle[3] := 0;
      nettle[4] := 0;
    //-----------------------
      c := Random(3) + 1;
      for i := 1 to 9 do
      begin
        if (FindColorSpiralTolerance(x, y, Nettle[c], msx1, msy1, msx2, msy2, 15)) then
        begin
          WriteLn('Tree # 2');
          result := 2;
          Exit;
        end else
        begin
          Writeln('Tree # 1');
          result := 1;
        end;
      end;
    end;
    Tell me if thats what your looking for, or if you need any more help.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how to use the find object function?
    By poolikemax in forum OSR Help
    Replies: 2
    Last Post: 12-27-2007, 06:53 PM
  2. Find Coords between 2 colors function
    By Bramble in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 02-25-2007, 06:06 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
  •