Results 1 to 7 of 7

Thread: Mining script not working properly

  1. #1
    Join Date
    Mar 2012
    Posts
    182
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Mining script not working properly

    The procedure mines mithril. I want to make it mine mithril while mithril can be found in view, and then if not found move on to the next procedure. Usually it mines one mithril, and although there are more mithril it will just move on to the next procedure.

    I think it's something to do with while-do or repeat-until or for-do, but changing things around didn't help.

    Thank you in advance for your expert help!



    Simba Code:
    procedure MithFinder;
    var
      x, y, z, T, d : Integer;
      CTS, I: Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    begin

      while (d<100) do
      inc(d);

      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);  
      SetColorSpeed2Modifiers(0.04,0.3);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9200996, MSX1, MSY1, MSX2, MSY2, 12);
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 15, 15);

      For I := 0 to High(ATPA) do

      begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 2, 2);

        if WaitUptext('ine',900) then
        begin
                ClickMouse2(1);
              MarkTime(T);
              Writeln('Minig Mithril')
              wait(random(1200));


        repeat
              inc(Z);
              writeln('waiting for mithril rock ('+(inttostr(z))+')');
              wait(1000+random(250));
        until(z>29) or (TimeFromMark(T)>14000+Random(450));

        end;
      end;
    end;
    Last edited by sickle; 06-17-2012 at 06:53 PM.

  2. #2
    Join Date
    Dec 2011
    Location
    -bash
    Posts
    515
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    In your repeat function, call the mining procedure again and repeat until there is no mithril to be found.

  3. #3
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Have a read through the comments:
    Simba Code:
    Function MithFinder : Boolean;  //Make this a function so you know if it worked
    var
      x, y, z, T, d, CTS, I, H, Count : Integer;
      TPA: TPointArray;
      ATPA: Array of TPointArray;
    begin

      while (d<100) do
        inc(d);
        //why not just:
      d := 101;

      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.04,0.3);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 9200996, MSX1, MSY1, MSX2, MSY2, 12);
      ColorToleranceSpeed(CTS);
      TPAtoATPAExWrap(TPA, 15, 15, ATPA);
      Count := InvCount;

      H := high(ATPA);  //This saves checking it every time (every time)
      For i := 0 to H do
      begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 5, 5);  //Increase the randomness
        if WaitUptext('ine',900) then
        begin
          Result := True;
          ClickMouse2(mouse_Left);//Use mouse_Left and mouse_Right they read better
          MarkTime(T);
          Writeln('Minig Mithril')
          wait(random(1200));
          repeat      //Your logic up to here has been great, but what are you doing here?
            inc(Z);
            writeln('waiting for mithril rock ('+(inttostr(z))+')');
            wait(1000+random(250));
          until((z>29) or (TimeFromMark(T)>14000+Random(450)));   //You don't need a counter and a time marker, choose one
          while(Count = InvCount)do       //I suggest you replace that repeat function with this...
            begin
              if(TimeFromMark(T)>14000+Random(450))then
                break;
              wait(200+Random(1000));
            end;
        end;
      end;
    end;

  4. #4
    Join Date
    Mar 2012
    Posts
    182
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I tried yours putonajonny, but it does exactly the same thing the previous version did, which is mining 1-2 mithril and then simply moving on to the next procedure without mining all mithril in view. Maybe it's something wrong outside my procedure?

  5. #5
    Join Date
    Jun 2012
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    can sumone help me when i use my simba bot and go to fishing at barbarian fishing spot it doesnt fish or bank...... just walks around tries to find it
    sumone plz help

  6. #6
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Post up the whole code of your script, it doesn't appear to be so much a problem with your mithril finding function as it does with your main loop.

  7. #7
    Join Date
    Mar 2012
    Posts
    182
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks every1 for many help! I solved it by separating it into mithril finding function and mithril mining procedure.

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
  •