Results 1 to 8 of 8

Thread: Why won't my powerminer click that rock?

  1. #1
    Join Date
    Feb 2012
    Posts
    390
    Mentioned
    2 Post(s)
    Quoted
    14 Post(s)

    Default Why won't my powerminer click that rock?

    Heres my script:
    Code:
    program ScriptNameHere;
    
    {$i SRL\SRL.simba}
    
    var
    objo:Integer;
    
      procedure DeclarePlayers;
    begin
    HowManyPlayers := 1;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0;
    
    Players[0].Name := 'NAME HERE!!!!'; //Your Runescape username here.
    Players[0].Pass := 'No no no!'; //Your Runescape password here.
    Players[0].Nick := 'kil'; //3 letters from your screen name (not first)
    Players[0].Active := True; //Set to True if you want to use this player. Set to False to disable this player.
    Players[0].Pin := 'Your_Bank_PIN'; //Put your Bank PIN here. Leave alone if you don't have a Bank PIN.
    end;
    Procedure Proggy;
    begin
    writeln('*******************************');
    writeln('Blackys Iron powerminer. Enjoy!!');
    writeln('You have been running for: ' + TimeRunning);
    writeln('You have Mined: ' + IntToStr(objo));
    writeln('*******************************');
    End;
    Procedure ANTIBAN;
    begin
    
    Case Random(30) of
    0: begin
       RandomRClick;
       end;
       1: begin
         BoredHuman;
       End;
       2: begin
           PickUpMouse;
       End;
       3: begin ExamineInv; end;
       4: HoverSkill('mining',false);
       5: RandomAngle(1);
    
    End;
    
    end;
    function colour: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.05, 0.16);
    
      if not (FindColorsTolerance(arP, 2109010, MSX1, MSY1, MSX2, MSY2, 5)) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;
    
      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);
    
      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;
    
      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    
      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;
    Procedure Ironer;
    var
    x,y,plusone,timer:integer;
    begin
    plusone := InvCount + 1;
    x := MSCX;
    y := MSCY;
    //if FindObjTPA(x,y,WillowColour,3,2,15,60,400,['Chop']) then
    if FindObj(x,y,'Mine',colour,5) then
    begin
    Mouse(x,y,2,2,false);
    
    
    Flag;
    MarkTime(timer);
    
    
    Repeat
     Antiban;
     wait(1500);
    Until(InvCount = plusone) or (TimeFromMark(timer) > 60000)
    if(InvCount = plusone) then
    writeln('Mined');
    end;
    end;
    procedure Dropper;
    begin
    writeln('Dropping ore');
    DropAll;
    writeln('Dropped ore');
    wait(2000 + Random(30));
    end;
    
    
    
    begin
    SetupSRL;
    DeclarePlayers;
    LoginPlayer;
    
    Repeat
    //ACA procedure and chop/mine/fish/mousepress/etc goes here.
    colour;
    Ironer;
    if(InvFull) then
    begin
    //Drop/bank and/or walking procedure goes here...
    Dropper;
    ClearDebug;
    Proggy;
    End;
    Until(false)
    end.
    I know im using FindObj, i though FindObjTPA might not be working... but its working fine. When i move my mouse about 2 seconds later it goes and click the inventory button (probably the PlusOne Procedure)

    Thanks in advance!!

  2. #2
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Does it right click the ore?
    Current Project: Retired

  3. #3
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Gucci asked that because you have (cleaned up a bit)
    Simba Code:
    if FindObj(x, y, 'Mine', colour, 5) then
    begin
      Mouse(x, y, 2, 2, false);
    end;

    If you want it to left click the rock, change the false to true or mouse_left

  4. #4
    Join Date
    Feb 2012
    Posts
    390
    Mentioned
    2 Post(s)
    Quoted
    14 Post(s)

    Default

    It doesnt move the mouse after clicking the bag tab

  5. #5
    Join Date
    Nov 2011
    Location
    MA
    Posts
    545
    Mentioned
    3 Post(s)
    Quoted
    10 Post(s)

    Default

    Update the main post with this:

    Simba Code:
    program ScriptNameHere;

    {$i SRL\SRL.simba}

    var
      objo:Integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := 'NAME HERE!!!!'; //Your Runescape username here.
      Players[0].Pass := 'No no no!'; //Your Runescape password here.
      Players[0].Nick := 'kil'; //3 letters from your screen name (not first)
      Players[0].Active := True; //Set to True if you want to use this player. Set to False to disable this player.
      Players[0].Pin := 'Your_Bank_PIN'; //Put your Bank PIN here. Leave alone if you don't have a Bank PIN.
    end;

    Procedure Proggy;
    begin
      writeln('*******************************');
      writeln('Blackys Iron powerminer. Enjoy!!');
      writeln('You have been running for: ' + TimeRunning);
      writeln('You have Mined: ' + IntToStr(objo));
      writeln('*******************************');
    End;

    Procedure ANTIBAN;
    begin
      Case Random(30) of
        0 : RandomRClick;
        1 : BoredHuman;
        2 : PickUpMouse;
        3 : ExamineInv;
        4 : HoverSkill('mining',false);
        5 : RandomAngle(1);
      End;
    end;

    function colour: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.05, 0.16);

      if not (FindColorsTolerance(arP, 2109010, MSX1, MSY1, MSX2, MSY2, 5)) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        Result := arC[i];
        Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    Procedure Ironer;
    var
      x, y, plusone, timer:integer;
    begin
      plusone := InvCount + 1;
      x := MSCX;
      y := MSCY;
      //if FindObjTPA(x,y,WillowColour,3,2,15,60,400,['Chop']) then
      if FindObj(x, y, 'Mine', colour, 5) then
      begin
        Mouse(x, y, 2, 2, false);
        Flag;
        MarkTime(timer);
        Repeat
          Antiban;
          wait(1500);
        Until(InvCount = plusone) or (TimeFromMark(timer) > 60000)
        if(InvCount = plusone) then
          writeln('Mined');
      end;
    end;

    procedure Dropper;
    begin
      writeln('Dropping ore');
      DropAll;
      writeln('Dropped ore');
      wait(2000 + Random(30));
    end;


    begin
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      Repeat
      //ACA procedure and chop/mine/fish/mousepress/etc goes here.
        colour;
        Ironer;
        if(InvFull) then
        begin
        //Drop/bank and/or walking procedure goes here...
          Dropper;
          ClearDebug;
          Proggy;
        End;
      Until(false);
    end.

    I'm going to bed, but now other members will be able to read it easily. If no one else solves it then pm me tomorrow

  6. #6
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Are you running SMART or no? I had this same problem when making my first script where it would open the inv tab and just sit there, but when I ran it in SMART it worked.

  7. #7
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by TotalKillz View Post
    Are you running SMART or no? I had this same problem when making my first script where it would open the inv tab and just sit there, but when I ran it in SMART it worked.
    I am also wondering this, smart may solve your problem.

  8. #8
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    So this function should work. Just write in here if you got another problem.


    Simba Code:
    function FindIron: Boolean;
    var
      arP, arAP: TPointArray;
      arC, arUC: TIntegerArray;
      ararP: T2DPointArray;
      tmpCTS, i, j, arL, arL2: Integer;
      P: TPoint;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.08, 0.94);

      if not(FindColorsTolerance(arP, 2109010, MSX1, MSY1, MSX2, MSY2, 6)) then
      begin
        Writeln('Rock Color not found...');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      arUC := arC;
      ClearSameIntegers(arUC);
      arL := High(arUC);
      arL2 := High(arC);

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 4.13) and (X <= 10.17) and (Y >= 3.71) and (Y <= 8.43) and (Z >= 2.49) and (Z <= 4.36) then
        begin
          for j := 0 to arL2 do
          begin
            if (arUC[i] = arC[j]) then
            begin
              SetLength(arAP, Length(arAP) + 1);
              arAP[High(arAP)] := arP[j];
            end;
          end;
        end;
      end;

      SortTPAFrom(arAP, Point(MSCX, MSCY));
      ararP := SplitTPAEx(arAP, 10, 10);
      arL := High(ararP);

      for i := 0 to arL do
      begin
        if (Length(ararP[i]) < 10) then Continue;
        P := MiddleTPA(ararP[i]);
        MMouse(P.x, P.y, 5, 5);
        Wait(100 + Random(100));
        if (IsUpText('Min')) and (IsUpText('Iron')) then
        begin;
          Mouse(p.x, p.y, 3, 3, True);
          Result := True;
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
      begin
        Writeln('Rock not found...');
        Exit;
      end;
    end;

    I will try to answer all Runescape related questions!

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
  •