Results 1 to 4 of 4

Thread: [Incomplete] Draynor Willow Whacker

  1. #1
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,321
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [Incomplete] Draynor Willow Whacker



    This is MY (100%) Draynor Willow Whacker.
    This script Chops, Banks, Drops, and Lights Willow Logs from Draynor Village.
    As you can see, it is in the Scripting Help sections of the SRL forums... meaning I have a problem that needs fixing.
    When I run the script, it compiles and opens SMART and everything, but it WON'T cut trees down... thus I cannot test the other functions like banking and lighting and dropping. If you could help me with this massive problem I will be THAT much closer to applying for SRL members
    PS. If a member wants to give me some pointers outside the fix to my problem that is welcome as well

    342 Lines
    Almost 10000 Chars
    Anybody can understand it. Just read through it!

    Simba Code:
    program JOEbotsWillowWhacker;
    {$DEFINE SMART}
    {$i SRL/srl.simba}
    {$i sps/sps.simba}
    {$i ObjectDTM\ObjDTMInclude.simba}

        //
       // This script is 100% JOEbot, This is my first time using ObjDTM and TPAs
      // Feel free to take anything from this script- Giving credit where needed!
     // What this script does is Chops Willows and Banks them in Draynor Village (Optional Firemaking)(Optional Dropping)
    //

    {================================ ! FILL THIS OUT ! ==========================================}
    {=============================================================================================}
    const
      Option = 1; // Option 1 is Banking. Option 2 is Firemaking (Lighting Logs). Option 3 is Dropping (Powerchopping)
    {=============================================================================================}
    {=============================================================================================}
    procedure DeclarePlayers;  // Login information. You want to play, dont you? Fancy Shmancy
    begin
      HowManyPlayers := 2; // You can add more if you want, Just copy and paste a Player Section and write a different number in the [0], [1], [2] box
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0; // Starts at Players[0]


      with Players[0] do
        begin
          Name        := '';     // Enter your username in the blue things
          Pass        := '';    // Enter your password in the blue things
          Nick        := '';   // use four characters from your username
          Pin         := '';  //Enter bank PIN here, leave empty if you don't have one
          Active      := True;
          BoxRewards := ['Xp', 'ostume', 'aphire'];
        end;

      with Players[1] do
        begin
          Name        := '';     // Enter your username in the blue things
          Pass        := '';    // Enter your password in the blue things
          Nick        := '';   // use four characters from your username
          Pin         := '';  //Enter bank PIN here, leave empty if you don't have one
          Active      := True;
          BoxRewards := ['Xp', 'ostume', 'aphire'];
        end;
    end;


    procedure iNotBanned; // You won't get banned while this is around
    begin
      if(not(LoggedIn)) then Exit;
        case Random(250) of

          10:
            begin
              Hoverskill('Woodcutting', False); // Hovers over the Woodcutting Skill
              wait(1551+Random(2111));
            end;

          20:
            begin
              Hoverskill ('Mining', False); // Hovers over the Mining Skill
              wait(1661+Random(2221));
            end;

          30:
            begin
              Hoverskill ('Fishing', False); // Hovers over the Fishing Skill
              wait(1771+Random(2331));
            end;

          40: RandomRClick; // Randomly Right Clicks (Anywhere)


          50: PickUpMouse; // Simulates a human Picking Up a Mouse


        end;
    end;

    procedure AntiRandoms; // Senses and completes random events. Failure isn't my fault.
    begin
      FindNormalRandoms;
      LampSkill := 'woodcutting'; // Puts the Random Event Rewards towards Woodcutting Exprience
      LevelUp;
    end;

    function iDrop: Boolean; // This Drops your Logs. Also known as Powerchopping
    var
    I: Integer;

    begin
      if (not Loggedin) then exit;
        if (Option = 3) then // You chose Option 3 (Dropping/Powerchopping) in the Const Box at the Top Of The Script
          begin
            if (invFull) then
              for i:= 0 to 28 do
        begin
          DropPattern(Random(2) + 1);
          if InvCount = 0 then
            break;
        end;
          end;
    end;

    function iChop: Boolean;  // TPAs with DTM Failsafe! This Chops Willow Trees in Edgeville
    var
      TPAA: T2DPointArray;
      TPA: TPointArray;
      x, y, CTS, I, Retry: Integer;
      GetIt: Extended;
      Tree: Integer;

    begin
      if (not Loggedin) then exit;
        AntiRandoms;
        iNotBanned;
        CTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1581089, MSX1, MSY1, MSX2, MSY2, 9);
        ColorToleranceSpeed(CTS);
        TPAA := TPAToATPAEx(TPA, 13, 12);
        SortATPASize(TPAA, True);
        for I := 0 to High(TPAA) do

          if GetArraylength(TPAA[i]) > 3 then
          begin
            repeat
              inc(Retry);
              MiddleTPAEx(TPAA[i], X, Y);
              MMouse(X, Y, 3, 3);
                if (IsUpTextMultiCustom(['chop', 'illow'])) then // Finds the uptext of a Willow Tree
                begin
                  Result := True;
                  GetMousePos(X, Y);
                  Mouse(x, y, 3, 3,false);
                  Wait(100 + random(200));
                  ChooseOption('hop');
                  Wait(5000 + random(1000));
                  Break;
                end;
            until (Retry = 2);
            Break;
          end else // If the TPA fails to find a Tree, the DTM will be initiated as a Failsafe
            begin
              Tree := DTMFromString('mWAAAAHicY2FgYLgOxPeB+DYQXwZiW0YGhkAgTgPiNiBWVJCAYwERDgZOoBpkzIiGQQAAoUsGRg==');
                if FindDTMRotated(Tree, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, GetIt) then
                  repeat
                    WriteLn('Found a Willow Tree');
                    Mouse(x, y, 3, 3,false);
                    Wait(100 + random(200));
                    ChooseOption('hop');
                    Wait(5000 + random(1000));
                  until not (IsUpText('illow')or(InvFull))
            end;
    FreeDTM(Tree);
    end;

    function iInvIncrease: Boolean; // Makes sure your inventory is increasing
    var
      willow, Cur: Integer;
    begin
      willow := DTMFromString('mbQAAAHicY2VgYNjLxMBwDIi3AvFmID4ExMGMDAyRQBwDxAFA7AfEliYCDE4WAgxRgZZgDGIzA/WjY0YsGAwAqMoI1Q==');
      Cur := CountItems('dtm', willow, []); // Counts the Willow Logs in Inventory
      while (InvCount <= Cur) do     // Waits for the Amount of Willows to Increase
        Wait(30);
    end;

    function iIsChopping: Boolean; // Makes sure you are in fact Woodcutting
    begin
      repeat
        iChop; // You are Chopping Trees
        WaitFunc(@iInvIncrease, 500, 150000);
      until InvFull;
      Result := (InvCount = 28); // Should result in a Full Inventory
    end;

    procedure iBankWalk; // ObjDTM with SPS failsafe! Walks from the Trees to the Bank
    var
      cx, cy: Integer;
      myPath:TPointArray;
    begin
      if (not Loggedin) then exit;
        AntiRandoms;
        iNotBanned;
        if ObjDTM_Find ('87:118:4:1:7:84:73:1:7:96:71:1:7:111:73:10:7:115:109:5:67:62:134:65:135:129:81:156:27:107', cx, cy, True) then
        begin
          WriteLn('We will now walk to the Bank!');
          ObjDTM_Walk ('87:118:4:1:7:84:73:1:7:96:71:1:7:111:73:10:7:115:109:5:67:62:134:65:135:129:81:156:27:107', 2, 102, 8, True);
        end else // If ODTM failed for some reason, it initiates SPS
          begin
            WriteLn('ObjDTM walk failed- GoGoGadget SPS!');
            SetupSRL;
            SPS_Setup(RUNESCAPE_SURFACE, [ '10_9' ]);
            myPath := [Point(4181, 3724), Point(4179, 3697), Point(4179, 3669), Point(4194, 3664), Point(4206, 3681)];
            SPS_WalkPath(myPath);
          end;
    end;

    function iBank: Boolean; // Banks your Logs in the Edgeville Bank
    begin
    if (Option = 1) then // You chose Option 1 (Banking) in the Const Box at the Top Of The Script
      begin
        if (not Loggedin) then exit;
          AntiRandoms;
          iNotBanned;
          if not OpenBankFast('db') then // If it cannot find the Counter
            OpenBankNPC                  // Then if it cannot find the Banker(s)
          else
            iBank;                      // Then it uses my own function. TRIPLE FAILSAFE!

          if BankScreen then
            DepositAll;

          if PinScreen then
            InPin(Players[CurrentPlayer].Pin);

          Result := True;
      end;
    end;

    procedure iTreeWalk; // ObjDTM with SPS failsafe! Walks from the Bank to the Trees
    var
      cx, cy: Integer;
      myPath:TPointArray;

    begin
      if (not Loggedin) then exit;
        AntiRandoms;
        iNotBanned;
        if ObjDTM_Find('67:78:6:1:7:58:71:1:7:70:74:1:7:66:87:10:7:78:43:10:7:78:31:10:7:62:26:5:19:33:60:12:117:15:139:123:48:147', cx, cy, True) then
        begin
          WriteLn('We will now walk to the Trees!');
          ObjDTM_Walk('67:78:6:1:7:58:71:1:7:70:74:1:7:66:87:10:7:78:43:10:7:78:31:10:7:62:26:5:19:33:60:12:117:15:139:123:48:147', 2, 102, 8, True);
        end else // If ODTM failed for some reason, it initiates SPS
          begin
            WriteLn('ObjDTM walk failed- GoGoGadget SPS!');
            SPS_Setup(RUNESCAPE_SURFACE, [ '10_9' ]);
            myPath := [Point(4209, 3686), Point(4203, 3665), Point(4184, 3664), Point(4179, 3685), Point(4182, 3708), Point(4183, 3722)];
            SPS_WalkPath(myPath);
          end;
    end;

    function iLite: Boolean; // If you want to Light the Logs instead of Bank them, Choose this on Declare Players
    var
      cx, cy: Integer;
      TPAA: T2DPointArray;
      TPA: TPointArray;
      x, y, CTS, I, Retry: Integer;
      myPath:TPointArray;

    begin // Yeah, some ObjDTM... No big deal or anything. This walks to the Firemaking Spot to start Lighting the Logs
      if (option = 2) then
        begin
            if ObjDTM_Find('114:42:6:1:7:36:93:1:7:62:109:1:7:58:122:10:7:69:74:10:7:52:57:10:7:69:61:5:58:147:4:72:15:37:135:30:146:117', cx, cy, True)then
              begin
                WriteLn('We will now walk to the Firemaking Spot!!');
                ObjDTM_Walk('114:42:6:1:7:36:93:1:7:62:109:1:7:58:122:10:7:69:74:10:7:52:57:10:7:69:61:5:58:147:4:72:15:37:135:30:146:117', 2, 102, 8, True);
              end else // If ODTM failed for some reason, it initiates SPS
                begin
                  WriteLn('ObjDTM walk failed- GoGoGadget SPS!');
                  SPS_Setup(RUNESCAPE_SURFACE, [ '10_9' ]);
                  myPath := [Point(4182, 3726), Point(4176, 3705), Point(4178, 3689), Point(4180, 3672), Point(4196, 3665), Point(4215, 3664), Point(4230, 3659)];
                  SPS_WalkPath(myPath);
                end;
            begin
              AntiRandoms;
              iNotBanned;
              CTS := GetColorToleranceSpeed;
              ColorToleranceSpeed(2);
              FindColorsSpiralTolerance(MICX, MICY, TPA, 1062978, MIX1, MIY1, MIX2, MIY2, 9);
              ColorToleranceSpeed(CTS);
              TPAA := TPAToATPAEx(TPA, 3, 9);
              SortATPASize(TPAA, True);
              for I := 0 to High(TPAA) do

                if GetArraylength(TPAA[i]) > 3 then
                begin
                  repeat
                    MiddleTPAEx(TPAA[i], X, Y);
                    MMouse(X, Y, 3, 3);
                      begin
                        Result := True;
                        GetMousePos(X, Y);
                        Mouse(x, y, 3, 3,false);
                        Wait(100 + random(200));
                        ChooseOption('ight');
                        Wait(5000 + random(1000));
                        Break;
                      end;
                  until (invempty)
                  Break;
              end;
            end;
        end;
      end;
    procedure iInventory; // Checks to see if youve completed an inventory
    begin
      AntiRandoms;
      if(InvFull) then  // If your inventroy is full then you will start this Loop
      begin
        WriteLn('Logs *GASP* SO HEAVY!');
        iBankWalk; // Walks to the Edgeville Bank
        Wait(1000 + Random(1500));
        iBank; // Banks your Logs
        iTreeWalk; // Walks back to the Trees
      end;
    end;

    begin  // MainLoop.
      Smart_server := 11;
      Smart_Signed := TRUE;
      Smart_Members := FALSE;
      Smart_SuperDetail := FALSE;

      SetupSRL;
      ObjDTM_Setup;
      DeclarePlayers;
      LoginPlayer;
      Wait(2000);
      GameTab(tab_Inv);

      if (not(LoggedIn)) then
        if Players[CurrentPlayer].Active then
            LoginPlayer;

      repeat
        repeat
          iIsChopping;  // Tree Cutting
          iInvIncrease // Inventory Monitoring
          iInventory  // Loop when your Inventory is Full
          iBankWalk; // Bank Walking Path
          iBank;    // Banking Procedure
          iLite;   // Firemaking/Lighting Procedure
          iDrop;  // Dropping/Powercutting Procedure
          iTreeWalk; // Tree Walking Path
        until (not Loggedin) // Multiplayer Initiator
        NextPlayer(Players[CurrentPlayer].Active = False); // MultiPlayer!
      until AllPlayersInactive;
    end.

    // LOLgoose.

    Thank you!


  2. #2
    Join Date
    May 2008
    Location
    ;)
    Posts
    573
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    iNotBanned;
        CTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1581089, MSX1, MSY1, MSX2, MSY2, 9);
        ColorToleranceSpeed(CTS);

    You forgot to set your Sat and hue mods? You really need to provide more information with what it's doing, other than it doesn't work.

    Another thing: You have a debug box for a reason, and that reason is to debug your script. Use writelns and conditional statements:

    Simba Code:
    if not findcolor(poop) then
    writeln('Couldn't find the color!');

  3. #3
    Join Date
    Feb 2012
    Location
    SRL Jail
    Posts
    1,321
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nickrules View Post
    Simba Code:
    iNotBanned;
        CTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, 1581089, MSX1, MSY1, MSX2, MSY2, 9);
        ColorToleranceSpeed(CTS);

    You forgot to set your Sat and hue mods? You really need to provide more information with what it's doing, other than it doesn't work.

    Another thing: You have a debug box for a reason, and that reason is to debug your script. Use writelns and conditional statements:

    Simba Code:
    if not findcolor(poop) then
    writeln('Couldn't find the color!');
    Thank you VERY VERY much!
    Other than that how does it look?

  4. #4
    Join Date
    May 2008
    Location
    ;)
    Posts
    573
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JOEbot View Post
    Thank you VERY VERY much!
    Other than that how does it look?
    Good.

    Simba Code:
    GetMousePos(X, Y);
                  Mouse(x, y, 3, 3,false);

    can be replaced with
    Simba Code:
    clickmouse2(clicktype)

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
  •