Results 1 to 6 of 6

Thread: dstone's Powerminer

  1. #1
    Join Date
    Oct 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default dstone's Powerminer

    I have never made a serious script before just small things so I decided to make a Powerminer. I have been working for about 4 1/2 - 5 hrs to get this far on this script that includes a lot of reading on the forums. Any criticism or suggestions is welcomed, for the script I want to add anti-randoms, anti-ban, multi-character support. I also need to find a way for the miner to mine all the rocks not just the ones in the upper left. If you have any advice/links or anything thing that can help it would be very much appreciated.


    SCAR Code:
    //ScriptName  = First Powerminer
    //Author      = dstone09
    //Description = Mines ore then drops it.
    //Version     = 0.1
    //Date        = Fri. July 06, 2007.
    //Comments    = Thanks to WhiteShadow, The_Rs_Monkey and WhoCares357 for the Tutorials!

    program FirstPowerminer;
    {.include SRL\SRL.scar}

    var
    Loads: Integer;
    r: integer;

    const
    EquipedPick = True; //Is your pick axe equiped?
    OreColor = 4681883; //Put the ore color here!
    NumberofLoads = 1; // The number of loads you want to do.
    WaitTime = 2000; //Time to wait before next click +Random 1000.

    procedure MineOre;
    begin
      repeat
        if(FindColorTolerance(x,y,OreColor,MSX1,MSY1,MSX2,MSY2,4))then
          begin
            MMouse(x,y,4,4);
            if(IsUpText('ine'))then
            begin
              GetMousePos(x,y);
              Mouse(x,y,0,0,true);
            end;
          end;
          wait(WaitTime+random(1000));
      until(InvFull);
    end;

    procedure DropOre;
    begin
      KeyDown(27);
      Wait(Random(100));
      KeyUp(27);
      if(EquipedPick)then
        DropAll;
      if(not(EquipedPick))then
        DropTo(2,28);
    end;

    procedure Report;
    begin
      Writeln('////////////////////////////////////////////////');
      Writeln('Dropped '+ IntToStr(Loads) + ' Loads of Ore');
      Writeln('\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\');
    end;

    procedure Sig;
    begin
      ClearDebug;
      writeln('    __         __');
      writeln('.--|  |.-----.|  |_.-----.-----.-----.-----.');
      writeln('|  _  ||__ --||   _|  _  |     |  -__|__ --|');
      writeln('|_____||_____||____|_____|__|__|_____|_____|');
      writeln(' ______                             _______ __');
      writeln('|   __ \.-----.--.--.--.-----.----.|   |   |__|.-----.-----.----.');
      writeln('|    __/|  _  |  |  |  |  -__|   _||       |  ||     |  -__|   _|');
      writeln('|___|   |_____|________|_____|__|  |__|_|__|__||__|__|_____|__|');
    end;

    begin
      ActivateClient;
      Wait(700+Random(1000))
      Sig;
      HighestAngle;
      repeat
        MineOre;
        DropOre;
        Loads:=Loads+1;
        r:=r+1;
      until(r=NumberofLoads);
      Report;
    end.

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    It seems like a pretty good first script even though I haven't tested it out yet.

    A problem is that you forgot to 'SetupSRL'. Also, what is the point of having both 'r' and 'Loads'. Don't both variables do the same thing?

    To make the script mine the rocks closest to you, you could make x and y the main screen centre and then replace FindColorTolerance with FindColorSpiralTolerance so the script searches for the colour from the middle out instead of from the top left corner to the bottom right.

  3. #3
    Join Date
    Feb 2007
    Posts
    169
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    perhaps use findobj instead of findcolor
    you need to add some failsafes into your procedure so if there are no rocks it doesn't just keep looping
    here's my mining procedure if you want to take a look at it
    it won't compile on your computer as it has lots of custom functions but is a good script example
    SCAR Code:
    procedure Mine;
    begin
      repeat
        AntiRandoms;
        if(Players[CurrentPlayer].Active = False)then
        Exit;
        P:=0
        repeat
          P:=P+1
          wait(250+random(100));
        until(FindObj(x,y,'ine',rockcolour,9))or(FindObj(x,y,'ine',rockcolour1,9))or(FindObj(x,y,'ine',rockcolour2,9))or(P=50)
        if(P=50)then
        begin
          writeln('No Rocks');
          Players[CurrentPlayer].Active := False;
          Players[CurrentPlayer].Loc := 'No Rocks';
          Exit;
        end;
        if(not(P=50))then
        begin
          MMouse(x,y,2,2);
          wait(100+random(50));
          if(random(7)=0)then
          begin
            Mouse(x,y,5,5,False);
            wait(25);
            ClickOption('ine',1);
          end
          else
          Mouse(x,y,5,5,True)
          wait(1150+random(450));
          Q:=0
        repeat
          Q:=Q+1
          wait(100+random(100));
        until(InChat('cur'))or(InChat('man'))or(Q=20)
        wait(500+random(500));
      end;
      Q:=0
      if(random(8)=0)then
        begin
          antirandoms;
          nobans;
        end;
        antirandoms;
      until(InvFull)
      i:= i + 1;
      l:= l + 1;
      DropOres;
    end;

  4. #4
    Join Date
    Oct 2006
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ZephyrsFury View Post
    It seems like a pretty good first script even though I haven't tested it out yet.

    A problem is that you forgot to 'SetupSRL'. Also, what is the point of having both 'r' and 'Loads'. Don't both variables do the same thing?

    To make the script mine the rocks closest to you, you could make x and y the main screen centre and then replace FindColorTolerance with FindColorSpiralTolerance so the script searches for the colour from the middle out instead of from the top left corner to the bottom right.
    Thanks for the feedback and the r and loads thing kinda happened at 2 in the morning so I need to fix that.

  5. #5
    Join Date
    Jun 2007
    Location
    Mianus
    Posts
    863
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    great job keep it up

  6. #6
    Join Date
    Jul 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i tryed it and i always get this

    Include file C:\WINDOWS\system32\includes\SRL\SRL.scar does not exist.
    Failed when compiling
    Line 24: [Error] (24:23): Unknown identifier 'x' in script C:\WINDOWS\system32\Scripts\dstone09sPowerminer.sc ar

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. powerminer help!!
    By seany in forum OSR Help
    Replies: 8
    Last Post: 01-26-2007, 06:45 AM
  2. My Powerminer v. 3.00
    By GoF in forum RS3 Outdated / Broken Scripts
    Replies: 17
    Last Post: 01-22-2007, 02:08 AM
  3. Need Help On My First PowerMiner
    By Buckleyindahouse in forum OSR Help
    Replies: 3
    Last Post: 12-23-2006, 06:08 PM
  4. powerminer
    By shadowblade in forum OSR Help
    Replies: 20
    Last Post: 12-15-2006, 12:34 AM
  5. my powerminer
    By shadowblade in forum OSR Help
    Replies: 3
    Last Post: 12-09-2006, 03:04 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
  •