Results 1 to 15 of 15

Thread: Help with my miner

  1. #1
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Help with my miner

    When my miner clicks a rock, walks and starts mining, my miner will look for another rock and click it. When it dosnt have to walk, it works perfectly.

    Here is 2 of my functions that will help you help me.
    SCAR Code:
    procedure WhileChipping;
    var
      StartInv, ChippingStart: integer;
    begin
      if not LoggedIn then Exit;
      Status('Chipping Rocks');
      StartInv:= InvCount;
      MarkTime(ChippingStart);
      while StartInv = InvCount do
      begin
        if not LoggedIn then Exit;
        wait(10);
        AutoRespond;
        if not FindColorTolerance(x,y,PickedColor,ColorLocX-6,ColorLocY-6,ColorLocX+6,ColorLocY+6,8) then Break;
        if (TimeFromMark(ChippingStart) >= TimeFromMark(ChippingStart)+20000) then Break;
        if InvFull then Break;
      end;
    end;

    procedure ChipRock;
    begin
      repeat
      if not LoggedIn then Exit;
      Status('Finding Rocks');
      FindNormalRandoms;
      AutoRespond;
      if FindObjCustom(x, y, ['Rocks'], OreColors, 2) then
      begin
        JustWalked:= false;
        MMouse(x,y,3,3);
        if IsUpText('Mine') then
        begin
          PickedColor := GetColor(x,y);
          GetMousePos(ColorLocX,ColorLocY);
          case Random(2) of
          0: Mouse(x,y,0,0,true);
          1: begin
               Mouse(x,y,0,0,false);
               Wait(RandomRange(100,200));
               ChooseOption('Mine');
             end;
          end;
          WaitToMove(800);
          while CharacterMoving do wait(10);
          WaitForAnim(2500);
          if (GetAnimation > 0) then WhileChipping;
        end;
        if not (GetAnimation > 0) then AntiBan;
      end else
      begin
        Wait(100);
        if FindSymbol(x,y,'mining spot') then
        begin
          if (y - 86 >= 40) then Mouse(x,y,4,4,true);
          Wait(RandomRange(250,500));
          Flag;
        end;
        if (TimeFromMark(FromWalk) >= 60000) and JustWalked then
        begin
          WalkToTile(Point(3286, 3366), 0, 5);
          Flag;
        end;
      end;
      until InvFull;
    end;

    I hope someone can help me

  2. #2
    Join Date
    Jun 2009
    Location
    The Netherlands
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think the problem is you don't have some wait after "while CharacterMoving do Wait(10);"
    because there is a pause between the character stopping and starting to mine.
    Start out with a long wait to see if that fixes the problem, and then make it as short as possible (allowing for some lag).

    Current Project:

    ChompieChopper - Early stages.

  3. #3
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by The Little View Post
    I think the problem is you don't have some wait after "while CharacterMoving do Wait(10);"
    because there is a pause between the character stopping and starting to mine.
    Start out with a long wait to see if that fixes the problem, and then make it as short as possible (allowing for some lag).
    Did you see:
    WaitForAnim(2500);
    It will wait for animation after done moving.
    Ive went up to 20 seconds and I am still having the problem.

    If I do while (GetAnimtion > 0) then WhileChipping;
    The problem goes away though but this will create a problem, if the ore is gone and the character is still animating, it will wait, making the bot look more botish.
    And if the character stops animating after the ore comes back, the bot will wait 20 seconds

  4. #4
    Join Date
    Jun 2009
    Location
    The Netherlands
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I suppose the full and empty rock have different IDs, you could then have the line:
    while (GetAnimation > 0) and FindObjectEx(variables) do WhileChipping;

    You will have to know the tile of the rock you're mining though.

    Current Project:

    ChompieChopper - Early stages.

  5. #5
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    ill look at it later but look at my power miner for tips it works almost flawlessly

  6. #6
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Reflection object finding is slow and I dont like using it.
    Instead I'll do
    while (GetAnimation > 0) and FindColorTolerance(x,y,PickedColor,ColorLocX-6,ColorLocY-6,ColorLocX+6,ColorLocY+6,8) do WhileChipping;
    I never though of that (I think).
    I tryed something like that in WhileChipping but didnt work. I dont know why I didnt think of this ^.
    Ill try and get back to you.

    Edit: If ore comes back, it will be stuck in the loop :/ I need a new suggestion
    Last edited by TRiLeZ; 07-01-2009 at 02:06 PM.

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

    Default

    If you going to use relfection, might as well use it for what it is best at.
    [minitut]
    Find all of the tiles that the rocks are on.
    Get the object type of those tiles.
    Make a function that checks those tiles for those object types(in arrays).
    Wallah! Fastest object finding known to reflection.
    [/minitut]

  8. #8
    Join Date
    Jun 2009
    Location
    The Netherlands
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Reflection object finding can be just as fast as color, don't worry . Try what Mormonman pointed out

    Current Project:

    ChompieChopper - Early stages.

  9. #9
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Instead of findobject. Use findobjectex(Tpointtostoreobjecttile,objID,20); (20 keeps the object finding really fast)

    I need to update that to my tutorial.

    That way Reflection owns this script.
    I do visit every 2-6 months

  10. #10
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Theres something wrong with WhileChipping
    Ive got it! It gets the position of the color before it moves!
    Im going change some stuff around and it should work

    Fixed!
    Last edited by TRiLeZ; 07-01-2009 at 06:04 PM.

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

    Default

    Quote Originally Posted by ZaSz View Post
    Instead of findobject. Use findobjectex(Tpointtostoreobjecttile,objID,20); (20 keeps the object finding really fast)

    I need to update that to my tutorial.

    That way Reflection owns this script.
    The method I posted only looks at one tile at a time that are actually the only ones that will ever return the correct ids. Thus it doesn't search within a 20 tile radius, but just on the tiles you choose. It is extremely fast.

  12. #12
    Join Date
    Jun 2009
    Location
    The Netherlands
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There is noticeable improvement until some point, the difference is too small to notice with the range set to lets say 20 tiles. Though you are right, it is faster .

    Current Project:

    ChompieChopper - Early stages.

  13. #13
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    The method I posted only looks at one tile at a time that are actually the only ones that will ever return the correct ids. Thus it doesn't search within a 20 tile radius, but just on the tiles you choose. It is extremely fast.
    meh, 2 minutes or less of extra-work for a few milliseconds of benefit. Im lazy. This way you don't have record any tiles.
    I do visit every 2-6 months

  14. #14
    Join Date
    Jun 2009
    Location
    The Netherlands
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    We're getting off topic much X D

    Anyway, did you get it to work Trilez?

    Current Project:

    ChompieChopper - Early stages.

  15. #15
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ya, I took out getting the color and color's coords because when you move the color disapears from its location.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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