Results 1 to 12 of 12

Thread: Al Kharid Mining Unstrung Symbol Crafter

  1. #1
    Join Date
    Nov 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default Al Kharid Mining Unstrung Symbol Crafter

    Al Kharid Mining Unstrung Symbol Crafter


    Hello everyone, I just came back from a very long break of runescape. I decided to come back because a friend told me they brought back Old School Runescape. It is my first public script since my return a few weeks ago. I wanted to help new comers who want to learn programming, so I added a lot of comments in my script. This way, you can learn from it and try to reuse some of my personal methods. If you have any question about how to use some of my method or how I get those values I am using, you can send me a PM and I will help you.


    Requirements
    • You must have a crafting level of 16 or higher
    • You must have a mining level of 20 or higher
    • You must have a smithing level of 20 or higher
    • You must have a Holy Mould in your Inventory
    • You must have a mining pick equipped or in your inventory
    • You must have AeroLib Revision 11
    • You must download the custom map I made for walking (I will explain)
    • You must do the quick fix to WorldSwitcher if you want to use multiple Worlds (I will explain)
    • You must make your own DTM for mining pick to use this script(I will explain)



    Cycle of the Script
    1. Start the script next to the 3 Silver ore's in Al Kharid
    2. It will mine Silver Ore until inventory is full and it will switch world(If you specified it)
    3. It will Walk to the Furnace in Al Kharid
    4. It will smelt the ore into bar and the bar into unstrung symbol
    5. It will walk to to the General Store in Al Kharid and it will sell the symbols
    6. It will walk back to the mining site and start over again


    Features
    • Random Detection
    • Antiban
    • Perfect for Ultimate Ironman
    • Fail Safe
    • My Custom Mining Detection
    • WorldSwitcher for people with a high mining level
    • Will Logout if something bad happen :-)



    Before running the Script
    Custom Map
    At the end of this post, you will find two attached files. The first one will be the script while the other one is my custom map. Once you have downloaded both, you will need to transfer the file named "CrafterMap" in your Simba folder under Aerolib\maps\surface. On my computer, the final path to this folder is this -> C:\Simba\Includes\AeroLib\maps\surface


    Inventory
    Make sure you have a Mining Pick Equipped or in Your Inventory and a Holy Mould.


    Complete Script
    Section to complete
    Simba Code:
    //Fails attempt for detecting mining pick. This number should be based on the performance of your computer.
    //On my personnal computer, I set this value to 8. At work, I use 18.
    failsLimit := 18;

    // Player info
    P_NICKNAME   = '';
    P_LAMPSKILL  = SKILL_SMITHING;

    Mining Pick DTM
    If you want to use my script, you will need to make 2 DTM. I will show you how to do these DTM that will be used for detecting if you are mining

    If you don't know how to make DTM -> https://villavu.com/forum/showthread.php?t=77691

    First, you need to make a DTM when the rock is located North. The Position of the mining pick when you make the DTM should be over your head.
    Mining Position

    DTM

    Result of the DTM


    Second, you need to make a DTM when the rock is located on the East. The position of the mining pick when you make the DTM should be over your head again
    Mining Position

    DTM

    Result of the DTM



    When you are done, add your two DTM at this location in the script
    They are located on line 545 and 546

    Simba Code:
    //Detect if user is done mining
    Procedure CheckIfUserMining();
    Var
      DTM_MiningPickHori, DTM_MiningPickVerti : Integer;
        FailsCounter : Integer = 0;
    Begin
      DTM_MiningPickHori := //Dtm 1
      DTM_MiningPickVerti := //Dtm2

      //Detect If user is Mining
      While FailsCounter < failsLimit Do
      Begin
        GeneralAntiban(3000);
        Wait(Randomrange(10,20));

        //Try to find Mining pick on screen
        If (FindDtmOnScreen([DTM_MiningPickHori,DTM_MiningPickVerti],TopLeftScreen,BotRightScreen)) Then
        Begin
          FailsCounter := 0;
        End Else
          FailsCounter := FailsCounter + 1;
      End;

      FreeDTM(DTM_MiningPickHori);
      FreeDTM(DTM_MiningPickVerti);
    End;


    If you want to use Multiple World

    Information you must know
    • It can support up to 3 worlds
    • You need to be in the world you set at world1 when you start the script
    • You can use a special function I made for clicking at the position where the worlds should be located
    • You need to apply my fix to WS_switchWorlds
    • Highly recommend to use worlds that are visible on the list where you decided to click it.


    Step 1 - Fixing WS_switchWorlds
    1. Under Functionlist, You need open the include list and you need to find WorldSwitcher. Once you find it, open the list and double-click on WS_switchWorlds;

    2. Replace function WS_switchWorlds(World: Integer): Boolean; with this
    Simba Code:
    function WS_switchWorlds(World: Integer): Boolean;
    var
      T : Timer;
      ms,x,y : Integer;
      rS : Extended;
    begin
      if not isLoggedIn() then Exit;

      WS_toggle();
      WS_World := World;
      if not WS_findWorld() then
      begin
        ms := MouseSpeed;
        mouseBox(toBox(725,250,733,260), MOUSE_MOVE);
        getMousePos(x, y);
        holdMouse(x, y, MOUSE_LEFT);

        mouseSpeed := 35;
        rS  := (random(30) / 30) / 10.0;
        if rS = 0.0 then
          rS := 0.1;

        windMouseFunc(X, Y, 725+random(8), 414+random(5), 9.0,3.0,10.0/rS,15.0/rS,10.0*rS, @WS_findWorld);
        wait(randomRange(200,400));
        getMousePos(X, Y);
        releaseMouse(X, Y, MOUSE_LEFT);
        wait(randomRange(700,1200));
      end;

      if not findText(X, Y, toStr(World), 'SmallChars07', WS_WorldBox) then
      begin
        warn('Failed to find world '+toStr(World)+' in the world list', WT_CORE);
        exit;
      end;

      warn('Found world '+toStr(World)+', switching worlds.', WT_CORE);
      T.start();
      while (Me.inCombat() and (T.timeElapsed() < 5000)) do
        wait(30);

      mouseBox(toBox(X,Y,X+15,Y+4), MOUSE_LEFT);
      fastClick(MOUSE_LEFT);
      T.start();
      while (T.timeElapsed() < 4000) do
      begin
        if findText(X, Y, 'lease', 'SmallChars07', toBox(0,0,230,35)) then
          break;
        if findText(X, Y, 'Yes', 'CharsNPC07', AREA_CB) then
          break;
        if isSplashScreen() then
          break;
      end;

      if isSplashScreen() then
      begin
        mouseBox(toBox(WDx1,WDy1,WDx2,WDy2), MOUSE_LEFT);
        while not isLoggedIn() do
          wait(60);
      end;

      if findText(X, Y, 'Yes', 'CharsNPC07', AREA_CB) then
        mouseBox(toBox(X,Y,X+10,Y+6), MOUSE_LEFT);
      T.start();
      while (T.timeElapsed() < 4000) do
        if findText(X, Y, 'lease', 'SmallChars07', toBox(0,0,230,35)) then
          break;
      while findText(X, Y, 'lease', 'SmallChars07', toBox(0,0,230,35)) do
        wait(30);

      if isSplashScreen() then
      begin
        mouseBox(toBox(WDx1,WDy1,WDx2,WDy2), MOUSE_LEFT);
        while not isLoggedIn() do
          wait(60);
        Exit(False);
      end;
      result := true;
    end;


    Step 2 - Update Script for Switching World
    Simba Code:
    //Variables if we want to switch worlds
    HowManyWorlds := 3;
    World1 := 20;
    World2 := 21;
    World3 := 22;

    Step 3 - Update Script to put the world list at the required position
    Since these worlds don't appear when we open the world switcher, I will use my custom method to set the world list at the right place for switching world at a faster pace
    Simba Code:
    //Set these values if you want to use my custom method instead of Aerolib
    useCustomScrolling := True;
    //Value between 240 and 410
    scrollYPosition := 300;


    Things To Do

    • Update comments on some functions because I made some change
    • Accurate Progress Report
    • Paint Progress Report on Smart
    • Find a Workaround for my Mining Detection so you won't need to make the 2 DTM required to run this script
    • Improve Walking Fixing, since the script will stop if it didn't made it to the destination(0.5%)

    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by DeniedHacker; 06-19-2015 at 03:03 AM.

  2. #2
    Join Date
    Jun 2015
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Looks great cant wait to try this

  3. #3
    Join Date
    Nov 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    IT'S HERE!!!
    - I did many small changes, so the script could get 6 hours more easily.
    - I reworked and did some test for detecting if the door was open when we leave the furnace because it had 5%-15% chance to fail at detecting the door with DTM(It was the main cause that was stopping the script from running for a very long time)
    -I Added Debug Info so It will be easier for people to tell me where the script stoped

    I may have introduced some bugs, but I ran this version for 2h without any problem.

  4. #4
    Join Date
    Apr 2015
    Location
    FireFox
    Posts
    528
    Mentioned
    10 Post(s)
    Quoted
    227 Post(s)

    Default

    Nice release, glad to see you're helping out the next generation of scripter!
    Scripting with ogLib

  5. #5
    Join Date
    Nov 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by srlMW View Post
    Nice release, glad to see you're helping out the next generation of scripter!
    Thanks you. I started my script before going to sleep. This is a progress Report from this version
    ***********Progress Report************
    * ~By Sheepexert~
    *Trip Done: 48 (6 Trip/H)
    *Crafting XP earned: 60000 (8007 XP/H)
    *Mining XP earned: 48000 (6405 XP/H)
    *Smithing XP earned: 16416 (2191 XP/H)
    *Total Time: 7 Hours, 29 Minutes and 37 Seconds
    *************************************

  6. #6
    Join Date
    Mar 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    how does the script looks when dtm is added ? do you need to add x&y?

  7. #7
    Join Date
    Jan 2016
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Is this script outdated or does it still run? I would like to test it.

  8. #8
    Join Date
    Feb 2015
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    doesnt work for me lol

  9. #9
    Join Date
    Oct 2015
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I think that the script is maybe a litle outdated
    Error: Expected variable of type "Int32", got "AnsiString" at line 1014, column 14 at line 1014
    Compiling failed.

  10. #10
    Join Date
    Jun 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    is this script still working?

  11. #11
    Join Date
    Jun 2017
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Need try it sounds good

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

    Default

    Nicely done mate. Multi-skilled scripts are impressive to me, and it looks like you really put some effort into this. Keep up the good work.

    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..."


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
  •