Page 2 of 2 FirstFirst 12
Results 26 to 33 of 33

Thread: AstralCrafter

  1. #26
    Join Date
    Feb 2013
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Is this working smoothly?

  2. #27
    Join Date
    Aug 2014
    Posts
    58
    Mentioned
    0 Post(s)
    Quoted
    30 Post(s)

    Default

    it is a bit out dated and needs tweaks to make it run for a while...the current one misclicks and sits there doing nothing.

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

    Lightbulb

    In case anyone is interested, I fixed a few things, just set your brightness to maximum in the game graphics settings and this will work. Also removed emptying pouches due to update. Lunar tele action bar 1 and npc contact action bar 2 and it runs great.


    Code:
    Program AstralCrafterRS3; //cleaned up
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    {$I sps/lib/sps-rs3.simba}
    
    const
      ColorAltar = 8885396;
      ColorTolAltar = 10;
      ColorDecayedPouch = 2698287;
      ColorTolDecayedPouch = 5;
      ColorCountDecayedPouch = 20;
      ColorAbyssMage = 1381655;
      ColorTolAbyssMage = 10;
      ColorBanker = 4234358;
      ColorTolBanker = 10;
    
    var
      PathBank: TPointArray;
      PathBankToAltar: TPointArray;
      MyScriptTimer: TTimeMarker;
      TripsMade: Integer;
      WE, FL, FM, FS, EG, EL, EM, ES, telefails, SlotNum: Integer;
      p: tpoint;
      DTMBank: Integer;
    
    label
     WalkToAltarLabel, TeleToMoonClanLabel, WithdrawEssLabel;
    
    procedure WaitRandom(MsecToWait: Integer); //procedure that makes random wait time
      begin
        Wait(MsecToWait + Random(Round(MsecToWait / 5.0)));
      end;
    
    procedure LoadResources; //loads up all the resources the script uses (paths and dtms)
      begin
        DTMBank := DTMFromString('mggAAAHicY2NgYOhjgeAOIJ4GxF1APAWILwHlTgDxWSi+B8Q3gLih0pihvDKX4cLCTIb+Ag+Gy4uzGXZNiGPABRhxYAgAALlpEZo=');
        PathBank := [Point(157, 206), Point(139, 193)];
        PathBankToAltar := [Point(207, 209), Point(196, 220), Point(184, 288), Point(190, 290), Point(177, 290), Point(217, 324), Point(206, 329), Point(194, 338), Point(212, 368), Point(223, 361), Point(236, 352), Point(248, 362), Point(242, 367), Point(234, 372), Point(248, 384), Point(257, 374), Point(264, 366), Point(271, 362), Point(281, 388), Point(270, 388), Point(264, 389), Point(281, 416), Point(288, 427), Point(296, 433), Point(313, 430), Point(313, 418), Point(327, 423), Point(331, 432), Point(341, 424), Point(345, 411)];
      end;
    
    procedure SetUp; //set up for the script to run
      begin
        SmartEnableDrawing := True;
        SetUpSrl;
        LoadResources;
        Sps.Setup('0_0MOONCLAN', RUNESCAPE_SURFACE);
        TripsMade := 0;
        writeLn('=====Setting up player camera!=====');
        minimap.setAngle(MM_DIRECTION_NORTH);
        TRSMainscreen.setAngle(MS_ANGLE_HIGH);
        mouseScroll(p, 50+Random(20));
        writeLn('=====Setting up complete!=====');
      end;
    
    procedure WhereAreWe; //Locates where the character is and determines whether to teleport or not
      begin
        If not (minimap.findsymbol(p, MM_SYMBOL_BANK, minimap.getbounds)) then
          begin
            writeLn('=====Could not find bank, now teleporting=====');
            ActionBar.ClickSlot(1);
          end
      end;
    
    procedure Antiban; //performs an antiban
    var
      i: integer;
      begin
        if not isLoggedIn then
          exit;
        i := random(500);
        case i of
          1..12: begin pickUpMouse(); writeLn('==PickUpMouse==') end;
          13..18: begin randomRClickItem(); writeLn('==randomRClickItem==') end;
          19..26: begin sleepAndMoveMouse(random(2000) + 750); writeLn('==SleepAndMoveMouse==') end;
          27..32: begin smallRandomMouse(); writeLn('==SmallRandomMouse==') end;
          33..50: begin mouseOffClient(OFF_CLIENT_RANDOM); writeLn('==MouseOffClient==') end;
          51..79: begin hoverSkill(Skill_Runecrafting); writeLn('==HoverSkillRunecrafting==') end;
          80..95: begin ; writeLn('==;==') end;
          96..120: begin hoverSkill(Skill_Magic); writeLn('==HoverSkillMagic==') end;
        end
      end;
    
    procedure ChatBoxOpen; //checks if the chat box is open, if so it hits continue until its closed
      begin
        if conversationBox.isOpen then
        begin
          repeat
            writeLn('==============Ahhh chatbox is open, now closing!===============');
            Conversationbox.Continue(True, True);
          until(not conversationBox.isOpen);
            writeLn('==============Chat closed!===============');
          //WaitRandom(1000);
        end
      end;
    
    procedure TeleToMoonclan; //Teleports to the Moonclan using the Action bar slot 1 + initializes antiban
      begin
        writeLn('==============Teleporting to MoonClan================');
        ActionBar.ClickSlot(1);
        Antiban;
        wait(2500 + randomrange(100,150));
      end;
    
    procedure WalkToBank; // Checks for full inventory, if full it exits WalkToBank and jumps to WalkToAltar, if not it walks to the Bank
      begin
        if (tabBackpack.isFull) then
        begin
          writeln('======seems like theres no need to bank, going to altar======');
          goto WalkToAltarLabel;
        end else
        begin
          writeLn('================= Walking to bank!=======================');
          Sps.WalkPath(PathBank);
          writeLn('==================Should be at the bank!==================');
          WaitRandom(400);
        end
      end;
    
    function HavePouchesDecayed: Boolean; //function for decayed pouch indentification
      begin
        Result := False;
        writeln('no decayed pouches found');
        for SlotNum := 1 to 4 do
        begin
          if CountColorTolerance(ColorDecayedPouch, TabBackpack.GetSlotBox(SlotNum), ColorTolDecayedPouch) > ColorCountDecayedPouch then
            begin
              writeLn('Detected decayed pouch in slot ' + IntToStr(SlotNum));
              Result := True;
              Break;
            end
        end
      end;
    
    procedure CastRepairSpell; //casts pouch repair spell in actionbar slt 9 repeats until no pouches are decayed
      begin
        Repeat
          ActionBar.ClickSlot(9);
          Mouse(tabBackpack.getSlotBox(SlotNum).GetMiddle, MOUSE_LEFT);
          wait(900 + randomrange(100,150));
        until (HavePouchesDecayed = False);
      end;
    
    procedure CastNpcContact; //casts npc contact to repair pouches actionbar slt2
      begin
        writeLn('==============Using NPC contact!===============');
        ActionBar.ClickSlot(2);
        WaitRandom(1000);
      end;
    
    procedure SelectAbyssMage;
    var
      TpaAbyssMage: TPointArray;
      AtpaAbyssMage: T2DPointArray;
      begin
        writeLn('==============Looking for Dark Mage!===============');
        MouseScroll(MainScreen.GetBounds.GetMiddle, 4);
        WaitRandom(500);
        if FindColorsTolerance(TpaAbyssMage, ColorAbyssMage, MainScreen.GetBounds, ColorTolAbyssMage) then
          begin
            AtpaAbyssMage := TpaAbyssMage.ToAtpa(20);
            SortAtpaSize(AtpaAbyssMage, True);
            TpaAbyssMage := AtpaAbyssMage[Low(AtpaAbyssMage)];
            Mouse(MedianTpa(TpaAbyssMage), MOUSE_LEFT);
            WaitRandom(6000);
          end
      end;
    
    procedure ChatWithAbyssMage;
    var
      IX: Integer; b: string;
      begin
        for IX := 1 to 6 do
          begin
            writeLn('==============Clicking continue!===============');
            ConversationBox.Continue(True, True);
            WaitRandom(1000);
          end
        ConversationBox.SelectOption(['Can you repair mv pouches?']);
        writeLn('==============Selecting repair pouches!===============');
        wait(500 + randomrange(100,150));
        for IX := 1 to 2 do
          begin
            writeLn('==============Clicking continue!===============');
            wait(500 + randomrange(100,150));
            ConversationBox.Continue(True, True);
          end
      end;
    
    procedure RepairPouches; //goes through the procedures to repair pouches
      begin
        //CastRepairSpell;
        CastNpcContact;
        SelectAbyssMage;
        ChatWithAbyssMage;
      end;
    
    procedure RepairPouchesIfNeeded; //if pouches need repair this begins the process
      begin
        writeln('======checking pouches======');
        if HavePouchesDecayed = true then
          begin
            writeLn('==============Beggining repair pouches!===============');
            RepairPouches;
          end
      end;
    
    procedure OpenBank; //tires to find banker,if found it left clicks on it to open bank, if pin screen is open it terminates script. it then checks to see if bank is open, if it is then it exits procedure, if it isnt open it goes to TeleToMoonClan
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      begin
        if FindColorsTolerance(ColorsFound, ColorBanker, MainScreen.GetBounds, ColorTolBanker) then
        begin
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint, MOUSE_LEFT);
          wait(900 + randomrange(50,100));
          if pinscreen.isOpen() then
          begin
            Writeln('======pin screen open, terminating script======');
            terminateScript();
          end
        end
        begin
          wait(1500 + randomrange(50,100));
          if bankscreen.isOpen then
          goto WithdrawessLabel;
        end
      end;
    
    procedure WithdrawEss; //check to see if bank is open, if so it withdraws essense until pack is full or its tried 5 or more times. if bank is not open it goes to TeleToMoonClanLabel.
      begin
        //repeat
          writeLn('=====Withdrawing essence=====');
          BankScreen.Withdraw(10, WITHDRAW_AMOUNT_ALL, ['']);
          wait(1500 + randomrange(5,20));
          //inc(WE);
          //until bankscreen.getPackCount = 28 or (WE >= 2);
      end
    procedure FillPouches1; //looks for giant pouch, rightclicks it, selects fill, and repeats until pack=16 or its tried 2 times
    var
      FG: Integer;
      begin
        repeat
          writeLn('==============Filling up the Giant pouch===============');
          Mouse(BankScreen.GetPackSlotBox(1).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Giant pouch'], 0.70);
          wait(1000 + randomrange(50,100));
          inc(FG);
        until ((bankscreen.getPackCount = 16) or (FG > 2));
      end;
    
    procedure FillPouches2; //does the same at fillpouch1 but for large=19, medium=13, and small=10
      var
      FL, FM, FS: Integer;
      begin
        repeat
          writeLn('==============Filling up the large pouch===============');
          Mouse(BankScreen.GetPackSlotBox(2).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Large pouch'], 0.80);
          wait(1000 + randomrange(50,100));
          inc(FL);
        until ((bankscreen.getPackCount = 19) or (FL >= 2));
        repeat
          writeLn('==============Filling up the Medium pouch===============');
          Mouse(BankScreen.GetPackSlotBox(3).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Medium pouch'], 0.80);
          wait(1000 + randomrange(50,100));
          inc(FM);
        until ((bankscreen.getPackCount = 13) or (FM >= 2));
        repeat
          writeLn('==============Filling up the small pouch===============');
          Mouse(BankScreen.GetPackSlotBox(4).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Small pouch'], 0.80);
          wait(1000 + randomrange(50,100));
          inc(FS);
        until ((bankscreen.getPackCount = 10) or (FS >= 2));
    end;
    
    procedure BankStep; //performs included procedures in this order withdrawess,fillpouches1,withdrawess,fillpouches2,withdrawess, and closes bank
    var OB: integer;
      begin
        WaitRandom(200);
        WithdrawEss;
        FillPouches1;
        WithdrawEss;
        FillPouches2;
        WithdrawEss;
        WaitRandom(30);
        BankScreen.Close;
        WaitRandom(25);
      end;
    
    procedure WalkToAltar; //walks to the altar
    begin
      writeLn('==============Walking to the Altar!===============');
      Sps.WalkPath(PathBankToAltar);
      wait(randomrange(100,500));
    end;
    
    procedure CraftRunes(WaitLonger: Boolean); //finds altar colors, if found it clicks altar. does some stuff im not sure is necessary - probably needs afailsafe
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      begin
        if FindColorsTolerance(ColorsFound, ColorAltar, MainScreen.GetBounds, ColorTolAltar) then
        begin
          writeLn('==============Crafting runes!===============');
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint, MOUSE_LEFT);
         writeLn('==============Done crafting runes!===============');
         wait(1500 + randomrange(100,150));
        end else
        MiniMap.WaitFlag;
        if (WaitLonger) then
        begin
          wait(900 + randomrange(100,150));
        end
    
      end;
    
    
    procedure CraftStep; //combines CraftRunes
    var
    craftfailure: integer;
      begin
        repeat
          CraftRunes(True);
          wait(900 + randomrange(100,150));
          inc(craftfailure);
          if (craftfailure >=3) then
            begin
              writeln('===oh shit, need to teleport!!===');
              ActionBar.ClickSlot(1);
              exit;
            end
        until ((TabBackPack.Count < 11) or (craftfailure >= 3));
        ChatBoxOpen;
        writeLn('==============Completely done crafting!===============');
        claimTicket();
    end;
    
    procedure PrintStatsReport; //makes the stats report - time run, runescrafted, runescrafted p/r, trips made, trips p/h, profit, profit p/r
    var
      runescrafted, profit, profitPerHour, runesPerHour, tripsPerHour: integer;
      begin
        runescrafted := TripsMade * 100;
        profit := (runescrafted * 344);
        profitPerHour := round((profit * 60) / (MyScriptTimer.getTime() / 60000));
        runesPerHour := round((runescrafted * 60) / (MyScriptTimer.getTime() / 60000));
        tripsPerHour := Round((TripsMade * 60) / (MyScriptTimer.getTime() / 60000));
    
        writeLn('========================================================');
        writeLn('Astral Crafter');
        writeLn('Time Run: ' + MsToTime(MyScriptTimer.getTime, TIME_FORMAL));
        writeLn('Runescrafted: ' + intToStr(runescrafted));
        writeLn('Runescrafted Per Hour: ' + intToStr(runesPerHour));
        writeLn('Trips Made: ' + intToStr(TripsMade));
        writeLn('Trips Per Hour: ' + intToStr(tripsPerHour));
        writeLn('Profit Made: ' + intToStr(profit));
        writeLn('Per Hour: ' + intToStr(profitPerHour));
        writeLn('========================================================');
      end;
    
    procedure MainLoopIteration; //the mainloop!
      begin
        //RestartScript:
        WaitRandom(500);
        WalkToBank;
        RepairPouchesIfNeeded;
        OpenBank;
        WithdrawEssLabel:
        WithdrawEss;
        FillPouches1;
        WithdrawEss;
        FillPouches2;
        WithdrawEss;
        WaitRandom(30);
        BankScreen.Close;
        WaitRandom(25);
        WalkToAltarLabel:
        WalkToAltar;
        CraftStep;
        TeleToMoonClanLabel:
        TeleToMoonclan;
        TripsMade := TripsMade + 1;
        //cleardebug;
        PrintStatsReport;
      end;
    
    begin //the brain
      SetUp;
      whereAreWe;
      MyScriptTimer.start;
      repeat
        MainLoopIteration;
      until False;
    end.



    ALSO: I didn't like using the same npc contact for each instance of the script I was using so here:

    add this to the const (under ColorTolBanker = 10; at the top):
    Code:
      ColorMage = 1447447;
      debug = true;
    and replace

    Code:
    procedure RepairPouches; //goes through the procedures to repair pouches
      begin
        //CastRepairSpell;
        CastNpcContact;
        SelectAbyssMage;
        ChatWithAbyssMage;
      end;
    with

    Code:
    procedure RepairPouches; //goes through the procedures to repair pouches
      begin
        //CastRepairSpell;
        CastNpcContact;
        //SelectAbyssMage;
       //ChatWithAbyssMage;
      end;

    and replace


    Code:
    procedure CastRepairSpell; //casts pouch repair spell in actionbar slt 9 repeats until no pouches are decayed
      begin
        Repeat
          ActionBar.ClickSlot(9);
          Mouse(tabBackpack.getSlotBox(SlotNum).GetMiddle, MOUSE_LEFT);
          wait(900 + randomrange(100,150));
        until (HavePouchesDecayed = False);
      end;
    
    procedure CastNpcContact; //casts npc contact to repair pouches actionbar slt2
      begin
        writeLn('==============Using NPC contact!===============');
        ActionBar.ClickSlot(2);
        WaitRandom(1000);
      end;
    with


    Code:
    procedure CastNpcContact; //casts npc contact to repair pouches actionbar slt2
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      jew:= Point(297,209);
      begin
        writeLn('==============Using NPC contact!===============');
        ActionBar.ClickSlot(2);
        WaitRandom(1000);
    
      if debug then
        writeln('Gut');
    
        mouseScroll(jew.rand(16), 4);
    
        WaitRandom(1000);
    
      if debug then
        writeln('Sehr Gut!');
    
        if FindColorsTolerance(ColorsFound, ColorMage, MainScreen.GetBounds, ColorTolBanker) then
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint, MOUSE_LEFT);
          wait(900 + randomrange(50,100))
        repeat
    
        conversationBox.continue(true, true);
    
        until(conversationBox.findOption(['epair']))
    
        if (conversationBox.selectOption(['epair'])) then
        writeln('Ich hasse Hippies!');
    
        repeat
    
          wait(50+random(10));
    
        until(conversationBox.continue(true,true))
    
      end;
    enjoy hippies@

  4. #29
    Join Date
    Aug 2014
    Location
    Michigan, USA
    Posts
    138
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    Wish this would be updated.

    Really need RC script for 30-90.

  5. #30
    Join Date
    Mar 2014
    Posts
    85
    Mentioned
    0 Post(s)
    Quoted
    53 Post(s)

    Default

    Quote Originally Posted by xSorrels View Post
    Wish this would be updated.

    Really need RC script for 30-90.
    doesn't what 420 posted work

  6. #31
    Join Date
    Aug 2014
    Location
    Michigan, USA
    Posts
    138
    Mentioned
    1 Post(s)
    Quoted
    68 Post(s)

    Default

    I figured that.

    I ended up using Claritys RC script.

    Thanks tho!

  7. #32
    Join Date
    Jul 2007
    Location
    Paris
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    15 Post(s)

    Default

    Gz on release !

    But there is a little problem for me, i do not use any pouches, I do not have 69 magic for moon tele (wouldnt that be cheaper and easier to use lodestones ?), and script after walking to bank, keep right clicking on the very left top corner of the screen.. :s

    Simba Code:
    ================= Walking to bank!=======================
    -- sps.getPlayerPos(): result = {X = 150, Y = 202}, took 406 ms
    ---- Waiting while the player is moving...
    -- sps.walkPath(): result = True
    ==================Should be at the bank!==================
    ======checking pouches======
    no decayed pouches found
    =====Withdrawing essence=====
    -- WARNING: bankscreen.withdraw(): Invalid slot 10
    ==============Filling up the Giant pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    ==============Filling up the Giant pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    ==============Filling up the Giant pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    =====Withdrawing essence=====
    -- WARNING: bankscreen.withdraw(): Invalid slot 10
    ==============Filling up the large pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    ==============Filling up the large pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    ==============Filling up the Medium pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    ==============Filling up the Medium pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    ==============Filling up the small pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    ==============Filling up the small pouch===============
    -- TRSChooseOption._select():
    ---- Options found: [Walk here, Cancel]
    ------ TRSChooseOption.close(): result = true
    ---- Failed to find any text matches
    -- TRSChooseOption._select() result = false
    =====Withdrawing essence=====
    -- WARNING: bankscreen.withdraw(): Invalid slot 10

  8. #33
    Join Date
    Nov 2014
    Location
    Australia
    Posts
    188
    Mentioned
    2 Post(s)
    Quoted
    97 Post(s)

    Default

    Thanks to 420 this script works great. Look above guys^
    I wish I could add familiar support, but i'm pretty new to this simba scripting. I've changed it all so it runs smoothly (Banking, Clicking Alter etc). It also supports NPC contact thanks to 420.
    Here it is, just copy paste this into the current script:
    Simba Code:
    Program AstralCrafterRS3; //cleaned up
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    {$I sps/lib/sps-rs3.simba}

    const
      ColorAltar = 7958133;
      ColorTolAltar = 20;
      ColorDecayedPouch = 2698287;
      ColorTolDecayedPouch = 5;
      ColorCountDecayedPouch = 20;
      ColorAbyssMage = 1381655;
      ColorTolAbyssMage = 10;
      ColorBanker = 9011069;
      ColorTolBanker = 10;
      ColorMage = 1447447;
      debug = true;

    var
      PathBank: TPointArray;
      PathBankToAltar: TPointArray;
      MyScriptTimer: TTimeMarker;
      TripsMade: Integer;
      WE, FL, FM, FS, EG, EL, EM, ES, telefails, SlotNum: Integer;
      p: tpoint;
      DTMBank: Integer;

    label
     WalkToAltarLabel, TeleToMoonClanLabel, WithdrawEssLabel;

    procedure WaitRandom(MsecToWait: Integer); //procedure that makes random wait time
      begin
        Wait(MsecToWait + Random(Round(MsecToWait / 5.0)));
      end;

    procedure LoadResources; //loads up all the resources the script uses (paths and dtms)
      begin
        DTMBank := DTMFromString('mggAAAHicY2NgYOhjgeAOIJ4GxF1APAWILwHlTgDxWSi+B8Q3gLih0pihvDKX4cLCTIb+Ag+Gy4uzGXZNiGPABRhxYAgAALlpEZo=');
        PathBank := [Point(157, 206), Point(139, 193)];
        PathBankToAltar := [Point(207, 209), Point(196, 220), Point(184, 288), Point(190, 290), Point(177, 290), Point(217, 324), Point(206, 329), Point(194, 338), Point(212, 368), Point(223, 361), Point(236, 352), Point(248, 362), Point(242, 367), Point(234, 372), Point(248, 384), Point(257, 374), Point(264, 366), Point(271, 362), Point(281, 388), Point(270, 388), Point(264, 389), Point(281, 416), Point(288, 427), Point(296, 433), Point(313, 430), Point(313, 418), Point(327, 423), Point(331, 432), Point(341, 424), Point(345, 411)];
      end;

    procedure SetUp; //set up for the script to run
      begin
        SmartEnableDrawing := True;
        SetUpSrl;
        LoadResources;
        Sps.Setup('0_0MOONCLAN', RUNESCAPE_SURFACE);
        TripsMade := 0;
        writeLn('=====Setting up player camera!=====');
        minimap.setAngle(MM_DIRECTION_NORTH);
        TRSMainscreen.setAngle(MS_ANGLE_HIGH);
        mouseScroll(p, 50+Random(20));
        writeLn('=====Setting up complete!=====');
      end;

    procedure WhereAreWe; //Locates where the character is and determines whether to teleport or not
      begin
        If not (minimap.findsymbol(p, MM_SYMBOL_BANK, minimap.getbounds)) then
          begin
            writeLn('=====Could not find bank, now teleporting=====');
            ActionBar.ClickSlot(1);
          end
      end;

    procedure Antiban; //performs an antiban
    var
      i: integer;
      begin
        if not isLoggedIn then
          exit;
        i := random(500);
        case i of
          1..12: begin pickUpMouse(); writeLn('==PickUpMouse==') end;
          13..18: begin randomRClickItem(); writeLn('==randomRClickItem==') end;
          19..26: begin sleepAndMoveMouse(random(2000) + 750); writeLn('==SleepAndMoveMouse==') end;
          27..32: begin smallRandomMouse(); writeLn('==SmallRandomMouse==') end;
          33..50: begin mouseOffClient(OFF_CLIENT_RANDOM); writeLn('==MouseOffClient==') end;
          51..79: begin hoverSkill(Skill_Runecrafting); writeLn('==HoverSkillRunecrafting==') end;
          80..95: begin ; writeLn('==;==') end;
          96..120: begin hoverSkill(Skill_Magic); writeLn('==HoverSkillMagic==') end;
        end
      end;

    procedure ChatBoxOpen; //checks if the chat box is open, if so it hits continue until its closed
      begin
        if conversationBox.isOpen then
        begin
          repeat
            writeLn('==============Ahhh chatbox is open, now closing!===============');
            Conversationbox.Continue(True, True);
          until(not conversationBox.isOpen);
            writeLn('==============Chat closed!===============');
          //WaitRandom(1000);
        end
      end;

    procedure TeleToMoonclan; //Teleports to the Moonclan using the Action bar slot 1 + initializes antiban
      begin
        writeLn('==============Teleporting to MoonClan================');
        ActionBar.ClickSlot(1);
        Antiban;
        wait(2500 + randomrange(100,150));
      end;

    procedure WalkToBank; // Checks for full inventory, if full it exits WalkToBank and jumps to WalkToAltar, if not it walks to the Bank
      begin
        if (tabBackpack.isFull) then
        begin
          writeln('======seems like theres no need to bank, going to altar======');
          goto WalkToAltarLabel;
        end else
        begin
          writeLn('================= Walking to bank!=======================');
          Sps.WalkPath(PathBank);
          writeLn('==================Should be at the bank!==================');
          WaitRandom(400);
        end
      end;

    function HavePouchesDecayed: Boolean; //function for decayed pouch indentification
      begin
        Result := False;
        writeln('no decayed pouches found');
        for SlotNum := 1 to 4 do
        begin
          if CountColorTolerance(ColorDecayedPouch, TabBackpack.GetSlotBox(SlotNum), ColorTolDecayedPouch) > ColorCountDecayedPouch then
            begin
              writeLn('Detected decayed pouch in slot ' + IntToStr(SlotNum));
              Result := True;
              Break;
            end
        end
      end;

    procedure CastRepairSpell; //casts pouch repair spell in actionbar slt 9 repeats until no pouches are decayed
      begin
        Repeat
          ActionBar.ClickSlot(9);
          Mouse(tabBackpack.getSlotBox(SlotNum).GetMiddle, MOUSE_LEFT);
          wait(900 + randomrange(100,150));
        until (HavePouchesDecayed = False);
      end;

    procedure CastNpcContact; //casts npc contact to repair pouches actionbar slt2
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      jew:= Point(297,209);
      begin
        writeLn('==============Using NPC contact!===============');
        ActionBar.ClickSlot(2);
        WaitRandom(1000);

      if debug then
        writeln('Gut');

        mouseScroll(jew.rand(16), 4);

        WaitRandom(1000);

      if debug then
        writeln('Sehr Gut!');

        if FindColorsTolerance(ColorsFound, ColorMage, MainScreen.GetBounds, ColorTolBanker) then
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint, MOUSE_LEFT);
          wait(900 + randomrange(50,100))
        repeat

        conversationBox.continue(true, true);

        until(conversationBox.findOption(['epair']))

        if (conversationBox.selectOption(['epair'])) then
        writeln('Ich hasse Hippies!');

        repeat

          wait(50+random(10));

        until(conversationBox.continue(true,true))

      end;

    procedure SelectAbyssMage;
    var
      TpaAbyssMage: TPointArray;
      AtpaAbyssMage: T2DPointArray;
      begin
        writeLn('==============Looking for Dark Mage!===============');
        MouseScroll(MainScreen.GetBounds.GetMiddle, 4);
        WaitRandom(500);
        if FindColorsTolerance(TpaAbyssMage, ColorAbyssMage, MainScreen.GetBounds, ColorTolAbyssMage) then
          begin
            AtpaAbyssMage := TpaAbyssMage.ToAtpa(20);
            SortAtpaSize(AtpaAbyssMage, True);
            TpaAbyssMage := AtpaAbyssMage[Low(AtpaAbyssMage)];
            Mouse(MedianTpa(TpaAbyssMage), MOUSE_LEFT);
            WaitRandom(6000);
          end
      end;

    procedure ChatWithAbyssMage;
    var
      IX: Integer; b: string;
      begin
        for IX := 1 to 6 do
          begin
            writeLn('==============Clicking continue!===============');
            ConversationBox.Continue(True, True);
            WaitRandom(1000);
          end
        ConversationBox.SelectOption(['Can you repair mv pouches?']);
        writeLn('==============Selecting repair pouches!===============');
        wait(500 + randomrange(100,150));
        for IX := 1 to 2 do
          begin
            writeLn('==============Clicking continue!===============');
            wait(500 + randomrange(100,150));
            ConversationBox.Continue(True, True);
          end
      end;

    procedure RepairPouches; //goes through the procedures to repair pouches
      begin
        CastRepairSpell;
        //CastNpcContact;
        //SelectAbyssMage;
       //ChatWithAbyssMage;
      end;

    procedure RepairPouchesIfNeeded; //if pouches need repair this begins the process
      begin
        writeln('======checking pouches======');
        if HavePouchesDecayed = true then
          begin
            writeLn('==============Beggining repair pouches!===============');
            RepairPouches;
          end
      end;

    procedure OpenBank; //tires to find banker,if found it left clicks on it to open bank, if pin screen is open it terminates script. it then checks to see if bank is open, if it is then it exits procedure, if it isnt open it goes to TeleToMoonClan
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      begin
        if FindColorsTolerance(ColorsFound, ColorBanker, MainScreen.GetBounds, ColorTolBanker) then
        begin
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint, MOUSE_LEFT);
          wait(900 + randomrange(50,100));
          if pinscreen.isOpen() then
          begin
            Writeln('======pin screen open, terminating script======');
            terminateScript();
          end
        end
        begin
          wait(1500 + randomrange(50,100));
          if bankscreen.isOpen then
          goto WithdrawessLabel;
        end
      end;

    procedure WithdrawEss; //check to see if bank is open, if so it withdraws essense until pack is full or its tried 5 or more times. if bank is not open it goes to TeleToMoonClanLabel.
      begin
        //repeat
          writeLn('=====Withdrawing essence=====');
          BankScreen.Withdraw(10, WITHDRAW_AMOUNT_ALL, ['']);
          wait(1500 + randomrange(5,20));
          //inc(WE);
          //until bankscreen.getPackCount = 28 or (WE >= 2);
      end
    procedure FillPouches1; //looks for giant pouch, rightclicks it, selects fill, and repeats until pack=16 or its tried 2 times
    var
      FG: Integer;
      begin
        repeat
          writeLn('==============Filling up the Giant pouch===============');
          Mouse(BankScreen.GetPackSlotBox(1).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Giant pouch'], 0.70);
          wait(1000 + randomrange(50,100));
          inc(FG);
        until ((bankscreen.getPackCount = 16) or (FG > 2));
      end;

    procedure FillPouches2; //does the same at fillpouch1 but for large=19, medium=13, and small=10
      var
      FL, FM, FS: Integer;
      begin
        repeat
          writeLn('==============Filling up the large pouch===============');
          Mouse(BankScreen.GetPackSlotBox(2).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Large pouch'], 0.80);
          wait(1000 + randomrange(50,100));
          inc(FL);
        until ((bankscreen.getPackCount = 19) or (FL >= 2));
        repeat
          writeLn('==============Filling up the Medium pouch===============');
          Mouse(BankScreen.GetPackSlotBox(3).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Medium pouch'], 0.80);
          wait(1000 + randomrange(50,100));
          inc(FM);
        until ((bankscreen.getPackCount = 13) or (FM >= 2));
        repeat
          writeLn('==============Filling up the small pouch===============');
          Mouse(BankScreen.GetPackSlotBox(4).GetMiddle, MOUSE_RIGHT);
          ChooseOption.Select(['Fill Small pouch'], 0.80);
          wait(1000 + randomrange(50,100));
          inc(FS);
        until ((bankscreen.getPackCount = 10) or (FS >= 2));
    end;

    procedure BankStep; //performs included procedures in this order withdrawess,fillpouches1,withdrawess,fillpouches2,withdrawess, and closes bank
    var OB: integer;
      begin
        WaitRandom(200);
        WithdrawEss;
        FillPouches1;
        WithdrawEss;
        FillPouches2;
        WithdrawEss;
        WaitRandom(30);
        BankScreen.Close;
        WaitRandom(25);
      end;

    procedure WalkToAltar; //walks to the altar
    begin
      writeLn('==============Walking to the Altar!===============');
      Sps.WalkPath(PathBankToAltar);
      wait(randomrange(100,500));
    end;

    procedure CraftRunes(WaitLonger: Boolean); //finds altar colors, if found it clicks altar. does some stuff im not sure is necessary - probably needs afailsafe
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      begin
        if FindColorsTolerance(ColorsFound, ColorAltar, MainScreen.GetBounds, ColorTolAltar) then
        begin
          writeLn('==============Crafting runes!===============');
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint, MOUSE_LEFT);
         writeLn('==============Done crafting runes!===============');
         wait(1500 + randomrange(100,150));
        end else
        MiniMap.WaitFlag;
        if (WaitLonger) then
        begin
          wait(900 + randomrange(100,150));
        end

      end;


    procedure CraftStep; //combines CraftRunes
    var
    craftfailure: integer;
      begin
        repeat
          CraftRunes(True);
          wait(900 + randomrange(100,150));
          inc(craftfailure);
          if (craftfailure >=3) then
            begin
              writeln('===oh shit, need to teleport!!===');
              ActionBar.ClickSlot(1);
              exit;
            end
        until ((TabBackPack.Count < 11) or (craftfailure >= 3));
        ChatBoxOpen;
        writeLn('==============Completely done crafting!===============');
        claimTicket();
    end;

    procedure PrintStatsReport; //makes the stats report - time run, runescrafted, runescrafted p/r, trips made, trips p/h, profit, profit p/r
    var
      runescrafted, profit, profitPerHour, runesPerHour, tripsPerHour: integer;
      begin
        runescrafted := TripsMade * 100;
        profit := (runescrafted * 344);
        profitPerHour := round((profit * 60) / (MyScriptTimer.getTime() / 60000));
        runesPerHour := round((runescrafted * 60) / (MyScriptTimer.getTime() / 60000));
        tripsPerHour := Round((TripsMade * 60) / (MyScriptTimer.getTime() / 60000));

        writeLn('========================================================');
        writeLn('Astral Crafter');
        writeLn('Time Run: ' + MsToTime(MyScriptTimer.getTime, TIME_FORMAL));
        writeLn('Runescrafted: ' + intToStr(runescrafted));
        writeLn('Runescrafted Per Hour: ' + intToStr(runesPerHour));
        writeLn('Trips Made: ' + intToStr(TripsMade));
        writeLn('Trips Per Hour: ' + intToStr(tripsPerHour));
        writeLn('Profit Made: ' + intToStr(profit));
        writeLn('Per Hour: ' + intToStr(profitPerHour));
        writeLn('========================================================');
      end;

    procedure MainLoopIteration; //the mainloop!
      begin
        //RestartScript:
        WaitRandom(500);
        WalkToBank;
        RepairPouchesIfNeeded;
        OpenBank;
        WithdrawEssLabel:
        WithdrawEss;
        FillPouches1;
        WithdrawEss;
        FillPouches2;
        WithdrawEss;
        WaitRandom(30);
        BankScreen.Close;
        WaitRandom(25);
        WalkToAltarLabel:
        WalkToAltar;
        CraftStep;
        TeleToMoonClanLabel:
        TeleToMoonclan;
        TripsMade := TripsMade + 1;
        //cleardebug;
        PrintStatsReport;
      end;

    begin //the brain
      SetUp;
      whereAreWe;
      MyScriptTimer.start;
      repeat
        MainLoopIteration;
      until False;
    end.
    If you wish to change between NPC Contact/Repair Rune Pouch (the latter is better but has to be unlocked through livid farm)see below for which lines to comment out (//):

    NPC Contact:
    Simba Code:
    procedure RepairPouches; //goes through the procedures to repair pouches
      begin
        //CastRepairSpell;
        CastNpcContact;
        SelectAbyssMage;
        ChatWithAbyssMage;
      end;

    Repair Rune Pouches (preferred)
    procedure RepairPouches; //goes through the procedures to repair pouches
    Simba Code:
    begin
        CastRepairSpell;
        //CastNpcContact;
        //SelectAbyssMage;
       //ChatWithAbyssMage;
      end;
    Great Script, Thanks
    Last edited by Obquility; 11-29-2014 at 07:12 AM.

Page 2 of 2 FirstFirst 12

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
  •