Results 1 to 10 of 10

Thread: how can i make this more reliable?

  1. #1
    Join Date
    Aug 2007
    Posts
    282
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default how can i make this more reliable?

    this is my tree finding procedure so far:
    SCAR Code:
    Function FindTree: Boolean;
    var
    xtree, ytree, tries, I, FTtol: integer;
    begin
      FTtol:= 9
      MakeCompass('N');
      wait(250 + random(500))
      HighestAngle;
      tries:= 0;
      repeat
        Wait(500 + random(250));
        for I:= 1 to 10 do
        begin
          if I = 1 then
          FTtol:= FTtol+1
          if (FindColorSpiralTolerance(x, y, TreeColors[I], MSX1, MSY1, MSX2, MSY2, FTtol)) then
          begin
            getmousepos(x, y);
            if confirm then
            begin
              result:= true;
              xtree:= x;
              ytree:= y;
              wait(50)
              TreeColors[I]:= getcolor(x, y)
              Exit;
            end else
            tries:= tries + 1;
          end;
        end;
      until(tries = 50)
      Writeln('We couldnt find the tree so we exited....')
      TerminateScript;
    end;

    confirm just makes sure that it is the right kind of tree.. and TreeColors[] is an array of 10 colors.

    also im not totally sure if it works or not, because i cant test it(the update)

    but i am wondering some sort of way that i can make it more reliable then it is... and if you know a better way to do something let me know

    thanks

  2. #2
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    wow nice dude =X ima learn how to do that soon hopefully but i would love to use that in mine OFCOURSE credit u before

  3. #3
    Join Date
    Aug 2007
    Posts
    282
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i would be honored

    i would have to test it to make sure it works and then send you the confirm part and the array. but ya

  4. #4
    Join Date
    Apr 2007
    Location
    Texas
    Posts
    1,668
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK, the reliability part is going to have to come wiht some testing. That the only way, you need to be able to see what goes wrong and then create methods to prevent it.

    Now, here is what i was, first off, semi colons, everywhere, add them!

    second, if there are no trees nearbym your script will call find color spiral 50 times, which is a bit much.

    an autocoloring procreudre for the tree may be better , but I am not sure.

    ill review it more later, but it loks pretty good rihgt now, i have never made a tree cutter, so im not sure what the potential problems are.
    [IMG]http://farm3.static.flickr.com/2120/2052732965_348f3629d0_o.jpg[/IMG]

  5. #5
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It looks oke.

    But instand of ''getMouce'' use ''MMouse(x, y, 1, 1);'' x and y ar the cordinates where he need to go to. the to 1s ar to make it random.

    as what gregg said. 50 is a bit high. set that to 10 or lower because your looking for an array of 10 collors. when you search 10 times it will do findcolorspiral 10*10= 100 times. when its 50 then 50*10 = 500 .

    it looks good. nice use of failsaves and arrays. Good luck with your script

  6. #6
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    TreeColors[i]:= getcolor(x, y)

    Wouldn't this mean that the array would just become one colour?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  7. #7
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No, because when he found color[I]. then he continue with that. so say that color i = 5.

    when it found color[5] then he move the mouse to there. when confrim = true then color[5] will get the color from x and y. after he have done that he will exit the i to 10 do loop. By using the ''exit'' commant.
    I hope you have followed what ive tryed to say

    but indeed. maby after a while all the colors will be the same...

  8. #8
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    But i is 1 to 10...so Color[i] would means all of the colours...
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  9. #9
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oke, din't know that.

    i allways tought the i was varibale that change with the to do.
    So the first time it will do: I=1 to 10 do.
    i = 1. it will use color[1].
    the second time it will do the to do loop I = 2. and he will use color[2]. When he found one of those colors. he will ''getColor(x,y);'' while he was using color[2]. after that he will exit the to do loop. so he will not contunue with overrighting the other colors.

    SCAR Code:
    program New;
    var  i: integer;
    begin
      for I:= 1 to 10 do
      begin
        WriteLn(+IntToStr(I));
        If Random(3) = 1 then
        begin;
          WriteLn('Exit the loop.');
          Exit;
        end;
      end;
    end.

  10. #10
    Join Date
    Aug 2007
    Posts
    282
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @lordgreggreg: ok ya, i will add semi colons, and i will lower the tries amount.

    @rikjess(1st): i see what your saying about the MMouse. And i could be wrong but i think it will only search 50 times... because it adds 1 try after each findcolorspiral. am i wrong?

    @SantaClause: what rikjess said, as far as i know

    @rikjess(2nd): it shouldnt be the same after a while because the colors are quite diferent.. say 738615 and 2773578... with a tolerance of only 10-15 they wont be able to change enough to be the same.. it will just tweak it a little bit if i am right.

    @the last 2: i think it works how rikjess said it, at least thats what i gathered from the tutorials i read.. but if i am for sure wrong, let me know

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Is this safe reliable??
    By thematpan in forum Discussions & Debates
    Replies: 0
    Last Post: 09-27-2007, 10:55 PM
  2. A good reliable Chicken Killer
    By Rune Hacker in forum RS3 Outdated / Broken Scripts
    Replies: 6
    Last Post: 04-12-2007, 12:17 AM
  3. Reliable walking system
    By Kingofptw in forum OSR Help
    Replies: 17
    Last Post: 04-01-2007, 07:30 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
  •