Results 1 to 14 of 14

Thread: specific tree finding

  1. #1
    Join Date
    Jan 2007
    Location
    new zealand
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default specific tree finding



    i need ti to click that tree not the others im out of ideas iv tried everything i can think of please help me

  2. #2
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Try that mate

    SCAR Code:
    If (FindColorSpiralTolerance(x,y, Treecolor, msx1,msy1,msx2,msy2, 5)) then
       Begin
                  MMouse(x, y, 3, 3);
               if(IsUpTextMulti('hop', 'own', 'ree'))then
                   begin
                        Wait(100 + Random(100));
                        Mouse(x,y,3,3, false);
                        Wait(50 + Random(35));
                        ChooseOption(x, y, 'Chop');
                        Wait(50 + Random(100));
                   end;
          end;

  3. #3
    Join Date
    Jan 2007
    Location
    new zealand
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thats what i had originally i need it to click that normal tree only once thanks for your help anyways and only once

  4. #4
    Join Date
    Dec 2006
    Location
    Ky
    Posts
    390
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What Me_ntal has should work put it in a procedure and make a loop. Have it run the procedure wait till the tree reappears, repeat clicking procedure.
    SUMMER BREAK be back when I want to

  5. #5
    Join Date
    Dec 2006
    Location
    Australia
    Posts
    698
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    just remember to declare clickcount as a const and set it as 0

    This will click the tree once
    SCAR Code:
    If(clickcount := 0) then
    begin
    If (FindColorSpiralTolerance(x,y, Treecolor, msx1,msy1,msx2,msy2, 5)) then
       Begin
                  MMouse(x, y, 3, 3);
               if(IsUpTextMulti('hop', 'own', 'ree'))then
                   begin
                        Wait(100 + Random(100));
                        Mouse(x,y,3,3, True);
                        clickcount := 1
                   end;
          end;
    end;


    this will make it loop to click for an invent
    SCAR Code:
    repeat
    If (FindColorSpiralTolerance(x,y, Treecolor, msx1,msy1,msx2,msy2, 5)) then
       Begin
                  MMouse(x, y, 3, 3);
               if(IsUpTextMulti('hop', 'own', 'ree'))then
                   begin
                        Wait(100 + Random(100));
                        Mouse(x,y,3,3, false);
                        Wait(50 + Random(35));
                        ChooseOption(x, y, 'Chop');
                        Wait(50 + Random(100));
                   end;
          end;
    until(InvFull)

  6. #6
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That should work.. Btw mental your standards are very strange :|

  7. #7
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    I think you better can use a FindObject. As mentals function *can* keep looking at exactly the same spot every time.
    Hup Holland Hup!

  8. #8
    Join Date
    Jan 2007
    Location
    new zealand
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by me_ntal View Post
    just remember to declare clickcount as a const and set it as 0

    This will click the tree once
    SCAR Code:
    If(clickcount := 0) then
    begin
    If (FindColorSpiralTolerance(x,y, Treecolor, msx1,msy1,msx2,msy2, 5)) then
       Begin
                  MMouse(x, y, 3, 3);
               if(IsUpTextMulti('hop', 'own', 'ree'))then
                   begin
                        Wait(100 + Random(100));
                        Mouse(x,y,3,3, True);
                        clickcount := 1
                   end;
          end;
    end;


    this will make it loop to click for an invent
    SCAR Code:
    repeat
    If (FindColorSpiralTolerance(x,y, Treecolor, msx1,msy1,msx2,msy2, 5)) then
       Begin
                  MMouse(x, y, 3, 3);
               if(IsUpTextMulti('hop', 'own', 'ree'))then
                   begin
                        Wait(100 + Random(100));
                        Mouse(x,y,3,3, false);
                        Wait(50 + Random(35));
                        ChooseOption(x, y, 'Chop');
                        Wait(50 + Random(100));
                   end;
          end;
    until(InvFull)

    i know all that but it clicks the willows as well and i only need the one log not a whole inv full i had and idea but then got banned from dda comp for 2 days supposed to be doing my home work right now lol i was thinking of just setting the coords in a general box round the tree then makeing the compass north and have hi8ghest angle then on what ever comp it is ittl just clikc that tree i will try that out next time im allowed on the comp

  9. #9
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    IsUpText('ree');

    and I'd recommend looping findcolortoleranceskipboxarray. When you find a basic treecolor, move the mouse over it. If the uptext is 'ree', click it. If not, add that coordinate and all coordinates 30 pixes around it to the box array to be skipped.

    continue the loop until either the tree has been found, or the mouse has been moved a certain amount of times

    If you want to see an example, look at my powercutter (powerkut)
    Interested in C# and Electrical Engineering? This might interest you.

  10. #10
    Join Date
    Jan 2007
    Location
    new zealand
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks smartzkidz do you ahve a link to your script?

  11. #11
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Interested in C# and Electrical Engineering? This might interest you.

  12. #12
    Join Date
    Jan 2007
    Location
    new zealand
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i looked throu but couldnt find it can you give me an example oh how to use it please?.

  13. #13
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    uses four colors to find the tree: tclr1, tclr2, tclr3, and tclrnew.

    SCAR Code:
    function MultiBoxes(tolerance: integer; Boxes: TBoxArray): boolean;
    begin
      result := false;
      if (FindColorSkipBoxArrayTolerance(tx, ty, tclr1, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
      begin
        result := true;
      end else
        if (FindColorSkipBoxArrayTolerance(tx, ty, tclr2, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
        begin
          result := true;
        end else
          if (FindColorSkipBoxArrayTolerance(tx, ty, tclr3, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
          begin
            result := true;
          end else
            if (FindColorSkipBoxArrayTolerance(tx, ty, tclrnew, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
            begin
              result := true;
            end;
    end;

    procedure findtrees(w: integer);
    var
      found: boolean;
      tolnce, tx, ty: integer;
      AntiBoxes: TBoxArray;
    begin
      tolnce := 16; //Initial tolerance
      repeat
        if (not (MultiBoxes(tolnce, AntiBoxes))) then
        begin
          tolnce := tolnce + 2;
        end else
        begin
          MMouse(tx, ty, 5, 5);
          wait(random(500));
        end;
        if (IsUpTextMulti('op do', 'hop', 'down')) and (not (BadTree)) then
        begin
          found := true;
        end else
        begin
          getmousepos(tx, ty);
          setarraylength(antiboxes, getarraylength(antiboxes) + 1);
          antiboxes[getarraylength(antiboxes) - 1].x1 := tx - 15;
          antiboxes[getarraylength(antiboxes) - 1].y1 := ty - 15;
          antiboxes[getarraylength(antiboxes) - 1].x2 := tx + 15;
          antiboxes[getarraylength(antiboxes) - 1].y2 := ty + 15;
        end;
      until (found) or (tolnce > 50);

      if (found) then
      Mouse(tx,ty,5,5,true);
    end;
    Interested in C# and Electrical Engineering? This might interest you.

  14. #14
    Join Date
    Jan 2007
    Location
    new zealand
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program THINGY;
    {.Include SRL/SRL.scar}

    var
    logDTM,c,TinderBox,MMtree,treeuperleft: integer;
    ty,tx :integer;

    const
    FishingSpot = 15315080;
    Treecolor1 =  2900024;
    tclr1 = 2373688;
    tclr2 = 2181184;
    tclr3 = 1318936;
    tclrnew = 1722432;

    procedure LoadBMPS;
    begin
     MMTree       := BitmapFromString(4, 5, 'z78DA7589410A0020080' +
           '4BFB4AE4A7614C2FF3F29C84B105D8661866125D0642178BC29C5' +
           'C0EA7E5F100ABE775A52B3BB438778F3D7371BEA19B0');

     treeuperleft  := BitmapFromString(25, 1, 'z78DA4DCC410E805' +
           '00843C12BD11A8D7F29D8FB5F49144C60319BBE00D776EF7644C4' +
           '8208D0C6E112FFB59BA081E56CDAB9BEFDD9CE9F4BC8B2740828B' +
           '3F4AF4F1F82E32065');

    end;

    procedure LoadDTMS;
    begin
     logDTM := DTMFromString('78DA632C66626078CE8002CA632C181E02694' +
           '620FE0F048C5540356F19D000231209A46B806AEE125053005473' +
           '87809A74A09A8704D46410760F0036D50E09');

     TinderBox := DTMFromString('78DA63F460626078CA8002362C59C2A0C3C8C' +
           '000440CFF8180D117A8E603031A60442281740850CD4D026ABC88' +
           '50630B54F388801A6BA09A5704D4D803D5BC23A02614A8E6397E3' +
           '50017E80FB0');
    end;

    procedure LightFire;
    begin
    if(FindDTM(logDTM,x,y,Mix1, Miy1, Mix2, Miy2))then
      wait(200+random(100));
       MMouse(x,y,0,0);
        wait(200+random(100));
         Mouse(x,y,0,0,true);
           FreeDTM(LogDTM);
         if(FindDTM(TinderBox,x,y,Mix1, Miy1, Mix2, Miy2))then
        wait(200+random(100));
       MMouse(x,y,0,0);
      wait(200+random(100));
     Mouse(x,y,0,0,true);
    FreeDTM(TinderBox);
    end;

    procedure FindFishSpot;
    begin;
    if (FindColortolerance(x, y, Fishingspot, msx1, msy1, msx2, msy2, 5)) then
        MMouse(x, y, 0, 0);
      if (IsUpText('Net')) or
        (IsUpText('N et')) or
        (IsUpText('Ne t')) then
        Mouse(x, y, 0, 0, true);
      FindNormalRandoms;
    end;

    procedure Walktotree;

    begin
    if(FindDeformed(x,y,MMTree,MMx1,MMy1,MMx2,MMy2))then
    wait(200+random(100));
       MMouse(x,y,0,0);
        wait(200+random(100));
         Mouse(x,y,0,0,true);
    if(not(FindDeformed(x,y,MMTree,MMx1,MMy1,MMx2,MMy2)))then
    writeln('you didnt find it');
    end;

    function MultiBoxes(tolerance: integer; Boxes: TBoxArray): boolean;
    begin
    result := false;
    if (FindColorSkipBoxArrayTolerance(tx, ty, tclr1, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
    begin
    result := true;
    end else
    if (FindColorSkipBoxArrayTolerance(tx, ty, tclr2, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
    begin
    result := true;
    end else
    if (FindColorSkipBoxArrayTolerance(tx, ty, tclr3, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
    begin
    result := true;
    end else
    if (FindColorSkipBoxArrayTolerance(tx, ty, tclrnew, msx1, msy1, msx2, msy2, tolerance, Boxes)) then
    begin
    result := true;
    end;
    end;


    procedure findtrees(w: integer);
    var
    found: boolean;
    tolnce, tx, ty: integer;
    AntiBoxes: TBoxArray;
    begin
    tolnce := 16; //Initial tolerance
    repeat
    if (not (MultiBoxes(tolnce, AntiBoxes))) then
    begin
    tolnce := tolnce + 2;
    end else
    begin
    MMouse(tx, ty, 5, 5);
    wait(random(500));
    end;
    if (IsUpTextMulti('op do', 'hop', 'down'))then
    begin
    found := true;
    end else
    begin
    getmousepos(tx, ty);
    setarraylength(antiboxes, getarraylength(antiboxes) + 1);
    antiboxes[getarraylength(antiboxes) - 1].x1 := tx - 15;
    antiboxes[getarraylength(antiboxes) - 1].y1 := ty - 15;
    antiboxes[getarraylength(antiboxes) - 1].x2 := tx + 15;
    antiboxes[getarraylength(antiboxes) - 1].y2 := ty + 15;
    end;
    until (found) or (tolnce > 50);


    begin
     SetUpSrl;
     Activateclient;
     perfectnorth;
     LoadBMPS;
     walktotree;
     wait(2500+random(500));
     findtrees;
     loadDTMS;
     wait(3000+random(500));
     lightfire;
    end.

    that is what i have so far in the script i get a strange error in the scrip in my main loop

    Line 140: [Error] (17475:10): Invalid number of parameters in script

    i know that its messy and stuff and dosent do everything but its my rough draft to get everything working properly

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Good Tree Finding Function?
    By TViYH in forum OSR Help
    Replies: 11
    Last Post: 09-03-2008, 12:48 AM
  2. Finding a tree
    By hamish909 in forum OSR Help
    Replies: 8
    Last Post: 05-06-2008, 07:52 PM
  3. Finding Specific Char's
    By omgnomorenames in forum OSR Help
    Replies: 11
    Last Post: 03-21-2008, 10:45 PM
  4. Finding Multiple Tree Colors
    By tigerskall in forum OSR Help
    Replies: 11
    Last Post: 11-18-2007, 07:04 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
  •