Page 1 of 6 123 ... LastLast
Results 1 to 25 of 136

Thread: JDDiv - A Divination Script

  1. #1
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Cool JDDiv - A Divination Script

    IN TOTAL REWRITE! PLEASE BE PATIENT AS IT MAY TAKE SOME TIME!

    Ecclesiastes 7:9
    "Be not quick in your spirit to become angry, for anger lodges in the heart of fools."

    Update on script
    So far, I have done a little bit of the script. At the moment it is not functioning but I have received some messages asking if I was even working on it.
    It is not ready to be run yet, nor will it even load SMART!
    Simba Code:
    program jdDivOGL;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    //{$I Sps/Sps.Simba}



     // Most of this script is either copy and pasted from the include, or closely rendered fromt he include.
     // This script would not have been remade if not for the help of Uri (Skype)/ Serajin (SRL)
     // Thanks for the motivation from rtrty10
     // SRL-6 is a bitch to learn
     // Hopefully this script helps a few other people learn some SRL-6 lingo



    // JDDivination, by Wu-Tang Clan

    const
      Which = 'Experience';
        // Energy - Convert memories into divine energy
        // Experience - Convert memories into divination experience
        // Combo - !NOT RECOMMENDED! Combine both energy and memories to get more experience
          // When using combo, it is recommended that you use the Energy setting for a while beforehand

      Where = 'Digsite';
        // Draynor - Level 1-10
        // Falador - Level 10-20
        // Digsite - Level 20-30
        // Seers V - Level 30-40 (Unstable, maps usually do not function properly, Digsite advised)
        // Relleka - Level 40-50
        // Karamja - Level 50-60
        // 50+ please spot me an account


    var
      rfail, pFail: Integer;

    procedure declarePlayers();
    begin
      players.setup([''], '');
      currentPlayer := 0;
    end;

    {procedure Walk;
    //*Contains paths for walking to and from the rift
    var
      myPath:TPointArray;

    begin
      case Where of
        // I am fully aware that these can be done easier/less code...

        'Draynor':
          begin
            writeLn('Walking to Rift');
            SPS_Setup(RUNESCAPE_SURFACE, ['10_9']);
            myPath := [Point(4265, 3739)];
            SPS_WalkPath(myPath);
          end;

        'Falador':
          begin
            writeLn('Walking to Rift');
            SPS_Setup(RUNESCAPE_SURFACE, ['9_7']);
            myPath := [Point(3816, 2986)];
            SPS_WalkPath(myPath);
          end;

        'Digsite':
          begin
            writeLn('Walking to Rift');
            SPS_Setup(RUNESCAPE_SURFACE, ['12_7']);
            myPath := [Point(5016, 3014)];
            SPS_WalkPath(myPath);
          end;

        'Seers V':
          begin
            writeLn('Walking to Rift');
            SPS_Setup(RUNESCAPE_SURFACE, ['6_7']);
            myPath := [Point(2718, 2943)];
            SPS_WalkPath(myPath);
          end;

        'Relleka':
          begin
            writeLn('Walking to Rift');
            SPS_Setup(RUNESCAPE_SURFACE, ['7_5']);
            myPath := [Point(2857, 2197)];
            SPS_WalkPath(myPath);
          end;

        'Karamja':
          begin
            writeLn('Walking to Rift');
            SPS_Setup(RUNESCAPE_SURFACE, ['8_10']);
            myPath := [Point(3339, 4388)];
            SPS_WalkPath(myPath);
          end;

      end;
    end;}


    function isInMotion(): Boolean;
    //*If backpack count changes, this will result true
    begin
      if tabBackpack.waitForShift(5000) then
        begin
          Result := True;
        end;
    end;

    function isInvFull(): Boolean;
    begin
    //*Will result true if the inventory is full
    // Can be done a number of ways:

      {if (tabBackpack.isItemInSlot(28)) then
        WriteLn('There is an item in slot 28, must convert for Divination XP.')
        Result := True;

      if (tabBackpack.count(28)) then
        WriteLn('We have a full inventory, time to convert it to XP.');
        Result := True;}


      if (tabBackpack.isFull) then
        WriteLn('Full backpack, attempting to convert for XP.');
        Result := True;
    end;

    function isBackpackUp(): Boolean;
    //*Opens up the backpack (DEVELOPMENT ->) and closes any currently open interfaces that aren't backpack
    var
      p: TPoint;
    begin
      if not (tabBackpack.isOpen()) then
        begin
          tabBackpack.Open();
        end;

      {if (gameTabs.areMultiOpen()) then
        begin
          if not (gameTabs._findTab(p, TAB_BACKPACK, gameTabs._getActiveTabBox())) then
            repeat
              gameTabs.findX(p);
              mouse(p.rand(3), MOUSE_LEFT);
            until (gameTabs.areAnyOpen());
        end;}


    end;

    function isMouseoverTextDiv():Boolean;
    //*Returns true if the Mouseover Text for the spring or wisp is found
    begin
      if (isMouseOverText(['arvest'], 1000)) then
        WriteLn('We have found a suitable Divination object to harvest.');
        Result := True;
    end;

    function ConvDialogue(): Boolean;
    //*Returns true if "convert" is found in the chatbox while converting Divination objects
    var
      P: Tpoint;

    begin
      if findText(p, clWhite, 5, ['onvert'], [UpCharsEx], chatbox.getBounds()) then
        writeln('We must be converting or earning XP.');
        Result := True;
    end;

    function Chronicle(): Boolean;
    //*Returns true if there is any Chronicle fragment alerts in the inventory
    var
      P: Tpoint;

    begin
      if findText(p, clWhite, 5, ['arvest'], [UpCharsEx], chatbox.getBounds()) then
        writeln('We must be harvesting memories or energy.');
        Result := True;
    end;

    procedure FindRift;
    //*Finds the rift in order to convert memories and energy
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;
      P: Tpoint;

    begin
      Writeln('FindRift;');
        begin
          theCTS := GetToleranceSpeed;

          SetColorToleranceSpeed(2);
          SetToleranceSpeed2Modifiers(0.21, 0.47);

          FindColorsSpiralTolerance(x,y,TPA,4520078, mainscreen.getBounds(),10);
          ATPA := TPAToATPAEx(TPA, 25, 25);

          SetColorToleranceSpeed(theCTS);
          SetToleranceSpeed2Modifiers(0.02, 0.02);

          H := High(ATPA);
          If Length(ATPA) = 0 Then
            begin
              writeln('No points found for FindRift;');
              Inc(Rfail);
              Exit;
            end;
          For I := 0 To H Do
            begin
              SortATPASize(ATPA,True);
              //SortATPAFrom(ATPA, Point(301,175));
                WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
              MiddleTPAEx(ATPA[I], X, Y);
              Mouse(Point(P.x + random(5), P.y + random(8)), mouse_Move, MOUSE_HUMAN);
              fastClick(mouse_Right);
                if (isMouseOverText(['onvert'], 1000)) then
                  begin
                    WriteLn('We have found Rift!');
                    Wait(1000+random(500));
                    break;
                  end;
                  Wait(1000+Random(500));
              end;
            //debugatpabounds(atpa);
        end;
      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.2, 0.2);
    end;

    procedure FindDivObj;
    //*Finds Divination NPC's and harvests from them
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;
      P: Tpoint;

    begin
      Writeln('FindDivObj;');
      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.29, 0.29);

      FindColorsSpiralTolerance(x,y,TPA,15899741, mainscreen.getBounds(),10);
      ATPA := TPAToATPAEx(TPA, 25, 25);

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      If Length(ATPA) = 0 Then
        begin
          Wait(1500+Random(500));
          WriteLn('FindPale = False');
          Inc(Pfail);
          Exit;
        end;
      For I := 0 To H Do
        begin
          //SortATPASize(ATPA,True);
          SortATPAFrom(ATPA, Point(301,175));
            WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
          MiddleTPAEx(ATPA[I], X, Y);
          Mouse(Point(P.x + random(5), P.y + random(8)), mouse_Move, MOUSE_HUMAN);
          fastClick(mouse_Right);
            if (isMouseOverText(['arvest'], 1000)) then
              begin
                WriteLn('We have found a Divination object!');
                Wait(5000+random(500));
                break;
              end;
          end;
        //debugatpabounds(atpa);
      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.2, 0.2);
    end;

    procedure Convert;
    //*Depending on which const you used, this will convert your memories/energy in the UI popup
    begin
    Writeln('Convert;');
      //Walk;
      Wait(1500+Random(500));
      FindRift;
      Wait(3000+Random(700));
        if (GetColor(343,142) = 986895) then
          begin
            case (Which) of

              'Energy':
                begin
                  mouseBox(inttobox(175,199,182,205), MOUSE_LEFT);
                    Wait(1000);
                      While (ConvDialogue) do Wait(1000+Random(500));
                        If (tabBackpack.isEmpty) then exit;
                end;

              'Experience':
                begin
                  mouseBox(inttobox(296,201,301,205), MOUSE_LEFT);
                    Wait(1000);
                      While (ConvDialogue) do Wait(1000+Random(500));
                        if (tabBackpack.isEmpty) then exit;
                end;

              'Combo':
                begin
                  mouseBox(inttobox(389,212,395,215), MOUSE_LEFT);
                    Wait(1000);
                      While (ConvDialogue) do Wait(1000+Random(500));
                        if (tabBackpack.isEmpty) then Exit;
                end;

            end;
          end;
    end;

    procedure MainLoop;
    //*Contains the procedures and functions written for this script
    var
      MainScreenBounds : TBox;

    begin
      MainScreenBounds := mainScreen.GetBounds();
        repeat
          FindDivObj;
          Convert;
        until(False);

    end;

    begin
      setupSRL();
      MainLoop;
    end.
    Last edited by Daniel; 08-23-2013 at 11:56 AM. Reason: Tagged thread.
    You have permission to steal anything I've ever made...

  2. #2
    Join Date
    Jan 2013
    Posts
    78
    Mentioned
    3 Post(s)
    Quoted
    44 Post(s)

    Default

    How can you run it without SMART? After I got banned by just using the client on PB I'm paranoid about using 3rd party clients. >.<

    I put the "//" in front of the smart code but I can never seem to figure it out.

  3. #3
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    I wouldn't run this script, but I am actually running it with smart.
    You would have to do some editing to your include to get everything working.
    You have permission to steal anything I've ever made...

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

    Default

    Quote Originally Posted by jamesaz1994 View Post
    How can you run it without SMART? After I got banned by just using the client on PB I'm paranoid about using 3rd party clients. >.<

    I put the "//" in front of the smart code but I can never seem to figure it out.
    Yeh put // before {$Define SMART} and also before {$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}

    Then drag the green crosshair from simba onto the game so it's all covered red.

    Creds to DannyRS for this wonderful sig!

  5. #5
    Join Date
    Jan 2013
    Posts
    78
    Mentioned
    3 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Wu-Tang Clan View Post
    I wouldn't run this script, but I am actually running it with smart.
    You would have to do some editing to your include to get everything working.
    Do you know how to do that or redirect me somewhere on how I can figure out how to do that?

  6. #6
    Join Date
    Jan 2013
    Posts
    78
    Mentioned
    3 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    Yeh put // before {$Define SMART} and also before {$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}

    Then drag the green crosshair from simba onto the game so it's all covered red.
    I never did it before the "{$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}" so ima see if that works.

    Thanks!

    EDIT: It works! Sweet! :-D

  7. #7
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    So how is this Working! Iv been Running PB Script None Stop and im already 51! I want to be one of the first to get 99 so Xp is not Wasted in Divination!

    As SRL 6 is Not Up PB and Java Here i Come!

  8. #8
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    ChatBoxUp always returns true.
    Theres a KeyDown, but no KeyUp.

    Simba Code:
    if (IsDiv) then
      repeat
        Wait(1000);
      until not (IsDiv);
    -- possible infinite loop, could be shortened to
    Simba Code:
    while IsDiv do Wait(1000);
    -- although, it should be a shorter wait (so it stops divining faster) as well as have some random in there.
    Simba Code:
    while IsDiv do
    Wait(50 + Random(50));
    And it should probably have a timeout too or something.

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

    Default

    Quote Originally Posted by Turpinator View Post
    ChatBoxUp always returns true.
    Theres a KeyDown, but no KeyUp.

    Simba Code:
    if (IsDiv) then
      repeat
        Wait(1000);
      until not (IsDiv);
    -- possible infinite loop, could be shortened to
    Simba Code:
    while IsDiv Wait(1000);
    -- although, it should be a shorter wait (so it stops divining faster) as well as have some random in there.
    Simba Code:
    while IsDiv
    Wait(50 + Random(50));
    And it should probably have a timeout too or something.
    while IsDiv do

    Creds to DannyRS for this wonderful sig!

  10. #10
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    while IsDiv do
    That makes more sense. i had the feeling i was missing something on the line, but counldnt place it.

  11. #11
    Join Date
    Jan 2013
    Posts
    78
    Mentioned
    3 Post(s)
    Quoted
    44 Post(s)

    Default

    Anyone know where to edit it so I can do higher tier springs?

  12. #12
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    Quote Originally Posted by jamesaz1994 View Post
    Anyone know where to edit it so I can do higher tier springs?
    Which one were you thinking? I can just get the colors for you quick
    You have permission to steal anything I've ever made...

  13. #13
    Join Date
    Feb 2006
    Location
    Australia, Queensland
    Posts
    120
    Mentioned
    1 Post(s)
    Quoted
    21 Post(s)

    Default

    Is there some sort of specific interface setup you have to use? I cant get this working

  14. #14
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    Quote Originally Posted by Squigglyo View Post
    Is there some sort of specific interface setup you have to use? I cant get this working
    I use Old School interface setup. If you are unsure of how to set that up press Escape and there will be a drop down menu with presets.
    You have permission to steal anything I've ever made...

  15. #15
    Join Date
    Apr 2012
    Location
    Seattle
    Posts
    791
    Mentioned
    1 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by Wu-Tang Clan View Post
    I use Old School interface setup. If you are unsure of how to set that up press Escape and there will be a drop down menu with presets.
    Which springs/wisps does it support so far?

  16. #16
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    Quote Originally Posted by Rincewind View Post
    Which springs/wisps does it support so far?
    Well I JUST got 10 div using the rather crappy xp divination provides. So I'm working on flickering ones now.
    You have permission to steal anything I've ever made...

  17. #17
    Join Date
    Jan 2013
    Posts
    78
    Mentioned
    3 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Wu-Tang Clan View Post
    Which one were you thinking? I can just get the colors for you quick
    Well I'm almost level 70 so lustrous would be nice. ;-P

  18. #18
    Join Date
    Jun 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Could you add glowing and sparkling?

  19. #19
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by Wu-Tang Clan View Post
    Everyone says they just "whipped this up and tossing it here"
    No.. I didn't just whip this up. I put some effort in and tested a while before having to go to work.
    I just thought maybe somebody would like to try this out and fix it up, at the moment it has quite a few kinks, but it occasionally does what its supposed to. So here it is. Don't be shy. Just make sure you have SMART up and logged in.

    Simba Code:
    program new;
      {$Define SMART}
      {$I SRL/SRL.Simba}
      {$i srl/srl/misc/debug.simba}
      {$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}
      {$i sps/sps.simba}

    // JDDivination, by Wu-Tang Clan

    const
      Which = 'Energy';
        // Energy - Convert memories into divine energy
        // Experience - Convert memories into divination experience
        // Combo - !NOT RECOMMENDED! Combine both energy and memories to get more experience
          // When using combo, it is recommended that you use the Energy setting for a while beforehand

    function ChatBoxUp: Boolean; // Not in use ATM.. not working correctly
    // Inv Full message via chatbox
    begin
    WriteLn('Hoping for 15723220, we got: ' + IntToStr (getcolor(447,549)));
      if (getcolor(447,549) = 12565949) then
        begin
          KeyDown(32);
            Wait(500+Random(100));
              Result := True;
        end;
    end;

    function IsDiv: Boolean;
    // The divination skill popup is up (collected in last 5 seconds)
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('IsDiv;');
      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.45, 0.97);

      FindColorsSpiralTolerance(399,25,TPA,2892290, 386,11, 411,39,10); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 30, 30); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      if Length(ATPA) = 0 then
        begin
          Writeln('IsDiv = False');
          Exit;
        end;
      if Length(ATPA) < 3 then
        begin
          WriteLn('IsDiv = True');
          Result := True;
        end;
    end;

    function CheckInv: Boolean;
    // Mouses on last inventory slot to see if there is a memory
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('CheckInv;');
      while (IsDiv) do Wait(1000+Random(500));
      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.45, 0.97);

      FindColorsSpiralTolerance(754,535,TPA,2892290, 738,526, 770, 550,10); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      If Length(ATPA) = 0 Then
        begin
          Writeln('CheckInv = False');
          Exit;
        end;
      For I := 0 To H Do
        begin
          SortATPASize(ATPA,True);
          //SortATPAFrom(ATPA, Point(301,175));
            WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
          MiddleTPAEx(ATPA[I], X, Y);
          MMouse(x,y,4,2);
          Clickmouse2(mouse_right);
            if OptionsExist(['estroy'], Nothing) then
              begin
                WriteLn('We have found Memory in last InvSlot!');
                Wait(1000+random(500));
                Result := True;
              end;
          end;
        //debugatpabounds(atpa);
    end;

    procedure Walk;
    // Walks to Rift via SPS !YOU MAY NOT HAVE SPS PROPERLY SET UP!
    var
      myPath:TPointArray;

    begin
      writeLn('Walking to Rift');
      SPS_Setup(RUNESCAPE_SURFACE, ['10_9']);
      myPath := [Point(4267, 3746)];
      SPS_WalkPath(myPath);
    end;

    procedure FindPale;
    // Finds pale wisps and harvests them
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('FindPale;');
      while (IsDiv) do Wait(1000+Random(500));

      if (CheckInv = True) then
        begin
          Exit;
        end;

      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.29, 0.29);

      FindColorsSpiralTolerance(301,175,TPA,15899741, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      If Length(ATPA) = 0 Then
        begin
          Exit;
        end;
      For I := 0 To H Do
        begin
          //SortATPASize(ATPA,True);
          SortATPAFrom(ATPA, Point(301,175));
            WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
          MiddleTPAEx(ATPA[I], X, Y);
          MMouse(x,y,4,2);
          Clickmouse2(mouse_right);
            if WaitOption('arvest ',500) then
              begin
                WriteLn('We have found Pale thing!');
                Wait(5000+random(500));
                break;
              end;
          end;
        //debugatpabounds(atpa);
    end;

    procedure FindRift;
    // Once inventory is full, will find Rift
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('FindRift;');
      if (CheckInv = True) then
        begin
          theCTS := GetToleranceSpeed;

          SetColorToleranceSpeed(2);
          SetToleranceSpeed2Modifiers(0.21, 0.47);

          FindColorsSpiralTolerance(301,175,TPA,4520078, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
          ATPA := TPAToATPAEx(TPA, 25, 25); // Splits TPA into ATPA 40x40 boxes

          SetColorToleranceSpeed(theCTS);
          SetToleranceSpeed2Modifiers(0.02, 0.02);

          H := High(ATPA);
          If Length(ATPA) = 0 Then
            begin
              Exit;
            end;
          For I := 0 To H Do
            begin
              SortATPASize(ATPA,True);
              //SortATPAFrom(ATPA, Point(301,175));
                WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
              MiddleTPAEx(ATPA[I], X, Y);
              MMouse(x,y,4,2);
              Clickmouse2(mouse_left);
                {if waitOption('onvert',800) then
                  begin
                    WriteLn('We have found Rift!');
                    Wait(1000+random(500));
                    break;
                  end;}

              end;
            //debugatpabounds(atpa);
        end;
    end;

    procedure Convert;
    // Depending on which const you used, you will convert your memories/energy in the UI
    begin
    Writeln('Convert;');
      Walk;
      FindRift;
      Wait(1000+Random(700));
        if (GetColor(343,142) = 986895) then
          begin
            case (Which) of

              'Energy':
                begin
                  Mouse(175,199,7,7,Mouse_Left);
                    Wait(1000);
                      if (IsDiv) then
                        repeat
                          Wait(1000);
                        until not (IsDiv);
                end;

              'Experience':
                begin
                  Mouse(296,201,5,5,Mouse_Left);
                    Wait(1000);
                      if (IsDiv) then
                        repeat
                          Wait(1000);
                        until not (IsDiv);
                end;

              'Combo':
                begin
                  Mouse(389,212,7,6,Mouse_Left);
                    Wait(1000);
                      if (IsDiv) then
                        repeat
                          Wait(1000);
                        until not (IsDiv);
                end;

            end;
          end;
    end;

    begin
      SetupSRL;
      repeat
        FindPale;
          Wait(2000);
        Convert;
          Wait(1000+Random(500));
      until (False);
    end.

    Enjoy. I'll be back later and see what I can do.

    EDIT: So I posted what I've done a little bit on. At the moment its pretty debug box intensive..
    I changed most of the getcolor functions to TPA, but even they tend to be inaccurate. I've changed them multiple times and they usually return false which I'm probably doing wrong. It usually just finds a pale wisp, clicks on it, then returns false for isDiv. After that it walks to the rift, and then clicks on more wisps. It no longer clicks on the rift like its supposed to.

    EDIT2: Reached 10 Div... so I changed some stuff and optimized it for flickering. Not much to change though. It works fairly good.
    Simba Code:
    program new;
      {$Define SMART}
      {$I SRL/SRL.Simba}
      {$i srl/srl/misc/debug.simba}
      {$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}
      {$i sps/sps.simba}

    // JDDivination, by Wu-Tang Clan

    const
      Which = 'Energy';
        // Energy - Convert memories into divine energy
        // Experience - Convert memories into divination experience
        // Combo - !NOT RECOMMENDED! Combine both energy and memories to get more experience
          // When using combo, it is recommended that you use the Energy setting for a while beforehand

    var
      Dfail,Pfail,Rfail: Integer;

    function CheckInv: Boolean;
    // Mouses on last inventory slot to see if there is a memory
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.45, 0.97);

      FindColorsSpiralTolerance(754,535,TPA,2892290, 738,526, 770, 550,10); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      If Length(ATPA) = 0 Then
        begin
          Wait(1500+Random(500));
          WriteLn('CheckInv = False');
          Exit;
        end;
      For I := 0 To H Do
        begin
          SortATPASize(ATPA,True);
          //SortATPAFrom(ATPA, Point(301,175));
            WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
          MiddleTPAEx(ATPA[I], X, Y);
          MMouse(x,y,4,2);
          Clickmouse2(mouse_right);
            if OptionsExist(['estroy'], Nothing) then
              begin
                WriteLn('We have found Memory in last InvSlot!');
                Wait(1000+random(500));
                MMouse(111,222,50,60);
                Result := True;
              end;
          end;
        //debugatpabounds(atpa);
    end;

    function IsDiv: Boolean;
    // The divination skill popup is up (collected in last 5 seconds)
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.25, 0.25);

      FindColorsSpiralTolerance(399,25,TPA,1776411, 386,11, 411,39,5); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 21, 21); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      if Length(ATPA) = 0 then
        begin
          Wait(1500+Random(500));
          Writeln('IsDiv = False');
          Inc(Dfail);
          Exit;
        end;
      if Length(ATPA) < 3 then
        begin
          WriteLn('IsDiv = True');
          Result := True;
        end;
    end;

    procedure Walk;
    // Walks to Rift via SPS !YOU MAY NOT HAVE SPS PROPERLY SET UP!
    var
      myPath:TPointArray;

    begin
      writeLn('Walking to Rift');
      SPS_Setup(RUNESCAPE_SURFACE, ['9_7']);
      myPath := [Point(3816, 2986)];
      SPS_WalkPath(myPath);
    end;

    procedure FindPale;
    // Finds pale wisps and harvests them
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('FindPale;');
      while (IsDiv = True) do Wait(1000);

      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.29, 0.29);

      FindColorsSpiralTolerance(301,175,TPA,15899741, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      If Length(ATPA) = 0 Then
        begin
          Wait(1500+Random(500));
          WriteLn('FindPale = False');
          Inc(Pfail);
          Exit;
        end;
      For I := 0 To H Do
        begin
          //SortATPASize(ATPA,True);
          SortATPAFrom(ATPA, Point(301,175));
            WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
          MiddleTPAEx(ATPA[I], X, Y);
          MMouse(x,y,4,2);
          Clickmouse2(mouse_right);
            if WaitOption('arvest ',500) then
              begin
                WriteLn('We have found Pale thing!');
                Wait(5000+random(500));
                break;
              end;
          end;
        //debugatpabounds(atpa);
    end;

    procedure FindRift;
    // Once inventory is full, will find Rift
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('FindRift;');
      if (CheckInv = True) then
        begin
          theCTS := GetToleranceSpeed;

          SetColorToleranceSpeed(2);
          SetToleranceSpeed2Modifiers(0.21, 0.47);

          FindColorsSpiralTolerance(301,175,TPA,4520078, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
          ATPA := TPAToATPAEx(TPA, 25, 25); // Splits TPA into ATPA 40x40 boxes

          SetColorToleranceSpeed(theCTS);
          SetToleranceSpeed2Modifiers(0.02, 0.02);

          H := High(ATPA);
          If Length(ATPA) = 0 Then
            begin
              writeln('No points found for FindRift;');
              Inc(Rfail);
              Exit;
            end;
          For I := 0 To H Do
            begin
              SortATPASize(ATPA,True);
              //SortATPAFrom(ATPA, Point(301,175));
                WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
              MiddleTPAEx(ATPA[I], X, Y);
              MMouse(x,y,4,2);
              Clickmouse2(mouse_left);
                if waitOption('onvert',800) then
                  begin
                    WriteLn('We have found Rift!');
                    Wait(1000+random(500));
                    break;
                  end;
                  Wait(1000+Random(500));
              end;
            //debugatpabounds(atpa);
        end;
    end;

    procedure Convert;
    // Depending on which const you used, you will convert your memories/energy in the UI
    begin
    if (CheckInv = True) then
    Writeln('Convert;');
      Walk;
      Wait(1500+Random(500));
      FindRift;
      Wait(3000+Random(700));
        if (GetColor(343,142) = 986895) then
          begin
            case (Which) of

              'Energy':
                begin
                  Mouse(175,199,7,7,Mouse_Left);
                    Wait(1000);
                      if (IsDiv) then
                        repeat
                          Wait(1000);
                        until not (IsDiv);
                end;

              'Experience':
                begin
                  Mouse(296,201,5,5,Mouse_Left);
                    Wait(1000);
                      if (IsDiv) then
                        repeat
                          Wait(1000);
                        until not (IsDiv);
                end;

              'Combo':
                begin
                  Mouse(389,212,7,6,Mouse_Left);
                    Wait(1000);
                      if (IsDiv) then
                        repeat
                          Wait(1000);
                        until not (IsDiv);
                end;

            end;
          end;
    end;

    procedure FailSafe;
    begin
      if (Pfail < 5) then
        begin
          WriteLn('Pfail < 5');
          Walk;
        end;

      if (Rfail < 5) then
        begin
          WriteLn('Rfail < 5');
          Walk;
        end;

      if (Dfail < 5) then
        begin
          WriteLn('Dfail < 5');
          Walk;
        end;
    end;

    begin
      SetupSRL;
      repeat
        FindPale;
          Wait(2000);
        Convert;
          Wait(1000+Random(500));
        Failsafe;
      until (False);
    end.

    I think its not working too bad aside from the fact that it will occasionally deposit memories before a full inv.

    EDIT3: Fixed the inventory error I think. Working well at the moment. If you want to use the tier 1 wisps and are unsure of how to get the script I just recently posted, please pm me and I will help you.
    Happy divining guys.
    @Justin do you have rights to add a divination section? You're the first person to come to mind.
    EDIT4: This could also just get moved to development or wherever you see fit. Just make sure its in the public.
    Only Administrators can add sections, I'll pass the suggestion on to the higher ranks.

    Forum account issues? Please send me a PM

  20. #20
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    Quote Originally Posted by angelaelikutty View Post
    Could you add glowing and sparkling?
    I'm nearly 20. I'll update the OP for those who want to do pale with an up to date script. And then I'll add the next tier.
    You have permission to steal anything I've ever made...

  21. #21
    Join Date
    Jan 2013
    Posts
    294
    Mentioned
    1 Post(s)
    Quoted
    121 Post(s)

    Default

    nice script. waiting for higher level release

  22. #22
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    Quote Originally Posted by dzpliu View Post
    nice script. waiting for higher level release
    What do you want and where is that node located?
    I'll go and get them for you right now.
    You have permission to steal anything I've ever made...

  23. #23
    Join Date
    Jan 2013
    Posts
    294
    Mentioned
    1 Post(s)
    Quoted
    121 Post(s)

    Default

    Quote Originally Posted by Wu-Tang Clan View Post
    What do you want and where is that node located?
    I'll go and get them for you right now.
    how did u make SPS work for you? did you edit any settings? like globals/players etc.
    i'm at karamja area. (north east of nature altar)

  24. #24
    Join Date
    Mar 2013
    Location
    Shaolin
    Posts
    863
    Mentioned
    24 Post(s)
    Quoted
    519 Post(s)

    Default

    Quote Originally Posted by dzpliu View Post
    how did u make SPS work for you? did you edit any settings? like globals/players etc.
    i'm at karamja area. (north east of nature altar)
    If you install my globals and have the old school interface SPS should work for you. And 1 sec I'll go and get that for you sir.program new;
    Simba Code:
    {$Define SMART}
      {$I SRL/SRL.Simba}
      {$i srl/srl/misc/debug.simba}
      {$I SRL/SRL/MISC/SMARTGRAPHICS.SIMBA}
      {$i sps/sps.simba}

    // JDDivination, by Wu-Tang Clan

    const
      Which = 'Experience';
        // Energy - Convert memories into divine energy
        // Experience - Convert memories into divination experience
        // Combo - !NOT RECOMMENDED! Combine both energy and memories to get more experience
          // When using combo, it is recommended that you use the Energy setting for a while beforehand

    var
      Dfail,Pfail,Rfail: Integer;

    function IsInvIncrease: Boolean;
    var
      InvPls:Integer;
    begin
      InvPls := 0;
      InvCount;
      InvPls := InvCount;
        Wait(1200+Random(300));
          if (InvCount < InvPls) then
            begin
              Wait(1000);
              Writeln('IsInvIncrease = True');
              Result := True;
            end;
          if (InvCount = InvPls) then
            begin
              Wait(1000+Random(500));
              Writeln('IsInvIncrease = False');
              Result := False;
              Exit;
            end;
    end;

    function IsConverting: Boolean;
    var
      InvPls: Integer;
    begin
      InvPls := 0;
      InvCount;
      InvPls := InvCount;
        Wait(1200+Random(300));
          if (InvCount > InvPls) then
            begin
              Wait(1000+Random(500));
              Writeln('IsConverting = True');
              Result := True;
            end;
          if (InvCount = InvPls) then
            begin
              Wait(1000+Random(500));
              Writeln('IsConverting = False');
              Result := False;
              Exit;
            end;
    end;

    function IsDiv: Boolean;
    // The divination skill popup is up (collected in last 5 seconds)
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
      if (IsInvIncrease = True) then Exit;
      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.25, 0.25);

      FindColorsSpiralTolerance(399,25,TPA,1776411, 386,11, 411,39,5); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 21, 21); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      if Length(ATPA) = 0 then
        begin
          Wait(1500+Random(500));
          Writeln('IsDiv = False');
          Inc(Dfail);
          Exit;
        end;
      if Length(ATPA) < 3 then
        begin
          WriteLn('IsDiv = True');
          Result := True;
        end;
    end;

    procedure Walk;
    // Walks to Rift via SPS !YOU MAY NOT HAVE SPS PROPERLY SET UP!
    var
      myPath:TPointArray;

    begin
      writeLn('Walking to Rift');
      SPS_Setup(RUNESCAPE_SURFACE, ['8_10']);
      myPath := [Point(3339, 4388)];
      SPS_WalkPath(myPath);
    end;

    procedure FindPale;
    // Finds pale wisps and harvests them
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('FindPale;');
      if (InvCount = 28) or (InvFull) or (IsInvIncrease = True) then
        begin
          Exit;
        end;
      while (IsDiv = True) do Wait(1000);

      theCTS := GetToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(0.29, 0.29);

      FindColorsSpiralTolerance(301,175,TPA,15899741, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
      ATPA := TPAToATPAEx(TPA, 15, 15); // Splits TPA into ATPA 40x40 boxes

      SetColorToleranceSpeed(theCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);

      H := High(ATPA);
      If Length(ATPA) = 0 Then
        begin
          Wait(1500+Random(500));
          WriteLn('FindPale = False');
          Inc(Pfail);
          Exit;
        end;
      For I := 0 To H Do
        begin
          //SortATPASize(ATPA,True);
          SortATPAFrom(ATPA, Point(301,175));
            WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
          MiddleTPAEx(ATPA[I], X, Y);
          MMouse(x,y,4,2);
          Clickmouse2(mouse_right);
            if WaitOption('arvest ',500) then
              begin
                WriteLn('We have found Pale thing!');
                Wait(5000+random(500));
                break;
              end;
          end;
        //debugatpabounds(atpa);
    end;

    procedure FindRift;
    // Once inventory is full, will find Rift
    var
      TPA: Array of TPoint;
      ATPA: T2DPointArray;
      Box: TBox;
      TheCTS, I, X, Y, H : Integer;

    begin
    Writeln('FindRift;');
      //if (CheckInv = True) then
        begin
          theCTS := GetToleranceSpeed;

          SetColorToleranceSpeed(2);
          SetToleranceSpeed2Modifiers(0.21, 0.47);

          FindColorsSpiralTolerance(301,175,TPA,4520078, MSX1, MSY1, MSX2, MSY2,10); // Starts at center coordinates of character in mainscreen and spirals out
          ATPA := TPAToATPAEx(TPA, 25, 25); // Splits TPA into ATPA 40x40 boxes

          SetColorToleranceSpeed(theCTS);
          SetToleranceSpeed2Modifiers(0.02, 0.02);

          H := High(ATPA);
          If Length(ATPA) = 0 Then
            begin
              writeln('No points found for FindRift;');
              Inc(Rfail);
              Exit;
            end;
          For I := 0 To H Do
            begin
              SortATPASize(ATPA,True);
              //SortATPAFrom(ATPA, Point(301,175));
                WriteLn('ATPA Length: ' + IntToStr (Length(ATPA)));
              MiddleTPAEx(ATPA[I], X, Y);
              MMouse(x,y,4,2);
              Clickmouse2(mouse_left);
                if waitOption('onvert',800) then
                  begin
                    WriteLn('We have found Rift!');
                    Wait(1000+random(500));
                    break;
                  end;
                  Wait(1000+Random(500));
              end;
            //debugatpabounds(atpa);
        end;
    end;

    procedure Convert;
    // Depending on which const you used, you will convert your memories/energy in the UI
    begin
    if (InvCount = 28) or (InvFull) then
    begin
    Writeln('Convert;');
      Walk;
      Wait(1500+Random(500));
      FindRift;
      Wait(3000+Random(700));
        if (GetColor(343,142) = 986895) then
          begin
            case (Which) of

              'Energy':
                begin
                  Mouse(175,199,7,7,Mouse_Left);
                    Wait(1000);
                      While (IsConverting) or (IsDiv) do Wait(1000+Random(500));
                end;

              'Experience':
                begin
                  Mouse(296,201,5,5,Mouse_Left);
                    Wait(1000);
                      While (IsConverting) or (IsDiv) do Wait(1000+Random(500));
                end;

              'Combo':
                begin
                  Mouse(389,212,7,6,Mouse_Left);
                    Wait(1000);
                      While (IsConverting) or (IsDiv) do Wait(1000+Random(500));
                end;

            end;
          end;
    end;
    end;

    begin
      SetupSRL;
      repeat
        FindPale;
          Wait(2000);
        Convert;
          Wait(1000+Random(500));
      until (False);
    end.

    Should work...
    You have permission to steal anything I've ever made...

  25. #25
    Join Date
    Jan 2013
    Posts
    294
    Mentioned
    1 Post(s)
    Quoted
    121 Post(s)

    Default

    wow thanks man!

Page 1 of 6 123 ... 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
  •