All pastes #246077 Raw Edit

Something

public text v1 · immutable
#246077 ·published 2006-11-11 21:06 UTC
rendered paste body
{.Script Info:

# ScriptName  = Draynor Willow Smasher and Banker
# Author      = Surajd
# Description = Smashes Willows and Banks them in Draynor =D
# Version     = v1.03 [ SRL Include ]
# Date        = 29/07/06 (v1.03)
# Comments    = Please post all Bugs/Corrections in this script's thread, What are you waiting for! =D

# Setup lines are from lines 35-58!
# Have Axe in the FIRST Inventory Slot!
# 06/06/06 : Added a Progress Report! As commented by a few people =D
# 06/06/06 : Fixed some bugs in the Counters =/
# 10/06/06 : Fixed a Major Bank finding bug! Now works perfectly! =D
# 18/06/06 : Added AntiRandom Functions to make the Script Less Detectable! =D
# 18/06/06 : Fixed Tree Finding! =D and another important update - Thanks to Pyro, Talking to Randoms works now! =)
# 20/06/06 : Fixed a Major Tree Finding Issue!
# 20/07/06 : Fixed and added a few functions, re-thought some procedures and cleaner code, should run more stable now =)

/Script Info}


Program DWSBanker_SRL_Remade;
{.include SRL/SRL.scar}
{.include SRL/SRL/Misc/PlayerForm.scar}
{.include SRL/SRL/Skill/Woodcutting.scar}


Var
  a, b                   : Integer;
  BTimes, FTimes, ETimes : Integer;
  BColor                 : Integer;

Const
 BenMouseBM     = true;   // Want to use BenLand100's great groove? =D
 TalkRandomly   = true;   // Talk Randomly or not?
 TalkAboutSkill = true;   // Types phrases about Woodcutting
 AntiBanAB      = true;   // AntiBan functions or not?
 MouseSpeedMS =   11;     // Change your Mouse-Speed, 11 works ok with BenMouse

  RChat        = 1;     // Random-Talk time? EG: 2 for every 2 minutes
  HowManyTrips = 5;     // How many trips do you want the script to do?
  WaitTime     = 5501;    // Time between Smashing the Willow Tree (Milliseconds)

  WTreeColor1 = 2658424;   // Color of Willow Tree (1)
  WTreeColor2 = 1332819;   // Color of Willow Tree (2)
  WTreeColor3 = 5535856;   // Color of Willow Tree (3)

  Txt1 = 'Wil'; // DONT CHANGE
  Txt2 = 'ill'; // DONT CHANGE
  Txt3 = 'low'; // DONT CHANGE

  TreeTypeTT = 'Willow'; // DONT CHANGE
  TTol = 10; // The Tolerance of finding the tree

  LSkill      = 'Woodcutting'; // Lamp Skill if Genie is found

  VersionNumber = 'v1.03 by Surajd'; // Do not change!


// ------- Taken from Realrune's:  SRL Willow Killer + Banker ------ \\
function RFindObj(var cx, cy: Integer; Text, Text2, Text3: String; color, color2, color3, tolerance: Integer): Boolean;
var
  x, y, a, c, i, x1, y1, x2, y2 : Integer;
begin
  if (FindMSColorTol(x, y, color, tolerance)) or (FindMSColorTol(x, y, color3, tolerance)) or (FindMSColorTol(x, y, color3, tolerance)) then
  begin
    x1 := 245;
    y1 := 165;
    x2 := 277;
    y2 := 185;
    repeat
      if (not (Loggedin)) then
        break;
      a := a + 1;
      if (a = 1) then
        c := c + 1;
      if (a = 3) then
        c := c + 1;
      for i := 1 to c do
      begin
        if (a = 1) then
        begin
          x1 := x1 + 30;
          x2 := x2 + 30;
        end;
        if (a = 2) then
        begin
          y1 := y1 - 20;
          y2 := y2 - 20;
        end;
        if (a = 3) then
        begin
          x1 := x1 - 30;
          x2 := x2 - 30;
        end;
        if (a = 4) then
        begin
          y1 := y1 + 20;
          y2 := y2 + 20;
        end;
        if (x1 = 485) and (x2 = 517) then
          x2 := x2 - 2;
        if (y1 = 325) and (y2 = 345) then
          y2 := y2 - 7;
        if (x2 > 515) then
          Break;
        if (FindColorTolerance(x, y, color, x1, y1, x2, y2, tolerance)) or (FindColorTolerance(x, y, color2, x1, y1, x2, y2, tolerance)) or (FindColorTolerance(x, y, color3, x1, y1, x2, y2, tolerance)) then
        begin
          MMouse(x, y, 0, 0)
          cx:=x;cy:=y;
          if (IsUpTextMulti(Text, Text2, Text3)) then
          begin
            Result := True;
            Break;
          end;
        end;
      end;
      if (a = 4) then
        a := 0;
    until (x2 > 515) or (Result = True);
  end;
end;
// ------- End of Realrune's nice RFindObj =D ------ \\


Procedure Callibrate;
begin
 SymbolAccuracy := 0.1;
 if (FindSymbol(x, y, 'bank')) then
 Mouse(x, y, 0, 0, true);
end;

Procedure FindMMColors;
begin
 SymbolAccuracy := 0.1;
 BColor := GetSymbolColor(x, y, 'bank');
 WriteLn(' Bank Symbol Color: ' +inttostr(BColor));
end;

procedure ProgressReport;
begin
 WriteLn(' ');
  WriteLn('<============== -' + VersionNumber + '- Progress Report ===============>');
  WriteLn(' Worked for ' + TimeRunning);
  WriteLn(' Banked:    ' + inttostr(BTimes) + ' Loads of Willows! ');
  WriteLn(' Fixed:     ' + inttostr(FTimes) + ' Axe(s)! ');
  WriteLn(' Found:     ' + inttostr(ETimes) + ' Ent(s)! ');
 SRLRandomsReport;
end;

procedure SetupScript;
begin
  MakeCompass('N');

   SetChat('Hide', 1);
   SetChat('Off',  2);
   SetChat('Off',  3);
   SetRun(true);

  GameTab(4);
end;

procedure AntiRandomsAR;
begin
  Findnormalrandoms;
  if ( AntiBanAB      = True)  then AntiBan;
  if ( TalkRandomly   = True)  then RandomChatEvery( RChat );
  if ( TalkAboutSkill = True)  then GhostSpeak( 'Woodcutting' );
  if ( AntiBanAB      = True)  then LeaveScreenEvery( 1 );
  if ( FindFight ) then
  begin
    Writeln('Fight Found! Running...');
    RunAwayDirection('E');
    wait( 5000 + random( 1 + 99 / 2 ));
    RunBack;
    Writeln('Fight successfully dodged, continuing...');
  end;
  FindEnt( WTreeColor1 );
  FindEnt( WTreeColor2 );
  FindEnt( WTreeColor3 );
   if (FindEnt( WTreeColor1 )) or
       FindEnt( WTreeColor2 ) or
       FindEnt( WTreeColor3 ) then
      ETimes := ETimes + 1
   if (not (ExistsItem(1))) or FindColorSpiral(x, y, 4345174, 616, 118, 623, 123) then
    begin
     Writeln('Axe head missing! Looking very carefully to find it =/');
    FindHead;
   FTimes := FTimes + 1
 end;
end;

procedure GoSmashWillows;
begin
 SymbolAccuracy := 0.1;
 if (FindSymbol(a, b, 'bank')) then
    wait(1001 + random(203 * 2 / 1 - 1 + 2));
  Mouse(a - 29, b + 41, 1, 2, true);
  Flag;
end;

procedure GoBank;
begin
  if (InvFull) then
  Writeln('Going to deposit this heavy load of bull! *Sigh*');

  SymbolAccuracy := 0.1;

   if (FindSymbol(a, b, 'bank')) then
   wait(2002 + random(6 * 6 / 2 + 5 - 2));

  MMouse(a, b, 0, 0);
  wait(1002 + random(40 * 2 / 2 + 6 - 1));
  Mouse(a, b - 2, 0 , 0, true);

   Flag;
   wait(2000 + random(500 * 2 / 3 + 100));

  OpenBankQuiet('db');
  wait(2100 + random(191 * 2 / 3 + 5));

  if (BankScreen) then
  begin
  Deposit(2, 28, 2);
  wait(1001 + random(30 * 8 / 2 - 7 + 10));
  BTimes := BTimes + 1
  CloseBank;

    Writeln('Successfully deposited the heap of goods!');
    wait(1500 + random(709 * 2 / 2 + 200 - 2));

  end;
end;

procedure ChopDownWillows;
begin
 repeat
   if (RFindObj(a, b, Txt1, Txt2, Txt3, WTreeColor1, WTreeColor2, WTreeColor3, TTol)) then
      wait(1523 + random(323 * 5 / 2));
       Mouse(a, b, 0, 0, false);
       ChooseOption(a, b, TreeTypeTT);
      wait(WaitTime + Random(500 * 8 / 2 + 3 - 1));
    AntiRandomsAR;
  until (InvFull);
end;

Procedure SetupPlayer;
begin
 Callibrate;
  Wait( 2122 + Random( 100 - 5 * 2 ));
    PerfectNorth;
     SetChat('hide', 1);
     SetChat('off', 2);
     SetChat('off', 3);
    SetRun (true);
  GameTab(4);
end;

procedure MainLoop;
begin
 SetupScript;
 FindMMColors;
 FindAxeHeadColor;
  repeat
   if (Not (LoggedIn)) then break;
    ChopDownWillows;
    GoBank;
    GoSmashWillows;
  until (HowManyTrips = BTimes);
   ProgressReport;
   NextPlayer(true);
   SetupPlayer;
  if (Not (LoggedIn)) then NextPlayer(True);
 MainLoop;
end;


begin

  BTimes := 0
  FTimes := 0
  ETimes := 0

   Writeln('You are using the Draynor Willow SMASHER and Banker script!');
   Writeln('... Created by Surajd =)');

  SetupPlayers;
  SetupSRL;
  DisguiseScar('Notepad');
  BenMouse   := BenMouseBM;
  MouseSpeed := MouseSpeedMS;
  MainLoop;

end.