Results 1 to 5 of 5

Thread: Varrock East Clay Softner

  1. #1
    Join Date
    Jun 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Varrock East Clay Softner

    This is my second script You need to start in Varrock East bank with 14 buckets in your inventory. It works better without smart so feel free to remove it Please comment the areas I need to improve in and rate the script.

    Credits: Tootoot222 for teaching me the basics of TBox.


    SCAR Code:
    program New;
    {.include SRL/SRL/misc/SMART.scar}
    {.include srl/srl.scar}



    var
    SoftClayBMP,ClayDTM,SoftClayDTM,ClaySofted,LoadsDone,LoadsToDo: Integer;

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1; //How many players?
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;  //Start player?

        Players[0].Name := 'xxxxxx';
        Players[0].Pass := '123456';
        Players[0].Nick := 'xxx';
        Players[0].Integers[0] := 0;  //Loads before switching users... {not functional as multiPlayer Not added yet}
        Players[0].Active := True;
        LoadsToDo:= 10

        //add more players below
      {  Players[1].Name := '';
        Players[1].Pass := '';
        Players[1].Nick := '';
        Players[1].Integers[0] := 0;
        Players[1].Active := True;

        Players[2].Name := '';
        Players[2].Pass := '';
        Players[2].Nick := '';
        Players[2].Integers[0] := 0;
        Players[2].Active := True;}

    end;



    Procedure LoadDTMsAndBMPs;
    Begin
      ClayDTM := DTMFromString('78DA63BCC8C0C0E0CAC8800A189148200D52E' +
           '34E40CD1520E14940CD0D20E14D40CD7D22EC7A02245C08A8B905' +
           '24ECF0AB0100609C07F1');
      SoftClayBMP := BitmapFromString(42, 33, 'beNqllr1KQ0EQhUv/43NY' +
           '2FikELQICCkUISAKWthYWFhYWPgyKdRGX0OUoJYiKhZ5FCccMhnPz' +
           'OxdEziEvZu9+52Znd29g7ufl/tZNHx7+B78mUQeVb5nrL4dMAvdd0' +
           '5BxzzhbKF8yETP0MPXEf3zaaQyorMxH2prfS5Ue20i64rQoH893xY' +
           'S2G0vqPY2G2QHi9RPlIE+ZT6k28l724uhDjtLJPuWGoiS31B1NcST' +
           'HZYOszZksbLCUxvWTD2OlOUBK+KLMAy8TDztLltldBuCoF0G+naD2' +
           'NXP6MStNwA6GaDtqeiQeLa7ksk6yeiafDoiqBFGV0AT3RchbUkqM9' +
           'sQw2Xo+f5I9QZQfpYuZxGdh5p2IoJVlndC4YdoOgbl6JPBNbhGD1Q' +
           'Dlp5diEKX8Zjqoteq1Ix0+RUu0KJ6rrdBBpB5e+YQ+v3xRriIHW9d' +
           'HrTqFSZBUwF6GDUkdJHcdzbwKdDegCbf07XkBI0Vp7W+OloN1eiEa' +
           'iDLOQQ67SxMmBmosUH08HTVdfdoNXB9PFGNE5t/DTyjQwU6GfA2fP' +
           'hEp288OmGgzIBHN9Jt2sECwkKJLm1bdQUDjYGj1HG/EBeSLWbRInx' +
           'kZmVfQ6e9BrSNlM5VdQLBRnndy1ygcchkXPKgdNQ/GfBpz7j2gpPA' +
           'iR460ZBJjTm3a0R3q1wrhahtJYCuUXsD/+KqKGqfhDBk+1eWluwVu' +
           '5Tab9t6uKnwiEWHaBfoJDZLoOjVjB7562P8qYyRuL90HvTQTrd/WQ' +
           'PaptfLGct6KO2jx1/FEqSk');
      SoftClayDTM := DTMFromString('78DA639CCEC4C0E0CEC8800A189148203D970' +
           '8358B806ABC09A8590254E34740CD7CA09A30026A6603D544E356' +
           'C302A22710A1A607A82682809A4EA09A10026ABA816A0209A8E9C' +
           '31F3E603513F1873358CD54C26A00DB1C0C10');
    End;

    function FindAnyColorTolerance(var X, Y: Integer; Colors: array of Integer; Sx, Sy, Ex, Ey, Tolerance: Integer): Boolean;
    var
      I: Integer;
    begin
      Result:= True;                    //if it Exit's, then the result will be true
      for I:= 0 to High(Colors) do          //run through the array of colors
        if(FindColorTolerance(X, Y, Colors[I], Sx, Sy, Ex, Ey, Tolerance)) then     //if the color was found
          Exit;                                                 //leave the function
      Result:= False;
    end;

    procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case Random(30) of
        1: RandomRClick;
        2: HoverSkill('Woodcutting', False);
        3: RandomMovement;
        4: BoredHuman;
      end;
    end;


    Procedure WithdrawBank;
    var
      x,y,T,I: Integer;
      B: TBox;
    Begin
      I:=0
      Gametab(4);
      if(FindDTM(SoftClayDTM,x,y,550, 193,737, 459)) then
      Begin
        OpenBank('veb',true,true);
        wait(1000+random(500));
        B:= InvBox(CoordsToItem(x, y));
        MouseBox(B.X1 + 5, B.Y1 + 5, B.X2 - 5, B.Y2 - 5, 2);
        Wait(500+random(500));
        ChooseOptionMulti(['14','eposit']);
        Wait(500+random(500));
        ClaySofted:= ClaySofted + 14
      end;
      Repeat
        while((not(PinScreen)) and (not(BankScreen))) do
          Begin
            OpenBank('veb', true, true);
            Wait(1500+Random(800));
          End;
         
        If(not(InvFull)) Then
        while(not(FindDTM(ClayDTM, x, y, 17, 23, 499, 326))) do
          repeat
            FindDTM(ClayDTM, x, y, 17, 23, 499, 326)
            wait(300+random(100));
            writeln('finding clay')
            I:=I+1
            if(I>=15)then
              begin
                writeln('Out Of Clay OR Script PHAIL3D!')
                TerminateScript;
              end;
          until((FindDTM(ClayDTM, x, y, 17, 23, 499, 326)) = True);

            begin
              Mouse(x,y,3,3,False);
              Wait(1000+Random(500));
              ChooseOptionMulti(['14', 'Withdraw-X']);
              Wait(1500 + Random(1000));
              if(FindText(X, Y, 'mount', UpChars, MCX1, MCY1, MCX2, MCY2)) then
              begin
                TypeSend('14');
                Wait(1000+random(500));
              end;
              Mouse(490, 35, 1, 1, True);
              Wait(500+random(500));
         end;
      Until((InvFull) or (TimeFromMark(T) >= 99999));

    End;

    Procedure WalkToFountain;
    var
    x,y,i: integer;
    Begin
      if(InvFull) then
        begin
          i:=Random(2)
          if(i=0) then SetRun(true);
          MakeCompass('N');
          RadialWalk(FindVarrockRoadColor, 320,360,60,3,3);
          FFlag(5+random(3));
          Wait(1000+random(500));

        end;
      if(FindSymbol(x,y,'water')) then
        begin
          Mouse(x,y,3,3,true);
          FFlag(3+random(5));
          Wait(300+random(200));
        end;
    End;

    Procedure FillBuckets;
    var
    x,y,T:integer;
    Begin
      Wait(1000+random(500));
      if(FindAnyColorTolerance(x, y, [10515292,7755076,12618607,14264721], MSX1, MSY1, MSX2, MSY2, 5)) then
        begin
          Wait(random(500));
          Mouse(576,229,3,3,true);
          wait(500+random(300));
          Mouse(x,y,2,2,true);
          T:= GetSystemTime;
          while(TimeFromMark(T) < 10000) do Antiban;
        end;
    End;



    Procedure SoftClay;
    var
    x,y,T:integer;
    Begin
      GameTab(4);
      T:= GetSystemTime;
      Mouse(579, 227, 3,3,true);
      wait(1000+random(500));
      Mouse(661, 339, 3,3,true);
      Wait(1000+random(500));
      FindBitmapToleranceIn(SoftClayBMP,x,y,4,338,514,476,5);
      Mouse(x,y,3,3,false);
      Wait(500+random(500));
      ChooseOption('ll');

      while(TimeFromMark(T) < 21500) do Antiban;
      ClaySofted:=ClaySofted + 1
    End;

    Procedure WalkToBank;
    var
    x,y:integer;
    Begin
      if not LoggedIn then exit;
      RadialWalk(FindVarrockRoadColor,95,100,55,3,3)
      FFlag(3+random(5));
      While(not(FindSymbol(x,y,'bank'))) Do
      Begin
        FindSymbol(x,y,'bank');
        wait(500+random(100));
      end;
        Begin
          Mouse(x,y,5,5,true);
          FFlag(3+random(5));
          Wait(500+random(500));
          LoadsDone:= LoadsDone + 1
        end;
    End;

    Procedure Proggy;
    Begin
    ClearDebug;
    Writeln(padr('==================================',40));
    Writeln(padr('|  ' + intTostr(LoadsDone) + ' Loads Done!',60));
    writeln(padr('|  ' +  inttostr(ClaySofted) + ' Soft Clay Banked!',60));
    Writeln(padr('==================================',40));
    end;


    begin
      SMARTSetUpEX(55, False, True, False);
      SetTargetDC(SMARTGetDC);
      SetupSRL
      LoadsDone
      LoadDTMsAndBMPs;;
      DeclarePlayers;
      LoginPlayer;
      Repeat
        WithdrawBank;
        WalkToFountain;
        FillBuckets;
        SoftClay;
        WalkToBank;
        Proggy;
        LoadsToDo:=LoadsToDo+1
      Until(LoadsDone>=LoadsToDo)
    end.

  2. #2
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    If you don't know how to use arrays, read a tutorial and then read this again.


    Make LoadsToDo an array and use it like this
    SCAR Code:
    var
      LoadsToDo: array [0..99] of integer;

    procedure declareplayers;
    begin
        HowManyPlayers := 1; //How many players?
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;  //Start player?
     
        Players[0].Name := 'xxxxxx';
        Players[0].Pass := '123456';
        Players[0].Nick := 'xxx';
        Players[0].Integers[0] := 0;  //Loads before switching users... {not functional as multiPlayer Not added yet}
        Players[0].Active := True;
        LoadsToDo[0]:= 10

        Players[1].Name := '';
        Players[1].Pass := '';
        Players[1].Nick := '';
        Players[1].Integers[0] := 0;
        Players[1].Active := True;
        LoadsToDo[1]:= 10;

    Also make all the other variables that count some amounts the same thing and in the end of your script use them like this:
    Remember when you add +1 to ClaySofted, for example, do this
    Inc(ClaySofted[CurrentPlayer]);

    SCAR Code:
    var
       LoadsDone, LoadsToDo, ClaySofted : array [0..99] of integer;

         ...

        Inc(LoadsDone[CurrentPlayer]) //use Inc() function rather than a:= a+1;
        //Here u were adding 1 to a wrong variable
      Until(LoadsDone[CurrentPlayer]>=LoadsToDo[CurrentPlayer])

    How to make it multiplayer?
    Create a function that tells you if u need to change player:
    SCAR Code:
    function DoWeSwitchPlayers: boolean;
    var
      i: integer;

    begin
     for i:= 0 to 1 do //i use case here, so if you need more than 2 reasons to change players it'll be easy to add.
     begin
      case i of
       0: Result := not loggedin;
       1: Result := LoadsDone[CurrentPlayer] >= LoadsToDo[CurrentPlayer];
      end;
      if Result then exit;
     end;
    end;
    Add a TimeMark variable, to make the script end after some amount of time

    SCAR Code:
    var
      TimeMark: integer;

    Also add a constant (const) TimeToRun to set for how long you want the script to run

    SCAR Code:
    const
      TimeToRun = 1000*60*60 //note in const its = not := and here time is expressed in milliseconds, but i made it simple here. You can use mathematics to express integers, like we just did.

    And make your mainloop to look something like this:
    SCAR Code:
    MarkTime(TimeMark);
      Repeat
        WithdrawBank;
        WalkToFountain;
        FillBuckets;
        SoftClay;
        WalkToBank;
        Proggy;
        LoadsToDo:=LoadsToDo+1
        if (DoWeSwitchPlayers = true) then
         NextPlayer(false);  //false means that this current player isnt active anymore and won't be used in the loop again.
      Until(TimeFromMark(TimeMark) > TimeToRun)

  3. #3
    Join Date
    Jun 2007
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow, that helped me a lot! Thanks!
    I wont be updating this script.. Gonna work on a new one!

  4. #4
    Join Date
    Mar 2009
    Posts
    50
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, Ill be sure to try it out.

  5. #5
    Join Date
    Jul 2008
    Location
    Canada
    Posts
    1,612
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    He's not updating the script, and it's hard to read your script man, more standards would b easier..Jewish_Rhapsody what failed name and he's not updating so if i were you i'd test out the script A.S.A.P or change it yourself.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. King's Varrock West Clay Softner
    By King of the Nites in forum RS3 Outdated / Broken Scripts
    Replies: 77
    Last Post: 09-07-2009, 04:05 AM
  2. Clay Softner
    By m0nd0 in forum RS3 Outdated / Broken Scripts
    Replies: 6
    Last Post: 08-06-2008, 10:26 AM

Posting Permissions

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