SCAR Code:
{First it will use your net and fish in draynor to 25 fishing.. Go to line 331 to change...
Next it will cut regular trees to level 15 woodcutting.. go to line 188 to change...
Next it will cut oaks till level 30 wc... line 347
Thanks to WIzzuP for some functions!
}
program DraynorSkills;
{.include SRL/SRL.scar}
{.include SRL\SRL\skill\Woodcutting.scar}
Var BankDTM,RotateNum,Ix,bx,by,Tries, FishingNet, FishingNetColor, Iy:Integer ;
WhirlPoolAcc: Extended;
CallBTime: LongInt;
NoNet: Boolean;
FishLoads:integer;
RegularLoads:integer;
OakLoads:integer;
WillowLoads:Integer;
var
frmDesign : TForm;
Image1 : TImage;
Start : TButton;
ProgressBar1 : TProgressBar;
const
TreeColor1 = 793624; //RegularTree
TreeColor2 = 4624512; //Oaks
Willow1 = 2592888; //willow
FishLevel = 25; //What level to get fishing to before starting on reg trees.
RegularTree = 15;//What level to get woodcutting before starting oaks
Oaklevel = 30;//What level to get woodcutting before willows
WillowLevel = 40;// What level to get from woodcutting from willows
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
procedure buttonclick(sender: TObject);
begin
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;
Procedure Initform;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.BorderStyle := bsToolWindow;
frmDesign.Caption := 'frmDesign';
frmDesign.ClientHeight := 458;
frmDesign.ClientWidth := 690;
frmDesign.Color := clBlack;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -10;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 84;
Image1 := TImage.Create(frmDesign);
Image1.Parent := frmDesign;
Image1.Left := -7;
Image1.Top := 26;
Image1.Width := 609;
Image1.Height := 358;
Start := TButton.Create(frmDesign);
Start.Parent := frmDesign;
Start.Left := 188;
Start.Top := 203;
Start.Width := 76;
Start.Height := 48;
Start.Caption := 'Start';
Start.TabOrder := 8;
Start.OnClick:= @buttonclick;
ProgressBar1 := TProgressBar.Create(frmDesign);
ProgressBar1.Parent := frmDesign;
ProgressBar1.Left := 96;
ProgressBar1.Top := 437;
ProgressBar1.Width := 486;
ProgressBar1.Height := 15;
ProgressBar1.TabOrder := 9;
end;
procedure SetupScript;
begin
SafeInitForm;
SafeShowFormModal;
end;
procedure DeclarePlayers;
begin
HowManyPlayers := 5;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //USername
Players[0].Pass := ''; //password
Players[0].Nick := 'nan'; //3-4 letters of username
Players[0].Active := True;
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := 'new';
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := True;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := True;
Players[4].Name := '';
Players[4].Pass := '';
Players[4].Nick := '';
Players[4].Active := True;
end;
Procedure AntiBan;
var ban: integer;
begin
Ban := Random(20);
case Ban of
0: Wait(550);
1: PickupMouse;
2: HoverSkill('Fishing', False);
3: HoverSkill('Defense', False);
4: HoverSkill('Defense', False);
5: HoverSkill('Woodcutting', False);
6: HoverSkill('Firemaking', False);
7: HoverSkill('Fishing', False);
8: SayCurrentLevels('Fishing');
9: Wait(550);
10: RandomRClick;
11: TypeSend('Type 1 if your bored!');
12: AlmostLogout;
13: SleepAndMoveMouse(5000 + random(2000));
14: GameTab(1 + random(12));
end;
end;
Procedure Randoms;
begin
if FindFight then
begin
Status('Running from Fight');
RunTo('n',true);
wait(8000 + random(1000));
RunTo('s',true);
end;
end;
procedure FindingEnts;
var
Ents: Integer;
begin
if (FindEnt(TreeColor1)) or
(FindEnt(TreeColor2)) then
begin
WriteLn('Ent! Eek!');
RunAwayDirection('N');
wait(7000 + random(3000));
RunBack;
Ents := Ents + 1;
end;
end;
Function IsFishNet: Boolean;
Var
x, y: Integer;
Begin
If Not LoggedIn Then Exit;
GameTab(4);
Result := FindColor(x, y, FishingNetColor, MIX1, MIY1, MIX2, MIY2);
If Result Then Exit;
Result := FindBitmapToleranceIn(FishingNet, x, y, MIX1, MIY1, MIX2, MIY2, 25);
If Result Then
Begin
FishingNetColor := GetColor(x, y);
WriteLn('FishingNetColor: ' +IntToStr(FishingNetColor));
End;
End;
Function FindNet: Boolean;
Var
x, y: Integer;
Begin
If Not LoggedIn Then Exit;
Result := True;
If Not IsFishNet Then
Begin
NoNet := True;
Result := False;
Wait(4000+Random(1000));
If FindObj(x, y, 'mall', FishingNetColor, 0) Then
Begin
Mouse(x, y, 0, 0, True);
Wait(100);
FFlag(0);
Wait(500);
If IsFishNet Then
Begin
Result := True;
NoNet := False;
Exit;
End;
End
Else
Begin
CallBTime := CallBTime - 25000;
Mouse(665, 72, 5, 5, True);
FFlag(0);
Wait(1000+Random(500));
If FindObj(x, y, 'mall', FishingNetColor, 0) Then
Begin
Mouse(x, y, 0, 0, True);
Wait(100);
FFlag(0);
Wait(500);
If IsFishNet Then
Begin
Result := True;
NoNet := False;
Exit;
End;
End;
End;
End;
End;
Procedure LoadDtms;
begin
BankDTM := DTMFromString('78DA63EC60626008614001FFFFFF676060042' +
'310FB3F6303508D37448E09AAE6ED5B08CD08E583D50413A1269C' +
'809A0AC26A00E665129F');
end;
function FindObjMultiText2(var cx, cy: Integer; Ut1, UT2, UT3: string; color,
tolerance: Integer): Boolean;
var
x, y, a, c, i, x1, y1, x2, y2: Integer;
begin
Color := Color;
if (FindColorTolerance(x, y, color, msx1, msy1, msx2, msy2, tolerance)) then
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (Loggedin)) then
Break;
a := a + 1;
if (a = 1) or (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
else if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end
else if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end
else 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)) then
begin
MMouse(x, y, 0, 0)
Wait(10);
cx := x;
cy := y;
if (IsUpTextMulti(UT1, UT2, UT3)) then
begin
Result := True;
Break;
end;
end;
end;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result = True);
end;
end;
Function FindDraynorBank(Var x, y: Integer): Boolean;
Var
BankA: Extended;
I: Integer;
Begin
Repeat
I := I + 1;
Wait(1);
Result:= FindDTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, 0.05, BankA);
// Result:= FindDTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, 0.1, BankA);
Until Result Or (I > 10);
End;
Procedure WalkToFish;
begin
If FindSymbol(x, y, 'fishing spot') Then
Mouse(x, y, 1, 1, True);
FindNormalRandoms;
randoms;
end;
procedure tobank;
begin
randoms;
FindNormalRandoms
If FindDraynorBank(x, y) Then
Begin
Mouse(x, y, 3, 3, True);
Randoms;
Wait(1500);
FFlag(0);
Wait(500);
Repeat
openbank3;
Tries := Tries + 1;
Until ((BankScreen) Or (Tries > 5));
end;
end;
Function FindFishingSpot(Var x, y: Integer): Boolean;
Var
I, ArrC, MinX, MinY, MaxX, MaxY, FishColor: Integer;
FPt: TPointArray;
Begin
If Not LoggedIn Then Exit;
If x = $0 Then x := $106;
If y = $0 Then y := $AA;
ColorToleranceSpeed(2);
If FindColorSpiralTolerance(x, y, 15181944, 5, 5, 515, 336, 20) Then
Begin
FishColor := GetColor(x, y);
FindColorsSpiralTolerance(x, y, FPt, FishColor, x - 20, y - 20, x + 20, y + 20, 40)
ArrC := GetArrayLength(FPt);
MinX := 1 Shl 10;
MinY := 1 Shl 10;
For I := 0 To ArrC - 1 Do
Begin
MaxX := Max(MaxX, FPt[I].X);
MinX := Min(MinX, FPt[I].X);
MaxY := Max(MaxY, FPt[I].Y);
MinY := Min(MinY, FPt[I].Y);
End;
x := (MaxX + MinX) Shr 1;
y := (MaxY + MinY) Shr 1;
Result := True;
ColorToleranceSpeed(1);
Exit;
End Else WriteLn('Color Not Found.');
ColorToleranceSpeed(1);
End;
Function FindWhirlPool(x, y: integer): Boolean;
Var
FishPoints: TPointArray;
Begin
If Not LoggedIn Then Exit;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x, y, FishPoints, 13947343, x - 20, y - 20, x + 20, y + 20, 40)
If GetArrayLength(FishPoints) > Round(230 * WhirlPoolAcc) Then
Begin
WhirlPools := Whirlpools + 1;
WriteLn(IntToStr(Round(GetArrayLength(FishPoints) / 1600))+ '% Change');
Result := True;
End;
ColorToleranceSpeed(1);
End;
Procedure WalkToTheWillows;
begin
MakeCompass('S');
if (FindSymbol(BX, BY, 'fish')) then
begin
Mouse(BX, BY, 1, 1, True);
wait(4000)
FindNormalRandoms;
randoms;
writeln('woot at willows');
end;
end;
procedure ChopWillows;
begin
GameTab(4);
repeat
WillowLoads:= 0
If InvFull Then
Begin
WillowLoads:= FishLoads+1
If WillowLoads > (WillowLevel) Then
begin
TerminateScript;
end;
if FindObjMultiText2(Ix, Iy, 'Wil', 'ill', 'low', Willow1, 5) then
Mouse(Ix, Iy, 1, 1, True);
FindingEnts;
randoms;
wait(6000 + random(1000));
FindNormalRandoms;
end;
until (InvFull);
end;
/////////////////Chopping/////////////////////////////////
Procedure ChopOakTree;
begin
GameTab(4);
repeat
OakLoads:= 0
If InvFull Then
Begin
OakLoads:= OakLoads+1
If OakLoads > (OakLevel) Then
begin
Tobank;
WalkToTheWillows;
end;
if FindObjMultiText2(Ix, Iy, 'Oa', 'ak', 'Oak', TreeColor2, 5) then
Mouse(Ix, Iy, 1, 1, True);
wait(6000 + random(1000));
FindingEnts;
randoms;
FindNormalRandoms;
end;
until (InvFull);
end;
Procedure WalkToTree1;
begin
RunTo('E', true);
end;
//////////////////////////////////////////////////////////
Function Fish: Boolean;
begin
repeat
FishLoads:= 0
If InvFull Then
Begin
FishLoads:= FishLoads+1
If FishLoads > (FishLevel) Then
begin
Tobank;
WalkToTree1;
end;
if not invfull then
begin
If FindFishingSpot (x, y) Then
Begin
RotateNum := 15000 + Random(20000);
If Not FindWhirlPool(x, y) Then
Begin
Mouse(x, y, 1, 1, True);
findnormalrandoms;
randoms;
end;
end;
end;
end;
until(IsUpText('You cant carry any more fish.'))
end;
//////////////////////////////////////////////////////////
procedure ChopRegTree;
begin
GameTab(4);
repeat
RegularLoads:= 0
If InvFull Then
Begin
RegularLoads:= RegularLoads+1
If RegularLoads > (RegularTree) Then
begin
Tobank;
WalkToTree1;
end;
if FindObjMultiText2(Ix, Iy, 'Tre', 'ree', 'Tree', TreeColor1, 5) then
Mouse(Ix, Iy, 1, 1, True);
wait(6000 + random(1000));
FindingEnts;
randoms;
FindNormalRandoms;
end;
until (InvFull);
end;
Procedure WalkToTree2;
begin
RunTo('E', true);
end;
begin
SetUpSRL;
LoadDTMS;
SetupScript;
DeclarePlayers;
If not (loggedin) then
loginplayer;
begin
Antiban;
WalkTofish;
Fish;
tobank;
antiban;
Walktofish;
end;
begin
AntiBan;
WalkToTree1;
ChopRegTree;
ToBank;
Antiban;
WalkToTree1;
end;
begin
AntiBan;
WalkToTree2;
ChopOakTree;
Tobank;
AntiBan;
WalktoTree2;
end;
begin
antiban;
WalkToTheWillows;
FindNormalRandoms;
ChopWillows;
Tobank;
AntiBan;
WalkToTheWillows;
end;
end.
it compiles can u test it ?