Results 1 to 14 of 14

Thread: Help with mining?

  1. #1
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with mining?

    Okay, I thought creating a mining script would be simple, but nothing I am doing is working right.

    If I want to mine ore, why the heck is this not working:

    Simba Code:
    procedure MineGold;
    var x, y: integer;
    begin
         FindObj(x, y, 'ine', 4637420); then
        begin
         ClickMouse2(mouse_left);
          wait(1500+random(1000));
          until (InvFull);
      end;

    Thanks a lot if you can help. Also, what is the code to click/right click on specific points in your inventory and other objects? thanks
    Last edited by ncore; 07-09-2012 at 04:35 PM.

  2. #2
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Should be
    Simba Code:
    procedure MineGold;
    var
      x, y: integer;
    begin
      Repeat
        If FindObj(x, y, 'ine', 4637420, {Tol} 10) then
        begin
          Mouse(x, y, 5, 5, true);
          wait(1500+random(1000));
        end;
      Until(InvFull);
    End;

    Anything you see in blue is a comment, you have to add a tolerance to FindObj as it is one of its parameters, also don't use clickmouse. This is a pretty basic procedure, and it should be backed up with antiban and other stuff.

    Edit, didnt see the second bit you posted, Look in In inventory.simba, MouseItem(I: Integer; button: Integer) is what your looking for it should be used like so...

    Simba Code:
    MouseItem(1, 1); This will cause a LeftClick at Inventory item 1 {MouseItem(1, mouse_left);}

    MouseItem(1, 2); This will cause a RightClick at Inventory item 1 {MouseItem(1, mouse_right);}

    MouseItem(1, 3); This will cause a move mouse to Inventory item 1 {MouseItem(1, mouse_move);}
    Last edited by Kasi; 07-09-2012 at 04:49 PM.

  3. #3
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by pur3b100d View Post
    Should be
    Simba Code:
    procedure MineGold;
    var
      x, y: integer;
    begin
      Repeat
        If FindObj(x, y, 'ine', 4637420, {Tol} 10) then
        begin
          Mouse(x, y, 5, 5, true);
          wait(1500+random(1000));
        end;
      Until(InvFull);
    End;

    Anything you see in blue is a comment, you have to add a tolerance to FindObj as it is one of its parameters, also don't use clickmouse. This is a pretty basic procedure, and it should be backed up with antiban and other stuff.
    Ok thanks. I think it read it, but i am getting an unexpected error at line 0 (?)

    so thats weird. and is there a way to click specific points on your inventory or right click and select options?

    Thanks

  4. #4
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by ncore View Post
    Ok thanks. I think it read it, but i am getting an unexpected error at line 0 (?)
    What other code are you including in your scripting window? compiles fine for me
    Edit : also look at my first post for the inventory thing

  5. #5
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by pur3b100d View Post
    What other code are you including in your scripting window? compiles fine for me
    Edit : also look at my first post for the inventory thing
    This is the full code so far:

    Simba Code:
    program GoldMiner;
    {$i srl/srl.simba}
    {$i SRL/SRL/misc/smart.simba}

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

      with Players[0] do
      begin
        Name := ''; // Username
        Pass := ''; // Password
        Active := True; // Set to true if you want to use Player 0
      end;
    end;

    procedure Antiban;
    begin
      if(not(LoggedIn))then Exit;
      begin
        case Random(100) of
          10: RandomRClick;
          30: PickUpMouse;
          50: RandomMovement;
          70: BoredHuman;
          89: ExamineInv;
        end;
      end;
    end;

    procedure MineGold;
    var
      x, y: integer;
    begin
      Repeat
        If FindObj(x, y, 'ine', 4637420, {Tol} 10) then
        begin
          Mouse(x, y, 5, 5, true);
          wait(1500+random(1000));
        end;
      Until(InvFull);
    End;

    This is my first time scripting, I have no idea if I am doing anything right, and it is hard to look at tutorials for exactly what I am planning on doing.

    And thank you for posting the clicking code, but is there any way to click on a set specific points on the screen? Like, if I wanted to go into my equipped items and use a teleportation device, how would I go about doing that?

  6. #6
    Join Date
    Jul 2010
    Location
    Western US
    Posts
    387
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Another issue is that you will keep clicking while mining unless you mine an ore in 1.5-2.5 seconds. Also, you need to detect when you clicked, and if someone else clicked and stole the ore from you.

    Try adding this:
    Simba Code:
    procedure MineGold;
    var
      x, y, c, k: integer;
    begin
      Repeat
        c:=invcount+1;//plan for having one more ore in inv
        If FindObj(x, y, 'ine', 4637420, {Tol} 10) then
        begin
          Mouse(x, y, 5, 5, true);
          wait(1500+random(1000));
          k:=0;
          if (IsChatBoxTextBetween('swing',clblack,8,8)) then
          repeat
            inc(k);
            wait(1000)
            if k=10 then//this will asume you lost your ore to someone else, or you may have not clicked right
              exit;
          until invcount=c //this will tell you if you have gained an item in your inv (note you may have gotten a spin ticked or gem too!)
        end;
      Until(InvFull);
    End;
    Of all the things I have lost, I miss my mind the most.
    Current Projects:
    Addy bar miner and superheater

  7. #7
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by ncore View Post

    This is my first time scripting, I have no idea if I am doing anything right, and it is hard to look at tutorials for exactly what I am planning on doing.

    And thank you for posting the clicking code, but is there any way to click on a set specific points on the screen? Like, if I wanted to go into my equipped items and use a teleportation device, how would I go about doing that?
    yes looking through the code, it looks fine, you need a "main loop", this normally is right at the bottom of your script and is like

    Simba Code:
    Begin
     // in here goes the order of what you want to do e.g...
      SetupSRL;  // setups all the default stuff.
      DeclarePlayers;  // Declares all the players ready for login

      LoginPlayer;  // login using the info your provided in DeclarePlayes;
      MineGold;  // goes to your function and does what your function says.
    End.  // notice the fullstop instead of semicolon, this ends your program
            // it has no other code to execute.

    also one other small thing, when your including smart you should always include it before SRL...like so

    Simba Code:
    {$i SRL/SRL/misc/smart.simba}
    {$i srl/srl.simba}
    and not
    Simba Code:
    {$i srl/srl.simba}  
    {$i SRL/SRL/misc/smart.simba}

    Amended script so far...

    Simba Code:
    program GoldMiner;
    {$i SRL/SRL/misc/smart.simba}
    {$i srl/srl.simba}


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

      with Players[0] do
      begin
        Name := ''; // Username
        Pass := ''; // Password
        Active := True; // Set to true if you want to use Player 0
      end;
    end;

    procedure Antiban;
    begin
      if(not(LoggedIn))then Exit;
      begin
        case Random(100) of
          10: RandomRClick;
          30: PickUpMouse;
          50: RandomMovement;
          70: BoredHuman;
          89: ExamineInv;
        end;
      end;
    end;

    procedure MineGold;
    var
      x, y: integer;
    begin
      Repeat
        If FindObj(x, y, 'ine', 4637420, {Tol} 10) then
        begin
          Mouse(x, y, 5, 5, true);
          wait(1500+random(1000));
          Antiban;
        end;
      Until(InvFull);
    End;

    Begin
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      MineGold;
    End.

  8. #8
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you so much! You are a godsent lol!

    It mined fine, but I will have to tweak the timing a bit to get it to mine ores properly without jumping to a new one.

    And is there a way to make the game screen stop closing and reopening if i start the script with the screen already open? thanks a lot!

  9. #9
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by ncore View Post
    Thank you so much! You are a godsent lol!

    It mined fine, but I will have to tweak the timing a bit to get it to mine ores properly without jumping to a new one.

    And is there a way to make the game screen stop closing and reopening if i start the script with the screen already open? thanks a lot!
    Yes, im guessing your talking about the smart window? it closes and opens because it's loading a different server each time your starting the script so if you keep it as the same server it shouldn't close smart everytime your restart to do this you have to add the following code to your main loop before "SetupSRL"

    Simba Code:
    SMART_Server := 83;  // change to whatever server you want but make sure its not random.
      SMART_Members := True;  // turn to false for non members
      SMART_Signed := True;
      SMART_SuperDetail := False;

    Edit: also to not click other ore whilst mining your current one look at animation.simba
    Last edited by Kasi; 07-09-2012 at 05:34 PM.

  10. #10
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, so i can just paste that in above the setup?

    And what I meant by clicking was not just in the inventory, but everywhere.

    Like if I wanted to click a door. That, plus specifically clicking a teleportation confirmation in the clan vexillium.

    I got this far, but I am not sure what to do from here:

    Simba Code:
    procedure ToMine;
      GameTab(Tab_Equip);
        if WearingItem(5) then
        begin
          MouseEquippedItem('weapon', MOUSE_RIGHT);
          WaitOption('eleport', 1000);

  11. #11
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by ncore View Post
    Thanks, so i can just paste that in above the setup?
    your main loop should look like this
    Simba Code:
    Begin
      SMART_Server := 83;
      SMART_Members := True;
      SMART_Signed := True;
      SMART_SuperDetail := False;
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      MineGold;
    End.

    Quote Originally Posted by ncore View Post
    And what I meant by clicking was not just in the inventory, but everywhere.
    if its in area's that don't change position then you can use Mouse() with
    set coords that dont change, keeping in mind to add randomness

    Simba Code:
    Mouse(87, 42, 5, 5, True);
    Mouse({X-Coord}, {Y-Coord}, {+ X Randomness}, {+ Y Randomness}, {ClickType, (True), (False)});

    Quote Originally Posted by ncore View Post
    Like if I wanted to click a door. That, plus specifically clicking a teleportation confirmation in the clan vexillium.
    if you were to search for a door, i would use TPA Color finding to find the coord of the door and then click it using mouse().

    Quote Originally Posted by ncore View Post
    I got this far, but I am not sure what to do from here:
    Simba Code:
    procedure ToMine;
      GameTab(Tab_Equip);
        if WearingItem(5) then
        begin
          MouseEquippedItem('weapon', MOUSE_RIGHT);
          WaitOption('eleport', 1000);
    For every "begin" in a script there should be a "end", for every procedure there should be at least one begin and that begin should come straight after your Procedure line providing you dont have to declare any variables. with that knowledge your procedure should be like so...

    Simba Code:
    procedure ToMine;
    Begin
      GameTab(Tab_Equip);
      If WearingItem(5) Then
      Begin
        MouseEquippedItem('weapon', MOUSE_RIGHT);
        WaitOption('eleport', 1000);
      End;
    End;

  12. #12
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok I think i fixed it. Sorry for the long response, I had to install .net framework to put this together:

    Simba Code:
    procedure WalkToMine;
    begin
      GameTab(Tab_Equip);
        if WearingItem(5) then
        begin
          MouseEquippedItem('weapon', MOUSE_RIGHT);
          WaitOption('eleport', 1000);
            begin
              Mouse(87, 42, 5, 5, True);
              Mouse(305, 537, 4, 2, True);
                begin
                  SPS_Setup(RUNESCAPE_SURFACE,['9_8','8_8']);
                  ToMine := [Point(3737, 3520), Point(3710, 3522), Point(3683, 3511), Point(3669, 3498), Point(3648, 3484), Point(3627, 3479), Point(3605, 3478), Point(3574, 3483), Point(3570, 3492), Point(3569, 3501)];
                  SPS_WalkPath(ToMine);
                end;
            end;
          end;
        end;



    does that look okay?

    Edit: I am getting identifier expected error
    Last edited by ncore; 07-09-2012 at 07:10 PM.

  13. #13
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    ah, you have to include SPS.simba, do that under the SRL include right at the top, (red Writing) also where are you setting the variable ToMine, that could cause another unidentified error, one last thing being, if your script is running back and forth to the mine you have to keep in mind that you only want to load the maps once, with SPS_Setup i would put it close to your main loop somewhere after SetupSRL making sure it is only called once

  14. #14
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, I was able to find out that it wasn't working because I didn't input a MyPath:TPointArray; under Var

    I tested out my script, and the walking to the mine is very smooth. However, getting into the mine isn't. I have not been able to open the blasted door to get in

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
  •