Page 1 of 2 12 LastLast
Results 1 to 25 of 32

Thread: Crafting Guild Miner and Smelter

  1. #1
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default Crafting Guild Miner and Smelter

    Hello folks, for my second script ever I present:

    CraftyMiner
    (oooo.....ahhhh)

    Requirements:
    Can smelt gold and silver
    Can access crafting guild (40 crafting)
    Brown Apron (worn)
    Rune Pick (wielded or not)

    BASICALLY you start it in the crafting guild right by the gold rocks and let er rip. It mines gold and silver, using objectDTM's to for locating between the two. After a full inventory is achieved, it then locates itself to the centre of the guild, rests, opens the door (thanks flight for the code), walks to the furnace using SPS, smelts (my favourite function :P), banks, walks, repeats! She ain't flawless and I don't have a report (yet), but seems fairly stable. Anything you see you don't like please leave a comment!
    Also, you need the objectDTM include. (props to euphphuhpusiusm)

    Simba Code:
    program craftyminer;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i ObjectDTM\ObjDTMInclude.simba}
    {$i sps/sps.simba} // has to be included after SRL
    const
    GOLDCOLOUR = 5296637;
    SILVERCOLOUR = 15593208;
    GOLDWAIT = 7000;
    SILVERWAIT = 5000;
    var
    miningcolour, location, waiter, goldoreDTM, silveroreDTM, goldbarDTM, silverbarDTM, loadz: Integer;
    PathThere, PathBack: TStringArray;
    GuildtoSmelt, SmelttoBank, BanktoGuild: TPointArray;

    procedure Antiban; //idea taken from Coh3n's tutorial.
    begin
      if not (LoggedIn) then
        Exit;
      begin
        case Random(80) of
          10: RandomMovement;
          20: PickUpMouse;
          30: RandomMovement;
          40: BoredHuman;
          50: RandomMovement;
          60: BoredHuman;
          69: ExamineInv;
        end;
      end;
    end;

    procedure RestUp;
    begin
      if not (LoggedIn) then
        Exit;
      begin
        SetRest;
        while not RunEnergy(95) do
        begin
          Antiban;
          Wait(Random(1000));
        end;
      end;
    end;

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

      Players[0].Name      := '';
      Players[0].Pass      := '';
      Players[0].Nick      := '337';
      Players[0].Pin       := '';
      Players[0].Active    := true;
    end;

    Function ChatCheck(s: string): Boolean;
    var
      i, l : Integer;
      b : Boolean;
    begin
         if (Pos(s, GetBlackChatMessage) > 0)then
        begin
           Writeln('Checked Black Chat Message');
           Result:=True;
      end;
    end;

    Procedure SetupPaths;
    begin
      SmelttoBank := [ Point(3752, 3161), Point(3791, 3170), Point(3827, 3195),
                       Point(3863, 3204), Point(3888, 3229)];

      GuildtoSmelt := [Point(3569, 3503), Point(3606, 3473), Point(3652, 3481),
                       Point(3698, 3497), Point(3744, 3518), Point(3782, 3499),
                       Point(3799, 3458), Point(3829, 3428), Point(3856, 3388),
                       Point(3861, 3339), Point(3864, 3293), Point(3865, 3244),
                       Point(3843, 3223), Point(3825, 3192), Point(3790, 3170),
                       Point(3757, 3162), Point(3734, 3179)];

      BanktoGuild := [ Point(3859, 3219), Point(3861, 3262), Point(3866, 3310),
                       Point(3864, 3352), Point(3852, 3397), Point(3828, 3439),
                       Point(3795, 3466), Point(3779, 3507), Point(3734, 3520),
                       Point(3690, 3516), Point(3652, 3496), Point(3614, 3484),
                       Point(3570, 3497)];
      goldoreDTM := DTMFromString('mlwAAAHicY2dgYFjCxsCwFIjXAvE8IJ4DxFOhbA5GBgZmIOYDYjEg5gJiJiD+D9S3a4oUkGTCio0YcANGPBgKAHYPB4I=');
      silveroreDTM := DTMFromString('mrAAAAHic42BgYFBiZ2BQBWIdIFYAYiEolgRiDZA4IwODGhBrA7ExEJsCsToQKwGxCRBPmjQDaAoTTmzEgB8wEsAwAAAwKASn');
      goldbarDTM := DTMFromString('mlwAAAHicY2dgYBAEYlYGCOAAYjEglgViASgfJM8NxMxQNexALALE11aBVDFhxUYMuAEjHgwFAPSzAo0=');
      silverbarDTM := DTMFromString('mlwAAAHicY2dgYHBkZWBwAmJ/IPaDso2A2ByIjzAyMFwA4sNAvA+IdwHxCSA+C8Tz5y8D6mbCio0YcANGPBgKAAi9CYo=');
    end;

    procedure Terminator;
    begin
      FreeDTM(goldoreDTM);
      FreeDTM(silveroreDTM);
      FreeDTM(goldbarDTM);
      FreeDTM(silverbarDTM);
      TerminateScript;
    end;

    Function Smelt: boolean;
    var
      x, y, counter: integer;
    begin
      counter := 0;
      if FindObjCustom(x, y, ['ace'], [3815997], 5) then
      begin
        wait(100 + random(250));
        Mouse(x, y, 1, 1, true);
        if FindDTM(goldoreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
         begin
           wait(4000 + random(2500));
           if FindDTM(goldbarDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
            begin
              Mouse(x, y, 1, 1, true);
              while ((counter<50) and not (FindNormalRandoms)) do
              begin
                if not FindDTM(goldoreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then break;
                wait(1000);
                counter := counter + 1;
              end;
            end;
            if FindObjCustom(x, y, ['ace'], [3815997], 5) then
             begin
               wait(100 + random(250));
               Mouse(x, y, 1, 1, true);
               wait(2000 + random(2500));
               if FindDTM(silverbarDTM, x, y, MCX1, MCY1, MCX2, MCY2) then
               begin
                 Mouse(x, y, 1, 1, true);
                 counter := 0;
                 while ((counter<50) and not (FindNormalRandoms)) do
                 begin
                   if not FindDTM(silveroreDTM, x, y, MIX1, MIY1, MIX2, MIY2) then break;
                   wait(1000);
                   counter := counter + 1;
                 end;
                 Result := true;
               end
             end
          else
           begin
             WriteLn('Couldn''t find initial goldoreDTM');
             Terminator;
           end
          end
       end
      else
       begin
         WriteLn('Couldn''t find furnace');
         Terminator;
       end
    end;



    Function MineOre: boolean;
    var
    x, y: integer;
    begin
      if FindObjCustom(x, y, ['ine', 'ocks'], [miningcolour], 5) then
      begin
        wait(100 + random(250));
        Mouse(x, y, 1, 1, true);
        wait(waiter + random(4500));
        Result := true;
        WriteLn('found a rock');
      end
      else
      begin
        Result := false;
        WriteLn('couldn''t find ore');
      end
    end;

    Procedure LocateSilver;
    begin
      if ObjDTMWalk('632:42:4:1:7:622:103:1:7:653:86:1:7:645:105:1:7:646:61', 0, 100, 80, True) then
        begin
          wait(500 + random(250));
          MakeCompass('n');
          WriteLn('location is now silver')
        end
      else WriteLn('could not locate silver');
    end;

    Procedure LocateSelfToDoor;
    begin
      if ObjDTMWalk('651:94:6:1:7:642:73:1:7:606:73:1:7:594:81:1:7:630:48:1:7:666:69:1:7:598:53', 0, 100, 80, True) then
        begin
          wait(500 + random(250));
          MakeCompass('n');
          WriteLn('located self to door')
        end
      else WriteLn('could not locate to door');
    end;

    Procedure LocateGold;
    begin
      if ObjDTMWalk('617:128:4:1:7:641:93:1:7:619:65:1:7:637:111:1:7:607:62', 0, 100, 80, True) then
        begin
          wait(500 + random(250));
          MakeCompass('s');
          WriteLn('location is now gold')
        end
      else WriteLn('could not locate gold');
    end;

    Procedure ChangeLocation;
    begin
     if (location=0) then
      begin
        LocateSilver;
        location := 1;
        waiter := SILVERWAIT;
        miningcolour := SILVERCOLOUR;
        wait(500 + random(250));
        Exit;
      end;
     if (location=1) then
      begin
       LocateGold;
       location := 0;
       waiter := GOLDWAIT;
       miningcolour := GOLDCOLOUR;
       wait(500 + random(250));
      end
     else
     WriteLn('location wasn''t valid');
    end;

    Procedure Mining;
    begin
      miningcolour := GOLDCOLOUR;
      location := 0;
      waiter := GOLDWAIT;
      repeat
        if not MineOre then
          begin
            ChangeLocation;
            wait(500 + random(250));
          end;
        if MineOre then Continue
        else
        WriteLn('MineOre returned true');
      until(InvFull);
    end;

    Procedure OpenTheDoor;    //newer door opener, thanks Flight
    var
    x, y, COUNTER: integer;
    begin
    If FindObj(x,y,'pen', 2117737, 5) then     //2581379
      Begin
        WriteLn('Opening Door...');
        ClickMouse2(True);
        COUNTER := 0;
        if not DidRedClick and (COUNTER<20) then   //If we missed, then exit so we can try again
          begin
            OpenTheDoor;
            inc(COUNTER);
          end;
        While IsMoving do
          Wait(100);
        //Maybe wait a little longer?
      end else if FindObj(x,y,'lose', 2117737, 5) then  //The door is already open, so let's exit
        Exit;
    end;

    Procedure RelocateToCenter;
    begin
    if ObjDTMWalk('585:65:4:1:7:635:76:1:7:643:102:1:7:639:56:1:7:659:90', 0, 100, 80, True) then
        begin
          wait(500 + random(250));
          MakeCompass('n');
          WriteLn('location is now guild centre');
          RestUntil(RandomRange(90,100));
          //RestUp;
        end
      else
        begin
          WriteLn('could not relocate to centre');
          Terminator;
        end;
    end;



    Procedure WalkToGold;
    begin
    if ObjDTMWalk('657:124:4:1:7:618:56:1:7:642:52:1:7:655:55:1:7:675:105', 0, 100, 80, True) then
        begin
          wait(500 + random(250));
          MakeCompass('s');
          WriteLn('walked to gold from centre')
        end
      else WriteLn('could not relocate to gold from centre');

    end;

    procedure Report;//Starts procedure off
    begin
      Writeln('[]------------------Crafting Guild Miner Smelter-------------------------[]');//Do any style you want
      Writeln('Worked For : ' + TimeRunning)//Displays how long it worked for
      Writeln('Mined/Dropped '+ IntToStr(loadz) + ' Loads');
      Writeln('[]--------------------------------------------[]');
    end;


    Procedure Bank;
    begin
    if ObjDTMWalk('631:91:4:1:7:595:89:1:7:595:73:1:7:603:50:1:7:580:77', 0, 100, 80, True)
    then
    begin
      wait(500 + random(250));
      WriteLn('made it to bank, banking...');
      if OpenBank('feb', false, false)
      then
      begin
        WriteLn('opened bank');
        wait(500 + random(550));
        if DepositAll then
        begin
          WriteLn('deposited all');
          CloseBank;
          inc(loadz);
          //RestUntil(RandomRange(90,100));
          RestUp;
          SetRun(true);
        end
      end
      else
      begin
        WriteLn('Couldn''t bank');
        Terminator;  //Instead of TerminateScript, this is another procedure i have which
      end             //frees my DTM's
    end
    else WriteLn('didn''t make it to the bank');
    end;

    begin
      smart_server := 1;
      smart_members := false;
      smart_signed := true;
      smart_superDetail := false;
      clearDebug();
      setupSRL();
      DeclarePlayers;
      if not LoggedIn then LogInPlayer;
      ObjDTM_Setup;
      SetAngle(SRL_ANGLE_HIGH);
      SPS_Setup(RUNESCAPE_SURFACE, ['8_8','9_8','9_7']);
      SetupPaths;
      repeat
        Mining;
        Report;
        RelocateToCenter;
        wait(2500 + random(2500));
        OpenTheDoor;
        if not SPS_WalkPath(GuildtoSmelt) then             //SPS walking
          begin
            WriteLn('Couldn''t make it to the smelter');
            Terminator;
          end;
        wait(7500 + random(2500));
        if not Smelt then
          begin
            WriteLn('Couldn''t smelt');
          end;
        //WalkToBank;  //objectDTM walking
        wait(1500 + random(2500));
        if not SPS_WalkPath(SmelttoBank) then             //SPS walking
          begin
            WriteLn('Couldn''t make it to the bank');
            Terminator;
          end;
        wait(1500 + random(2500));
        Bank;
        if not SPS_WalkPath(BanktoGuild) then             //SPS walking
          begin
          WriteLn('Couldn''t make it to the guild');
          Terminator;
          end;
        //WalkToGuild;   //objectDTM walking
        wait(3500 + random(2500));
        LocateSelfToDoor;
        wait(2500 + random(2500));
        OpenTheDoor;
        wait(2500 + random(2500));
        WalkToGold;
        Report;
      until(Players[CurrentPlayer].Active=false);
    end.
    First Report!
    Progress Report:
    []------------------Crafting Guild Miner Smelter-------------------------[]
    Worked For : 1 Hours, 43 Minutes and 11 Seconds
    Mined/Dropped 8 Loads
    []--------------------------------------------[]
    Last edited by cause; 01-08-2012 at 08:20 PM.

  2. #2
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    I might try this soon. Also first.

  3. #3
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Very neat, cause.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  4. #4
    Join Date
    Jul 2007
    Location
    Finland
    Posts
    304
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice script havent tried it yet thought.

  5. #5
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Ahh so this is the script you were bugging me about on IRC huh? Nice release!
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  6. #6
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default

    lol yes this is it, unsurprisingly, it's not that popular.

  7. #7
    Join Date
    Nov 2011
    Location
    Damascus,Syria
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice script! It's pretty cool I shall post a proggy in the morning also do you have any idea what the profit per hour is?

    BTW- What it the DTM include? is that something we need to manually add?
    Previously know as Badreddine.

  8. #8
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    You can download it from here.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  9. #9
    Join Date
    Feb 2011
    Location
    Canada
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Look's very promising! Good luck on perfecting it!

  10. #10
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Awsome Idea just looked it over havnt tested it but its along the lines of something I wanted to make for my first script so awsome I have a basic outline to work around =P
    YOUR LATE!

  11. #11
    Join Date
    Dec 2011
    Location
    United States
    Posts
    960
    Mentioned
    21 Post(s)
    Quoted
    504 Post(s)

    Default

    Looks good. Im going to test it on my Pure/Skiller soon. Ill post a proggy if i end up using it.
    Last edited by Wetish; 02-12-2012 at 12:31 PM.

  12. #12
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    87
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'll test this out when I reach 40 crafting? (I think that's what I need to be? :O)

  13. #13
    Join Date
    Dec 2011
    Posts
    1,162
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol sweet cause. You did the stuff my craftguilder didnt! :P i might have to try this out!

  14. #14
    Join Date
    Jan 2012
    Posts
    470
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    somewhat works it has a terrible time opennig doors and banking. also sometimes fails to find the rocks.

  15. #15
    Join Date
    Sep 2006
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    WIll post a pr soon. Thank you kindly for keeping things fresh!!

    Here is my experience:

    Worked pretty flawlessly, noticed has slight bias towards silver at a rate of 2.

    Ran to smelting point but stayed at DTM location too long - only smelted Silver ore.

    Ran to bank and sketched for almost a minute, banked and just kept rotating camera.

    Very nice start. I commend you for putting this all together! Keep it up!
    Last edited by hoopla; 03-19-2012 at 10:00 PM.

  16. #16
    Join Date
    Mar 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hey can someone tell me how to change this to skip the smithing part? Would I have to rewrite the entire script or just delete some parts or what? I've never written a script before and I really don't know python at all.... Just wondering how hard it would be and if it would be manageable. Thanks!

  17. #17
    Join Date
    Apr 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What are the xp/hour rates?

  18. #18
    Join Date
    Mar 2012
    Location
    Indiana
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Looks great, i tried making something similar with kbot but failed at finding and opening the door :/

    Will run the script tonight and let you know how it goes!
    lukas76 here cooking up another evil plan!

  19. #19
    Join Date
    Apr 2012
    Location
    Portugal
    Posts
    144
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    anyone have tried ?

  20. #20
    Join Date
    Jan 2012
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I will be trying this soon. I will tell you how it works

  21. #21
    Join Date
    May 2012
    Location
    Australia
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry to be annoying but how do i download this? im new.

  22. #22
    Join Date
    Nov 2011
    Location
    Southern Finland
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by chosen357 View Post
    sorry to be annoying but how do i download this? im new.
    Are you serious?

  23. #23
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default

    Hey guys, I haven't really updated this at all! I think I'll update it in a week or so, probably use SPS walking.

  24. #24
    Join Date
    May 2012
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cause View Post
    Hey guys, I haven't really updated this at all! I think I'll update it in a week or so, probably use SPS walking.
    Please do my good sir
    Thinking about using this to 99 mining/smithing
    2 birds in one stone

  25. #25
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    2,254
    Mentioned
    21 Post(s)
    Quoted
    238 Post(s)

    Default

    Lol that would probably take awhile haha. I haven't quite moved into my house yet so this still is in the todo pile.

Page 1 of 2 12 LastLast

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
  •