SRL Archive - Archive

4tt4k 0f u - SRL Member Application Form


4tt4k 0f u

2007-05-13 06:50:14

<!– BEGIN TEMPLATE: formanswers –>
4tt4k 0f u - SRL Member Application Form
4tt4k 0f u

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
yes
by starblaster 100 on sythe forums

Programming Knowledge
scar

Other Communitys
sythe

How Long have You Played Runescape
2 years

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

idk about programming but i can script abit

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

{=========================================================================]
[ willo cuter by 4tt4k 0f m3 ]
[ ]
[ NAME : willo cuter by 4tt4k 0f m3 ]
[ WRITER : 4tt4k 0f m3 ]
[ CATEGORY : Woodcutter 0f 4tt4k ]
[ DESCRIPTION : Chops willows in PS and banks them ]
[ USAGE : Start at the willows / in the bank ]
[ AUTOCOLOR : Yes ]
[ ]
[ ]
[=========================================================================]
[ Instructions. ]
[=========================================================================]
[ 1. USE Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in the form (comes when started). ]
[ 4. Start script Logged Out / Logged in ]
[ 5. Set Colors or Leave at Zero to autopick ]
[ 6. Have Axe in First inventoryslot or wielded and more in the bank ]
[ 7. Setup lines below ]
[=========================================================================]
[ Credits to : me and ONLY me 4tt4k 0f m3 ]
[
[=========================================================================}
program SLPSWW;
{.include SRL/SRL.scar}
{.include SRL/SRL/misc/Loading.scar}
{.include SRL/SRL/misc/Trade.scar}
{.include SRL/SRL/skill/WoodCutting.scar}


const
PartOfRCName = ''; // Your .Nick for your Remote Controll man
UsePlayerForm = True; // If false, then DeclarePlayers(below) is used.

//***********_Setup if wanted.._**********\\
const
MaxSecToWait = 15; // Will check for wc axe every x sec
MaxLoginTime = 25; // Per playerturn - in minuts
RanLoginTime = 3; // + x mins random time
StartPlayer = 0; // Player to start with
MinzCount = 6; // If it fails to find trees - lower this.
MinWCount = 20; // Lower if it fails to find trees
MinHCount = 20; // Lower this together with MinWCount

//***********_No need to setup these_**********\\
const
DebugStyle = 'None'; // Write / Disguise / Status / None.
RunDir = 'N'; // Changing wouldn't be necessary..
RunFar = True; // Same here
gMouseSpeed = 20; // Adds a random of 5
MMLadder = 1062250; // Autocolor doesnt work all to well...
MSTreeColor = 4350048; // Currently you don't need to change this

//***********_Don't change_**********\\
const
VersionNumber = '0.96';
MinHue = 10;
MaxHue = 34;
MaxFenceCount = 7;

//------------------------------------------------------------------------\\
{ DeclarePlayers - Sets Player array. ||
\\------------------------------------------------------------------------//}

procedure DeclarePlayers;
begin
HowManyPlayers := 6;
CurrentPlayer := StartPlayer;
NumberOfPlayers(HowManyPlayers); // set arraylength

Players[0].Name :='Username';
Players[0].Pass :='Password';
Players[0].Nick :='sern';
Players[0].Active:= True;
Players[0].String1 := '0000';//PinNumber
Players[0].String2 := 'bank';

Players[1].Name :='Username';
Players[1].Pass :='Password';
Players[1].Nick :='sern';
Players[1].Active:= True;
Players[1].String1 := '0000';
Players[1].String2 := 'bank';

Players[2].Name :='Username';
Players[2].Pass :='Password';
Players[2].Nick :='sern';
Players[2].Active:= True;
Players[2].String1 := '0000';
Players[2].String2 := 'bank';

Players[3].Name :='Username';
Players[3].Pass :='Password';
Players[3].Nick :='sern';
Players[3].Active:= True;
Players[3].String1 := '0000';
Players[3].String2 := 'bank';

Players[4].Name :='Username';
Players[4].Pass :='Password';
Players[4].Nick :='sern';
Players[4].Active:= True;
Players[4].String1 := '0000';
Players[4].String2 := 'bank';

Players[5].Name :='Username';
Players[5].Pass :='Password';
Players[5].Nick :='sern';
Players[5].Active:= True;
Players[5].String1 := '0000';
Players[5].String2 := 'bank';
end;

type
RespondType = record
Question: array of string;
Answer: Integer;
end;

{ FORM variables }

var
SLPSWWForm : TForm;
mMemoBox : TMemo;
bNews : TButton;
bVersionCheck : TButton;
bSetupUsers : TButton;
bReportBug : TButton;
bStartScript : TButton;
bBestReport : TButton;

{ SCRIPT variables }

var
LadderColor, FarmingColor, QuestColor, WaterSymbolColor, BarColor, BankCount: Integer;
LogMask, LogsChopped, Loads, gPlayerTime, gRanTime, gWillowFailSafes: Integer;
HeadColor: array[0..2] of Integer;
gBrokenAxe, PlayerStatus: Boolean;
PinNumber: string;

{ AUTO CHATTER variables }
var
OldChatText, NewChatText, OldChatter, NewChatter: string;
arChatLines: array of RespondType;

procedure DebugMe(aString: string);
begin
case LowerCase(DebugStyle) of
'write' : WriteLn(astring);
'disguise' : DisguiseScar(astring);
'status' : Status(astring);
end;
end;

//------------------------------------------------------------------------\\
{ ChangeLoc - Changes the Loc of the player ||
\\------------------------------------------------------------------------//}

procedure ChangeLoc(aString: string);
begin
Players[CurrentPlayer].String2 := LowerCase(aString);
WriteLn('We are at ' + aString);
end;

//------------------------------------------------------------------------\\
{ PlayerLost - Logs out player when lost ||
\\------------------------------------------------------------------------//}

procedure PlayerLost(Info:string);
begin
Writeln('Player Lost, '+ Info);
Logout;
end;

//------------------------------------------------------------------------\\
{ ProgressReport - Prints the progressreport ||
\\------------------------------------------------------------------------//}

procedure ProgressReport;//Made by Fakawi, i think, edited by Sumilion
var
PActive, Spaces: string;
i, K, MaxSpace, SpaceNumber: Integer;
begin
SRLRandomsReport;
If Players[CurrentPlayer].Active then PActive:='True' else PActive:='False';
Writeln(' ');
Writeln('//=============== SL PSWW ================\\');
Writeln('\\======== -'+VersionNumber+'- Progress Report ========//');
Writeln('/==========================================\');
Writeln('| Worked for '+ TimeRunning);
Writeln('| Chopped '+ IntToStr(LogsChopped)+(' logs.'));
Writeln('| Banked '+ IntToStr(Loads)+(' times.'));
Writeln('\==========================================/');
Writeln(' Name : '+Players[CurrentPlayer].Name);
Writeln(' Wcing Lvl : '+IntToStr(Players[CurrentPlayer].Level[20]));
Writeln(' Worked for : '+IntToStr(Players[CurrentPlayer].Worked)+' minutes.');
Writeln(' Active : '+PActive);
Writeln(' Location : '+Players[CurrentPlayer].String2);
Writeln('\\----------------------------------------//');
for i := 0 to HowManyPlayers-1 do
if(Length(Players[I].Name) > MaxSpace)then
MaxSpace := Length(Players[I].Name);
for i := 0 to HowManyPlayers-1 do
begin
SpaceNumber := MaxSpace - Length(Players[I].Name);
for K := 0 to SpaceNumber do
Spaces := Spaces + ' ';
if Players[i].Active=True then PActive:='True' else PActive:='False';
Writeln( (IntToStr(I))+': '+ Players[I].Name + Spaces+ '= '+PActive+
' , Wc lvl : '+IntToStr(Players[i].Level[20])+
' , Worked '+IntToStr(Players[i].Worked)+ ' minutes, '+
'Loc: '+Players[i].String2)
Spaces := '';
end;
Writeln('\\========================================//');
if(ScriptTime(3) > StrToIntDef(LoadSetting('PSWW', 'LongestTime'), 0))then
begin
Writeln('Saved Proggie!');
SaveSetting('PSWW', 'LongestTime', IntToStr(ScriptTime(3)));
SaveSetting('PSWW', 'BestTime', TimeRunning);
SaveSetting('PSWW', 'BestLogs', IntToStr(LogsChopped));
SaveSetting('PSWW', 'BestBanks', IntToStr(Loads));
end;
end;

//------------------------------------------------------------------------\\
{ LoadBMPs - Loads LOTS of bmps in the memory ^^. ||
\\------------------------------------------------------------------------//}

procedure LoadBMPs;
begin
LogMask := BitmapFromString(13, 10, 'z78DA33301805E40037BC8' +
'0BAB6D0C2E5F451494998D02E5471010034299979');
end;

//------------------------------------------------------------------------\\
{ BestProgressReport - Writes the best progress report made. ||
\\------------------------------------------------------------------------//}

procedure BestProgressReport;
begin
if(LoadSetting('PSWW', 'BestTime') = '')then
begin
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('Currently unavailable.');
Exit;
end;
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('//=========== SL PSWW ===========\\');
mMemoBox.Lines.Add('\\====== -Best- Progress Report ========//');
mMemoBox.Lines.Add('/===============================\');
mMemoBox.Lines.Add('| Worked for '+ LoadSetting('PSWW', 'BestTime'));
mMemoBox.Lines.Add('| Chopped '+ LoadSetting('PSWW', 'BestLogs')+(' logs.'));
mMemoBox.Lines.Add('| Banked '+ LoadSetting('PSWW', 'BestBanks')+(' times.'));
mMemoBox.Lines.Add('\===============================/');
end;

//------------------------------------------------------------------------\\
{ WriteNews - Writes the News. ||
\\------------------------------------------------------------------------//}

procedure WriteNews(HowMany: Integer);//Thnx to StarBlaster
var
Timer, i, x, y: Integer;
News :array of string;
New, TheNews: string;
begin
SetArrayLength(News, HowMany+1);
Wait(1);
TheNews := Getpage('http://sumilionscripts.freehostia.com/PSWWNews.txt');
x := 0;
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('//==============================\\');
mMemoBox.Lines.Add('| >> PSWW News (v' + VersionNumber + ')');
mMemoBox.Lines.Add('|');
y := 1;
for i := 1 to HowMany do
begin
MarkTime(Timer);
repeat
x := x + 1;
new := copy(TheNews, x, x+1);
if(new = '|')then
begin
i := HowMany;
Break;
end;
until(copy(new, 1, 1) = ',')or(TimeFromMark(Timer) >= 2000);
news[i]:= copy(TheNews, y, (x-y));
y := x + 1;
mMemoBox.Lines.Add('| -- '+news[i]);
Wait(1);
end;
mMemoBox.Lines.Add('|');
mMemoBox.Lines.Add('\\==============================//');
end;

//------------------------------------------------------------------------\\
{ CheckVersion - Checks the current version. ||
\\------------------------------------------------------------------------//}

procedure CheckVersion;
var
CurrentVersion: Extended;
begin
CurrentVersion := StrToFloat(GetPage('http://sumilionscripts.freehostia.com/PSWWVersion.txt'));
if(CurrentVersion > StrToFloat(VersionNumber))then
begin
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('Your current version is outdated.');
mMemoBox.Lines.Add('Contact Lorax or Sumilion for an update.');
Exit;
end;
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('You are up to date.');
end;

//------------------------------------------------------------------------\\
{ FormStuff - Different stuff for the form. ||
\\------------------------------------------------------------------------//}

procedure ButtonClick(Sender: TObject);
begin
case Sender of
bStartScript :
begin
SLPSWWForm.Caption:= SLPSWWForm.Caption + '.';
SLPSWWForm.ModalResult:= mrOk;
end;
bSetupUsers :
begin
StartPlayers(true, 'string1 string2');
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('Players Saved.');
end;
bReportBug :
begin
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('Currently unavailable.');
end;
bVersionCheck :
CheckVersion;
bNews :
WriteNews(10);
bBestReport :
BestProgressReport;
end;
end;

{Normal Form}
procedure LoadSLPSWWForm;
begin
SLPSWWForm := CreateForm;
SLPSWWForm.Left := 250;
SLPSWWForm.Top := 114;
SLPSWWForm.Width := 439;
SLPSWWForm.Height := 351;
SLPSWWForm.Caption := 'SL PSWW - Form';
SLPSWWForm.Color := clBtnFace;
SLPSWWForm.Font.Color := clWindowText;
SLPSWWForm.Font.Height := -11;
SLPSWWForm.Font.Name := 'MS Sans Serif';
SLPSWWForm.Font.Style := [];
SLPSWWForm.Visible := False;
SLPSWWForm.PixelsPerInch := 96;
mMemoBox := TMemo.Create(SLPSWWForm);
mMemoBox.Font.Name := 'Segoe UI';
mMemoBox.Font.Height := -12;
mMemoBox.Parent := SLPSWWForm;
mMemoBox.Left := 134;
mMemoBox.Top := 16;
mMemoBox.Width := 272;
mMemoBox.Height := 225;
mMemoBox.Lines.Add('Thank you for using the PSWW. Be on the lookout for an EYC!!! (Edge Yew Chopper)');
mMemoBox.TabOrder := 4;
bNews := TButton.Create(SLPSWWForm);
bNews.Parent := SLPSWWForm;
bNews.Left := 30;
bNews.Top := 20;
bNews.Width := 83;
bNews.Height := 25;
bNews.Caption := 'News';
bNews.TabOrder := 0;
bNews.OnClick := @ButtonClick;
bVersionCheck := TButton.Create(SLPSWWForm);
bVersionCheck.Parent := SLPSWWForm;
bVersionCheck.Left := 30;
bVersionCheck.Top := 55;
bVersionCheck.Width := 83;
bVersionCheck.Height := 25;
bVersionCheck.Caption := 'Version Check';
bVersionCheck.TabOrder := 1;
bVersionCheck.OnClick := @ButtonClick;
bSetupUsers := TButton.Create(SLPSWWForm);
bSetupUsers.Parent := SLPSWWForm;
bSetupUsers.Left := 30;
bSetupUsers.Top := 160;
bSetupUsers.Width := 83;
bSetupUsers.Height := 25;
bSetupUsers.Caption := 'Setup Users';
bSetupUsers.TabOrder := 4;
bSetupUsers.OnClick := @ButtonClick;
bStartScript := TButton.Create(SLPSWWForm);
bStartScript.Parent := SLPSWWForm;
bStartScript.Left := 163;
bStartScript.Top := 266;
bStartScript.Width := 197;
bStartScript.Height := 25;
bStartScript.Caption := 'Start Script!';
bStartScript.TabOrder := 5;
bStartScript.OnClick := @ButtonClick;
bReportBug := TButton.Create(SLPSWWForm);
bReportBug.Parent := SLPSWWForm;
bReportBug.Left := 30;
bReportBug.Top := 90;
bReportBug.Width := 83;
bReportBug.Height := 25;
bReportBug.Caption := 'Report Bug';
bReportBug.TabOrder := 2;
bReportBug.OnClick := @ButtonClick;
bBestReport := TButton.Create(SLPSWWForm);
bBestReport.Parent := SLPSWWForm;
bBestReport.Left := 30;
bBestReport.Top := 125;
bBestReport.Width := 83;
bBestReport.Height := 25;
bBestReport.Caption := 'Best Report';
bBestReport.TabOrder := 3;
bBestReport.OnClick := @ButtonClick;
end;

procedure ShowFormModal;
begin
SLPSWWForm.ShowModal;
end;

procedure Signature; forward;
procedure ShowNormalForm;
var
v: TVariantArray;
begin
Signature;
SetArrayLength(V, 0);
ThreadSafeCall('LoadSLPSWWForm', v);
SetArrayLength(v, 0);
ThreadSafeCall('ShowFormModal', v);
end;

//------------------------------------------------------------------------\\
{ LoadChatArray - Loads Chat text in the memory. ||
\\------------------------------------------------------------------------//}

procedure LoadChatArray;
begin
SetArrayLength(arChatLines, 20);
//b
SetArrayLength(arChatLines[0].Question, 1);
arChatLines[0].Question[0] := 'ban';
arChatLines[0].Answer := 2;
//c
SetArrayLength(arChatLines[1].Question, 1);
arChatLines[1].Question[0] := 'cheat';
arChatLines[1].Answer := 2;
//g
SetArrayLength(arChatLines[2].Question, 1);
arChatLines[2].Question[0] := 'gf';
arChatLines[2].Answer := 3;
SetArrayLength(arChatLines[3].Question, 1);
arChatLines[3].Question[0] := 'girl friend';
arChatLines[3].Answer := 3;
//h
SetArrayLength(arChatLines[4].Question, 1);
arChatLines[4].Question[0] := 'hi';
arChatLines[4].Answer := 0;
SetArrayLength(arChatLines[5].Question, 1);
arChatLines[5].Question[0] := 'hey';
arChatLines[5].Answer := 0;
SetArrayLength(arChatLines[6].Question, 1);
arChatLines[6].Question[0] := 'hello';
arChatLines[6].Answer := 0;
SetArrayLength(arChatLines[7].Question, 1);
arChatLines[7].Question[0] := 'how are';
arChatLines[7].Answer := 1;
//r
SetArrayLength(arChatLines[8].Question, 1);
arChatLines[8].Question[0] := 'report';
arChatLines[8].Answer := 2;
//w
SetArrayLength(arChatLines[9].Question, 3);
arChatLines[9].Question[0] := 'wc';
arChatLines[9].Question[1] := '+level';
arChatLines[9].Question[2] := '+lvl';
arChatLines[9].Answer := 4;
SetArrayLength(arChatLines[10].Question, 3);
arChatLines[10].Question[0] := 'woodcut';
arChatLines[10].Question[1] := '+level';
arChatLines[10].Question[2] := '+lvl';
arChatLines[10].Answer := 4;
end;

//------------------------------------------------------------------------\\
{ LoadAnswer - Loads answers in the memory. ||
\\------------------------------------------------------------------------//}

function LoadAnswer(AnswerType: Integer): string;
begin
case AnswerType of
0: begin
case Random(5) of
0: Result := 'hi';
1: Result := 'hey';
2: Result := 'whats up?';
3: Result := 'hello';
4: Result := 'hey you';
end;
end;
1: begin
case Random(4) of
0: Result := 'fine';
1: Result := 'good';
2: Result := 'ok';
3: Result := 'splendid';
end;
end;
2: begin
case Random(6) of
0: Result := 'why?';
1: Result := 'me?';
2: Result := 'sure';
3: Result := 'if you feel like it';
4: Result := 'please don''t';
5: Result := 'that''s not nice';
end;
end;
3: begin
case Random(5) of
0: Result := 'lol';
1: Result := 'ew';
2: Result := 'haha';
3: Result := 'go away!';
4: Result := 'let''s not';
end;
end;
end;
end;

//------------------------------------------------------------------------\\
{ getChatter - Gets the chatters name. ||
\\------------------------------------------------------------------------//}

function getChatter(MyLine: string): string;
var
Count: Integer;
begin
for Count := 1 to Length(MyLine) do
if(MyLine[Count] = ':')then
begin
Result := LowerCase(Copy(MyLine, Count, 1));
Exit;
end;
end;

//------------------------------------------------------------------------\\
{ CompareStrings - Compares the string. ||
\\------------------------------------------------------------------------//}

function CompareStrings(comText: string; var count: Integer): Boolean;
var
bolMatch: array of Boolean;
Count2, Count3: Integer;
tmpString: string;
begin
for Count := 0 to GetArrayLength(arChatLines) - 1 do
begin
Count3 := 0;
SetArrayLength(bolMatch, Count3);
for Count2 := 0 to GetArrayLength(arChatLines[Count]) - 1 do
begin
if(arChatLines[Count].Question[Count2][1] = '+')then
begin
if(Count2 <> 0)then
begin
if(arChatLines[Count].Question[Count2-1][1] <> '+')then
begin
Count3 := Count3 + 1;
SetArrayLength(bolMatch, Count3);
end;
end else
begin
Count3 := Count3 + 1;
SetArrayLength(bolMatch, Count3);
end;
tmpString := Copy(arChatLines[Count].Question[Count2], 2, Length(arChatLines[Count].Question[Count2]));
if(bolMatch[Count3 - 1] <> true)then
if(Pos(tmpString, comText) <> 0)then
bolMatch[Count3 - 1] := True;
end else
begin
Count3 := Count3 + 1;
SetArrayLength(bolMatch, Count3);
tmpString := arChatLines[Count].question[Count2];

if(Pos(tmpString, comText) <> 0)then
bolMatch[Count3 - 1] := True;
end;
end;
Result := True;
for Count3 := 0 to GetArrayLength(bolMatch) - 1 do
if(bolMatch[Count] = false)then
Result := false;
if Result then
Exit;
end;
end;

//------------------------------------------------------------------------\\
{ ChatBack - Should we chat ? ||
\\------------------------------------------------------------------------//}

function ChatBack: Boolean;
var
MyAnswer: string;
Count: Integer;
begin
OldChatText := NewChatText;
OldChatter := NewChatter;
NewChatText := getNewChatMsg;
NewChatter := getChatter(NewChatText);

if(NewChatter = '')then
Exit;

if(NewChatter <> LowerCase(Players[CurrentPlayer].Nick))and
(OldChatText <> NewChatText)then
begin

if CompareStrings(NewChatText, Count)then
begin
Result := True
end;

if Result then
begin
MyAnswer := LoadAnswer(arChatLines[Count].Answer);
TypeSend(MyAnswer);
end;
end;
end;

//******_Anti Randoms_******\\
//------------------------------------------------------------------------\\
{ FindFastRandoms - Finds basic randoms ||
\\------------------------------------------------------------------------//}

function FindFastRandoms: Boolean; //WT-Fawki
var
i: Integer;
begin
for i:=1 to 10 do
begin
case I of
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
ChangeLoc('No GameTab');
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
ChangeLoc('InBlack');
Logout;
Exit;
end;
end;
8: if(RC)or(HandleTrade)then
Result := True;
9: if FindTalk then
Result := True;
10: if ChatBack then
Result := True;
end;
wait(1);
end;
end;

//******_Math procedures_******\\
//------------------------------------------------------------------------\\
{ FindColorsArray - Finds Raw colors ||
\\------------------------------------------------------------------------//}

function FindColorsArray(Color, Tolerance, Step, MaxTol: Integer): TPointArray;
var
Count, tx, ty: Integer;
begin
while (not FindColorTolerance(tx, ty, Color, MSX1, MSY1, MSCX, MSY2, Tolerance + Count * Step))and
(Count * Step <= MaxTol) do
Count := Count + 1;
FindColorsSpiralTolerance(MSCX, MSCY, Result, Color, MSX1, MSY1, MSCX, MSY2, Tolerance + Count * Step);
end;

//------------------------------------------------------------------------\\
{ getArrayFromBox - Gets colors in groups ||
\\------------------------------------------------------------------------//}

function getArrayFromBox(arColor: TPointArray; Width, Height: Integer): TPointArray;
var
Count, Count2, Count3: Integer;
Match: Boolean;
begin
Count2 := 1;
SetArrayLength(Result, Count2);
Result[Count2 - 1].x := arColor[0].x;
Result[Count2 - 1].y := arColor[0].y;
for Count := 1 to GetArrayLength(arColor) - 1 do
begin
Match := False;
for Count3 := 0 to GetArrayLength(Result) - 1 do
begin
if(arColor[Count].x < Result[Count3].x + Width)and
(arColor[Count].y < Result[Count3].y + Height)and
(arColor[Count].x > Result[Count3].x - Width)and
(arColor[Count].y > Result[Count3].y - Height)then
Match := True;
end;
if(Match = False)then
begin
Count2 := Count2 + 1;
SetArrayLength(Result, Count2);
Result[Count2 - 1].x := arColor[Count].x;
Result[Count2 - 1].y := arColor[Count].y;
end;
end;
end;

//------------------------------------------------------------------------\\
{ CheckColor - Checks that we haven't found a player ||
\\------------------------------------------------------------------------//}

function CheckColor(ax, ay: Integer): Boolean;
var
xCount, yCount, zCount: Integer;
begin
for xCount := 0 to 4 do
for yCount := 0 to 4 do
if SimilarColors(GetColor(ax - 2 + xCount, ay - 2 + yCount), 16183532, 15) then
zCount := zCount + 1;

if(zCount <= MaxFenceCount)then
Result := True;
end;

//------------------------------------------------------------------------\\
{ IsFenceInLine - Checks for fence between two points ||
\\------------------------------------------------------------------------//}

function IsFenceInLine(var ax, ay: Integer; x1, y1, x2, y2, fromPercent, toPercent: Integer): Boolean;
var
a, b: Extended;
t1, t2, Count: Integer;
begin
t1 := x1; t2 := x2;
x1 := Min(t1, t2);
x2 := Max(t1, t2);
if x1 <> t1 then begin t1 := y1; t2 := y2; y1 := t2; y2 := t1; end;
t1 := -y1;
t2 := -y2;
a := (t2 - t1) div (x2 - x1);
b := t1 - (a * x1);

for Count := Trunc((fromPercent div 100.0) * (x2 - x1)) to Trunc((toPercent div 100.0) * (x2 - x1)) - 1 do
begin
ax := Count + x1;
ay := Trunc(-1 * (a * ax + b));
if SimilarColors(GetColor(ax, ay), 16183532, 15) then
begin
if CheckColor(ax, ay) then
begin
Result := True;
Exit;
end;
end;
end;
end;

//******_Walking procedures_******\\
//------------------------------------------------------------------------\\
{ SLWaterWalk - Walks along the water / road ||
\\------------------------------------------------------------------------//}

function SLWaterWalk(StartRadial, EndRadial: Integer; Radius,
FFlagBreakOut: Integer; Xoff, Yoff, Xmod, Ymod: Integer): Boolean;
// By Wizzup? and WT-Fakawi.
var
i, X1, Y1: Integer;
begin
Result := False;
if not(LoggedIn)then
Exit;
if (StartRadial < EndRadial) then
begin
repeat
for i := StartRadial to EndRadial do
begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
if FindColor(x, y, RoadColor, X1, Y1, X1 + 1, Y1 + 1) then
begin
MouseFindNoFlag(x + Xoff, y + Yoff, Xmod, Ymod);
Result := True;
FFlag(FFlagBreakOut);
Exit;
end;
end;
Radius := Radius - 4;
until Radius <= 1;
end;
if (StartRadial > EndRadial) then
begin
repeat
for i := StartRadial downto EndRadial do
begin
x1 := Round(Radius * Sine(i)) + 646;
y1 := Round(-Radius * Cose(i)) + 84;
if (FindColor(x, y, RoadColor, X1, Y1, X1 + 1, Y1 + 1)) then
begin
MouseFindNoFlag(x + Xoff, y + Yoff, Xmod, Ymod);
Result := True;
FFlag(FFlagBreakOut);
Exit;
end;
end;
Radius := Radius - 4;
until Radius <= 1;
end;
end;

//------------------------------------------------------------------------\\
{ SLGetSymbol - Lowers acc for better finding ||
\\------------------------------------------------------------------------//}

function SLGetSymbol(var ax, ay: Integer; Symbol: string): Integer;
begin
SymbolAccuracy := 0.7;
if(Lowercase(Symbol) = 'bank')then
SymbolAccuracy := 0.3;
Result := GetSymbolColor(ax, ay, Symbol);
DebugMe(IntToStr(ax)+' '+IntToStr(ay));
SymbolAccuracy := 0.8;
end;

//------------------------------------------------------------------------\\
{ GotColor - Do we got the wanted color ? ||
\\------------------------------------------------------------------------//}

function GotColor(ColorType: string): Boolean;
begin
case LowerCase(ColorType) of
'bank' : Result := (BankColor > 0);
'road' : Result := (RoadColor > 0);
'ladder': Result := (LadderColor > 0);
'quest' : Result := (QuestColor > 0);
'farm' : Result := (FarmingColor > 0);
end;
if not(Result)then
begin
Writeln(ColorType + 'Color NOT found, setting to false');
LogOut;
end;
end;

//------------------------------------------------------------------------\\
{ RelocateAtWillows - Resets player ||
\\------------------------------------------------------------------------//}

procedure RelocateAtWillows;
var
ax, ay: Integer;
begin
if not(LoggedIn)then
Exit;
MakeCompass('N');
if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
begin
MouseFindNoFlag(ax + 10, ay + 15, 5, 5);
FFlag(0);
Exit;
end;

if(QuestColor = 0)then
QuestColor := SLGetSymbol(ax, ay, 'quest');
if(QuestColor <> 0)then
if FindColor(ax, ay, QuestColor, MMX1, MMCY, MMX2, MMY2) then
begin
MouseFindNoFlag(ax + 20, ay - 20, 4, 4);
FFlag(0);
Exit;
end;

if(BarColor = 0)then
BarColor := SLGetSymbol(ax, ay, 'bar');
if(BarColor <> 0)then
if FindColor(ax, ay, BarColor, MMX1, MMY1, MMX2, MMY2) then
begin
MouseFindNoFlag(ax + 30, ay + 10, 4, 4);
FFlag(0);
Exit;
end;

WriteLn('We didn''t find any points - while relocating');
LogOut;
end;

//------------------------------------------------------------------------\\
{ BankToWillows - Walks to the willows ||
\\------------------------------------------------------------------------//}

procedure BankToWillows;
var
ax, ay, Count: Integer;
begin
if LoggedIn then
begin
MouseSpeed := 5 + Random(5);
MakeCompass('N');
WriteLn('Bank to willows');
FindRoadColor;
GotColor('Road');
BankColor := SLGetSymbol(ax, ay, 'bank');
GotColor('Bank');
if(LadderColor = 0)then
begin
LadderColor := FindLadderColor;
GotColor('Ladder');
end;

SLWaterWalk(300, 220, 60, 8, 0, 0, 3, 3);

if(QuestColor = 0)then
QuestColor := SLGetSymbol(ax, ay, 'quest');

if(QuestColor = 0)then
begin
Wait(500 + Random(100));
FFlag(0);
QuestColor := SLGetSymbol(ax, ay, 'quest');
if(QuestColor = 0)then
begin
FindRoadColor;
SLWaterWalk(280, 220, 50, 0, 0, 0, 0, 0);
QuestColor := SLGetSymbol(ax, ay, 'quest');
end;
end;
GotColor('Quest');

MouseFindNoFlag(ax - 22, ay, 3, 3);
FFlag(10);

for Count := 3 downto 0 do
begin
if(SLGetSymbol(ax, ay, 'farming spot') <> 0)and(ay - 25 > 25)then
Break;
if(QuestColor <> 0)then
if FindColor(ax, ay, QuestColor, MMX1, MMY1, MMX2, MMY2) then
MouseFindNoFlag(ax - 22 - 24 + (Count * 6), ay, 3, 3);
FFlag(0);
end;

if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
begin
MouseFindNoFlag(ax + 20 + Random(5), ay - 25 - Random(3), 0, 0);
if(not FlagPresent)then
Wait(3000 + Random(1000));
end else
begin
if FindColor(ax, ay, QuestColor, MMX1, MMY1, MMX2, MMY2) then
MouseFindNoFlag(ax - 50, ay - 30, 3, 3);
end;

FFlag(0);
if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
MouseFindNoFlag(ax + 10, ay + 15, 5, 5)
else
begin
WriteLn('Didn''t find farm spot number 2 - trying again');
FFlag(0);
if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
begin
MouseFindNoFlag(ax + 10, ay + 15, 5, 5);
FFlag(0);
end else
begin
WriteLn('Didn''t find farm spot number 2 second try');
for Count := 0 to 2 do
begin
WriteLn('Making blind click');
MouseFindNoFlag(635, 105, 5, 5);
FFlag(0);
if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
begin
Count := -1;
Break;
end;
end;
if(Count <> 2)then
MouseFindNoFlag(ax + 10, ay + 15, 5, 5)
else
begin
WriteLn('Didn''t find farm spot number 2 - setting active: false');
LogOut;
Exit;
end;
end;
end;

FFlag(0);
ChangeLoc('willows');
MouseSpeed := gMouseSpeed + Random(5);
end;
end;

//------------------------------------------------------------------------\\
{ WillowsToBank - Walks to the bank ||
\\------------------------------------------------------------------------//}

procedure WillowsToBank;
var
ax, ay, bx, by, cx, cy, Count: Integer;
begin
if LoggedIn then
begin
MouseSpeed := 5 + Random(5);
MakeCompass('N');
WriteLn('Willows to bank');
if(FarmingColor = 0)then
FarmingColor := SLGetSymbol(ax, ay, 'farming spot');
GotColor('Farm');

if(QuestColor = 0)then
QuestColor := SLGetSymbol(ax, ay, 'quest');
GotColor('Quest');

while(not FindColor(bx, by, QuestColor, 678, MMY1, MMX2, MMY2))and
(Count <= 24)do
begin
if FindColor(ax, ay, FarmingColor, MMX1, MMY1, MMX2, MMY2) then
MouseFindNoFlag(ax + 10 + Count, ay, 3, 3);
FFlag(0);
Count := Count + 6;
end;

if Count = 30 then
begin
RelocateAtWillows;
WillowsToBank;
end;

if(FindColor(ax, ay, FarmingColor, MMX1, MMY1, MMX2, MMY2))and
(FindColor(bx, by, QuestColor, 678, MMY1, MMX2, MMY2))then
begin
if IsFenceInLine(cx, cy, ax, ay, bx, by, 40, 60)then
begin
WriteLn('Used fence');
MouseFindNoFlag(cx + 8, (by + ay) div 2 - 25, 3, 3);
end else
MouseFindNoFlag( Trunc(ax * 0.3 + bx * 0.7), (by + ay) div 2 - 25, 3, 3);
end;

FFlag(0);
if(FindColor(bx, by, QuestColor, MMCX, MMY1, MMX2, MMY2))then
MouseFindNoFlag(bx, by, 3, 3);
if(RoadColor = 0)then
FFlag(0)
else
FFlag(10);
FindRoadColor;
GotColor('Road');
for Count := 0 to 2 do
begin
SLWaterWalk(150, 80, 60, 10, 0, 0, 4, 4);
FindRoadColor;
BankColor := SLGetSymbol(ax, ay, 'bank');
if(BankColor <> 0)then
Break;
end;

if(BankColor <> 0)then
begin
if(FindColor(ax, ay, BankColor, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(ax, ay, 5, 5, true);
FFlag(0);
end;
end else
if(LadderColor <> 0)then
begin
if(FindColor(ax, ay, LadderColor, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(ax + 20, ay + 40, 5, 5, true);
FFlag(0);
end;
end else
begin
WriteLn('Sorry we couldn''t find Ladder or BankColor - terminating');
LogOut;
Exit;
end;

ChangeLoc('bank');
MouseSpeed := gMouseSpeed + Random(5);
end;
end;

//******_AxeHead procedures_******\\
//------------------------------------------------------------------------\\
{ FindBestAxe - Gets best axe in the bank ||
\\------------------------------------------------------------------------//}

function FindBestAxe(var fx, fy: Integer; InBank: Boolean): Boolean;
var
I, x1, y1, x2, y2 : Integer;
dtmAxes: Array[1..6] of integer;
begin
if LoggedIn then
begin
dtmAxes[1] := DTMFromString('78DA637461626078CC8002EA627919B880342' +
'310FF0702C600A09A9BA86A1CC2121858A16A4080D10FA8E63EAA' +
'1A538F0054355E98E6B8C566A2A801004FC20C7D'); //rune
dtmAxes[2] := DTMFromString('78DA638C6460606864400155D1BC0C5C409A1' +
'188FF0301630A90518FAAC6C2C3828115AA060418D3804405AA1A' +
'3B7F3B5435F1986A5C22DC50D40000CFF90AD7'); //addy
dtmAxes[3] := DTMFromString('78DA63CC63626078C48002AAA27919B880342' +
'310FF0702C66AA09A9BA86AAC6DA31858A16A4080B104538DA373' +
'32AA9A4AA09A07A86A4C4D0350D400007A240CC5'); //mith
dtmAxes[4] := DTMFromString('78DA633CC3C4C0A0CCC8800C6A4B4A1858813' +
'448F43F10309E07AA5147559326C6095703028C87806A7450D5B4' +
'A6F2A1AA390254A382AAA629094DCD7EA01A3354356591686A4E6' +
'0BA393D211E450D0018290FAB'); //steel - remade
dtmAxes[5] := DTMFromString('78DA63DCC5C0C010C880029A127919B880342' +
'310FF0702C623404600AA1A3747470656A81A10603C06243C51D5' +
'F87B78A0AAD98FA9262C2000450D00288E0BE1'); //iron
dtmAxes[6] := DTMFromString('78DA637465626078C480023A530518B880342' +
'310FF0702C640A09A9BA86ABC2C141858A16A4080D11FA8E601AA' +
'1A47231954355E4035B7F09B03002D2F0B9B'); //bronze
for I := 1 to 7 do
begin
if(I = 7)then
Break;
if(InBank)then
begin
x1 := MSX1; y1 := MSY1; x2 := MSX2; y2 := MSY2;
end else
begin
x1 := MIX1; y1 := MIY1; x2 := MIX2; y2 := MIY2;
end;
if(FindDtm(dtmAxes[I], fx, fy, x1, y1, x2, y2))then
begin
Result := True;
Break;
end;
end;
if(I = 7)then
PlayerLost('We didn''t have an axe - FindBestAxe');
for I := 1 to 6 do
FreeDtm(dtmAxes[I]);
end;
end;

//------------------------------------------------------------------------\\
{ SLFindAxeHeadColor - Finds axe at the player ||
\\------------------------------------------------------------------------//}

function SLFindAxeHeadColor: Boolean;
var
InvAxe, WieldAxe, Ix, Iy: integer;
dtmAxes: Array[1..6] of integer;
begin
if LoggedIn then
begin
dtmAxes[1] := DTMFromString('78DA637461626078CC8002EA627919B880342' +
'310FF0702C600A09A9BA86A1CC2121858A16A4080D10FA8E63EAA' +
'1A538F0054355E98E6B8C566A2A801004FC20C7D'); //rune
dtmAxes[2] := DTMFromString('78DA638C6460606864400155D1BC0C5C409A1' +
'188FF0301630A90518FAAC6C2C3828115AA060418D3804405AA1A' +
'3B7F3B5435F1986A5C22DC50D40000CFF90AD7'); //addy
dtmAxes[3] := DTMFromString('78DA63CC63626078C48002AAA27919B880342' +
'310FF0702C66AA09A9BA86AAC6DA31858A16A4080B104538DA373' +
'32AA9A4AA09A07A86A4C4D0350D400007A240CC5'); //mith
dtmAxes[4] := DTMFromString('78DA637461626078CC80021A13F9184480342' +
'310FF0702467FA09A07A86A72D3D218B8A06A40803110A8E626AA' +
'9AF2BC5C54355E986A9AAAAA50D4000094B60DD3'); //steel
dtmAxes[5] := DTMFromString('78DA630C666260506364400641DEDE0CAC401' +
'A24FA1F081823806AB450D5A48A72C2D580006324508D3AAA9A4C' +
'7435614035AAB8ED82ABD1C0AF060097330A65'); //iron - made by Lorax
dtmAxes[6] := DTMFromString('78DA637465626078C480023A530518B880342' +
'310FF0702C640A09A9BA86ABC2C141858A16A4080D11FA8E601AA' +
'1A47231954355E4035B7F09B03002D2F0B9B'); //bronze
GameTab(4);
for InvAxe := 1 to 7 do
begin
if(InvAxe = 7)then Break;
if(FindDtm(dtmAxes[InvAxe], Ix, Iy, MIX1, MIY1, MIX2, MIY2))then
Break;
end;
GameTab(5);
for WieldAxe := 1 to 7 do
begin
if(WieldAxe = 7)then Break;
if(FindDtm(dtmAxes[WieldAxe], x, y, MIX1, MIY1, MIX2, MIY2))then
Break;
end;

if(InvAxe = 7)and(WieldAxe = 7)then
begin
Result := False;
Exit;
end;
if((InvAxe-WieldAxe) < 0)then
EquipAxe := False
else
EquipAxe := True;
Result := true;
if(EquipAxe)then
begin
GameTab(5);
Wait(1000 + Random(500));
HeadColor[0] := GetColor(597, 294);
HeadColor[1] := GetColor(600, 295);
HeadColor[2] := GetColor(599, 298);
end else
begin
GameTab(4);
if FindBestAxe(ix, iy, False) then
Mouse(ix, iy, 3, 3, True);
Wait(2000 + Random(1000));
if(InChat('You need'))then
PlayerLost('Noob alert - you do not have the required att to wield axe');
GameTab(5);
HeadColor[0] := GetColor(597, 294);
HeadColor[1] := GetColor(600, 295);
HeadColor[2] := GetColor(599, 298);
end;
for WieldAxe := 1 to 6 do
FreeDtm(dtmAxes[WieldAxe]);
WriteLn('Axe head colors: ' + IntToStr(HeadColor[0]) + ' ' + IntToStr(HeadColor[1]) + ' ' +
IntToStr(HeadColor[1]));
end;
end;

//------------------------------------------------------------------------\\
{ AttachHead2 - Attaches found head, needed modifying. ||
\\------------------------------------------------------------------------//}

function AttachHead2: Boolean;
var
AxeHandleDTM, AxeHeadDTM, ax, ay: Integer;
Reequip: Boolean;
begin
AxeHandleDTM := DTMFromString('78DA637465626078C48002CA2379191E02694' +
'620FE0F048C0E40352F19D000231209A4ED806A3E1150E30454F3' +
'86801A2FA09AEB04D47800D5DC23A0C616A8E61D01358E4035EF0' +
'9A80185CF03FC6A00E1CD105C');
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');

WriteLn('Attaching head');
if not(LoggedIn)then
Exit;
if EquipAxe then
begin
GameTab(5);
Wait(200 + Random(200));
Mouse(592, 297, 2, 2, True);
Wait(2000 + Random(800));
Reequip := True;
end;
GameTab(4);
if (FindDTM(AxeHeadDTM, x, y, MIX1, MIY1, MIX2, MIY2)) and
(FindDTM(AxeHandleDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
if (FindDTM(AxeHeadDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 3, 3, True);
Wait(600 + Random(400));
end;
if (FindDTM(AxeHandleDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 3, 3, True);
Wait(500 + Random(200));
AxeAttaches := AxeAttaches + 1;
Result := True;
WriteLn('Attached Axe Head!');
GameTab(4);
MakeCompass('N');
end;
if ReEquip then
begin
Wait(1000 + Random(1000));
if FindBestAxe(ax, ay, False) then
Mouse(ax, ay, 3, 3, True);
Wait(500 + Random(500));
end;
end;
FreeDTM(AxeHandleDTM);
FreeDTM(AxeHeadDTM);
end;

//------------------------------------------------------------------------\\
{ SLFindHead - Finds the AxeHead if not on the handle ||
\\------------------------------------------------------------------------//}

function SLFindHead: Boolean;
var
AxeHeadDTM, Tries, ax, ay, ChatText: Integer;
a, c: Extended;
begin
if LoggedIn then
begin
Result := True;

ChatText := CreateBitmapMaskFromText('ou do not have an axe', SmallChars);
if FindBitmapMaskTolerance(ChatText, x, y, 17, 399, 188, 440, 10, 85) then
begin
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');

Result := False;
Tries := 0;
a := 1.0;
repeat
if not LoggedIn then Exit;
GameTab(4);
if (FindDTM(AxeHeadDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
Break;

a := a + 1;
c := Trunc(a div 2.0) * 1.0;
if(c = a div 2.0)then
begin
if(FindObjMulti('ake', HeadColor[0], HeadColor[1], HeadColor[2], 5))then
begin
WriteLn('Axe head found - picking it up');
Wait(450 + Random(400));
GetMousePos(ax, ay);
Mouse(ax, ay, 0, 0, False);
Popup('ake');
FFlag(0);
Wait(1000 + Random(500));
end else
begin
Tries := Tries + 1;
WriteLn('Axe head was not found. Taken ' + IntToStr(Tries) + ' tries');
KeyDown(VK_LEFT);
Wait(1000 + Random(400));
KeyUp(VK_LEFT);
Wait(300 + Random(150));
end;
end else
begin
WriteLn('Axe head wasn''t found - Moving to a Red dot');
ax := MMCX;
ay := MMCY;
if(FindColorSpiral(ax, ay, 241, MMCX + 3, MMY1, MMX2, MMY2))or
(FindColorSpiral(ax, ay, 241, MMX1, MMY1, MMCX - 3, MMY2))or
(FindColorSpiral(ax, ay, 241, MMX1, MMCY + 3, MMX2, MMY2))or
(FindColorSpiral(ax, ay, 241, MMX1, MMY1, MMX2, MMCY - 3))then
MouseFindNoFlag(ax + 3, ay + 3, 2, 2);
FFlag(0);
Wait(500 + Random(500));
end;
until(Tries > 5)or
(FindDTM(AxeHeadDTM, ax, ay, MIX1, MIY1, MIX2, MIY2));

if AttachHead2 then
Result := True;

Wait(500);
if(InChat('You need'))then
PlayerLost('Noob alert - not high enough att level to wear axe');

RelocateAtWillows;
end;

gBrokenAxe := (not Result);

if(AxeHeadDTM <> 0)then
FreeDTM(AxeHeadDTM);
FreeBitmap(ChatText);
end;
end;

//******_Bank procedures_******\\
//------------------------------------------------------------------------\\
{ SLOpenBank - Opents the bank ||
\\------------------------------------------------------------------------//}

function SLOpenBank: Boolean;
var
BankTime, I: Integer;
arBankColor, arBankColorResults: TPointArray;
begin
if LoggedIn then
begin
MarkTime(BankTime);
while(not(BankScreen))and(TimeFromMark(BankTime) < 20000)do
begin
arBankColor := FindColorsArray(541273, 0, 2, 10);
if(GetArrayLength(arBankColor) = 0)then
Break;
arBankColorResults := getArrayFromBox(arBankColor, 40, 40);
for I := 1 to GetArrayLength(arBankColorResults)-1 do
begin
if not(LoggedIn)then Exit;
FFlag(0);
Wait(100 + Random(100));
MMouse(arBankColorResults[I].x, arBankColorResults[I].y, 5, 5);
if(IsUpTextMulti('se Ban', 'ank b', 'booth'))then
begin
GetMousePos(x, y);
Mouse(x, y, 2, 2, false);
Wait(100+Random(100));
ChooseOption(x, y, 'uickly');
end;
if(PinScreen)then
if not(InPin(PinNumber))then
Writeln('Player lost.');
if(BankScreen)or(TimeFromMark(BankTime) > 20000)then
Break;
end;
end;
FFlag(0);
Wait(4000 + Random(500));
Result := BankScreen;
end;
end;

//------------------------------------------------------------------------\\
{ SLBank - Main banking procedure ||
\\------------------------------------------------------------------------//}

procedure SLBank(WithdrawAxe: Boolean);
var
dtmLogs, ax, ay: Integer;
begin
if LoggedIn then
begin
if(BankCount = 3)then
PlayerLost('We failed the bank');

if(WithdrawAxe)then
begin
if(InvCount = 28)then
begin
dtmLogs := DTMFromString('78DA637CC3C0C0308B010538588AC3D9FF818' +
'0F13590B184010D30229140FA2790984F40CD57203109BF1A001E' +
'6D0ACB');
if(FindDtm(dtmLogs, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Mouse(x, y, 5, 5, false);
ChooseOption(x, y, 'rop');
end;
FreeDtm(dtmLogs);
end;
GameTab(5);
Mouse(591, 304, 10, 10, true);
GameTab(4);
end;
SLOpenBank;
if(not BankScreen)then
begin
Writeln('Failed to open the bank.');
ax := MMCX; ay := MMCY;
if FindColorSpiral2(ax, ay, RoadColor, MMX1, MMY1, MMX2, MMY2) then
MouseFindNoFlag(ax, ay, 3, 3);
FFlag(0);
BankCount := BankCount + 1;
SLBank(WithdrawAxe);
end else
BankCount := 0;
FixBank;
if(InvCount = 28)then
Loads := Loads + 1;
LogsChopped := LogsChopped + CountItemBmpMaskTol(LogMask, 5, 5);
ReportVars[0] := ReportVars[0] + CountItemBmpMaskTol(LogMask, 5, 5);
DepositAll;
if(InvCount > 0)then
DepositAll;
if(WithDrawAxe)then
begin
if(FindBestAxe(x, y, True))then
begin
Mouse(x, y, 5, 5, true);
Wait(200+Random(300));
end;
end;
CloseBank;
Wait(200+Random(200));
if(BankScreen)then
CloseBank;
if(WithDrawAxe)then
begin
ClickItemColorTol(876930, 10, true);
Wait(400 + Random(400));
if(not SLFindAxeHeadColor)then
PlayerLost('You don''t have an axe');
end;
gBrokenAxe := false;
end;
ProgressReport;
end;

//******_Chopping procedures_******\\
//------------------------------------------------------------------------\\
{ SLFindEnt - Finds the evil ent ! ||
\\------------------------------------------------------------------------//}

function SLFindEnt(var ax, ay: Integer; tColor: Integer): Boolean;
var
TempMouseSpeed, mx, my, Count: integer;
begin
GetMousePos(mx, my);
if(mx < ax + 5)and(mx > ax - 5)and(my < ay + 5)and(my > ay - 5)then
else
if(FindColorSpiralTolerance(ax, ay, tColor, ax - 5, ay - 5, ax + 5, ay + 5, 5))then
begin
MMouse(ax, ay, 2, 2);
Wait(75 + Random(30));
end;
if(FindColorTolerance(ax, ay, 122333, 84, 1, 123, 15, 10))then
begin
for Count := 0 to 4 do
begin
Result := IsUpTextMulti('hop', 'own', 'down');
if(Result)then
Break;
Wait(25);
end;
if(Result)then
begin
Writeln('Ent found!!! Waiting...');
TempMouseSpeed := MouseSpeed;
MouseSpeed := 2 + Random(2);
Mouse(MMCX, MMCY, 2, 2, true);
IdleTime(5000 + Random(10000), 500, 1.0);
EntsAvoided := EntsAvoided + 1;
MouseSpeed := TempMouseSpeed;
end;
end;
end;

//------------------------------------------------------------------------\\
{ ValidateTree - Is it the correct tree ? ||
\\------------------------------------------------------------------------//}

function ValidateTree(ax, ay: Integer): boolean;
begin
if(IsUpText('hop'))or(IsUpText('own'))then
begin
if IsUpTextMulti('ree', 'ak', 'ew') then
Exit;
if IsUpText('illow') then
Result := True;
end;
end;

//------------------------------------------------------------------------\\
{ SLFindMiddleOfTree - Finds ... the middle of the tree ||
\\------------------------------------------------------------------------//}

function SLFindMiddleOfTree(var ax, ay: Integer; tColor: Integer): Boolean;
var
Count, x1, y1, x2, y2, bCount, aCount: Integer;
arLuminance: array[0..1] of Extended;
Hue, Saturation: Extended;
begin
if(FindColorSpiralTolerance(ax, ay, tColor, ax - 10, ay - 10, ax + 10, ay + 10, 5))and
(LoggedIn)then
begin
for bCount := 0 to 3 do
begin
ColorToHSL(GetColor(ax, ay), Hue, Saturation, arLuminance[1]);
Count := 0;
if(bCount = 2)then
ax := (x2 + x1) div 2;
repeat
arLuminance[0] := arLuminance[1];
case bCount of
0: ColorToHSL(GetColor(ax - Count, ay), Hue, Saturation, arLuminance[1]);
1: ColorToHSL(GetColor(ax + Count, ay), Hue, Saturation, arLuminance[1]);
2: ColorToHSL(GetColor(ax, ay - Count), Hue, Saturation, arLuminance[1]);
3: ColorToHSL(GetColor(ax, ay + Count), Hue, Saturation, arLuminance[1]);
end;

if(Hue > 14)and(Hue < 34)then
begin
if(arLuminance[0] < arLuminance[1] - 1.5)or
(arLuminance[0] > arLuminance[1] + 1.5)then
aCount := 0
else
aCount := aCount + 1;
end else
aCount := aCount + 1;

if(aCount = 3)then
begin
case bCount of
0: x1 := ax - Count + 3;
1: x2 := ax + Count - 3;
2: y1 := ay - Count + 3;
3: y2 := ay + Count - 3;
end;
end;
Count := Count + 1;
until(Count = 60)or(aCount = 3);
if(Count = 60)then
begin
case bCount of
0: x1 := ax - Count;
1: x2 := ax + Count;
2: y1 := ay - Count;
3: y2 := ay + Count;
end;
end;
end;

ay := (y2 + y1) div 2;
if((x2 - x1) * (y2 - y1) >= MinWCount * MinHCount)then
Result := True;
end;
end;

//------------------------------------------------------------------------\\
{ FindTree2 - Finds the tree in the screen ||
\\------------------------------------------------------------------------//}

function FindTree2(var gx, gy: Integer): Boolean;
var
tColors: array[0..8]of Integer;
xCount, yCount, cCount, zCount, tCount, tColor: Integer;
Luminance: array[0..8]of Extended;
Saturation, Hue: Extended;
x1, y1, x2, y2, a, c, i, tx, ty: Integer;
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 + 60;
x2 := x2 + 60;
end;
if (a = 2) then
begin
y1 := y1 - 40;
y2 := y2 - 40;
end;
if (a = 3) then
begin
x1 := x1 - 60;
x2 := x2 - 60;
end;
if (a = 4) then
begin
y1 := y1 + 40;
y2 := y2 + 40;
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;
zCount := 0;
tx := x2 - x1;
ty := y2 - y1;
if(FindColorSpiralTolerance(tx, ty, MSTreeColor, x1, y1, x2, y2, 10))then
begin
DebugMe('We found a color');
for xCount := 0 to 2 do
for yCount := 0 to 2 do
tColors[yCount + xCount * 3] := GetColor(tx - 1 + xCount, ty - 1 + yCount);
for xCount := 0 to 2 do
begin
for yCount := 0 to 2 do
begin
cCount := yCount + xCount * 3;
ColorToHSL(tColors[cCount], Hue, Saturation, Luminance[cCount]);
if(cCount > 0)then
begin
if(Hue > MinHue)and(Hue < MaxHue)then
begin
if(cCount = 3)or(cCount = 6)then
tCount := cCount - 2
else
tCount := cCount;
if(Luminance[cCount] > Luminance[tCount - 1] + 2)or
(Luminance[cCount] < Luminance[tCount - 1] - 2)then
zCount := zCount + 1;
end;
end;
end;
end;
if(zCount >= MinzCount)then
begin
tColor := GetColor(tx, ty);
if SLFindMiddleOfTree(tx, ty, tColor) then
begin
MMouse(tx, ty, 3, 3);
Wait(100 + Random(50));
tColor := GetColor(tx, ty);
Result := (ValidateTree(tx, ty))and(not SLFindEnt(tx, ty, tColor));
if(Result)then
begin
DebugMe('And we owned the tree');
gx := tx;
gy := ty;
Exit;
end else
DebugMe('Tree didn''t validate or we found an ent');
end else
DebugMe('It wasn''t a large enough tree');
end else
DebugMe('Color didn''t match closely enough');
end;
end;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result);
end;

//------------------------------------------------------------------------\\
{ UpdateColor - Updates coords of the tree ||
\\------------------------------------------------------------------------//}

function UpdateColor(var ax, ay: Integer; tColor: Integer): boolean;
var
Checker: Integer;
begin
Checker := GetSystemTime;
while(FindColorSpiralTolerance(ax, ay, tColor, ax - 20, ay - 20, ax + 20, ay + 20, 5))and
(TimeFromMark(Checker) < 10000)and
(FlagPresent)do
Wait(16);
for Checker := 0 to 45 do
begin
if(not FindColorSpiralTolerance(ax, ay, tColor, ax - 10, ay - 10, ax + 10, ay + 10, 5))then
Break;
if(not SLFindHead)then
Exit;
Wait(16);
end;

Result := FindColorSpiralTolerance(ax, ay, tColor, ax - 10, ay - 10, ax + 10, ay + 10, 5);
if(not Result)then
DebugMe('We lost the color while updating it');
end;

//------------------------------------------------------------------------\\
{ GetEmptyItemPosition2 - Returns first empty inv slot ||
\\------------------------------------------------------------------------//}

function GetEmptyItemPosition2: Integer;
begin
if not(LoggedIn)then
Exit;
GameTab(4);
for Result := 1 to 29 do
begin
if(Result = 29)then
begin
Result := -1;
Exit;
end else
if(not ExistsItem(Result))then
Break;
end;
end;

//------------------------------------------------------------------------\\
{ CheckLeveled - Did we go op a lvl ? ||
\\------------------------------------------------------------------------//}

function CheckLeveled: Boolean;
var
ax, ay: Integer;
begin
if(FindColorTolerance(ax, ay, 3303512, 57 - 5, 385 - 5, 57 + 5, 385 + 5, 15))and
(FindColorTolerance(ax, ay, 16711680, 254 - 5, 441 - 5, 254 + 5, 441 + 5, 15))then
begin
Result := True;
ClickToContinue;
end;
end;

//------------------------------------------------------------------------\\
{ WaitWhileWorking - Waits while chopping ||
\\------------------------------------------------------------------------//}

procedure WaitWhileWorking(ax, ay, tempSpot, tColor: Integer);
var
CutMark, CutMarkTotal, CutMarkTemp: Integer;
begin
CutMark := GetSystemTime;
CutMarkTotal := GetSystemTime;
CutMarkTemp := GetSystemTime;
while (LoggedIn) do
begin
if(not FindColorSpiralTolerance(ax, ay, tColor, ax - 10, ay - 10, ax + 10, ay + 10, 5))then
begin
DebugMe('We lost the color while waiting');
Exit;
end;
if(TimeFromMark(CutMarkTemp) > 5 * 1000)then
begin
if(not SLFindMiddleOfTree(ax, ay, tColor))then
begin
DebugMe('Lost actual tree');
Exit;
end;
CutMarkTemp := GetSystemTime;
end;
if(TimeFromMark(CutMarkTotal) < 5 * 1000)then
begin
if(not SLFindHead)then
begin
DebugMe('Axe fucked');
Exit;
end;
end;
Wait(10);
if SLFindEnt(ax, ay, tColor) then
begin
PlaySound('C:\WINDOWS\Media\winAquariumCritStop.wav');
DebugMe('We got an ent while waiting');
Exit;
end;
Wait(10);
if CheckLeveled then
begin
PlaySound('C:\WINDOWS\Media\winAquariumCritStop.wav');
DebugMe('We got a level');
CutMark := GetSystemTime;
end;
Wait(10);
if FindFastRandoms then
begin
DebugMe('Found a random while waiting');
PlaySound('C:\WINDOWS\Media\winAquariumCritStop.wav');
Exit;
end;
Wait(50);
if(TimeFromMark(CutMark) > MaxSecToWait * 1000)then
begin
DebugMe('No logs for '+IntToStr(MaxSecToWait)+' secs ');
Exit;
end;
if(TimeFromMark(CutMarkTotal) > 60 * 1000)then
begin
DebugMe('1 minute at the same tree, preventing logout');
Exit;
end;
if(FindFight)then
begin
PlaySound('C:\WINDOWS\Media\winAquariumCritStop.wav');
RunTo(RunDir, True);
DebugMe('We got into a fight');
Exit;
end;
Wait(10);
if ExistsItem(tempSpot) then
begin
CutMark := GetSystemTime;
tempSpot := GetEmptyItemPosition2;
if(tempSpot = -1)then
Exit;
end;
end;
end;

//------------------------------------------------------------------------\\
{ ChopTree - Main chopping procedure ||
\\------------------------------------------------------------------------//}

procedure ChopTree;
var
ax, ay, tempSpot, tColor: Integer;
begin
if LoggedIn then
begin
if FindTree2(ax, ay) then
begin
gWillowFailSafes := GetSystemTime;
tColor := GetColor(ax, ay);
if SLFindEnt(ax, ay, tColor) then
Exit;
if(Random(20) < 19)then
Mouse(ax, ay, 3, 3, True)
else
begin
Mouse(ax, ay, 3, 3, False);
ChooseOption(ax, ay, 'own');
end;
if UpdateColor(ax, ay, tColor) then
begin

tempSpot := GetEmptyItemPosition2;
if(tempSpot = -1)then
Exit;
if SLFindMiddleOfTree(ax, ay, tColor) then
begin
tColor := GetColor(ax, ay);
WaitWhileWorking(ax, ay, tempSpot, tColor);
gWillowFailSafes := GetSystemTime;
end;
end;
end;
end;
end;

//******_Setup stuff_******\\
//------------------------------------------------------------------------\\
{ Signature - To prove its ours, muhaha. ||
\\------------------------------------------------------------------------//}

procedure Signature;
begin
ChangeReportWidth(220);
Writeln(' ______ __ __ _');
Writeln(' / ___/| | _____ __________|__|_____/ |_ _____');
Writeln(' \__ \ | | / ___// ___\_ __ \ \___ \ __\/ __/');
Writeln(' / \| |__\__ \ \___| | \/ | |_> > | \__ \');
Writeln('/____ /|_____/__ >\___ >_| |__| __/|_| /___ /');
Writeln(' \/ \/ \/ |_| \/');
Writeln(' Bring you :');
Writeln(' Port Sarim Willow Whacker');
end;

//------------------------------------------------------------------------\\
{ TimeToSwitchPlayers - Time to switch the players ? ||
\\------------------------------------------------------------------------//}

function TimeToSwitchPlayers: boolean;
begin
if(TimeFromMark(gPlayerTime) > MaxLoginTime * 1000 * 60 + gRanTime)then
begin
Result := True;
WriteLn('Time is up');
end;
end;

//------------------------------------------------------------------------\\
{ SetupClient - Prepares the client for the script ||
\\------------------------------------------------------------------------//}

procedure SetupClient;
begin
SetupSRL;
ScriptID := '60';
LoadChatArray;
LoadBMPs;
ClearDebug;
ClearReport;
ShowNormalForm;
Wait(1000 + Random(500));
if(UsePlayerForm)then
begin
StartPlayers(false, 'string1 string2');
end else
DeclarePlayers;
CurrentPlayer := StartPlayer;
BenMouse := False;
ActivateClient;
Wait(1000);
end;

//------------------------------------------------------------------------\\
{ SetupUser - Sets the current player ready ||
\\------------------------------------------------------------------------//}

procedure SetupUser;
begin
gWillowFailSafes := GetSystemTime;
PinNumber := Players[CurrentPlayer].String1;
MouseSpeed := gMouseSpeed + Random(5);
LoginPlayer;
repeat
Wait(100);
until(not IsLoading);
Wait(3000 + Random(1000));
Players[CurrentPlayer].Level[20] := GetSkillLevel('woodcutting');
WriteLn('Current woodcutting lvl: ' + IntToStr(Players[CurrentPlayer].Level[20]));
if(not SLFindAxeHeadColor)then
begin
SLBank(true);
if (not SLFindAxeHeadColor) then
PlayerLost('We didn''t have an axe');
end;
HighestAngle;
Loads := 0;
SetChat('on', 1);
SetChat('friends', 2);
SetChat('on', 3);
WaterSymbolColor := GetSymbolColor(x, y, 'water');
if(not WaterSymbolColor = 0)then
WriteLn('WaterSymbolColor = ' + IntToStr(WaterSymbolColor))
else
begin
WaterSymbolColor := 14772023;
WriteLn('Couldn''t find watersymbolcolor - setting from default');
end;
MarkTime(gPlayerTime);
SetRun(false);
LadderColor := 0;
FarmingColor := 0;
QuestColor := 0;
RoadColor := 0;
BankColor := 0;
end;

//******_Main Loop_******\\
//------------------------------------------------------------------------\\
{ Main line - Its magic. ||
\\------------------------------------------------------------------------//}

begin
SetupClient;
repeat
SetupUser;
repeat
LadderColor := MMLadder;
ActivateClient;

if(Players[CurrentPlayer].String2 = 'bank')and
(LoggedIn)then
begin
if(InvCount = 0)and
(not gBrokenAxe)then
else
SLBank(gBrokenAxe);
BankToWillows;
gWillowFailSafes := GetSystemTime;
end;

if(Players[CurrentPlayer].String2 = 'willows')and
(LoggedIn)then
begin
repeat
MakeCompass('E');
Wait(16);
ChopTree;
Wait(16);
FindFastRandoms;
Wait(16);
FindBirdsNest;
Wait(16);
if(FindFight)then
RunTo(RunDir, True);
Wait(16);
if FindNewBox then
SolveBox;
if(1 * 30 * 1000 < GetSystemTime - gWillowFailSafes)then
begin
WriteLn('Relocating');
RelocateAtWillows;
end;
if(1 * 60 * 1000 < GetSystemTime - gWillowFailSafes)then
begin
WriteLn('We didn''t find any willows');
LogOut;
Exit;
end;
until(TimeToSwitchPlayers)or(InvCount = 28)or
(not LoggedIn)or(gBrokenAxe);
WillowsToBank;
end;

until(TimeToSwitchPlayers)or(not LoggedIn);

PlayerStatus := LoggedIn;
LogOut;
NextPlayer(PlayerStatus);
until(false);
end.

——————————————————
<!– END TEMPLATE: formanswers –>

neG

2007-05-13 06:56:25

Uhh, can anyone say Port Sarim Willow Whacker?
Dont copy scripts man..


RETARDED DUCK!!

begin
ChangeReportWidth(220);
Writeln(' ______ __ __ _');
Writeln(' / ___/| | _____ __________|__|_____/ |_ _____');
Writeln(' \__ \ | | / ___// ___\_ __ \ \___ \ __\/ __/');
Writeln(' / \| |__\__ \ \___| | \/ | |_> > | \__ \');
Writeln('/____ /|_____/__ >\___ >_| |__| __/|_| /___ /');
Writeln(' \/ \/ \/ |_| \/');
Writeln(' Bring you :');
Writeln(' Port Sarim Willow Whacker');
end;

rkroxpunk

2007-05-13 07:03:52

Yay! I get to do my first copybust!
http://www.villavu.com/forum/showthread.php?t=5511
w00t get out noob u might wanna actually change the name of the script and all the things saying SL and summillion and Lorax lawl!

EDIT: NOOO! dam u beat me lol

me_ntal

2007-05-13 07:20:46

Wow you guys are good, always fast and very good at what you do.

What exactly happens to a complete copied script? I hope they serve a temp ban and hence they figure its no use than permantly leave.

~alex~

2007-05-13 07:36:22

From: me_ntal
Wow you guys are good, always fast and very good at what you do.

What exactly happens to a complete copied script? I hope they serve a temp ban and hence they figure its no use than permantly leave.


I wish… All they get is a slap on the wrists and told not to do it again, oh and also some light flaming.

Buckleyindahouse

2007-05-13 07:48:21

well its a no from me cause you copied it and I saw you on rs at the pc place a while back.

neG

2007-05-13 07:50:38

From: rkroxpunk
Yay! I get to do my first copybust!
http://www.villavu.com/forum/showthread.php?t=5511
w00t get out noob u might wanna actually change the name of the script and all the things saying SL and summillion and Lorax lawl!

EDIT: NOOO! dam u beat me lol


Haha, beaten by a good 7 mins :P

rkroxpunk

2007-05-13 09:23:56

didn't refresh :(

Abyssal

2007-05-13 10:00:05

Haha you guys are so funny. Both the copier and buster :)

I enjoy seeing a rush for it, it's good we have people keeping track of things like this!

omgh4x0rz

2007-05-13 14:28:54

yea, now yohojo has some competition.

YoHoJo

2007-05-13 19:34:58

Competition my arse.
I got 35+

the scar noob

2007-09-23 06:36:32

From: YoHoJo
Competition my arse.
I got 35+


hehe lol:p
1. I don't want to gravedig
2. You have 51 atm
3. Isn't it time to close this application form?:p

MasterKill

2007-09-23 08:14:50

From: the scar noob

3. Isn't it time to close this application form?:p


yes? :rolleyes:

btw, i voted no (o rly?! YES)

edit: o lol i didn't vote no couse it's closed allready lol

YoHoJo

2007-09-23 16:38:35

05-14-2007, 12:34 AM
Nice 4 month bump guys….