Varrock East Clay Softner

Discussion in 'RuneScape Scripts' started by dude_richard, Feb 24, 2009.

Varrock East Clay Softner
  1. Unread #1 - Feb 24, 2009 at 8:05 AM
  2. dude_richard
    Joined:
    Nov 23, 2007
    Posts:
    34
    Referrals:
    0
    Sythe Gold:
    0

    dude_richard Member

    Varrock East Clay Softner

    Varrock East Clay Softner


    What it does:

    Softens all clay at varrock east bank and fountain, supports multiplayer so can run for long periods of time


    Features:

    -Anti ban
    -Anti randoms
    -Runs on SMART
    -DTM finding
    -TPA finding
    -Multiplayer
    -Forms
    -Sleeping (will sleep for a lot longer if running 8 hours+)
    Note: It doesn't have an autoresponder, due to the fact alot of the time when I had one it replied to questions not directed at me, and I found that when running it no-one really talks to you, so I found it better to not have it


    Credits to:


    explosious - tested, and though of better methods for things



    Instructions:

    Proggies

    Stopped due to it running out of clay


    Bugs

    -The DTM for the clay has a lot of the same properties as a normal log, so occassionly will withdraw them, avoid having them visible in your bank.


    What you can do for me:


    Sell your autoed clay at the mid/max price! The prices are falling rapidly due to people selling cheaply.


    Enjoy the script!

    Code:
    { Clay Softner by Richard
    
      What it does: softens clay in varrock east bank using the
                    nearby fountain.
      Latest Version: 1.07 (11/04/2009)
      Location to auto: Varrock east bank (start at either fountain or bank)
    
    
                                      Instructions
    
    1. Place your player with 14 buckets (empty or full) in your inventory
       and clay in your bank, make sure they are visible.
    2. Make sure your player is either at the fountain or the bank.
    3. Drag the crosshair onto your client (not needed if using SMART)
    4. Press play and fill out the form (the valid locations are either
       "bank" or "fountain", lowercase please).
    5. Enjoy the script!
    
    
    Notes:
    
    #1. Avoid having logs or oak logs in your bank as the DTM for them
        and clay are very similar
    
    
    Please post up any errors or bugs                                       }
    
    
    program ClaySoftner;
    {.include SRL/SRL/misc/SMART.scar}
    {.include SRL/SRL.scar}
    {.include SRL/SRL/misc/users.scar}
    
    
    Var
    PlainClay, SoftClay, EmptyBucket, FullBucket, AntiBanned,
    ClayMade, Loads, t, NotedClay, p: integer;
    frmDesign : TForm;
    GroupBox1 : TGroupBox;
    Label1, Label2, Label3, Label4 : TLabel;
    Edit1, Edit2, Edit3, Edit4 : TEdit;
    CheckBox1 : TCheckBox;
    Button1 : TButton;
    
    
    Procedure NextPlayerFix(Active: Boolean); forward;
    
    
    procedure StartClick(sender: TObject);
    begin
      frmDesign.ModalResult:= mrOk;
      MouseSpeed := (StrToInt(Edit2.text));
      SymbolAccuracy := 0.5;
    end;
    
    
    Procedure StartForm;
    Begin
      with frmDesign do
      begin
        frmDesign := CreateForm;
        frmDesign.Left := 309;
        frmDesign.Top := 129;
        frmDesign.Width := 220;
        frmDesign.Height := 330;
        frmDesign.Caption := 'ClaySoftner';
        frmDesign.Color := clTeal;
        frmDesign.Font.Color := clBlack;
        frmDesign.Font.Height := -11;
        frmDesign.Font.Name := 'MS Sans Serif';
        frmDesign.Font.Style := [];
        frmDesign.Visible := False;
        frmDesign.PixelsPerInch := 76;
      end;
      with GroupBox1 do
      begin
        GroupBox1 := TGroupBox.Create(frmDesign);
        GroupBox1.Parent := frmDesign;
        GroupBox1.Left := 16;
        GroupBox1.Top := 16;
        GroupBox1.Width := 177;
        GroupBox1.Height := 257;
        GroupBox1.Caption := 'Start Setup';
        GroupBox1.TabOrder := 0;
      end;
      with Label1 do
      begin
        Label1 := TLabel.Create(GroupBox1);
        Label1.Parent := GroupBox1;
        Label1.Left := 8;
        Label1.Top := 24;
        Label1.Width := 51;
        Label1.Height := 13;
        Label1.Caption := 'Lamp Skill:';
      end;
      with Label2 do
      begin
        Label2 := TLabel.Create(GroupBox1);
        Label2.Parent := GroupBox1;
        Label2.Left := 8;
        Label2.Top := 56;
        Label2.Width := 69;
        Label2.Height := 13;
        Label2.Caption := 'Mouse Speed:';
      end;
      with Label3 do
      begin
        Label3 := TLabel.Create(GroupBox1);
        Label3.Parent := GroupBox1;
        Label3.Left := 8;
        Label3.Top := 88;
        Label3.Width := 38;
        Label3.Height := 13;
        Label3.Caption := 'SRL ID:';
      end;
      with Label4 do
      begin
        Label4 := TLabel.Create(GroupBox1);
        Label4.Parent := GroupBox1;
        Label4.Left := 8;
        Label4.Top := 120;
        Label4.Width := 50;
        Label4.Height := 13;
        Label4.Caption := 'SRL Pass:';
      end;
      with Edit1 do
      begin
        Edit1 := TEdit.Create(GroupBox1);
        Edit1.Parent := GroupBox1;
        Edit1.Left := 88;
        Edit1.Top := 24;
        Edit1.Width := 73;
        Edit1.Height := 21;
        Edit1.TabOrder := 0;
        Edit1.Text := 'crafting';
      end;
      with Edit2 do
      begin
        Edit2 := TEdit.Create(GroupBox1);
        Edit2.Parent := GroupBox1;
        Edit2.Left := 88;
        Edit2.Top := 56;
        Edit2.Width := 73;
        Edit2.Height := 21;
        Edit2.TabOrder := 1;
        Edit2.Text := '15';
      end;
      with Button1 do
      begin
        Button1 := TButton.Create(GroupBox1);
        Button1.Parent := GroupBox1;
        Button1.Left := 32;
        Button1.Top := 208;
        Button1.Width := 105;
        Button1.Height := 33;
        Button1.Caption := 'Start the script';
        Button1.TabOrder := 3;
        Button1.OnClick := @StartClick;
      end;
      with Edit3 do
      begin
        Edit3 := TEdit.Create(GroupBox1);
        Edit3.Parent := GroupBox1;
        Edit3.Left := 88;
        Edit3.Top := 88;
        Edit3.Width := 73;
        Edit3.Height := 21;
        Edit3.TabOrder := 4;
      end;
      with Edit4 do
      begin
        Edit4 := TEdit.Create(GroupBox1);
        Edit4.Parent := GroupBox1;
        Edit4.Left := 88;
        Edit4.Top := 120;
        Edit4.Width := 73;
        Edit4.Height := 21;
        Edit4.TabOrder := 5;
      end;
      with CheckBox1 do
      begin
        CheckBox1 := TCheckBox.Create(GroupBox1);
        CheckBox1.Parent := GroupBox1;
        CheckBox1.Left := 8;
        CheckBox1.Top := 176;
        CheckBox1.Width := 161;
        CheckBox1.Height := 17;
        CheckBox1.Caption := 'Use Debug? (designed for me)';
        CheckBox1.TabOrder := 6;
      end;
    end;
    
    
    procedure SafeForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('StartForm', v);
    end;
    
    
    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;
    
    
    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;
    
    
    Procedure DRDebug(S: string);
    Begin
      If CheckBox1.Checked then
        WriteLN(S);
    end;
    
    
    Function FindColorToleranceInc(Color: Integer; var x, y: Integer; xs, ys, xe, ye: Integer; MaxTolerance: Integer): Boolean;
    Var
    tol : Integer;
    Begin
      tol := 0;
      If (MaxTolerance <= -1) then
        srl_Warn('FindColorToleranceInc', 'Tolerance cannot be below 0', warn_AllVersions);
      For tol := 0 to (MaxTolerance) do
      Begin
        If FindColorTolerance(x, y, Color, xs, ys, xe, ye, tol) then
        Begin
          Result := FindColorTolerance(x, y, Color, xs, ys, xe, ye, tol);
          WriteLN('FindColorToleranceInc: '+IntToStr(tol)+' was the final tolerance');
          Break;
        end;
        If (tol >= MaxTolerance) then
        Begin
          srl_Warn('FindColorToleranceInc', 'couldn'#39't find the color', warn_AllVersions);
          Exit;
        end;
      end;
    end;
    
    
    procedure LoginPlayerFix;//Temp
    var
      Mark, Attempts: Integer;
      Actions: TVariantArray;
      RetryLogin: Boolean;
    label
      ProcStart;
    begin
      ActivateClient;
      Wait(100);
      TypeByte(vk_Escape);
    
      if (GetColor(212, 327) = 238301) then    //At Click To Play screen
      begin
        Wait(1000 + Random(3000));
        MouseBox(227, 337, 555, 364, 1);
        MarkTime(Mark);
        while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
          Wait(1000 + Random(1000));
      end;
      if (not(RSReady)) then
      begin
        MarkTime(Mark);
        while (not(RSReady)) do
        begin
          Wait(100);
          if (TimeFromMark(Mark) > 180000) then
          begin
            WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
            TerminateScript;
          end;
        end;
        WriteLn('Welcome to Runescape.');
      end;
    
      LoginScreenMusic(True);
      if (not(GraphicsSet)) then
      begin
        SetAutoingDefaults;
        GraphicsSet := True;
      end;
      ProcStart:
    
      if (not(LoggedIn)) then
      begin
        if (not(Players[CurrentPlayer].Active)) then
        begin
          WriteLn('Player is not Active...');
          NextPlayerFix(False);
          Exit;
        end;
        Wait(900 + random(60));
    
        //Click 'Log In' on main menu
        while (GetColor(343, 175) <> 7750) do //while (GetColor(343, 174) <> 7750) do
        begin
          MouseBox(360, 180, 400, 185, 1);
          Wait(100 + Random(100));
        end;
    
        //Type Username
        Mouse(315, 272, 10, 5, True);
        while (CountColor(7750, 311, 269, 452, 284) > 13) do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        for Mark := 0 to 3 do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        Wait(100 + Random(200));
        WriteLn(Capitalize(Players[CurrentPlayer].Name));
        TypeSend(Players[CurrentPlayer].Name);
        Wait(100+random(50));
    
        //Type Password
        Mouse(315, 334, 10, 5, True);
        while (CountColor(7750, 311, 337, 452, 352) > 13) do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        for Mark := 0 to 3 do
        begin
          KeyDown(vk_Back);
          Wait(10 + Random(10));
          KeyUp(vk_Back);
          Wait(50 + Random(50));
        end;
        Wait(100 + Random(200));
        TypeSend(Players[CurrentPlayer].Pass);
        Wait(500 + Random(300));
    
        if (not(FindTextTPA(12509695, 0, 288, 205, 475, 247, 'login', StatChars, Nothing))) then   //If 'enter' from typesend didn't log us in
        begin
          MouseBox(355, 359, 403, 372, 1);  //Click 'login' login screen
          Wait(250 + random(100));
        end;
    
        MarkTime(Mark);
        repeat
          SetLength(Actions, 0);
    
          if (TimeFromMark(Mark) > 60000) then
            Actions := ['One minute has passed...', 0, 2, 'NextPlayerFix', 'Login Failed']
          else
          case (CountColor(12509695, 288, 205, 475, 247)) of   //Number of text colour points
            //   Actions := ['WriteLn Text', TimeToWait, NumberOfRetries, 'FinalAction', 'PlayerStatus'];
            760: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'NextPlayerFix', ''];
            536: Actions := ['Login limit exceeded. Please wait 1 minute and try again.', 60000, 2, 'NextPlayerFix', ''];
            711: Actions := ['Your account has been disabled', 0, 0, 'NextPlayerFix', 'Acc Disabled'];
            598: Actions := ['Invalid Username / Password', 0, 2, 'NextPlayerFix', 'Wrong User/Pass'];
            787: Actions := ['Not a Members Account', 0, 0, 'NextPlayerFix', 'Non-member'];
            408: Actions := ['World is full.', 5000, 20, 'Terminate', ''];
            623: Actions := ['Your account is already logged in', 5000, 0, 'RandomNextPlayerFix', ''];
            555: Actions := ['The Server is being updated.', 60000, 4, 'Terminate', 'Server Updating'];
            218: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
            335: Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000), 4, 'Terminate', 'Login Server Offline'];
            512: Actions := ['RuneScape has been updated. Script Terminated.', 0, 0, 'Terminate', 'RS Updated'];
            489: Actions := ['Connection timed out.', 0, 4, 'Terminate', 'Connection Timed Out'];
            737: Actions := ['You are standing in a members-only area.', 0, 0, 'NextPlayerFix', 'In Mems-Only Area'];
            //10: Actions := ['Error loading your profile.', 5000, 10, 'NextPlayerFix', 'Profile Loading Failed']; // Error loading your profile. Will attempt to re-login 5 more times.)
            //11: Actions := ['Login server rejected session.', 1000, 10, 'NextPlayerFix', 'Login Serv. Rejected'];  // Login server rejected session.
          end;
    
          if (Length(Actions) > 0) then
          begin
            WriteLn(Actions[0]);
            Wait(Actions[1] + Random(100));
            if (Actions[2] <> 0) then
              if (Attempts < Actions[2]) or (Actions[2] = -1) then
              begin
                RetryLogin := True;
                Break;
              end;
            if (Actions[4] <> '') then
              Players[CurrentPlayer].Loc := Actions[4];
            case Actions[3] of
              'NextPlayerFix': NextPlayerFix(False);
              'RandomNextPlayer': RandomNextPlayer(True);
              'Terminate': TerminateScript;
            end;
            Exit;
          end;
          Wait(100);
        until(GetColor(266, 69) = 1647915);//changed
    
        if (RetryLogin) then
        begin
          RetryLogin := False;
          Inc(Attempts);
          goto ProcStart;
        end;
    
        if (GetColor(266, 69) = 1647915) then//changed
        begin
          Wait(1000 + Random(2000));
          MouseBox(210, 410, 560, 450, 1);//changed
        end;
        MarkTime(Mark);
        while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
          Wait(1000 + Random(1000));
      end;
    
      if (LoggedIn) then
      begin
        PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
        if Length(Players[CurrentPlayer].NickTPA) < 2 then
        begin;
          Writeln('Creating the NickTPA.');
          if Players[CurrentPlayer].Nick <> '' then
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
          else
          begin;
            Writeln('Nickname isn''t set, taking the username instead..');
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
          end;
        end;
        AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
      end;
    end;
    
    function RRadialWalk(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
    var
      tpa: TPointArray;
      i: Integer;
    begin
      Result := False;
      if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
        for i := 0 to High(tpa) do
          if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
          begin
            Result := True;
            Break;
          end;
    end;
    
    
    procedure NextPlayerFix(Active: Boolean);
    begin
      if RandomPlayer then
        RandomNextPlayer(Active)
      else
      begin
        WriteLn('NextPlayerFix(Active: ' + BoolToStr(Active)+ ');');
        Players[CurrentPlayer].Active := Active;
        Logout;
        if (SRL_Procs[srl_OnNextPlayer] <> nil) then
          SRL_Procs[srl_OnNextPlayer]();
        PlayerCurTime := (GetSystemTime div 1000);
        Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
          ((PlayerCurTime - PlayerStartTime) / 60);
        CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
        while Players[CurrentPlayer].Active = False do
        begin
          CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
          if (AllPlayersInactive) then Wait(60000); // Everybody False. Endless Loop.
        end;
        SRL_Logs := SRL_Logs + 1;
        LoginPlayerFix;
      end;
    end;
    
    
    Procedure DeclarePlayers;
    Begin
      SRLPlayerForm(True, [], ['Loads'], ['PIN','Location'], []);
    end;
    
    
    Procedure DTMs;
    Begin
        PlainClay := DTMFromString('78DA639CCCC4C010CEC80002CC0C10B0736E1' +
           '6831C900689FE070246909A5054356B2625C1D58000584D10AA9A' +
           '594DE1A86A6662AA294A744455D30F541388AAA621D713450D000' +
           'E4E105A');
        SoftClay := DTMFromString('78DA63CC62626078C28006189148209D0C54F' +
              '38C809A6CA09AC704D4E401D5DC27A0A69C08738A806A9E125093' +
              '0354F306BF1A00189A095F');
        NotedClay := DTMFromString('78DA63EC646260706164000108C9C0F0FF3F0' +
           '3831C94FF1F08182702D5F8A0AAD9B1A216AE062C3E15A8260455' +
           'CDFAA929A86A6600D504A0AA01B150D4CC03AA89445573744B3B8' +
           'A1A001FCD10A7');
        EmptyBucket := DTMFromString('78DA63CC65626078C4800212BD2519E480342' +
           '310FF0702C612A09AF70C688011AE06CC4BC5AF068CCB806AEEE2' +
           '56C304A29381E403DC6A98811800B4F80C12');
        FullBucket := DTMFromString('78DA63CC65626078C480026A6A6633C801694' +
           '620FE0F048C254035EF19D000235C0D98978A5F0D189701D5DCC5' +
           'AD8609442703C907B8D53003310034920CE0');
    end;
    
    
    Procedure FreeDTMs;
    Begin
      FreeDTM(PlainClay);
      FreeDTM(EmptyBucket);
      FreeDTM(SoftClay);
      FreeDTM(FullBucket);
    end;
    
    
    Procedure Antiban;
    Var
    MouseSpeed1, Deg, x, y, GTab: Integer;
    Begin
      If not LoggedIn then
      Exit;
      Case random(55) of
       1: Begin
            KeyDown(VK_Down);
            Wait(random(1000));
            KeyUp(VK_Down);
            KeyDown(VK_Up);
            Wait(500 + random(1000));
            KeyUp(VK_Up);
            MakeCompass('n');
            GameTab(4);
            AntiBanned := AntiBanned + 1;
            ReportVars[2] := ReportVars[2] + 1;
          end;
       2: Begin
            KeyDown(VK_Left);
            Wait(random(1000));
            KeyUp(VK_Left);
            KeyDown(VK_Right);
            Wait(random(1000));
            KeyUp(VK_Right);
            MakeCompass('n');
            GameTab(4);
            AntiBanned := AntiBanned + 1;
            ReportVars[2] := ReportVars[2] + 1;
          end;
       3: Begin
            KeyDown(VK_Left);
            Wait(random(1000));
            KeyUp(VK_Left);
            KeyDown(VK_Right);
            Wait(random(1000));
            KeyUp(VK_Right);
            MakeCompass('n');
            GameTab(4);
            AntiBanned := AntiBanned + 1;
            ReportVars[2] := ReportVars[2] + 1;
          end;
       4: Begin
            KeyDown(VK_Up);
            KeyDown(VK_Left);
            Wait(random(1000));
            KeyUp(VK_Up);
            Wait(random(800));
            KeyUp(VK_Left);
            MakeCompass('n');
            GameTab(4);
            AntiBanned := AntiBanned + 1;
            ReportVars[2] := ReportVars[2] + 1;
          end;
       5: Begin
            PickupMouse;
            GetMousePos(x,y);
            DRDebug('Mouse moved to '+IntToStr(x)+', '+IntToStr(y)+'.');
            AntiBanned := AntiBanned + 1;
            ReportVars[2] := ReportVars[2] + 1;
         end;
       6: Begin
            BoredHuman;
            GetMousePos(x,y);
            DRDebug('Mouse moved to '+IntToStr(x)+', '+IntToStr(y)+'.');
            AntiBanned := AntiBanned + 1;
            ReportVars[2] := ReportVars[2] + 1;
          end;
       7..10: Begin
                   MMouse(116-Random(100), 285-Random(256),60,60);
                   PickupMouse;
                   GetMousePos(x,y);
                   DRDebug('Mouse moved to '+IntToStr(x)+', '+IntToStr(y)+'.');
                   AntiBanned := AntiBanned + 1;
                   ReportVars[2] := ReportVars[2] + 1;
                 end;
       11..14: Begin
                 PickupMouse;
                 GetMousePos(x,y);
                 DRDebug('Mouse moved to '+IntToStr(x)+', '+IntToStr(y)+'.');
                 AntiBanned := AntiBanned + 1;
                 ReportVars[2] := ReportVars[2] + 1;
               end;
       15..20: Begin
                 Deg := (1+random(359));
                 MakeCompass(IntToStr(Deg));
                 Wait(1500+random(5000));
                 DRDebug('Made compass '+IntToStr(Deg)+' degrees');
                 MakeCompass('n');
                 AntiBanned := AntiBanned + 1;
                 ReportVars[2] := ReportVars[2] + 1;
               end;
       21..26: Begin
                 GTab := 1 +random(12);
                 Gametab(GTab);
                 Wait(1500+random(4000));
                 GameTab(4);
                 DRDebug('Switched to gametab '+IntToStr(GTab)+'.');
                 AntiBanned := AntiBanned + 1;
                 ReportVars[2] := ReportVars[2] + 1;
               end;
       26..31: Begin
                 RandomRClick;
                 AntiBanned := AntiBanned + 1;
                 ReportVars[2] := ReportVars[2] + 1;
                 GetMousePos(x,y);
                 DRDebug('Randomly right clicked at '+IntToStr(x)+', '+IntToStr(y)+'.');
               end;
       32..40: Begin
                 MouseSpeed1 := (12+random(6));
                 MouseSpeed := (MouseSpeed1);
                 DRDebug('Mouse speed changed to '+IntToStr(MouseSpeed1)+'.');
                 AntiBanned := AntiBanned + 1;
                 ReportVars[2] := ReportVars[2] + 1;
               end;
        end;
    end;
    
    
    Procedure AntiRandoms;
    Begin
      If not LoggedIn then
        Exit;
      LampSkill:= Edit1.text;
      FindNormalRandoms;
      SRLRandomsReport;
      SendSRLReport;
    end;
    
    
    Procedure ROpenBank;
    Begin
      If not(LoggedIn) then Exit;
      If (Players[CurrentPlayer].Loc = 'fountain') then Exit;
      DTMs;
      GameTab(4);
      If (CountItems(EmptyBucket, 'DTM', [0]) + CountItems(PlainClay, 'DTM', [0]) + CountItems(FullBucket, 'DTM', [0]) = 28) then Exit;
      Begin
        SetAngle(False);
        If not(OpenBankFast('veb')) then
        Begin
          Players[CurrentPlayer].Active := False;
          Players[CurrentPlayer].Strings[2] := 'No bank';
          WriteLN(Players[CurrentPlayer].Strings[2]);
          Logout;
        end;
      end;
      If BankScreen then Fixbank;
      If Pinscreen then InPin(Players[CurrentPlayer].Strings[0]);
      Fixbank;
      FreeDTMs;
    end;
    
    
    function AmountScreen: Boolean;
    var
      x, y: integer;
    begin
      Result := FindText(x, y, 'moun', UpChars, MCX1, MCY1, MCX2, MCy2);
    end;
    
    
    Function RandomIntArray(Length:integer):TIntegerArray;
    Var
    i, r:integer;
    Begin
      SetArrayLength(Result,Length);
      For i := 0 to length - 1 do
        Result[i] := -1;
      For i := 0 to length - 1 do
      Begin
        r := Random(Length);
        If (not(InIntArray(Result,r))) then
        Begin
          Result[i] := r;
        end else
        Begin
          Repeat
            Inc(r);
            If r >= length then
              r := 0;
          Until(not(InIntArray(Result,r)));
          Result[i] := r;
        end;
      end;
    end;
    
    
    Procedure DepositAndWithdraw;
    Var
    i, x, y, w, ww: integer;
    z : TIntegerArray;
    ItemSlot : TBox;
    Begin
      w := 0;
      ww := 0;
      If Not(LoggedIn) then Exit;
      If Not(BankScreen) then Exit;
      If (Players[CurrentPlayer].Loc = 'fountain') then Exit;
      DTMs;
      w := (CountItems(EmptyBucket, 'DTM', [0]) + CountItems(FullBucket, 'DTM', [0]) + CountItems(NotedClay, 'DTM', [0]))
      z := RandomIntArray(28)
      If FindDTM(NotedClay, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
        Mouse(x, y, 5, 5, False);
        ChooseOption('ll');
      end;
      For i := 0 to 27 do
      if existsItem(z[i]+1) then
      begin
        ItemSlot:=InvBox(z[i]+1);
        If not(findDTM(EmptyBucket, x, y, ItemSlot.x1, ItemSlot.y1, ItemSlot.x2, ItemSlot.y2)) then
        If not(findDTM(FullBucket, x, y, ItemSlot.x1, ItemSlot.y1, ItemSlot.x2, ItemSlot.y2)) then
        If not(findDTM(PlainClay, x, y, ItemSlot.x1, ItemSlot.y1, ItemSlot.x2, ItemSlot.y2)) then
        Deposit(z[i]+1, z[i]+1, true);
      end;
      If (w < 14) then
      Begin
        ww := 14 - w;
        If FindDTM(FullBucket, x, y, MSX1, MSY1, MSX2, MSY2) then
        Begin
          Mouse(x, y, 5, 5, false);
          ChooseOption('X');
          Repeat
            Wait(100+random(100));
          Until (AmountScreen);
          TypeSend(IntToStr(ww));
          w := (CountItems(EmptyBucket, 'DTM', [0]) + CountItems(FullBucket, 'DTM', [0]));
        end;
        If (w < 14) then
        Begin
          ww := 14 - w;
          If FindDTM(EmptyBucket, x, y, MSX1, MSY1, MSX2, MSY2) then
          Mouse(x, y, 5, 5, false);
          ChooseOption('X');
          Repeat
            Wait(100+random(100));
          Until (AmountScreen);
          TypeSend(IntToStr(ww));
        end;
      end;
      Wait(500+random(300));
      If (FindDTM(PlainClay, x, y, 20,80,500,290)) then
      Begin
        Mouse(x, y, 5, 5, false);
        ChooseOption('ll');
        Wait(200+random(100));
      end else
      Begin
        CloseBank;
        Players[CurrentPlayer].Active := False;
        Players[CurrentPlayer].Strings[2] := 'No clay in bank';
        WriteLN(Players[CurrentPlayer].Strings[2]);
        Logout;
      end;
      CloseBank;
      Wait(200+random(100));
      DRDebug('Banked successfully');
      MakeCompass('n');
      FreeDTMs;
      Wait(1000+random(500));
    end;
    
    
    Procedure RunMyPlayer;
    Var
      colorsign: string;
      g: integer;
    Begin
      g := GetMMLevels('run', colorsign);
      If (g >= 25) then SetRun(True);
    end;
    
    
    {*******************************************************************************
    function IsMoving(WaitTime: Integer): Boolean;
    By: Bullzeye95; Edits by Nava2
    Description: Checks if the currently loaded player is moving. Uses Minimap,
                 ignoring all dots which can move without the player moving.
                 Nava2 edit: Added try..finally, also changed to work with SMART,
                 as well added WaitTime Parameter.
    *******************************************************************************}
    function IsMoving(WaitTime: Integer): Boolean;
    var
      BMP, BMP2, I, H, x, y: Integer;
      ReplaceCols: TIntegerArray;
      P: TPointArray;
      DC: HDC;
    begin
      WaitTime := Max(100, WaitTime);
      try
        DC := GetTargetDC;
        ReplaceCols:= [65536, 16711422, 12961221, 14869218, 16777215, 15527148, 195836, 56797, 60909, 52428,
                       13816530, 982782, 1310462, 62965, 2105598, 395004, 789758, 3553023, 217, 188, 241,
                       206, 233, 64768, 58880, 51456, 49152, 44800, 61440, 16215571, 9716750, 13129742];
        BMP:= BitmapFromString(100, 100, '');
        BMP2:= BitmapFromString(100, 100, '');
        SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP), MMCX - 50, MMCY - 50, MMCX + 50, MMCY + 50, 0, 0, 100, 100);
        H := High(ReplaceCols);
        for I:= 0 to H do
          FastReplaceColor(BMP, ReplaceCols[i], 0);
        wait(WaitTime);
        SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP2), MMCX - 50, MMCY - 50, MMCX + 50, MMCY + 50, 0, 0, 100, 100);
        SetTargetDC(GetBitmapDC(BMP2));
        for I:= 0 to H do
        begin
          FindColorsTolerance(P, ReplaceCols[i], 0, 0, 99, 99, 0);
          for x:= 0 to High(P) do
            FastSetPixel(BMP2, P[x].x, P[x].y, FastGetPixel(BMP, P[x].x, P[x].y));
        end;
        Result:= not FindBitmapIn(BMP, x, y, 0, 0, 100, 100);
      finally
        SetTargetDC(DC);
        FreeBitmap(BMP);
        FreeBitmap(BMP2);
      end;
    end;
    
    
    Procedure WaitWhileWalk; //Jagex can't make walking properly it would seem...
    Var
    walk: integer;
    Begin
      MarkTime(walk);
      Repeat
        Wait(300+random(200));
      Until (TimeFromMark(walk) >= 5000) or (not(FlagPresent)) or (not(IsMoving(500)));
    end;
    
    
    Procedure WalkToFountain;
    Var
      i, x, y : integer;
      a :TpointArray;
      aa :T2DpointArray;
      RoadBox : TBox;
    Begin
      If (Players[CurrentPlayer].Loc = 'fountain') then Exit;
      If not(LoggedIn) then Exit;
      MakeCompass('n');
      RunMyPlayer;
      AntiRandoms;
        Begin
          If not(RRadialWalk(FindVarrockRoadColor, 270, 350, 50, 0, 0)) then
            Begin
              Players[CurrentPlayer].Active := False;
              Players[CurrentPlayer].Strings[2] := 'Unable to walk';
              WriteLN(Players[CurrentPlayer].Strings[2]);
              Logout;
            end;
            WaitWhileWalk;
            AntiRandoms;
            Wait(1);
            Begin
              FindColorsTolerance(a, FindVarrockRoadColor, MMY1, MMY1, MMX2, MMY2, 0);
              aa := SplitTPA(a, 2);
              For i := 0 to High(aa) do
              Begin
                RoadBox := GetTPABounds(aa[i]);
                If (InRange(RoadBox.x2-RoadBox.x1,20,28))and(InRange(RoadBox.y2-RoadBox.y1,20,28)) then
                  If InRange(Length(aa[i]), 280, 530) then
                    If MiddleTPAEx(aa[i], x, y) then
                    Begin
                      Mouse(x, y, 5, 5, true);
                      WaitWhileWalk;
                      Players[CurrentPlayer].Loc := 'fountain';
                      Wait(500+random(500));
                    end else
                    Begin
                      If FindSymbol(x, y, 'water') then
                      Begin
                        Mouse(x, y, 3, 3,true);
                        WaitWhileWalk;
                      end else
                      Begin
                        Players[CurrentPlayer].Active := False;
                        Players[CurrentPlayer].Strings[2] := 'Unable to walk';
                      end
                    end;
              end;
            end;
        end;
        Players[CurrentPlayer].Loc := 'fountain';
    end;
    
    
    Procedure WalkToBank;
    Var
    x, y:integer;
    Begin
      If not(LoggedIn) then Exit;
      If (Players[CurrentPlayer].Loc = 'bank') then Exit;
      AntiRandoms;
      Wait(1);
        Begin
        If not(RRadialWalk(FindVarrockRoadColor, 110, 125, 50, 0, 0)) then
          Begin
            Players[CurrentPlayer].Active := False;
            Players[CurrentPlayer].Strings[2] := 'Unable to walk';
            WriteLN(Players[CurrentPlayer].Strings[2]);
            Logout;
          end;
          AntiRandoms;
          WaitWhileWalk;
          AntiRandoms;
          Begin
            If not(RadialWalk(FindLadderColor, 130, 165, 25, 1, 1)) then
            Begin
              SymbolAccuracy := 0.3;
              If FindSymbol(x, y, 'bank') then
              Begin
                Mouse(x, y, 5, 5, True);
                WaitWhileWalk;
              end else
              Begin
                DRDebug('Using coord clicking as there is no symbol');
                Mouse(640, 120, 5, 5, true);
                WaitWhileWalk;
              end;
                end else
            Begin
              WaitWhileWalk;
           end;
        end;
      end;
      Wait(1);
      Players[CurrentPlayer].Loc := 'bank';
      AntiRandoms;
    end;
    
    
    Function LocateFountain:Boolean;
    Var
      TPA: TPointArray;
      Temp: T2DPointArray;
      h, x, y, z, t, i, l : Integer;
    begin
      If not LoggedIn then
      Exit;
      If Players[CurrentPlayer].Loc = 'bank' then Exit;
      DTMs;
      If FindDTM(EmptyBucket, x, y, MIX1, MIY1, MIX2, MIY2) then
      Mouse(x, y, 5, 5, true);
      Begin
        l := 0;
        Repeat
          l := l + 1
          t := GetSystemTime;
          ColorToleranceSpeed(2);
          FindColorsSpiralTolerance(x, y, TPA, 14066312, MSX1, MSY1, MSX2, MSY2, 19);
          Temp := TPAtoATPAex(TPA, 40, 40);
          SortATPASize(Temp, True);
          h := High(Temp);
          For z := 0 to h do
          Begin
            MiddleTPAex(Temp[z], x, y);
            MMouse(x, y, 5, 5);
            i := 0;
            AntiRandoms;
            Repeat
              Wait(50+random(20));
              i := i + 1;
              AntiRandoms;
              Result := (IsUpText('ountain'));
              If not(Result) then
                Result := IsUpText('ell');
              If Result then
                Break;
            Until (i = 25);
            Wait(1);
          end;
          If Result then
          Begin
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, True);
            WriteLN('Found the fountain in '+IntToStr(((GetSystemTime) - t)- 100)+' msecs');
          end;
          If (i < 25) then
            Break;
        Until(l >= 2);
        AntiBan;
        MarkTime(t);
        Repeat
          Wait(1000+random(2000));
          AntiRandoms;
        Until(Not(FindDTM(EmptyBucket, x , y, MIX1, MIY1, MIX2, MIY2))) or (TimeFromMark(t) >= 25000);
        FreeDTMs;
      end;
    end;
    
    
    Procedure SoftenClay;
    Var
    x, y, x1, y1, w:integer;
    Begin
      If not(LoggedIn) then Exit;
      AntiRandoms;
      DTMs;
      If FindDTM(PlainClay, x1, y1, MIX1, MIY1, MIX2, MIY2) then
      If FindDTM(FullBucket, x, y, MIX1, MIY1, MIX2, MIY2) then
      Begin
        Mouse(x1, y1, 5, 5, true);
        Wait(100+random(100));
        Mouse(x, y, 5, 5, true);
        Repeat
          Wait(300+random(100));
          AntiRandoms;
        Until FindText(x, y, 'make', NPCChars, MCX1, MCY1, MCX2, MCY2);
        Mouse(220, 390, 50, 50, False);
        ChooseOption('ll');
        MarkTime(w);
        AntiBan;
        Repeat
          Wait(2000+random(1000));
          AntiRandoms;
        Until (Not(FindDTM(FullBucket, x, y, MIX1, MIY1, MIX2, MIY2))) or (Not(FindDTM(PlainClay, x, y, MIX1, MIY1, MIX2, MIY2))) or (TimeFromMark(w) >= 60000);
        FreeDTMs;
        Loads := Loads + 1;
        ClayMade := ClayMade + 14;
        ReportVars[0] := ReportVars[0] + 14;
        ReportVars[1] := ReportVars[1] + 1;
        Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + 14;
      end;
    end;
    
    
    Procedure SleepThatPlayer;
    Var
    SleepStart, H, M, C, SleepT, LosTimos :Integer;
    Begin
      If not LoggedIn then
      Exit;
      AntiRandoms;
      LosTimos := 900000+random(300000);
      If (TimeFromMark(t) >= LosTimos) then
      Begin
        Logout;
        Disguise('Sleeping');
        WriteLN('Sleeping for antiban purposes');
        Case Random(11) of
          0,1,2,3,4: SleepT := (60000+Random(60000));
          5,6,7,8,9: SleepT := (300000+Random(300000));
          10: SleepT := (900000+Random(300000));
        end;
        MarkTime(SleepStart);
        ConvertTime(SleepT, H, M, C);
        Status('Sleeping for '+IntToStr(H)+'hr , '+IntToStr(M)+'min, '+IntToStr(C)+'sec');
        Repeat
          Wait(1000);
          ConvertTime(Round(SleepT-TimeFromMark(SleepStart)), H, M, C);
          Status(+IntToStr(H)+'hr '+IntToStr(M)+'min '+IntToStr(C)+'sec remaining');
        Until(TimeFromMark(SleepStart) >= SleepT);
        Wait(100);
        Status('Logged back in');
        LoginPlayerFix;
        MarkTime(t);
        Status(' ');
        Disguise('Logging back in');
        ReportVars[3] := ReportVars[3] + 1;
        Wait(200+random(200));
      end;
    end;
    
    
    Procedure Information;
    Begin
      Case Random(3) of
        0: Disguise('Done '+IntToStr(Loads)+' Loads');
        1: Disguise(TimeRunning);
      end;
    end;
    
    
    Procedure ProgressReport;
    Var
    i : integer;
    Begin
      ClearDebug;
      WriteLN('===================================================');
      WriteLN('Clay Softner by Richard');
      WriteLN(' ');
      WriteLN('===================================================');
      For i := 0 to HowManyPlayers-1 do
      Begin
        WriteLN('|||||||||||||||||||||||||||');
        WriteLN(Padr('|| Player: '+Capitalize(Players[i].Name)+'.', 24)+' ||');
        WriteLN(Padr('|| Active: '+BoolToStr(Players[i].Active)+'.', 24)+' ||');
        WriteLN(Padr('|| Clay Softned: '+IntToStr(Players[i].Integers[1])+'.', 24)+' ||');
        WriteLN(Padr('|| Location: '+Capitalize((Players[i].Loc))+'.', 24)+' ||');
        If not(Players[i].Active) then
        Begin
          WriteLN(Padr('|| Reason failed:', 24)+' ||');
          WriteLN(Padr('|| '+Players[i].Strings[2]+'.', 24)+' ||');
        end;
        WriteLN('|||||||||||||||||||||||||||');
        WriteLN(' ');
      end;
      WriteLN(' ');
      WriteLN('Softened a total of '+IntToStr(ClayMade)+' clay.');
      WriteLN('Done '+IntToStr(Loads)+' loads.');
      WriteLN('Ran for '+(TimeRunning)+'.');
      WriteLN(' ');
      Writeln('===================================================');
      SendSRLReport;
      SRLRandomsReport;
    end;
    
    
    Procedure ScriptTerminate;
    Begin
      ProgressReport;
      WriteLN('Thanks for using Clay --> Soft Clay');
      WriteLN('Please post the above progress report');
      WriteLN(' ');
    end;
    
    
    Begin
      SafeForm;
      SafeShowFormModal;
      DeclarePlayers;
      SetupSRL;
      SMARTSetupEx(134, false, true, false);
      SetTargetDC(SMARTGetDC);
      ScriptID := '1187';
      SRLID := Edit3.text;
      SRLPassword := Edit4.text;
      SymbolAccuracy := 0.5;
      ActivateClient;
      Loads := 0;
      Begin
        For p := 0 to (HowManyPlayers - 1) do
          Players[p].Loc := (Players[CurrentPlayer].Strings[1]);
      end;
      Repeat
        Players[CurrentPlayer].Integers[1] := 0;
        Players[CurrentPlayer].Active := True;
        LoginPlayerFix;
        ChatsOff;
        MarkTime(t);
        GameTab(4);
        Repeat
          MouseSpeed := StrToInt(Edit2.text);
          DRDebug('Mouse speed reset to '+Edit2.text+'.');
          SRLRandomsReport;
          SendSRLReport;
          SleepThatPlayer;
          ROpenBank;
          DepositAndWithdraw;
          SoftenClay;
          ROpenBank;
          DepositAndWithdraw;
          SetAngle(True);
          WalkToFountain;
          LocateFountain;
          SoftenClay;
          LocateFountain;
          WalkToBank;
          ProgressReport;
          SoftenClay;
          Information;
          Wait(1);
        Until ((Players[CurrentPlayer].Integers[1]/14) >= Players[CurrentPlayer].Integers[0]) or not(LoggedIn);
        Logout;
        If (Players[CurrentPlayer].Integers[1] >= Players[CurrentPlayer].Integers[0]) then
          Players[CurrentPlayer].Strings[2] := 'Completed loads';
        WriteLN(Players[CurrentPlayer].Strings[2]);
        NextPlayerFix(False);
        ProgressReport;
      Until(AllPlayersInactive);
    end.
     
  3. Unread #2 - Feb 25, 2009 at 7:43 AM
  4. DepthCharge
    Joined:
    Feb 25, 2009
    Posts:
    2
    Referrals:
    0
    Sythe Gold:
    0

    DepthCharge Newcomer

    Varrock East Clay Softner

    I have not used this nor intend to although a combo of 14 buckets and 14 clay each time @ Fally west works well.
    You should think about converting it for there.
    Shorter distance as far as i know and it fills up all the buckets in the one use (take a little bit but its very short, i have no idea if they fill up all of them at fountains never bothered to check).
     
  5. Unread #3 - Feb 25, 2009 at 1:43 PM
  6. dude_richard
    Joined:
    Nov 23, 2007
    Posts:
    34
    Referrals:
    0
    Sythe Gold:
    0

    dude_richard Member

    Varrock East Clay Softner

    I've never tried it at fally, but in varrock its only about a 10 second walk, and it fills all the buckets up at one time, and fast.
     
  7. Unread #4 - Feb 25, 2009 at 6:13 PM
  8. DepthCharge
    Joined:
    Feb 25, 2009
    Posts:
    2
    Referrals:
    0
    Sythe Gold:
    0

    DepthCharge Newcomer

    Varrock East Clay Softner

    Another thing that i will not know if it does it but it could cut down on time largely for you.
    14 buckets and 14 clay per load.

    Withdraw 14 clay (required)
    Fill buckets (fill all 14 of them)
    Make soft clay (obviously required)
    Fill buckets (while you are still at the fountain you may as well fill them up again)
    Bank soft clay (make space in inventory)
    Withdraw 14 clay (yes still in the one cycle here)
    Make soft clay (use the filled buckets you have when you are standing at the bank booth)
    Bank soft clay (2 loads less walking time)
    Rinse, repeat.
     
  9. Unread #5 - Feb 28, 2009 at 9:47 AM
  10. dude_richard
    Joined:
    Nov 23, 2007
    Posts:
    34
    Referrals:
    0
    Sythe Gold:
    0

    dude_richard Member

    Varrock East Clay Softner

    It already does that ;)

    I'm thinking about adding Falador banking, because I've been asked multiple times now on SRL.
     
< B.A.A - Blanko's Attempt (at) A.N.N.A | *REQUEST* Mining guild coal miner >

Users viewing this thread
1 guest


 
 
Adblock breaks this site