Results 1 to 8 of 8

Thread: (OSR) CageEarthCrafter

  1. #1
    Join Date
    Sep 2013
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    20 Post(s)

    Thumbs up (OSR) CageEarthCrafter V1.01




    About

    After looking around the old school Runescape scripts, I realized there wasn’t much in the way of Runecrafting scripts so I took upon myself to have a go at making one. I thought it would be a fun challenge to create a script from scratch since I had very little prior programming experience before I joined the forums, and on top of that, I get to help out this great community. Win Win if I do say so myself!

    Script Features


    • Banking With multiple failsafes
    • Reflection Walking - Thanks @hoodz @Flight @Officer Barbrady and all else involved!
    • Works with SMART 8.3
    • Autologin
    • Combined Antiban and AntiRandom Procedures. I like to call PlayerProtection!
    • Progress Report - Includes how many essence you have crafted + time running


    Instructions

    Step 1: Make sure both al_functions and MiniReflection (included below) are in your Includes/SRL-OSR/SRL/misc folder
    Step 2: Enter your details in the section near the top of the script.
    Step 3: Start your character at Varrock East bank with your earth tiara equipped.
    Step 4: Enjoy!

    Current Bugs

    None that I am aware of so far. HOWEVER, this is my first script and I haven't had much time to bug test it so I expect there to be a few! Please reply and try to describe the bug so I can fix it!

    Change Log


    • Version 1.0 - Initial Release (5/10/13)
      Version 1.01 - Cleaned up code. Stability improvements (8/10/13)



    Proggies






    Notes

    Any feedback, be it positive or negative is welcome! I am planning on applying for SRL members with this script. So SRL Members, feel free to treat this script almost as an application in your evaluations. Thanks!

    And finally, ENJOY! ^_^


    Simba Code:
    program CageEarthRuneCrafter;

    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$i SRL-OSR/SRL/misc/al_functions.simba}  // Credits to Flight
    {$I SRL-OSR/SRL/misc/MiniReflection.simba}  // Credits to Hoodz


    {//////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////

      Welcome to Cages Earth Rune Crafter!

      Step 1: Make sure both al_functions and MiniReflection are in your misc folder
      Step 2: Enter your details below.
      Step 3: Start your character
      at Varrock East bank with your earth tiara equipped.
      Step 4: Enjoy!

      P.S. If you run into any problems let me know and I will try to fix
      them as soon as possible.

     ///////////////////////////////////////////////////////////////////////
     ///////////////////////////////////////////////////////////////////////
     ///////////////////////////////////////////////////////////////////////}



    var
      EssDTM, EssMade: Integer;


    const
      VERSION = '1.01';
      NICKNAME = '';                    {Please Fill in your player details here}
      USERNAME = '';
      PASSWORD = '';
      BANKPIN = '';


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      with Players[0] do
      begin
        Name := USERNAME;
        Pass := PASSWORD;
        nick := NICKNAME;
        Active := True;
        pin := BANKPIN;
      end;
    end;


    procedure LoadDTM;
    begin
       EssDTM := DTMFromString('mggAAAHicY2NgYOBjZmDgAmJRIGZGYmcyMjCUAXEREGcDcTIQZwDxxPZ2hpiwMIbJHR0MxdlZDKvnz2dYt2gRAyfQLGyYEQeGAACUYAye');
    end;

    procedure FreeTheDTM;
    begin
      FreeDtm(EssDTM);
    end;

    procedure ProgressReport;
    begin
      WriteLn('Congratulations! you have crafted ' + IntToStr(EssMade) + ' ess in this run!');
      WriteLn('The script has been running for: ' +  TimeRunning);
      WriteLn('Thanks for using Cages Earth Crafter!');
    end;

    procedure PlayerProtection;
    begin
      case Random(65) of
        10: PickUpMouse;
        20: RandomMovement;
        30: RandomTab(True);
        40: ExamineInv;
        50: HoverSkill(skill_Runecrafting, False);
        60: SmallRandomMouse;
      end;

      FindNormalRandoms;

    end;

    procedure Bank;
    var
      TPAA: T2DPointArray;
      CTS, L, I, X, Y, Tries, BankFound: Integer;
      TPA: TPointArray;
    begin
      repeat
        PlayerProtection;
        CTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.11, 2.93);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2051676, MSX1, MSY1, MSX2, MSY2, 4);
        TPAA := TPAToATPAEx(TPA, 200, 100);
        L := High(TPAA);
        ColorToleranceSpeed(CTS);
        for I := 0 to L do
        begin
          MiddleTPAEx(TPAA[i], X, Y);
          MMouse(X, Y, 3, 3);
          if WaitUptext('th', 300) then
          begin
            GetMousePos(X, Y);
            Mouse(X, Y, 0, 0, True);
            Wait(2500 + Random(500));
            BankFound := 1;
            Break;
          end;
        end;

        if not (BankScreen) then
        begin
          if not WaitUptext('th', 300) then
          begin
            MakeCompass(randomrange(-20, 20));
            blindwalk(Point(3254 + random(1), 3420 + random(1)));
            PlayerProtection;
            inc(Tries)
            WriteLn('Attempt number: ' + IntToStr(Tries));
          end;
        end;

       if (Tries > 5) then
       begin
          WriteLn('Failed finding the bank too many times. Exiting Script.');
          Logout;
          TerminateScript;
       end;

      until(BankFound = 1);


       if (PinScreen) then
         InPin(BANKPIN);


       if (BankScreen) then
       if finddtm(EssDTM, X, Y, MSX1, MSY1, MSX2, MSY2) then
        begin
          QuickDeposit('inv');
          WriteLn('Commencing Banking');
          MMouse(X, Y, 3, 3);
          wait(randomrange(10, 30));
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, mouse_right);
          wait(randomrange(10, 30));
          ChooseOption('Withdraw-All')
          wait(randomrange(10, 30));
          CloseBank;
          WriteLn('Banking Complete');
          PlayerProtection;
          Exit;
        end else
        begin
          WriteLn('Could not find the Essence DTM. Consider making another one.');
          Logout;
          TerminateScript;
        end;
    end;

    function EnterRCAltar: Boolean;
    var
      TPAA: T2DPointArray;
      CTS, L, I, X, Y, Tries: Integer;
      TPA: TPointArray;
    label
      Start;
    begin
      Start:
      PlayerProtection;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.4, 0.4);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5725540, MSX1, MSY1, MSX2, MSY2, 20);
      TPAA := TPAToATPAEx(TPA, 100, 150);
      SortATPAFromSize(TPAA, 8000, True);
      L := High(TPAA);
      ColorToleranceSpeed(CTS);
      for I := 0 to L do
      begin
        MiddleTPAEx(TPAA[i], X, Y);
        MMouse(X, Y, 3, 3);
        if IsUpText('ste') then
        begin
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
          Wait(100 + Random(25));
          Flag;
          Wait(1500 + Random(500));
          blindwalk(Point(2658 + random(1), 4839 + random(1)));
          Result := True;
          Exit;
        end;
      end;

     if not IsUpText('ste') then
     begin
        MakeCompass(randomrange(0, 360));
        Inc(Tries);
        WriteLn('You have failed to find the uptext ' + IntToStr(Tries) + ' Times.');                                                                        //FailSafes
     end;

     if (Tries > 5) then
     begin
        WriteLn('Failed too many times finding runecrafting alter. Terminating');
        Logout;
        TerminateScript;
     end;

     goto Start;
     SetColorSpeed2Modifiers(0.2, 0.2);

    end;

    function LocatePortal: Boolean;
    var
      TPAA: T2DPointArray;
      CTS, L, I, X, Y, Tries: Integer;
      TPA: TPointArray;
    label
      Start;
    begin
      Start:
      PlayerProtection;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.08, 0.63);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 7447982, MSX1, MSY1, MSX2, MSY2, 13);
      TPAA := TPAToATPAEx(TPA, 10, 10);
      SortATPAFromSize(TPAA, 8000, True);
      L := High(TPAA);
      ColorToleranceSpeed(CTS);
      for I := 0 to L do
      begin
        MiddleTPAEx(TPAA[i], X, Y);
        MMouse(X, Y, 3, 3);
        if WaitUpTextMulti(['ort'], 300) then
        begin
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
          Wait(2200 + Random(500));
          Flag;
          Result := True;
          Exit;
        end;
      end;

     if not IsUpText('ort') then
     begin
        MakeCompass(randomrange(0, 360));
        Inc(Tries);
        WriteLn('You have failed to find the uptext ' + IntToStr(Tries) + ' Times.');                                                                            //FailSafes
     end;

     if (Tries > 5) then
     begin
       WriteLn('Failed too many times finding runecrafting alter. Terminating');
       Logout;
       TerminateScript;
     end;

     goto Start;
     SetColorSpeed2Modifiers(0.2, 0.2);

    end;

    function UseRCAltar: Boolean;
    var
      TPAA: T2DPointArray;
      CTS, L, I, X, Y, Tries: Integer;
      TPA: TPointArray;
    label
      Start;
    begin
      Start:
      PlayerProtection;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.56, 0.54);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2895924, MSX1, MSY1, MSX2, MSY2, 10);
      TPAA := TPAToATPAEx(TPA, 70, 70);
      SortATPAFromSize(TPAA, 8000, True);
      L := High(TPAA);
      ColorToleranceSpeed(CTS);
      for I := 0 to L do
      begin
        MiddleTPAEx(TPAA[i], X, Y);
        MMouse(X, Y, 3, 3);
        if WaitUpTextMulti(['lta'], 300) then
        begin
          GetMousePos(X, Y);
          Mouse(X, Y, 0, 0, True);
          EssMade := EssMade + 28;
          Wait(100 + Random(25));
          Flag;
          Wait(4000 + Random(650));
          blindwalk(Point(2655 + random(1), 4830 + random(1)));
          Wait(1700 + Random(650));
          Result := True;
          Exit;
        end;
      end;

      if not IsUpText('lta') then
      begin
        MakeCompass(randomrange(0, 360));
        Inc(Tries);
        WriteLn('You have failed to find the uptext ' + IntToStr(Tries) + ' Times.');
      end;                                                                                  //FailSafes

      if (Tries > 5) then
      begin
        WriteLn('Failed too many times finding runecrafting alter. Terminating');
        Logout;
        TerminateScript;
      end;

      goto Start;
      SetColorSpeed2Modifiers(0.2, 0.2);

    end;

    procedure ToBank;
    begin
      blindwalk(Point(3254 + random(1), 3420 + random(1)));
      PlayerProtection;
    end;


    procedure ToAlter;
    begin
      blindwalk(Point(3305 + random(1), 3472 + random(1)));
      PlayerProtection;
    end;


    procedure Walking(Route: string);
    begin
      case Lowercase(Route) of
        'bank': ToBank;

        'alter': ToAlter;
      else
        WriteLn('Please select a valid route (bank or alter)');
      end;
    end;

    begin
      DeclarePlayers;
      SetupSRL();
      SetupReflection;
      LoadDTM;
      AddOnTerminate('FreeTheDTM');
      AddOnTerminate('ProgressReport');

      if not LoggedIn then
      begin
        WriteLn('Player was not logged in. Logging in...');
        LogInPlayer;
        SetAngle(0);
      end;

      repeat

        SetRun(True);
        Bank;
        Walking('alter');
        EnterRCAltar;
        UseRCAltar;
        LocatePortal;
        Walking('bank');

      until (False);
    end.
    Attached Files Attached Files
    Last edited by Cage; 10-08-2013 at 06:42 PM.

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Very nice thread layout and that banner is epic

    I would wait few more weeks before applying for members, since activity + helpfulness around the forums is a big plus

    nice first script! I like it
    Last edited by Sjoe; 10-05-2013 at 08:24 PM.

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    gz on release! what is going to be your next script?

    edit: you might add the script itself as a download too

  4. #4
    Join Date
    Sep 2013
    Posts
    73
    Mentioned
    0 Post(s)
    Quoted
    20 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    Very nice thread layout and that banner is epic

    I would wait few more weeks before applying for members, since activity + helpfulness around the forums is a big plus

    nice first script! I like it
    Thanks!



    Quote Originally Posted by hoodz View Post
    gz on release! what is going to be your next script?

    edit: you might add the script itself as a download too

    Thanks! No idea. I will just keep browsing around reading tutorials and if I come accross an interesting concept that I havn't tried, ill either implement into my current script, or ill make a new script.

    Added script for download!

  5. #5
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Congrats on your first script release! I hadn't expected that banner but I like it

    This is also very good for a first script, keep it up

  6. #6
    Join Date
    Sep 2013
    Location
    Latvia
    Posts
    75
    Mentioned
    0 Post(s)
    Quoted
    38 Post(s)

    Default

    Congratz!!! good job.. i will test it out when I'll be done with my "super - duper" settings..

  7. #7
    Join Date
    Jun 2013
    Posts
    79
    Mentioned
    1 Post(s)
    Quoted
    62 Post(s)

    Default

    Congratulations! you have crafted 700 ess in this run!
    The script has been running for: 54 Minutes and 24 Seconds
    Thanks for using Cages Earth Crafter!
    Successfully executed.
    works well if anything alter dection could be worked on miss a few times

  8. #8
    Join Date
    Oct 2011
    Location
    England
    Posts
    401
    Mentioned
    10 Post(s)
    Quoted
    176 Post(s)

    Default

    Haha this looks awesome!
    Yer a wizard, 'oopi

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •