SRL Archive - Senior Scripts and Snippets

Old 2007 scripts


Markus

2013-02-23 15:21:45

Some goodies for you. Mostly sorta 'cracked'/'nulled' scripts.
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GExtremeRanger ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{
Last Modified: April 15, 2007
Author: Gsquare567 -> MSN/Email - <a href="mailto:Gsquare567alt@hotmail.com">Gsquare567alt@hotmail.com</a>
PM - Gsquare567 on Rs-Resources, Srl
Gsquare on Sythe
And an anonymous auth cracker :)
Credits: Starblaster100, WT-Wataki, Stupid3ooo, RsN, Pyro, Masquerader,
Wizzup?, and all other SRL Members I did not mention,
because they have taught me everything I know about Scar and SRL.
Also Joe from RSR, who helped me make the Auth System!

How to Use:
-----------
1. Setup - first, drag the crosshair onto the runscape client, from there
just click Run Script, edit any settings in the form from previously
saved settings or the default settings and press the "Start Script" button.
2. Watch - once the script is run, your job is simply to sit back and
relax, and watch your ranger own.

Features (so far):
---------
1. Auto-Login
2. Great Monster Detection
3. Auto-Colored Arrow-Pickup and Arrow-Equip with DTMs
4. Multi-Food Eating with DTMs and Runaway
5. Multi-Item-Pickup
6. Incredible Anti-Ban
7. Advanced Anti-Random Checks
8. Incredible Auto-Talk/Auto-Respond System with Chat-Timing and
Last-Chat Checking
9. Script-Killing in response to Time, Kills, Health, and Max-Levels
10. Highly-Detailed Reports
11. Support Ranged Combat
12. Form with Saving and Loading Previous Settings
13. A nice crack so you can use it for free :p

Features (to add):
---------
1. Support of Magic Combat (Non-HP-Growing Spells)
2. Fishing and Cooking and a Variety of Areas (including Edgeville, Draynor, Falador, etc.)
3. Specialized Ranging Areas that will combine Fishing + Cooking with Ranging
4. Support of Melee Combat
5. Specialized Low-Health/Lost/Death Tele-Walk, corresponding to areas used in (3.)
}

//program GExtremeRanger;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Fighting.scar}
{.include srl\srl\extended\xInventory.scar}

const
VERSION = 1.0; // check out RSR or Sythe to see if this is the latest!

{*LEVEL*}
MaxAttack = 20; // will be used in later versions
MaxStrength = 1; // will be used in later versions
MaxRanged = 99; // will be used in later versions
MaxMagic = 99; // will be used in later versions
MaxDefence = 30; // will be used in later versions
MaxPrayer = 1; // will be used in later versions

var
// script variables

ArrowHead, ArrowTail, ArrowMid, ArrowDTM, Killed, ArrowsPicked, NoMonsters,
StartTime, Kills, Runtime, ArrowGrabs, ItemGrabs, FoodEaten, LowestHealth,
LastSpeakTime, FightTime, LastFightTime, i, j, PointColor, RunTox, RunToy,
RunBackx, RunBacky, MMOtherPersonDTM, LastResponseType, PlayerMouseSpeed,
MaxRuntime, MinRuntime, MaxEatHP, MinEatHP, FightMode, MonsterColor1,
MonsterColor2, MonsterColor3, MonsterColorTolerance, MaxKills, MinKills,
MaxFightTime, MinFightTime, ArrowTolerance, LoadsBeforeEquipMax,
LoadsBeforeEquipMin, ItemTolerance, MinChatLinesUntilSpeak, MinSpeakTime
: Integer;

FoodName, FoodDTMName, ItemName, SkillsUsing, Greetings, Questions, Responses,
Messages, GrewMessages, RangeLvlQuestions, DefLvlQuestions, HpLvlQuestions,
LvlQuestions, LvlResponses, NoobQuestions, NoobResponses, MoneyQuestions,
Moneyresponses,AgeQuestions,AgeResponses, LocationQuestions,LocationResponses,
SexQuestions,Sexresponses,LeavingQuestions, LeavingResponses, ArrowQuestions,
ArrowResponses
: array of String;

ArrowName, Skill, CombatType, RunAwayDir, StoreString1, StoreString2
: String;

SkillsLevels, ItemColor, FoodCol, FoodDTM, RandomFightTabs, RandomFishTabs
: array of Integer;

SameColor, FirstLoop, BoxInFight, FirstTalk, PlayerBenMouse, RightClickMonster,
PickArrows, PickItems, AutoTalk, AutoRespond
: Boolean;

// form variables
RealPassword : String;
frmDesign : TForm;
GBGeneral : TGroupBox;
LPassword : TLabel;
LBenMouse : TLabel;
LMouseSpeed : TLabel;
LMaxRuntime : TLabel;
LMinRuntime : TLabel;
LNickname : TLabel;
LUsername : TLabel;
LMaxKills : TLabel;
LMinKills : TLabel;
ENickname : TEdit;
EMouseSpeed : TEdit;
CBBenMouse : TComboBox;
EMaxRuntime : TEdit;
EMinRuntime : TEdit;
EUsername : TEdit;
EMaxKills : TEdit;
EMinKills : TEdit;
EPassword : TEdit;
BGHealth : TGroupBox;
LRunAwayDir : TLabel;
LMaxEatHP : TLabel;
LMinEatHP : TLabel;
LFoods : TLabel;
CBRunAwayDir : TComboBox;
EMaxEatHP : TEdit;
EMinEatHP : TEdit;
CBShrimp : TCheckBox;
CBSardine : TCheckBox;
CBHerring : TCheckBox;
CBAnchovies : TCheckBox;
CBTrout : TCheckBox;
CBPike : TCheckBox;
CBSalmon : TCheckBox;
CBTuna : TCheckBox;
CBLobster : TCheckBox;
CBSwordfish : TCheckBox;
CBCookedChicken : TCheckBox;
CBCookedMeat : TCheckBox;
CBBread : TCheckBox;
CBKebab : TCheckBox;
CBSpinachRoll : TCheckBox;
EFoodColor : TEdit;
BFoodColor : TButton;
GBFight : TGroupBox;
LFightMode : TLabel;
LRightClickMonster : TLabel;
LMaxFightTime : TLabel;
LMinFightTime : TLabel;
LMonsterColor1 : TLabel;
LMonsterColor2 : TLabel;
LMonsterColor3 : TLabel;
LMonsterColorTolerance : TLabel;
CBFightMode : TComboBox;
CBRightClickMonster : TComboBox;
EMaxFightTime : TEdit;
EMinFightTime : TEdit;
EMonsterColor1 : TEdit;
EMonsterColor2 : TEdit;
EMonsterColor3 : TEdit;
BMonsterColor1Pick : TButton;
BMonsterColor2Pick : TButton;
BMonsterColor3Pick : TButton;
EMonsterColorTolerance : TEdit;
GBTalk : TGroupBox;
LMinSpeakTime : TLabel;
LMinChatLinesUntilSpeak : TLabel;
LAutoTalk : TLabel;
LAutoRespond : TLabel;
CBMinChatLinesUntilSpeak : TComboBox;
CBAutoRespond : TComboBox;
EMinSpeakTime : TEdit;
CBAutoTalk : TComboBox;
BStartScript : TButton;
GBItem : TGroupBox;
LPickArrows : TLabel;
LArrowName : TLabel;
LLoadsBeforeEquipMax : TLabel;
LLoadsBeforeEquipMin : TLabel;
LPickItems : TLabel;
LArrowTolerance : TLabel;
LArrowHead : TLabel;
LArrowMid : TLabel;
LArrowTail : TLabel;
LItemName : TLabel;
LItemColor : TLabel;
LItemTolerance : TLabel;
CBArrowName : TComboBox;
CBPickArrows : TComboBox;
ELoadsBeforeEquipMax : TEdit;
ELoadsBeforeEquipMin : TEdit;
EArrowHead : TEdit;
BArrowHead : TButton;
EArrowMid : TEdit;
EArrowTail : TEdit;
EArrowTolerance : TEdit;
CBPickItems : TComboBox;
EItemName : TEdit;
EItemColor : TEdit;
EItemTolerance : TEdit;
BItemColor : TButton;
BArrowMid : TButton;
BArrowTail : TButton;

procedure GAuthorizeScript;
//var
//AuthMessage, AuthUsername, AuthPassword: String;
begin
{ AuthUsername := Readln('Enter Authorization Username:');
AuthPassword := Readln('Enter Authorization Password:');
AuthMessage := GetPage('http://gextremeranger.freehostia.com/abc.php?username=' + AuthUsername + '&password=' + AuthPassword);
if AuthMessage = 'ACCEPTED' then
begin
Writeln('Authorization accepted.');
end else
if AuthMessage = 'DENIED' then
begin
Writeln('Authorization denied.');
TerminateScript;
end else
begin
Writeln(AuthMessage);
TerminateScript;
end; }
end;

{***************************}
{***** FORM PROCEDURES *****}
{***************************}

// file opening/saving
function GetFormSettingsFromFile: array of String;
var
FileNumber: Integer;
Data: String;
begin
SetArrayLength(Result, 0);

if FileExists(ScriptPath + 'GExtremeRanger1.dat') then
begin
FileNumber := OpenFile(ScriptPath + 'GExtremeRanger1.dat', True);
Writeln('Loading saved settings...');
ReadFileString(FileNumber, Data, FileSize(FileNumber));
Data := Trim(Data);
repeat
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := Copy(Data, 1, Pos(Chr(13), Data) - 1);
Delete(Data, 1, Pos(Chr(13), Data));
until Pos(Chr(13), Data) < 1
CloseFile(FileNumber);
end else
begin
// default settings - coded this way to easily add in new settings
Writeln('Loading default settings...');
SetArrayLength(Result, GetArrayLength(Result) + 1); // general
Result[GetArrayLength(Result) - 1] := 'Username';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '******';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'ser';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '5';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '90';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '60';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '200';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '50';
SetArrayLength(Result, GetArrayLength(Result) + 1); // health
Result[GetArrayLength(Result) - 1] := '20';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '10';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'North';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'False';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'False';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'False';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'False';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'False';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'False';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1); // fight
Result[GetArrayLength(Result) - 1] := 'Accurate';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'False';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '45';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '180';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '0';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True'; // item settings
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'Bronze';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '5';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '1';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '-1';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '0';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '0';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '0';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'Coins';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '1413553';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '0';
SetArrayLength(Result, GetArrayLength(Result) + 1); // talk
Result[GetArrayLength(Result) - 1] := '30';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := '1';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := 'True';
end;
end;

procedure SaveFormSettingsToFile;
var
FileNumber: Integer;
begin
Writeln('Saving current settings...');
FileNumber := ReWriteFile(ScriptPath + 'GExtremeRanger1.dat', False);
WriteFileString(FileNumber, Players[0].Name + Chr(13));
WriteFileString(FileNumber, Players[0].Pass + Chr(13));
WriteFileString(FileNumber, Players[0].Nick + Chr(13));
WriteFileString(FileNumber, EMouseSpeed.Text + Chr(13));
WriteFileString(FileNumber, CBBenMouse.Text + Chr(13));
WriteFileString(FileNumber, EMaxRuntime.Text + Chr(13));
WriteFileString(FileNumber, EMinRuntime.Text + Chr(13));
WriteFileString(FileNumber, EMaxKills.Text + Chr(13));
WriteFileString(FileNumber, EMinKills.Text + Chr(13));
WriteFileString(FileNumber, EMaxEatHP.Text + Chr(13));
WriteFileString(FileNumber, EMinEatHP.Text + Chr(13));
WriteFileString(FileNumber, CBRunAwayDir.Text + Chr(13));
WriteFileString(FileNumber, EFoodColor.Text + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBShrimp.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBSardine.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBHerring.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBAnchovies.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBTrout.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBPike.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBSalmon.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBTuna.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBLobster.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBSwordfish.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBCookedChicken.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBCookedMeat.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBBread.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBKebab.Checked) + Chr(13));
WriteFileString(FileNumber, BoolToStr(CBSpinachRoll.Checked) + Chr(13));
WriteFileString(FileNumber, CBFightMode.Text + Chr(13));
WriteFileString(FileNumber, CBRightClickMonster.Text + Chr(13));
WriteFileString(FileNumber, EMaxFightTime.Text + Chr(13));
WriteFileString(FileNumber, EMinFightTime.Text + Chr(13));
WriteFileString(FileNumber, EMonsterColor1.Text + Chr(13));
WriteFileString(FileNumber, EMonsterColor2.Text + Chr(13));
WriteFileString(FileNumber, EMonsterColor3.Text + Chr(13));
WriteFileString(FileNumber, EMonsterColorTolerance.Text + Chr(13));
WriteFileString(FileNumber, CBPickArrows.Text + Chr(13));
WriteFileString(FileNumber, CBArrowName.Text + Chr(13));
WriteFileString(FileNumber, ELoadsBeforeEquipMax.Text + Chr(13));
WriteFileString(FileNumber, ELoadsBeforeEquipMin.Text + Chr(13));
WriteFileString(FileNumber, EArrowHead.Text + Chr(13));
WriteFileString(FileNumber, EArrowMid.Text + Chr(13));
WriteFileString(FileNumber, EArrowTail.Text + Chr(13));
WriteFileString(FileNumber, EArrowTolerance.Text + Chr(13));
WriteFileString(FileNumber, CBPickItems.Text + Chr(13));
WriteFileString(FileNumber, EItemName.Text + Chr(13));
WriteFileString(FileNumber, EItemColor.Text + Chr(13));
WriteFileString(FileNumber, EItemTolerance.Text + Chr(13));
WriteFileString(FileNumber, EMinSpeakTime.Text + Chr(13));
WriteFileString(FileNumber, CBMinChatLinesUntilSpeak.Text + Chr(13));
WriteFileString(FileNumber, CBAutoTalk.Text + Chr(13));
WriteFileString(FileNumber, CBAutoRespond.Text + Chr(13));
CloseFile(FileNumber);
end;

function SettingsCorrect: Boolean;
begin
Result := True;
end;

// set variables and start script
procedure ClickStartScript(sender: TObject); // Adding Buttons and Interactivity
begin
Status('Checking settings...');
if not SettingsCorrect then Exit;
Status('Storing settings...');
{*GENERAL*}
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := EUsername.Text;
Players[0].Pass := EPassword.Text;
if Length(ENickname.Text) > 0 then Players[0].Nick := ENickname.Text
else
begin
Players[0].Nick := Copy(Players[0].Name, 2, 3);
Writeln('Your nickname is ' + Players[0].Nick + '.');
end;
Players[0].Active := True;

PlayerMouseSpeed := StrToInt(EMouseSpeed.Text);
PlayerBenMouse := StrToBool(CBBenMouse.Text);
MaxRuntime := StrToInt(EMaxRuntime.Text);
MinRuntime := StrToInt(EMinRuntime.Text);
MaxKills := StrToInt(EMaxKills.Text);
MinKills := StrToInt(EMinKills.Text);

{*HEALTH*}
MaxEatHP := StrToInt(EMaxEatHP.Text);
MinEatHP := StrToInt(EMinEatHP.Text);
RunAwayDir := Copy(CBRunAwayDir.Text, 1, 1);

SetArrayLength(FoodCol, 0);
StoreString1 := EFoodColor.Text;
while Pos(', ', StoreString1) > 0 do
begin
SetArrayLength(FoodCol, GetArrayLength(FoodCol) + 1);
FoodCol[GetArrayLength(FoodCol) - 1] := StrToInt(Trim(Copy(StoreString1, 1, Pos(', ', StoreString1) - 1)));
Delete(StoreString1, 1, Pos(', ', StoreString1) + 1);
end;
if Length(StoreString1) > 0 then
begin
SetArrayLength(FoodCol, GetArrayLength(FoodCol) + 1);
FoodCol[GetArrayLength(FoodCol) - 1] := StrToInt(Trim(StoreString1));
end;

SetArrayLength(FoodName, 0);
if CBShrimp.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBShrimp.Caption;
end;
if CBSardine.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBSardine.Caption;
end;
if CBHerring.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBHerring.Caption;
end;
if CBAnchovies.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBAnchovies.Caption;
end;
if CBTrout.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBTrout.Caption;
end;
if CBPike.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBPike.Caption;
end;
if CBSalmon.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBSalmon.Caption;
end;
if CBTuna.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBTuna.Caption;
end;
if CBLobster.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBLobster.Caption;
end;
if CBSwordfish.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBSwordfish.Caption;
end;
if CBCookedChicken.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBCookedChicken.Caption;
end;
if CBCookedMeat.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBCookedMeat.Caption;
end;
if CBBread.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBBread.Caption;
end;
if CBKebab.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBKebab.Caption;
end;
if CBSpinachRoll.Checked then
begin
SetArrayLength(FoodName, GetArrayLength(FoodName) + 1);
FoodName[GetArrayLength(FoodName) - 1] := CBSpinachRoll.Caption;
end;

{*FIGHT*}
case CBFightMode.Text of
'Accurate': FightMode := 1;
'Rapid': FightMode := 2;
'Longrange': FightMode := 3;
end;
RightClickMonster := StrToBool(CBRightClickMonster.Text);
MaxFightTime := StrToInt(EMaxFightTime.Text);
MinFightTime := StrToInt(EMinFightTime.Text);
MonsterColor1 := StrToInt(EMonsterColor1.Text);
MonsterColor2 := StrToInt(EMonsterColor2.Text);
MonsterColor3 := StrToInt(EMonsterColor3.Text);
MonsterColorTolerance := StrToInt(EMonsterColorTolerance.Text)

{*ITEM*}
PickArrows := StrToBool(CBPickArrows.Text);
ArrowName := CBArrowName.Text;
LoadsBeforeEquipMax := StrToInt(ELoadsBeforeEquipMax.Text);
LoadsBeforeEquipMin := StrToInt(ELoadsBeforeEquipMin.Text);
ArrowHead := StrToInt(EArrowHead.Text);
ArrowMid := StrToInt(EArrowMid.Text);
ArrowTail := StrToInt(EArrowTail.Text);
ArrowTolerance := StrToInt(EArrowTolerance.Text);
PickItems := StrToBool(CBPickItems.Text);

SetArrayLength(ItemName, 0);
SetArrayLength(ItemColor, 0);

StoreString1 := EItemName.Text;
StoreString2 := EItemColor.Text;
while (Pos(', ', StoreString1) > 0) and (Pos(', ', StoreString2) > 0) do
begin
SetArrayLength(ItemName, GetArrayLength(ItemName) + 1);
SetArrayLength(ItemColor, GetArrayLength(ItemColor) + 1);

ItemName[GetArrayLength(ItemName) - 1] := Trim(Copy(StoreString1, 1, Pos(', ', StoreString1) - 1));
ItemColor[GetArrayLength(ItemColor) - 1] := StrToInt(Trim(Copy(StoreString2, 1, Pos(', ', StoreString2) - 1)));

Delete(StoreString1, 1, Pos(', ', StoreString1) + 1);
Delete(StoreString2, 1, Pos(', ', StoreString2) + 1);
end;
if (Length(StoreString1) > 0) and (Length(StoreString2) > 0) then
begin
SetArrayLength(ItemName, GetArrayLength(ItemName) + 1);
SetArrayLength(ItemColor, GetArrayLength(ItemColor) + 1);

ItemName[GetArrayLength(ItemName) - 1] := Trim(StoreString1);
ItemColor[GetArrayLength(ItemColor) - 1] := StrToInt(Trim(StoreString2));
end;
ItemTolerance := StrToInt(EItemTolerance.Text);

{*TALK*}
MinSpeakTime := StrToInt(EMinSpeakTime.Text);
MinChatLinesUntilSpeak := StrToInt(CBMinChatLinesUntilSpeak.Text);
AutoTalk := StrToBool(CBAutoTalk.Text);
AutoRespond := StrToBool(CBAutoRespond.Text);

// save settings
SaveFormSettingsToFile;

// start script
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;

// closing form
procedure ClosingForm(sender: TObject); // Adding Buttons and Interactivity
begin
Writeln('Hey! Did you just decide not to use this script?!');
Wait(2000);
Writeln('Whats with that, man? This script pwnz!');
Wait(2000);
Writeln('Whatever. Your choice... even though its not a good one =P');
Wait(3000);
Writeln('Maybe we can chill later ^^');
TerminateScript;
end;

// pick monster colors
procedure ClickPickMColor1(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
EMonsterColor1.Text := IntToStr(Color);
EMonsterColor1.Font.Color := Color;
if Color < 3500000 then EMonsterColor1.Color := clWhite
else EMonsterColor1.Color := clBlack;
end;
procedure ClickPickMColor2(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
EMonsterColor2.Text := IntToStr(Color);
EMonsterColor2.Font.Color := Color;
if Color < 3500000 then EMonsterColor2.Color := clWhite
else EMonsterColor2.Color := clBlack;
end;
procedure ClickPickMColor3(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
EMonsterColor3.Text := IntToStr(Color);
EMonsterColor3.Font.Color := Color;
if Color < 3500000 then EMonsterColor3.Color := clWhite
else EMonsterColor3.Color := clBlack;
end;

// pick food colors
procedure ClickPickFoodColor(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
if Length(EFoodColor.Text) > 0 then EFoodColor.Text := EFoodColor.Text + ', ' + IntToStr(Color)
else EFoodColor.Text := IntToStr(Color);
end;

// pick item colors
procedure ClickPickArrowHColor(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
EArrowHead.Text := IntToStr(Color);
EArrowHead.Font.Color := Color;
if Color < 3500000 then EArrowHead.Color := clWhite
else EArrowHead.Color := clBlack;
end;
procedure ClickPickArrowMColor(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
EArrowMid.Text := IntToStr(Color);
EArrowMid.Font.Color := Color;
if Color < 3500000 then EArrowMid.Color := clWhite
else EArrowMid.Color := clBlack;
end;
procedure ClickPickArrowTColor(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
EArrowTail.Text := IntToStr(Color);
EArrowTail.Font.Color := Color;
if Color < 3500000 then EArrowTail.Color := clWhite
else EArrowTail.Color := clBlack;
end;
procedure ClickPickItemColor(sender: TObject); // Adding Buttons and Interactivity
var Color: Integer;
begin
PickColor(Color, x, y);
if Length(EItemColor.Text) > 0 then EItemColor.Text := EItemColor.Text + ', ' + IntToStr(Color)
else EItemColor.Text := IntToStr(Color);
end;

// form creation
procedure InitForm;
var
SettingValues: array of String;
begin
// set variables
//SetArrayLength(SettingValues, 52);
SettingValues := GetFormSettingsFromFile;
i := 0;

frmDesign := CreateForm;
frmDesign.Left := 121;
frmDesign.Top := 15;
frmDesign.Width := 570;
frmDesign.Height := 613;
frmDesign.Caption := 'GExtremeRanger V1.0';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
GBGeneral := TGroupBox.Create(frmDesign);
GBGeneral.Parent := frmDesign;
GBGeneral.Left := 0;
GBGeneral.Top := 0;
GBGeneral.Width := 212;
GBGeneral.Height := 229;
GBGeneral.Caption := 'General Settings';
GBGeneral.Color := cl3DDkShadow;
GBGeneral.Font.Color := clWindowText;
GBGeneral.Font.Height := -16;
GBGeneral.Font.Name := 'Courier New';
GBGeneral.Font.Style := [fsBold];
GBGeneral.ParentColor := False;
GBGeneral.ParentFont := False;
GBGeneral.TabOrder := 0;
LUsername := TLabel.Create(GBGeneral);
LUsername.Parent := GBGeneral;
LUsername.Left := 23;
LUsername.Top := 33;
LUsername.Width := 63;
LUsername.Height := 14;
LUsername.Caption := 'Username:';
LUsername.Color := clBtnFace;
LUsername.Font.Color := clWindowText;
LUsername.Font.Height := -11;
LUsername.Font.Name := 'Courier New';
LUsername.Font.Style := [];
LUsername.ParentColor := False;
LUsername.ParentFont := False;
LPassword := TLabel.Create(GBGeneral);
LPassword.Parent := GBGeneral;
LPassword.Left := 23;
LPassword.Top := 54;
LPassword.Width := 63;
LPassword.Height := 14;
LPassword.Caption := 'Password:';
LPassword.Font.Color := clWindowText;
LPassword.Font.Height := -11;
LPassword.Font.Name := 'Courier New';
LPassword.Font.Style := [];
LPassword.ParentFont := False;
LMouseSpeed := TLabel.Create(GBGeneral);
LMouseSpeed.Parent := GBGeneral;
LMouseSpeed.Left := 23;
LMouseSpeed.Top := 96;
LMouseSpeed.Width := 84;
LMouseSpeed.Height := 14;
LMouseSpeed.Caption := 'Mouse Speed:';
LMouseSpeed.Font.Color := clWindowText;
LMouseSpeed.Font.Height := -11;
LMouseSpeed.Font.Name := 'Courier New';
LMouseSpeed.Font.Style := [];
LMouseSpeed.ParentFont := False;
LBenMouse := TLabel.Create(GBGeneral);
LBenMouse.Parent := GBGeneral;
LBenMouse.Left := 23;
LBenMouse.Top := 117;
LBenMouse.Width := 70;
LBenMouse.Height := 14;
LBenMouse.Caption := 'Ben Mouse:';
LBenMouse.Font.Color := clWindowText;
LBenMouse.Font.Height := -11;
LBenMouse.Font.Name := 'Courier New';
LBenMouse.Font.Style := [];
LBenMouse.ParentFont := False;
LMaxRuntime := TLabel.Create(GBGeneral);
LMaxRuntime.Parent := GBGeneral;
LMaxRuntime.Left := 23;
LMaxRuntime.Top := 138;
LMaxRuntime.Width := 84;
LMaxRuntime.Height := 14;
LMaxRuntime.Caption := 'Max Runtime:';
LMaxRuntime.Font.Color := clWindowText;
LMaxRuntime.Font.Height := -11;
LMaxRuntime.Font.Name := 'Courier New';
LMaxRuntime.Font.Style := [];
LMaxRuntime.ParentFont := False;
LMinRuntime := TLabel.Create(GBGeneral);
LMinRuntime.Parent := GBGeneral;
LMinRuntime.Left := 23;
LMinRuntime.Top := 159;
LMinRuntime.Width := 84;
LMinRuntime.Height := 14;
LMinRuntime.Caption := 'Min Runtime:';
LMinRuntime.Font.Color := clWindowText;
LMinRuntime.Font.Height := -11;
LMinRuntime.Font.Name := 'Courier New';
LMinRuntime.Font.Style := [];
LMinRuntime.ParentFont := False;
LNickname := TLabel.Create(GBGeneral);
LNickname.Parent := GBGeneral;
LNickname.Left := 23;
LNickname.Top := 75;
LNickname.Width := 63;
LNickname.Height := 14;
LNickname.Caption := 'Nickname:';
LNickname.Font.Color := clWindowText;
LNickname.Font.Height := -11;
LNickname.Font.Name := 'Courier New';
LNickname.Font.Style := [];
LNickname.ParentFont := False;
LMaxKills := TLabel.Create(GBGeneral);
LMaxKills.Parent := GBGeneral;
LMaxKills.Left := 23;
LMaxKills.Top := 180;
LMaxKills.Width := 70;
LMaxKills.Height := 14;
LMaxKills.Caption := 'Max Kills:';
LMaxKills.Font.Color := clWindowText;
LMaxKills.Font.Height := -11;
LMaxKills.Font.Name := 'Courier New';
LMaxKills.Font.Style := [];
LMaxKills.ParentFont := False;
LMinKills := TLabel.Create(GBGeneral);
LMinKills.Parent := GBGeneral;
LMinKills.Left := 23;
LMinKills.Top := 201;
LMinKills.Width := 70;
LMinKills.Height := 14;
LMinKills.Caption := 'Min Kills:';
LMinKills.Font.Color := clWindowText;
LMinKills.Font.Height := -11;
LMinKills.Font.Name := 'Courier New';
LMinKills.Font.Style := [];
LMinKills.ParentFont := False;
EUsername := TEdit.Create(GBGeneral);
EUsername.Parent := GBGeneral;
EUsername.Left := 111;
EUsername.Top := 29;
EUsername.Width := 90;
EUsername.Height := 22;
EUsername.Hint := 'Enter the username of your ranging account.';
EUsername.Font.Color := clWindowText;
EUsername.Font.Height := -11;
EUsername.Font.Name := 'Courier New';
EUsername.Font.Style := [];
EUsername.ParentFont := False;
EUsername.ParentShowHint := False;
EUsername.ShowHint := True;
EUsername.TabOrder := 5;
EUsername.Text := SettingValues[i];
i := i + 1;
EPassword := TEdit.Create(GBGeneral);
EPassword.Parent := GBGeneral;
EPassword.Left := 111;
EPassword.Top := 50;
EPassword.Width := 90;
EPassword.Height := 22;
EPassword.Hint := 'Enter the password or your ranging account.';
EPassword.Font.Color := clWindowText;
EPassword.Font.Height := -11;
EPassword.Font.Name := 'Courier New';
EPassword.Font.Style := [];
EPassword.ParentFont := False;
EPassword.ParentShowHint := False;
EPassword.ShowHint := True;
EPassword.TabOrder := 8;
EPassword.PasswordChar := '*';
EPassword.Text := SettingValues[i];
i := i + 1;
ENickname := TEdit.Create(GBGeneral);
ENickname.Parent := GBGeneral;
ENickname.Left := 111;
ENickname.Top := 71;
ENickname.Width := 90;
ENickname.Height := 22;
ENickname.Hint := 'Enter the nickname of your ranging account. This is usually three letters in the middle of your username. If left blank, the script will automatically create a proper nickname for you.';
ENickname.Font.Color := clWindowText;
ENickname.Font.Height := -11;
ENickname.Font.Name := 'Courier New';
ENickname.Font.Style := [];
ENickname.ParentFont := False;
ENickname.ParentShowHint := False;
ENickname.ShowHint := True;
ENickname.TabOrder := 0;
ENickname.Text := SettingValues[i];
i := i + 1;
EMouseSpeed := TEdit.Create(GBGeneral);
EMouseSpeed.Parent := GBGeneral;
EMouseSpeed.Left := 111;
EMouseSpeed.Top := 92;
EMouseSpeed.Width := 90;
EMouseSpeed.Height := 22;
EMouseSpeed.Hint := 'Enter the desired mouse speed (Lower = Faster, Higher = Slower). Anywhere from 5-15 is normal.';
EMouseSpeed.Font.Color := clWindowText;
EMouseSpeed.Font.Height := -11;
EMouseSpeed.Font.Name := 'Courier New';
EMouseSpeed.Font.Style := [];
EMouseSpeed.ParentFont := False;
EMouseSpeed.ParentShowHint := False;
EMouseSpeed.ShowHint := True;
EMouseSpeed.TabOrder := 1;
EMouseSpeed.Text := SettingValues[i];
i := i + 1;
CBBenMouse := TComboBox.Create(GBGeneral);
CBBenMouse.Parent := GBGeneral;
CBBenMouse.Left := 111;
CBBenMouse.Top := 113;
CBBenMouse.Width := 90;
CBBenMouse.Height := 22;
CBBenMouse.Hint := 'Choose True to use Ben Mouse or False to not use Ben Mouse. Ben Mouse is highly recommended to decrease detectability.';
CBBenMouse.Font.Color := clWindowText;
CBBenMouse.Font.Height := -11;
CBBenMouse.Font.Name := 'Courier New';
CBBenMouse.Font.Style := [];
CBBenMouse.ItemHeight := 14;
CBBenMouse.ItemIndex := 0;
CBBenMouse.ParentFont := False;
CBBenMouse.ParentShowHint := False;
CBBenMouse.ShowHint := True;
CBBenMouse.TabOrder := 2;
CBBenMouse.Text := SettingValues[i];
i := i + 1;
CBBenMouse.Items.Add('True');
CBBenMouse.Items.Add('False');
EMaxRuntime := TEdit.Create(GBGeneral);
EMaxRuntime.Parent := GBGeneral;
EMaxRuntime.Left := 111;
EMaxRuntime.Top := 134;
EMaxRuntime.Width := 90;
EMaxRuntime.Height := 22;
EMaxRuntime.Hint := 'Enter the maximum time in minutes you wish the script to run. *Note - this MUST be of greater value than the minimum runtime.';
EMaxRuntime.Font.Color := clWindowText;
EMaxRuntime.Font.Height := -11;
EMaxRuntime.Font.Name := 'Courier New';
EMaxRuntime.Font.Style := [];
EMaxRuntime.ParentFont := False;
EMaxRuntime.ParentShowHint := False;
EMaxRuntime.ShowHint := True;
EMaxRuntime.TabOrder := 3;
EMaxRuntime.Text := SettingValues[i];
i := i + 1;
EMinRuntime := TEdit.Create(GBGeneral);
EMinRuntime.Parent := GBGeneral;
EMinRuntime.Left := 111;
EMinRuntime.Top := 155;
EMinRuntime.Width := 90;
EMinRuntime.Height := 22;
EMinRuntime.Hint := 'Enter the maximum time in minutes you wish the script to run. *Note - this MUST be of greater value than the minimum runtime.';
EMinRuntime.Font.Color := clWindowText;
EMinRuntime.Font.Height := -11;
EMinRuntime.Font.Name := 'Courier New';
EMinRuntime.Font.Style := [];
EMinRuntime.ParentFont := False;
EMinRuntime.ParentShowHint := False;
EMinRuntime.ShowHint := True;
EMinRuntime.TabOrder := 4;
EMinRuntime.Text := SettingValues[i];
i := i + 1;
EMaxKills := TEdit.Create(GBGeneral);
EMaxKills.Parent := GBGeneral;
EMaxKills.Left := 111;
EMaxKills.Top := 176;
EMaxKills.Width := 90;
EMaxKills.Height := 22;
EMaxKills.Hint := 'Enter the maximum number of monster kills before ending the script. *Note - this MUST be of greater value than the minimum kills.';
EMaxKills.Font.Color := clWindowText;
EMaxKills.Font.Height := -11;
EMaxKills.Font.Name := 'Courier New';
EMaxKills.Font.Style := [];
EMaxKills.ParentFont := False;
EMaxKills.ParentShowHint := False;
EMaxKills.ShowHint := True;
EMaxKills.TabOrder := 6;
EMaxKills.Text := SettingValues[i];
i := i + 1;
EMinKills := TEdit.Create(GBGeneral);
EMinKills.Parent := GBGeneral;
EMinKills.Left := 111;
EMinKills.Top := 197;
EMinKills.Width := 90;
EMinKills.Height := 22;
EMinKills.Hint := 'Enter the minimum number of monsters you wish to kill before ending the script. *Note - this may cause the script to continue past the determined runtime if you have not accomplished the minimum number of kills.';
EMinKills.Font.Color := clWindowText;
EMinKills.Font.Height := -11;
EMinKills.Font.Name := 'Courier New';
EMinKills.Font.Style := [];
EMinKills.ParentFont := False;
EMinKills.ParentShowHint := False;
EMinKills.ShowHint := True;
EMinKills.TabOrder := 7;
EMinKills.Text := SettingValues[i];
i := i + 1;
BGHealth := TGroupBox.Create(frmDesign);
BGHealth.Parent := frmDesign;
BGHealth.Left := 0;
BGHealth.Top := 230;
BGHealth.Width := 274;
BGHealth.Height := 224;
BGHealth.Caption := 'Health Settings';
BGHealth.Color := clBtnFace;
BGHealth.Font.Color := clBlack;
BGHealth.Font.Height := -16;
BGHealth.Font.Name := 'Courier New';
BGHealth.Font.Style := [fsBold];
BGHealth.ParentColor := False;
BGHealth.ParentFont := False;
BGHealth.TabOrder := 1;
LRunAwayDir := TLabel.Create(BGHealth);
LRunAwayDir.Parent := BGHealth;
LRunAwayDir.Left := 23;
LRunAwayDir.Top := 54;
LRunAwayDir.Width := 133;
LRunAwayDir.Height := 14;
LRunAwayDir.Caption := 'Run-Away Direction:';
LRunAwayDir.Font.Color := clWindowText;
LRunAwayDir.Font.Height := -11;
LRunAwayDir.Font.Name := 'Courier New';
LRunAwayDir.Font.Style := [];
LRunAwayDir.ParentFont := False;
LMaxEatHP := TLabel.Create(BGHealth);
LMaxEatHP.Parent := BGHealth;
LMaxEatHP.Left := 23;
LMaxEatHP.Top := 33;
LMaxEatHP.Width := 77;
LMaxEatHP.Height := 14;
LMaxEatHP.Caption := 'Max Eat HP:';
LMaxEatHP.Color := clBtnFace;
LMaxEatHP.Font.Color := clBlack;
LMaxEatHP.Font.Height := -11;
LMaxEatHP.Font.Name := 'Courier New';
LMaxEatHP.Font.Style := [];
LMaxEatHP.ParentColor := False;
LMaxEatHP.ParentFont := False;
LMinEatHP := TLabel.Create(BGHealth);
LMinEatHP.Parent := BGHealth;
LMinEatHP.Left := 141;
LMinEatHP.Top := 33;
LMinEatHP.Width := 77;
LMinEatHP.Height := 14;
LMinEatHP.Caption := 'Min Eat HP:';
LMinEatHP.Color := clBtnFace;
LMinEatHP.Font.Color := clBlack;
LMinEatHP.Font.Height := -11;
LMinEatHP.Font.Name := 'Courier New';
LMinEatHP.Font.Style := [];
LMinEatHP.ParentColor := False;
LMinEatHP.ParentFont := False;
LFoods := TLabel.Create(BGHealth);
LFoods.Parent := BGHealth;
LFoods.Left := 23;
LFoods.Top := 75;
LFoods.Width := 91;
LFoods.Height := 14;
LFoods.Caption := 'Foods to Eat:';
LFoods.Font.Color := clBlack;
LFoods.Font.Height := -11;
LFoods.Font.Name := 'Courier New';
LFoods.Font.Style := [];
LFoods.ParentFont := False;
EMaxEatHP := TEdit.Create(BGHealth);
EMaxEatHP.Parent := BGHealth;
EMaxEatHP.Left := 104;
EMaxEatHP.Top := 29;
EMaxEatHP.Width := 21;
EMaxEatHP.Height := 22;
EMaxEatHP.Hint := 'Enter the maximum number of hitpoints you wish to start eating food.';
EMaxEatHP.Font.Color := clBlack;
EMaxEatHP.Font.Height := -11;
EMaxEatHP.Font.Name := 'Courier New';
EMaxEatHP.Font.Style := [];
EMaxEatHP.ParentFont := False;
EMaxEatHP.ParentShowHint := False;
EMaxEatHP.ShowHint := True;
EMaxEatHP.TabOrder := 1;
EMaxEatHP.Text := SettingValues[i];
i := i + 1;
EMinEatHP := TEdit.Create(BGHealth);
EMinEatHP.Parent := BGHealth;
EMinEatHP.Left := 222;
EMinEatHP.Top := 29;
EMinEatHP.Width := 21;
EMinEatHP.Height := 22;
EMinEatHP.Hint := 'Enter the number of hitpoints you wish to log out at.';
EMinEatHP.Font.Color := clBlack;
EMinEatHP.Font.Height := -11;
EMinEatHP.Font.Name := 'Courier New';
EMinEatHP.Font.Style := [];
EMinEatHP.ParentFont := False;
EMinEatHP.ParentShowHint := False;
EMinEatHP.ShowHint := True;
EMinEatHP.TabOrder := 2;
EMinEatHP.Text := SettingValues[i];
i := i + 1;
CBRunAwayDir := TComboBox.Create(BGHealth);
CBRunAwayDir.Parent := BGHealth;
CBRunAwayDir.Left := 160;
CBRunAwayDir.Top := 51;
CBRunAwayDir.Width := 57;
CBRunAwayDir.Height := 22;
CBRunAwayDir.Hint := 'Choose the direction to which you wish to run away if you have no food left and are below the minimum eat hitpoints.';
CBRunAwayDir.Font.Color := clBlack;
CBRunAwayDir.Font.Height := -11;
CBRunAwayDir.Font.Name := 'Courier New';
CBRunAwayDir.Font.Style := [];
CBRunAwayDir.ItemHeight := 14;
CBRunAwayDir.ItemIndex := 0;
CBRunAwayDir.ParentFont := False;
CBRunAwayDir.ParentShowHint := False;
CBRunAwayDir.ShowHint := True;
CBRunAwayDir.TabOrder := 0;
CBRunAwayDir.Text := SettingValues[i];
i := i + 1;
CBRunAwayDir.Items.Add('North');
CBRunAwayDir.Items.Add('South');
CBRunAwayDir.Items.Add('West');
CBRunAwayDir.Items.Add('East');
EFoodColor := TEdit.Create(BGHealth);
EFoodColor.Parent := BGHealth;
EFoodColor.Left := 119;
EFoodColor.Top := 72;
EFoodColor.Width := 70;
EFoodColor.Height := 22;
EFoodColor.Hint := 'Click on the Pick Color button (to the right) to get the color of any foods you want to eat or pick up which are not preset.';
EFoodColor.Font.Color := clBlack;
EFoodColor.Font.Height := -11;
EFoodColor.Font.Name := 'Courier New';
EFoodColor.Font.Style := [];
EFoodColor.ParentFont := False;
EFoodColor.ParentShowHint := False;
EFoodColor.ShowHint := True;
EFoodColor.TabOrder := 18;
EFoodColor.Text := SettingValues[i];
i := i + 1;
BFoodColor := TButton.Create(BGHealth);
BFoodColor.Parent := BGHealth;
BFoodColor.Left := 189;
BFoodColor.Top := 73;
BFoodColor.Width := 78;
BFoodColor.Height := 20;
BFoodColor.Hint := 'To pick a food color, click me then click on the food.';
BFoodColor.Caption := 'Pick Color';
BFoodColor.Font.Color := clBlack;
BFoodColor.Font.Height := -11;
BFoodColor.Font.Name := 'Courier New';
BFoodColor.Font.Style := [];
BFoodColor.ParentFont := False;
BFoodColor.ParentShowHint := False;
BFoodColor.ShowHint := True;
BFoodColor.TabOrder := 19;
BFoodColor.OnClick := @ClickPickFoodColor;
CBShrimp := TCheckBox.Create(BGHealth);
CBShrimp.Parent := BGHealth;
CBShrimp.Left := 39;
CBShrimp.Top := 96;
CBShrimp.Width := 97;
CBShrimp.Height := 17;
CBShrimp.Caption := 'Shrimp';
CBShrimp.Font.Color := clBlack;
CBShrimp.Font.Height := -11;
CBShrimp.Font.Name := 'Courier New';
CBShrimp.Font.Style := [];
CBShrimp.ParentFont := False;
CBShrimp.TabOrder := 3;
CBShrimp.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBSardine := TCheckBox.Create(BGHealth);
CBSardine.Parent := BGHealth;
CBSardine.Left := 125;
CBSardine.Top := 96;
CBSardine.Width := 97;
CBSardine.Height := 17;
CBSardine.Caption := 'Sardine';
CBSardine.Font.Color := clBlack;
CBSardine.Font.Height := -11;
CBSardine.Font.Name := 'Courier New';
CBSardine.Font.Style := [];
CBSardine.ParentFont := False;
CBSardine.TabOrder := 4;
CBSardine.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBHerring := TCheckBox.Create(BGHealth);
CBHerring.Parent := BGHealth;
CBHerring.Left := 198;
CBHerring.Top := 96;
CBHerring.Width := 97;
CBHerring.Height := 17;
CBHerring.Caption := 'Herring';
CBHerring.Font.Color := clBlack;
CBHerring.Font.Height := -11;
CBHerring.Font.Name := 'Courier New';
CBHerring.Font.Style := [];
CBHerring.ParentFont := False;
CBHerring.TabOrder := 5;
CBHerring.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBAnchovies := TCheckBox.Create(BGHealth);
CBAnchovies.Parent := BGHealth;
CBAnchovies.Left := 39;
CBAnchovies.Top := 117;
CBAnchovies.Width := 97;
CBAnchovies.Height := 17;
CBAnchovies.Caption := 'Anchovies';
CBAnchovies.Font.Color := clBlack;
CBAnchovies.Font.Height := -11;
CBAnchovies.Font.Name := 'Courier New';
CBAnchovies.Font.Style := [];
CBAnchovies.ParentFont := False;
CBAnchovies.TabOrder := 6;
CBAnchovies.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBTrout := TCheckBox.Create(BGHealth);
CBTrout.Parent := BGHealth;
CBTrout.Left := 125;
CBTrout.Top := 117;
CBTrout.Width := 97;
CBTrout.Height := 17;
CBTrout.Caption := 'Trout';
CBTrout.Font.Color := clBlack;
CBTrout.Font.Height := -11;
CBTrout.Font.Name := 'Courier New';
CBTrout.Font.Style := [];
CBTrout.ParentFont := False;
CBTrout.TabOrder := 7;
CBTrout.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBPike := TCheckBox.Create(BGHealth);
CBPike.Parent := BGHealth;
CBPike.Left := 198;
CBPike.Top := 117;
CBPike.Width := 97;
CBPike.Height := 17;
CBPike.Caption := 'Pike';
CBPike.Font.Color := clBlack;
CBPike.Font.Height := -11;
CBPike.Font.Name := 'Courier New';
CBPike.Font.Style := [];
CBPike.ParentFont := False;
CBPike.TabOrder := 8;
CBPike.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBSalmon := TCheckBox.Create(BGHealth);
CBSalmon.Parent := BGHealth;
CBSalmon.Left := 39;
CBSalmon.Top := 138;
CBSalmon.Width := 97;
CBSalmon.Height := 17;
CBSalmon.Caption := 'Salmon';
CBSalmon.Font.Color := clBlack;
CBSalmon.Font.Height := -11;
CBSalmon.Font.Name := 'Courier New';
CBSalmon.Font.Style := [];
CBSalmon.ParentFont := False;
CBSalmon.TabOrder := 9;
CBSalmon.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBTuna := TCheckBox.Create(BGHealth);
CBTuna.Parent := BGHealth;
CBTuna.Left := 125;
CBTuna.Top := 138;
CBTuna.Width := 97;
CBTuna.Height := 17;
CBTuna.Caption := 'Tuna';
CBTuna.Font.Color := clBlack;
CBTuna.Font.Height := -11;
CBTuna.Font.Name := 'Courier New';
CBTuna.Font.Style := [];
CBTuna.ParentFont := False;
CBTuna.TabOrder := 10;
CBTuna.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBLobster := TCheckBox.Create(BGHealth);
CBLobster.Parent := BGHealth;
CBLobster.Left := 198;
CBLobster.Top := 138;
CBLobster.Width := 97;
CBLobster.Height := 17;
CBLobster.Caption := 'Lobster';
CBLobster.Font.Color := clBlack;
CBLobster.Font.Height := -11;
CBLobster.Font.Name := 'Courier New';
CBLobster.Font.Style := [];
CBLobster.ParentFont := False;
CBLobster.TabOrder := 11;
CBLobster.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBSwordfish := TCheckBox.Create(BGHealth);
CBSwordfish.Parent := BGHealth;
CBSwordfish.Left := 39;
CBSwordfish.Top := 159;
CBSwordfish.Width := 97;
CBSwordfish.Height := 17;
CBSwordfish.Caption := 'Swordfish';
CBSwordfish.Font.Color := clBlack;
CBSwordfish.Font.Height := -11;
CBSwordfish.Font.Name := 'Courier New';
CBSwordfish.Font.Style := [];
CBSwordfish.ParentFont := False;
CBSwordfish.TabOrder := 12;
CBSwordfish.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBCookedChicken := TCheckBox.Create(BGHealth);
CBCookedChicken.Parent := BGHealth;
CBCookedChicken.Left := 39;
CBCookedChicken.Top := 180;
CBCookedChicken.Width := 124;
CBCookedChicken.Height := 17;
CBCookedChicken.Caption := 'Cooked Chicken';
CBCookedChicken.Font.Color := clBlack;
CBCookedChicken.Font.Height := -11;
CBCookedChicken.Font.Name := 'Courier New';
CBCookedChicken.Font.Style := [];
CBCookedChicken.ParentFont := False;
CBCookedChicken.TabOrder := 13;
CBCookedChicken.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBCookedMeat := TCheckBox.Create(BGHealth);
CBCookedMeat.Parent := BGHealth;
CBCookedMeat.Left := 160;
CBCookedMeat.Top := 180;
CBCookedMeat.Width := 97;
CBCookedMeat.Height := 17;
CBCookedMeat.Caption := 'Cooked Meat';
CBCookedMeat.Font.Color := clBlack;
CBCookedMeat.Font.Height := -11;
CBCookedMeat.Font.Name := 'Courier New';
CBCookedMeat.Font.Style := [];
CBCookedMeat.ParentFont := False;
CBCookedMeat.TabOrder := 14;
CBCookedMeat.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBBread := TCheckBox.Create(BGHealth);
CBBread.Parent := BGHealth;
CBBread.Left := 39;
CBBread.Top := 201;
CBBread.Width := 97;
CBBread.Height := 17;
CBBread.Caption := 'Bread';
CBBread.Font.Color := clBlack;
CBBread.Font.Height := -11;
CBBread.Font.Name := 'Courier New';
CBBread.Font.Style := [];
CBBread.ParentFont := False;
CBBread.TabOrder := 15;
CBBread.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBKebab := TCheckBox.Create(BGHealth);
CBKebab.Parent := BGHealth;
CBKebab.Left := 97;
CBKebab.Top := 201;
CBKebab.Width := 97;
CBKebab.Height := 17;
CBKebab.Caption := 'Kebab';
CBKebab.Font.Color := clBlack;
CBKebab.Font.Height := -11;
CBKebab.Font.Name := 'Courier New';
CBKebab.Font.Style := [];
CBKebab.ParentFont := False;
CBKebab.TabOrder := 16;
CBKebab.Checked := StrToBool(SettingValues[i]);
i := i + 1;
CBSpinachRoll := TCheckBox.Create(BGHealth);
CBSpinachRoll.Parent := BGHealth;
CBSpinachRoll.Left := 154;
CBSpinachRoll.Top := 201;
CBSpinachRoll.Width := 105;
CBSpinachRoll.Height := 17;
CBSpinachRoll.Caption := 'Spinach Roll';
CBSpinachRoll.Font.Color := clBlack;
CBSpinachRoll.Font.Height := -11;
CBSpinachRoll.Font.Name := 'Courier New';
CBSpinachRoll.Font.Style := [];
CBSpinachRoll.ParentFont := False;
CBSpinachRoll.TabOrder := 17;
CBSpinachRoll.Checked := StrToBool(SettingValues[i]);
i := i + 1;
GBFight := TGroupBox.Create(frmDesign); // fight settings
GBFight.Parent := frmDesign;
GBFight.Left := 213;
GBFight.Top := 0;
GBFight.Width := 348;
GBFight.Height := 229;
GBFight.Caption := 'Fight Settings';
GBFight.Font.Color := clWindowText;
GBFight.Font.Height := -16;
GBFight.Font.Name := 'Courier New';
GBFight.Font.Style := [fsBold];
GBFight.ParentFont := False;
GBFight.TabOrder := 2;
LFightMode := TLabel.Create(GBFight);
LFightMode.Parent := GBFight;
LFightMode.Left := 23;
LFightMode.Top := 33;
LFightMode.Width := 77;
LFightMode.Height := 14;
LFightMode.Caption := 'Fight Mode:';
LFightMode.Font.Color := clWindowText;
LFightMode.Font.Height := -11;
LFightMode.Font.Name := 'Courier New';
LFightMode.Font.Style := [];
LFightMode.ParentFont := False;
LRightClickMonster := TLabel.Create(GBFight);
LRightClickMonster.Parent := GBFight;
LRightClickMonster.Left := 23;
LRightClickMonster.Top := 54;
LRightClickMonster.Width := 133;
LRightClickMonster.Height := 14;
LRightClickMonster.Caption := 'Right-Click Attack:';
LRightClickMonster.Font.Color := clWindowText;
LRightClickMonster.Font.Height := -11;
LRightClickMonster.Font.Name := 'Courier New';
LRightClickMonster.Font.Style := [];
LRightClickMonster.ParentFont := False;
LMaxFightTime := TLabel.Create(GBFight);
LMaxFightTime.Parent := GBFight;
LMaxFightTime.Left := 23;
LMaxFightTime.Top := 75;
LMaxFightTime.Width := 133;
LMaxFightTime.Height := 14;
LMaxFightTime.Caption := 'Max Time per Fight:';
LMaxFightTime.Font.Color := clWindowText;
LMaxFightTime.Font.Height := -11;
LMaxFightTime.Font.Name := 'Courier New';
LMaxFightTime.Font.Style := [];
LMaxFightTime.ParentFont := False;
LMinFightTime := TLabel.Create(GBFight);
LMinFightTime.Parent := GBFight;
LMinFightTime.Left := 23;
LMinFightTime.Top := 96;
LMinFightTime.Width := 168;
LMinFightTime.Height := 14;
LMinFightTime.Caption := 'Max Time between Fights:';
LMinFightTime.Font.Color := clWindowText;
LMinFightTime.Font.Height := -11;
LMinFightTime.Font.Name := 'Courier New';
LMinFightTime.Font.Style := [];
LMinFightTime.ParentFont := False;
LMonsterColor1 := TLabel.Create(GBFight);
LMonsterColor1.Parent := GBFight;
LMonsterColor1.Left := 23;
LMonsterColor1.Top := 117;
LMonsterColor1.Width := 112;
LMonsterColor1.Height := 14;
LMonsterColor1.Caption := 'Monster Color 1:';
LMonsterColor1.Font.Color := clWindowText;
LMonsterColor1.Font.Height := -11;
LMonsterColor1.Font.Name := 'Courier New';
LMonsterColor1.Font.Style := [];
LMonsterColor1.ParentFont := False;
LMonsterColor2 := TLabel.Create(GBFight);
LMonsterColor2.Parent := GBFight;
LMonsterColor2.Left := 23;
LMonsterColor2.Top := 137;
LMonsterColor2.Width := 112;
LMonsterColor2.Height := 14;
LMonsterColor2.Caption := 'Monster Color 2:';
LMonsterColor2.Font.Color := clWindowText;
LMonsterColor2.Font.Height := -11;
LMonsterColor2.Font.Name := 'Courier New';
LMonsterColor2.Font.Style := [];
LMonsterColor2.ParentFont := False;
LMonsterColor3 := TLabel.Create(GBFight);
LMonsterColor3.Parent := GBFight;
LMonsterColor3.Left := 23;
LMonsterColor3.Top := 158;
LMonsterColor3.Width := 112;
LMonsterColor3.Height := 14;
LMonsterColor3.Caption := 'Monster Color 3:';
LMonsterColor3.Font.Color := clWindowText;
LMonsterColor3.Font.Height := -11;
LMonsterColor3.Font.Name := 'Courier New';
LMonsterColor3.Font.Style := [];
LMonsterColor3.ParentFont := False;
LMonsterColorTolerance := TLabel.Create(GBFight);
LMonsterColorTolerance.Parent := GBFight;
LMonsterColorTolerance.Left := 23;
LMonsterColorTolerance.Top := 179;
LMonsterColorTolerance.Width := 126;
LMonsterColorTolerance.Height := 14;
LMonsterColorTolerance.Caption := 'Monster Tolerance:';
LMonsterColorTolerance.Font.Color := clWindowText;
LMonsterColorTolerance.Font.Height := -11;
LMonsterColorTolerance.Font.Name := 'Courier New';
LMonsterColorTolerance.Font.Style := [];
LMonsterColorTolerance.ParentFont := False;
CBFightMode := TComboBox.Create(GBFight);
CBFightMode.Parent := GBFight;
CBFightMode.Left := 196;
CBFightMode.Top := 30;
CBFightMode.Width := 86;
CBFightMode.Height := 22;
CBFightMode.Hint := 'Choose the desired fight mode.';
CBFightMode.Font.Color := clWindowText;
CBFightMode.Font.Height := -11;
CBFightMode.Font.Name := 'Courier New';
CBFightMode.Font.Style := [];
CBFightMode.ItemHeight := 14;
CBFightMode.ItemIndex := 0;
CBFightMode.ParentFont := False;
CBFightMode.ParentShowHint := False;
CBFightMode.ShowHint := True;
CBFightMode.TabOrder := 0;
CBFightMode.Text := SettingValues[i];
i := i + 1;
CBFightMode.Items.Add('Accurate');
CBFightMode.Items.Add('Rapid');
CBFightMode.Items.Add('Longrange');
CBRightClickMonster := TComboBox.Create(GBFight);
CBRightClickMonster.Parent := GBFight;
CBRightClickMonster.Left := 196;
CBRightClickMonster.Top := 50;
CBRightClickMonster.Width := 86;
CBRightClickMonster.Height := 22;
CBRightClickMonster.Hint := 'Choose True if the monster you are training on has a higher combat level than your combat level. Training on a higher level monster is not recommended, but still supported.';
CBRightClickMonster.Font.Color := clWindowText;
CBRightClickMonster.Font.Height := -11;
CBRightClickMonster.Font.Name := 'Courier New';
CBRightClickMonster.Font.Style := [];
CBRightClickMonster.ItemHeight := 14;
CBRightClickMonster.ItemIndex := 1;
CBRightClickMonster.ParentFont := False;
CBRightClickMonster.ParentShowHint := False;
CBRightClickMonster.ShowHint := True;
CBRightClickMonster.TabOrder := 1;
CBRightClickMonster.Text := SettingValues[i];
i := i + 1;
CBRightClickMonster.Items.Add('True');
CBRightClickMonster.Items.Add('False');
EMaxFightTime := TEdit.Create(GBFight);
EMaxFightTime.Parent := GBFight;
EMaxFightTime.Left := 196;
EMaxFightTime.Top := 71;
EMaxFightTime.Width := 86;
EMaxFightTime.Height := 22;
EMaxFightTime.Hint := 'Enter the maximum number of seconds per fight until assuming there is a swarm attack and running away.';
EMaxFightTime.Font.Color := clWindowText;
EMaxFightTime.Font.Height := -11;
EMaxFightTime.Font.Name := 'Courier New';
EMaxFightTime.Font.Style := [];
EMaxFightTime.ParentFont := False;
EMaxFightTime.ParentShowHint := False;
EMaxFightTime.ShowHint := True;
EMaxFightTime.TabOrder := 2;
EMaxFightTime.Text := SettingValues[i];
i := i + 1;
EMinFightTime := TEdit.Create(GBFight);
EMinFightTime.Parent := GBFight;
EMinFightTime.Left := 196;
EMinFightTime.Top := 92;
EMinFightTime.Width := 86;
EMinFightTime.Height := 22;
EMinFightTime.Hint := 'Enter the minimum number of seconds between fights before assuming you are lost and logging out.';
EMinFightTime.Font.Color := clWindowText;
EMinFightTime.Font.Height := -11;
EMinFightTime.Font.Name := 'Courier New';
EMinFightTime.Font.Style := [];
EMinFightTime.ParentFont := False;
EMinFightTime.ParentShowHint := False;
EMinFightTime.ShowHint := True;
EMinFightTime.TabOrder := 3;
EMinFightTime.Text := SettingValues[i];
i := i + 1;
EMonsterColor1 := TEdit.Create(GBFight);
EMonsterColor1.Parent := GBFight;
EMonsterColor1.Left := 139;
EMonsterColor1.Top := 113;
EMonsterColor1.Width := 65;
EMonsterColor1.Height := 22;
EMonsterColor1.Hint := 'Click on the Pick Color button (to the right) and click on the monster you wish to kill or type in the monster color.'
EMonsterColor1.Font.Color := clWindowText;
EMonsterColor1.Font.Height := -11;
EMonsterColor1.Font.Name := 'Courier New';
EMonsterColor1.Font.Style := [];
EMonsterColor1.ParentFont := False;
EMonsterColor1.ParentShowHint := False;
EMonsterColor1.ShowHint := True;
EMonsterColor1.TabOrder := 4;
EMonsterColor1.Text := SettingValues[i];
i := i + 1;
EMonsterColor2 := TEdit.Create(GBFight);
EMonsterColor2.Parent := GBFight;
EMonsterColor2.Left := 139;
EMonsterColor2.Top := 133;
EMonsterColor2.Width := 65;
EMonsterColor2.Height := 22;
EMonsterColor2.Hint := 'Click on the Pick Color button (to the right) and click on the monster you wish to kill or type in the monster color.';
EMonsterColor2.Font.Color := clWindowText;
EMonsterColor2.Font.Height := -11;
EMonsterColor2.Font.Name := 'Courier New';
EMonsterColor2.Font.Style := [];
EMonsterColor2.ParentFont := False;
EMonsterColor2.ParentShowHint := False;
EMonsterColor2.ShowHint := True;
EMonsterColor2.TabOrder := 5;
EMonsterColor2.Text := SettingValues[i];
i := i + 1;
EMonsterColor3 := TEdit.Create(GBFight);
EMonsterColor3.Parent := GBFight;
EMonsterColor3.Left := 139;
EMonsterColor3.Top := 154;
EMonsterColor3.Width := 65;
EMonsterColor3.Height := 22;
EMonsterColor3.Hint := 'Click on the Pick Color button (to the right) and click on the monster you wish to kill or type in the monster color.';
EMonsterColor3.Font.Color := clWindowText;
EMonsterColor3.Font.Height := -11;
EMonsterColor3.Font.Name := 'Courier New';
EMonsterColor3.Font.Style := [];
EMonsterColor3.ParentFont := False;
EMonsterColor3.ParentShowHint := False;
EMonsterColor3.ShowHint := True;
EMonsterColor3.TabOrder := 6;
EMonsterColor3.Text := SettingValues[i];
i := i + 1;
BMonsterColor1Pick := TButton.Create(GBFight);
BMonsterColor1Pick.Parent := GBFight;
BMonsterColor1Pick.Left := 204;
BMonsterColor1Pick.Top := 114;
BMonsterColor1Pick.Width := 78;
BMonsterColor1Pick.Height := 20;
BMonsterColor1Pick.Hint := 'Click me to pick a monster color, then move your mouse until you see a color that is special to the monster and click.';
BMonsterColor1Pick.Caption := 'Pick Color';
BMonsterColor1Pick.Font.Color := clWindowText;
BMonsterColor1Pick.Font.Height := -11;
BMonsterColor1Pick.Font.Name := 'Courier New';
BMonsterColor1Pick.Font.Style := [];
BMonsterColor1Pick.ParentFont := False;
BMonsterColor1Pick.ParentShowHint := False;
BMonsterColor1Pick.ShowHint := True;
BMonsterColor1Pick.TabOrder := 7;
BMonsterColor1Pick.OnClick := @ClickPickMColor1;
BMonsterColor2Pick := TButton.Create(GBFight);
BMonsterColor2Pick.Parent := GBFight;
BMonsterColor2Pick.Left := 204;
BMonsterColor2Pick.Top := 134;
BMonsterColor2Pick.Width := 78;
BMonsterColor2Pick.Height := 20;
BMonsterColor2Pick.Hint := 'Click me to pick a monster color, then move your mouse until you see a color that is special to the monster and click.';
BMonsterColor2Pick.Caption := 'Pick Color';
BMonsterColor2Pick.Font.Color := clWindowText;
BMonsterColor2Pick.Font.Height := -11;
BMonsterColor2Pick.Font.Name := 'Courier New';
BMonsterColor2Pick.Font.Style := [];
BMonsterColor2Pick.ParentFont := False;
BMonsterColor2Pick.ParentShowHint := False;
BMonsterColor2Pick.ShowHint := True;
BMonsterColor2Pick.TabOrder := 8;
BMonsterColor2Pick.OnClick := @ClickPickMColor2;
BMonsterColor3Pick := TButton.Create(GBFight);
BMonsterColor3Pick.Parent := GBFight;
BMonsterColor3Pick.Left := 204;
BMonsterColor3Pick.Top := 155;
BMonsterColor3Pick.Width := 78;
BMonsterColor3Pick.Height := 20;
BMonsterColor3Pick.Hint := 'Click me to pick a monster color, then move your mouse until you see a color that is special to the monster and click.';
BMonsterColor3Pick.Caption := 'Pick Color';
BMonsterColor3Pick.Font.Color := clWindowText;
BMonsterColor3Pick.Font.Height := -11;
BMonsterColor3Pick.Font.Name := 'Courier New';
BMonsterColor3Pick.Font.Style := [];
BMonsterColor3Pick.ParentFont := False;
BMonsterColor3Pick.ParentShowHint := False;
BMonsterColor3Pick.ShowHint := True;
BMonsterColor3Pick.TabOrder := 9;
BMonsterColor3Pick.OnClick := @ClickPickMColor3;
EMonsterColorTolerance := TEdit.Create(GBFight);
EMonsterColorTolerance.Parent := GBFight;
EMonsterColorTolerance.Left := 151;
EMonsterColorTolerance.Top := 175;
EMonsterColorTolerance.Width := 53;
EMonsterColorTolerance.Height := 22;
EMonsterColorTolerance.Hint := 'Enter the flexibility for monster colors for finding the monster.';
EMonsterColorTolerance.Font.Color := clWindowText;
EMonsterColorTolerance.Font.Height := -11;
EMonsterColorTolerance.Font.Name := 'Courier New';
EMonsterColorTolerance.Font.Style := [];
EMonsterColorTolerance.ParentFont := False;
EMonsterColorTolerance.ParentShowHint := False;
EMonsterColorTolerance.ShowHint := True;
EMonsterColorTolerance.TabOrder := 10;
EMonsterColorTolerance.Text := SettingValues[i];
i := i + 1;
GBItem := TGroupBox.Create(frmDesign);
GBItem.Parent := frmDesign;
GBItem.Left := 274;
GBItem.Top := 230;
GBItem.Width := 287;
GBItem.Height := 287;
GBItem.Caption := 'Item Settings';
GBItem.Font.Color := clWindowText;
GBItem.Font.Height := -16;
GBItem.Font.Name := 'Courier New';
GBItem.Font.Style := [fsBold];
GBItem.ParentFont := False;
GBItem.TabOrder := 5;
LPickArrows := TLabel.Create(GBItem);
LPickArrows.Parent := GBItem;
LPickArrows.Left := 23;
LPickArrows.Top := 33;
LPickArrows.Width := 105;
LPickArrows.Height := 14;
LPickArrows.Caption := 'Pick Up Arrows:';
LPickArrows.Font.Color := clWindowText;
LPickArrows.Font.Height := -11;
LPickArrows.Font.Name := 'Courier New';
LPickArrows.Font.Style := [];
LPickArrows.ParentFont := False;
LArrowName := TLabel.Create(GBItem);
LArrowName.Parent := GBItem;
LArrowName.Left := 23;
LArrowName.Top := 54;
LArrowName.Width := 77;
LArrowName.Height := 14;
LArrowName.Caption := 'Arrow Name:';
LArrowName.Font.Color := clWindowText;
LArrowName.Font.Height := -11;
LArrowName.Font.Name := 'Courier New';
LArrowName.Font.Style := [];
LArrowName.ParentFont := False;
LLoadsBeforeEquipMax := TLabel.Create(GBItem);
LLoadsBeforeEquipMax.Parent := GBItem;
LLoadsBeforeEquipMax.Left := 23;
LLoadsBeforeEquipMax.Top := 75;
LLoadsBeforeEquipMax.Width := 161;
LLoadsBeforeEquipMax.Height := 14;
LLoadsBeforeEquipMax.Caption := 'Max Loads before Equip:';
LLoadsBeforeEquipMax.Font.Color := clWindowText;
LLoadsBeforeEquipMax.Font.Height := -11;
LLoadsBeforeEquipMax.Font.Name := 'Courier New';
LLoadsBeforeEquipMax.Font.Style := [];
LLoadsBeforeEquipMax.ParentFont := False;
LLoadsBeforeEquipMin := TLabel.Create(GBItem);
LLoadsBeforeEquipMin.Parent := GBItem;
LLoadsBeforeEquipMin.Left := 23;
LLoadsBeforeEquipMin.Top := 96;
LLoadsBeforeEquipMin.Width := 161;
LLoadsBeforeEquipMin.Height := 14;
LLoadsBeforeEquipMin.Caption := 'Min Loads before Equip:';
LLoadsBeforeEquipMin.Font.Color := clWindowText;
LLoadsBeforeEquipMin.Font.Height := -11;
LLoadsBeforeEquipMin.Font.Name := 'Courier New';
LLoadsBeforeEquipMin.Font.Style := [];
LLoadsBeforeEquipMin.ParentFont := False;
LPickItems := TLabel.Create(GBItem);
LPickItems.Parent := GBItem;
LPickItems.Left := 23;
LPickItems.Top := 201;
LPickItems.Width := 98;
LPickItems.Height := 14;
LPickItems.Caption := 'Pick Up Items:';
LPickItems.Font.Color := clWindowText;
LPickItems.Font.Height := -11;
LPickItems.Font.Name := 'Courier New';
LPickItems.Font.Style := [];
LPickItems.ParentFont := False;
LArrowTolerance := TLabel.Create(GBItem);
LArrowTolerance.Parent := GBItem;
LArrowTolerance.Left := 23;
LArrowTolerance.Top := 180;
LArrowTolerance.Width := 112;
LArrowTolerance.Height := 14;
LArrowTolerance.Caption := 'Arrow Tolerance:';
LArrowTolerance.Font.Color := clWindowText;
LArrowTolerance.Font.Height := -11;
LArrowTolerance.Font.Name := 'Courier New';
LArrowTolerance.Font.Style := [];
LArrowTolerance.ParentFont := False;
LArrowHead := TLabel.Create(GBItem);
LArrowHead.Parent := GBItem;
LArrowHead.Left := 23;
LArrowHead.Top := 117;
LArrowHead.Width := 119;
LArrowHead.Height := 14;
LArrowHead.Caption := 'Arrow Head Color:';
LArrowHead.Font.Color := clWindowText;
LArrowHead.Font.Height := -11;
LArrowHead.Font.Name := 'Courier New';
LArrowHead.Font.Style := [];
LArrowHead.ParentFont := False;
LArrowMid := TLabel.Create(GBItem);
LArrowMid.Parent := GBItem;
LArrowMid.Left := 23;
LArrowMid.Top := 138;
LArrowMid.Width := 112;
LArrowMid.Height := 14;
LArrowMid.Caption := 'Arrow Mid Color:';
LArrowMid.Font.Color := clWindowText;
LArrowMid.Font.Height := -11;
LArrowMid.Font.Name := 'Courier New';
LArrowMid.Font.Style := [];
LArrowMid.ParentFont := False;
LArrowTail := TLabel.Create(GBItem);
LArrowTail.Parent := GBItem;
LArrowTail.Left := 23;
LArrowTail.Top := 159;
LArrowTail.Width := 119;
LArrowTail.Height := 14;
LArrowTail.Caption := 'Arrow Tail Color:';
LArrowTail.Font.Color := clWindowText;
LArrowTail.Font.Height := -11;
LArrowTail.Font.Name := 'Courier New';
LArrowTail.Font.Style := [];
LArrowTail.ParentFont := False;
LItemName := TLabel.Create(GBItem);
LItemName.Parent := GBItem;
LItemName.Left := 23;
LItemName.Top := 222;
LItemName.Width := 70;
LItemName.Height := 14;
LItemName.Caption := 'Item Name:';
LItemName.Font.Color := clWindowText;
LItemName.Font.Height := -11;
LItemName.Font.Name := 'Courier New';
LItemName.Font.Style := [];
LItemName.ParentFont := False;
LItemColor := TLabel.Create(GBItem);
LItemColor.Parent := GBItem;
LItemColor.Left := 23;
LItemColor.Top := 243;
LItemColor.Width := 77;
LItemColor.Height := 14;
LItemColor.Caption := 'Item Color:';
LItemColor.Font.Color := clWindowText;
LItemColor.Font.Height := -11;
LItemColor.Font.Name := 'Courier New';
LItemColor.Font.Style := [];
LItemColor.ParentFont := False;
LItemTolerance := TLabel.Create(GBItem);
LItemTolerance.Parent := GBItem;
LItemTolerance.Left := 23;
LItemTolerance.Top := 264;
LItemTolerance.Width := 105;
LItemTolerance.Height := 14;
LItemTolerance.Caption := 'Item Tolerance:';
LItemTolerance.Font.Color := clWindowText;
LItemTolerance.Font.Height := -11;
LItemTolerance.Font.Name := 'Courier New';
LItemTolerance.Font.Style := [];
LItemTolerance.ParentFont := False;
CBPickArrows := TComboBox.Create(GBItem);
CBPickArrows.Parent := GBItem;
CBPickArrows.Left := 131;
CBPickArrows.Top := 29;
CBPickArrows.Width := 73;
CBPickArrows.Height := 22;
CBPickArrows.Hint := 'Choose True to pick up arrows or False to not pick up arrows.';
CBPickArrows.Font.Color := clWindowText;
CBPickArrows.Font.Height := -11;
CBPickArrows.Font.Name := 'Courier New';
CBPickArrows.Font.Style := [];
CBPickArrows.ItemHeight := 14;
CBPickArrows.ItemIndex := 0;
CBPickArrows.ParentFont := False;
CBPickArrows.ParentShowHint := False;
CBPickArrows.ShowHint := True;
CBPickArrows.TabOrder := 1;
CBPickArrows.Text := SettingValues[i];
i := i + 1;
CBPickArrows.Items.Add('True');
CBPickArrows.Items.Add('False');
CBArrowName := TComboBox.Create(GBItem);
CBArrowName.Parent := GBItem;
CBArrowName.Left := 131;
CBArrowName.Top := 50;
CBArrowName.Width := 73;
CBArrowName.Height := 22;
CBArrowName.Hint := 'Choose the arrow type you are using.';
CBArrowName.Font.Color := clWindowText;
CBArrowName.Font.Height := -11;
CBArrowName.Font.Name := 'Courier New';
CBArrowName.Font.Style := [];
CBArrowName.ItemHeight := 14;
CBArrowName.ItemIndex := 0;
CBArrowName.ParentFont := False;
CBArrowName.ParentShowHint := False;
CBArrowName.ShowHint := True;
CBArrowName.TabOrder := 0;
CBArrowName.Text := SettingValues[i];
i := i + 1;
CBArrowName.Items.Add('Bronze');
CBArrowName.Items.Add('Iron');
CBArrowName.Items.Add('Steel');
CBArrowName.Items.Add('Mithril');
CBArrowName.Items.Add('Adamant');
ELoadsBeforeEquipMax := TEdit.Create(GBItem);
ELoadsBeforeEquipMax.Parent := GBItem;
ELoadsBeforeEquipMax.Left := 189;
ELoadsBeforeEquipMax.Top := 71;
ELoadsBeforeEquipMax.Width := 15;
ELoadsBeforeEquipMax.Height := 22;
ELoadsBeforeEquipMax.Hint := 'Enter the maximum number of arrow loads before equipping the arrows. *Note - this MUST be of greater value than the minimum loads before equip.'
ELoadsBeforeEquipMax.Font.Color := clWindowText;
ELoadsBeforeEquipMax.Font.Height := -11;
ELoadsBeforeEquipMax.Font.Name := 'Courier New';
ELoadsBeforeEquipMax.Font.Style := [];
ELoadsBeforeEquipMax.ParentFont := False;
ELoadsBeforeEquipMax.ParentShowHint := False;
ELoadsBeforeEquipMax.ShowHint := True;
ELoadsBeforeEquipMax.TabOrder := 2;
ELoadsBeforeEquipMax.Text := SettingValues[i];
i := i + 1;
ELoadsBeforeEquipMin := TEdit.Create(GBItem);
ELoadsBeforeEquipMin.Parent := GBItem;
ELoadsBeforeEquipMin.Left := 189;
ELoadsBeforeEquipMin.Top := 92;
ELoadsBeforeEquipMin.Width := 15;
ELoadsBeforeEquipMin.Height := 22;
ELoadsBeforeEquipMin.Hint := 'Enter the minimum number of arrow loads before equipping the arrows. *Note - this MUST be of lesser value than the max loads before equip.';
ELoadsBeforeEquipMin.Font.Color := clWindowText;
ELoadsBeforeEquipMin.Font.Height := -11;
ELoadsBeforeEquipMin.Font.Name := 'Courier New';
ELoadsBeforeEquipMin.Font.Style := [];
ELoadsBeforeEquipMin.ParentFont := False;
ELoadsBeforeEquipMin.ParentShowHint := False;
ELoadsBeforeEquipMin.ShowHint := True;
ELoadsBeforeEquipMin.TabOrder := 3;
ELoadsBeforeEquipMin.Text := SettingValues[i];
i := i + 1;
EArrowHead := TEdit.Create(GBItem);
EArrowHead.Parent := GBItem;
EArrowHead.Left := 145;
EArrowHead.Top := 113;
EArrowHead.Width := 59;
EArrowHead.Height := 22;
EArrowHead.Hint :='Enter 0 to auto-color the arrow head, -1 to not look for the arrow head, or click the Pick Color button (to the right) to manually choose the color.';
EArrowHead.Font.Color := clWindowText;
EArrowHead.Font.Height := -11;
EArrowHead.Font.Name := 'Courier New';
EArrowHead.Font.Style := [];
EArrowHead.ParentFont := False;
EArrowHead.ParentShowHint := False;
EArrowHead.ShowHint := True;
EArrowHead.TabOrder := 4;
EArrowHead.Text := SettingValues[i];
i := i + 1;
BArrowHead := TButton.Create(GBItem);
BArrowHead.Parent := GBItem;
BArrowHead.Left := 204;
BArrowHead.Top := 114;
BArrowHead.Width := 78;
BArrowHead.Height := 20;
BArrowHead.Hint := 'To pick the arrow head color, click me then click on the arrow head.';
BArrowHead.Caption := 'Pick Color';
BArrowHead.Font.Color := clWindowText;
BArrowHead.Font.Height := -11;
BArrowHead.Font.Name := 'Courier New';
BArrowHead.Font.Style := [];
BArrowHead.ParentFont := False;
BArrowHead.ParentShowHint := False;
BArrowHead.ShowHint := True;
BArrowHead.TabOrder := 5;
BArrowHead.OnClick := @ClickPickArrowHColor;
EArrowMid := TEdit.Create(GBItem);
EArrowMid.Parent := GBItem;
EArrowMid.Left := 145;
EArrowMid.Top := 134;
EArrowMid.Width := 59;
EArrowMid.Height := 22;
EArrowMid.Hint := 'Enter 0 to auto-color the arrow mid, -1 to not look for the arrow mid, or click the Pick Color button (to the right) to manually choose the color.';
EArrowMid.Font.Color := clWindowText;
EArrowMid.Font.Height := -11;
EArrowMid.Font.Name := 'Courier New';
EArrowMid.Font.Style := [];
EArrowMid.ParentFont := False;
EArrowMid.ParentShowHint := False;
EArrowMid.ShowHint := True;
EArrowMid.TabOrder := 6;
EArrowMid.Text := SettingValues[i];
i := i + 1;
EArrowTail := TEdit.Create(GBItem);
EArrowTail.Parent := GBItem;
EArrowTail.Left := 145;
EArrowTail.Top := 155;
EArrowTail.Width := 59;
EArrowTail.Height := 22;
EArrowTail.Hint := 'Enter 0 to auto-color the arrow tail, -1 to not look for the arrow tail, or click the Pick Color button (to the right) to manually choose the color.';
EArrowTail.Font.Color := clWindowText;
EArrowTail.Font.Height := -11;
EArrowTail.Font.Name := 'Courier New';
EArrowTail.Font.Style := [];
EArrowTail.ParentFont := False;
EArrowTail.ParentShowHint := False;
EArrowTail.ShowHint := True;
EArrowTail.TabOrder := 7;
EArrowTail.Text := SettingValues[i];
i := i + 1;
EArrowTolerance := TEdit.Create(GBItem);
EArrowTolerance.Parent := GBItem;
EArrowTolerance.Left := 145;
EArrowTolerance.Top := 176;
EArrowTolerance.Width := 59;
EArrowTolerance.Height := 22;
EArrowTolerance.Hint := 'Enter the flexibility of the arrow colors for finding arrows.';
EArrowTolerance.Font.Color := clWindowText;
EArrowTolerance.Font.Height := -11;
EArrowTolerance.Font.Name := 'Courier New';
EArrowTolerance.Font.Style := [];
EArrowTolerance.ParentFont := False;
EArrowTolerance.ParentShowHint := False;
EArrowTolerance.ShowHint := True;
EArrowTolerance.TabOrder := 8;
EArrowTolerance.Text := SettingValues[i];
i := i + 1;
CBPickItems := TComboBox.Create(GBItem);
CBPickItems.Parent := GBItem;
CBPickItems.Left := 145;
CBPickItems.Top := 197;
CBPickItems.Width := 59;
CBPickItems.Height := 22;
CBPickItems.Hint := 'Choose True to pick up items or False to not pick up items.';
CBPickItems.Font.Color := clWindowText;
CBPickItems.Font.Height := -11;
CBPickItems.Font.Name := 'Courier New';
CBPickItems.Font.Style := [];
CBPickItems.ItemHeight := 14;
CBPickItems.ItemIndex := 0;
CBPickItems.ParentFont := False;
CBPickItems.ParentShowHint := False;
CBPickItems.ShowHint := True;
CBPickItems.TabOrder := 9;
CBPickItems.Text := SettingValues[i];
i := i + 1;
CBPickItems.Items.Add('True');
CBPickItems.Items.Add('False');
EItemName := TEdit.Create(GBItem);
EItemName.Parent := GBItem;
EItemName.Left := 107;
EItemName.Top := 218;
EItemName.Width := 97;
EItemName.Height := 22;
EItemName.Hint := 'Enter the keywords of items you wish to pick up, and be sure to correspond their colors in the next text box. *Note - this is case-sensitive, and you can find the correct case by right-clicking the item.';
EItemName.Font.Color := clWindowText;
EItemName.Font.Height := -11;
EItemName.Font.Name := 'Courier New';
EItemName.Font.Style := [];
EItemName.ParentFont := False;
EItemName.ParentShowHint := False;
EItemName.ShowHint := True;
EItemName.TabOrder := 10;
EItemName.Text := SettingValues[i];
i := i + 1;
EItemColor := TEdit.Create(GBItem);
EItemColor.Parent := GBItem;
EItemColor.Left := 107;
EItemColor.Top := 239;
EItemColor.Width := 97;
EItemColor.Height := 22;
EItemColor.Hint := 'Click on the Pick Color button (to the right) to get the color of the items on the item name list. *Note - positions on this list correspond to the item name list.';
EItemColor.Font.Color := clWindowText;
EItemColor.Font.Height := -11;
EItemColor.Font.Name := 'Courier New';
EItemColor.Font.Style := [];
EItemColor.ParentFont := False;
EItemColor.ParentShowHint := False;
EItemColor.ShowHint := True;
EItemColor.TabOrder := 11;
EItemColor.Text := SettingValues[i];
i := i + 1;
EItemTolerance := TEdit.Create(GBItem);
EItemTolerance.Parent := GBItem;
EItemTolerance.Left := 131;
EItemTolerance.Top := 260;
EItemTolerance.Width := 73;
EItemTolerance.Height := 22;
EItemTolerance.Hint := 'Enter the flexibility of the item colors for finding items.';
EItemTolerance.Font.Color := clWindowText;
EItemTolerance.Font.Height := -11;
EItemTolerance.Font.Name := 'Courier New';
EItemTolerance.Font.Style := [];
EItemTolerance.ParentFont := False;
EItemTolerance.ParentShowHint := False;
EItemTolerance.ShowHint := True;
EItemTolerance.TabOrder := 15;
EItemTolerance.Text := SettingValues[i];
i := i + 1;
BItemColor := TButton.Create(GBItem);
BItemColor.Parent := GBItem;
BItemColor.Left := 204;
BItemColor.Top := 240;
BItemColor.Width := 78;
BItemColor.Height := 20;
BItemColor.Hint := 'To pick an item color, click me then click on the item.';
BItemColor.Caption := 'Pick Color';
BItemColor.Font.Color := clWindowText;
BItemColor.Font.Height := -11;
BItemColor.Font.Name := 'Courier New';
BItemColor.Font.Style := [];
BItemColor.ParentFont := False;
BItemColor.ParentShowHint := False;
BItemColor.ShowHint := True;
BItemColor.TabOrder := 12;
BItemColor.OnClick := @ClickPickItemColor;
BArrowMid := TButton.Create(GBItem);
BArrowMid.Parent := GBItem;
BArrowMid.Left := 204;
BArrowMid.Top := 135;
BArrowMid.Width := 78;
BArrowMid.Height := 20;
BArrowMid.Hint := 'To pick the arrow mid color, click me then click on the arrow mid.';
BArrowMid.Caption := 'Pick Color';
BArrowMid.Font.Color := clWindowText;
BArrowMid.Font.Height := -11;
BArrowMid.Font.Name := 'Courier New';
BArrowMid.Font.Style := [];
BArrowMid.ParentFont := False;
BArrowMid.ParentShowHint := False;
BArrowMid.ShowHint := True;
BArrowMid.TabOrder := 13;
BArrowMid.OnClick := @ClickPickArrowMColor;
BArrowTail := TButton.Create(GBItem);
BArrowTail.Parent := GBItem;
BArrowTail.Left := 204;
BArrowTail.Top := 157;
BArrowTail.Width := 78;
BArrowTail.Height := 20;
BArrowTail.Hint := 'To pick the arrow tail color, click me then click on the arrow tail.';
BArrowTail.Caption := 'Pick Color';
BArrowTail.Font.Color := clWindowText;
BArrowTail.Font.Height := -11;
BArrowTail.Font.Name := 'Courier New';
BArrowTail.Font.Style := [];
BArrowTail.ParentFont := False;
BArrowTail.ParentShowHint := False;
BArrowTail.ShowHint := True;
BArrowTail.TabOrder := 14;
BArrowTail.OnClick := @ClickPickArrowTColor;
GBTalk := TGroupBox.Create(frmDesign);
GBTalk.Parent := frmDesign;
GBTalk.Left := 0;
GBTalk.Top := 454;
GBTalk.Width := 274;
GBTalk.Height := 125;
GBTalk.Caption := 'Talk Settings';
GBTalk.Font.Color := clBlack;
GBTalk.Font.Height := -16;
GBTalk.Font.Name := 'Courier New';
GBTalk.Font.Style := [fsBold];
GBTalk.ParentFont := False;
GBTalk.TabOrder := 3;
LMinSpeakTime := TLabel.Create(GBTalk);
LMinSpeakTime.Parent := GBTalk;
LMinSpeakTime.Left := 23;
LMinSpeakTime.Top := 33;
LMinSpeakTime.Width := 154;
LMinSpeakTime.Height := 14;
LMinSpeakTime.Caption := 'Min Time between Talk:';
LMinSpeakTime.Font.Color := clBlack;
LMinSpeakTime.Font.Height := -11;
LMinSpeakTime.Font.Name := 'Courier New';
LMinSpeakTime.Font.Style := [];
LMinSpeakTime.ParentFont := False;
LMinChatLinesUntilSpeak := TLabel.Create(GBTalk);
LMinChatLinesUntilSpeak.Parent := GBTalk;
LMinChatLinesUntilSpeak.Left := 23;
LMinChatLinesUntilSpeak.Top := 54;
LMinChatLinesUntilSpeak.Width := 154;
LMinChatLinesUntilSpeak.Height := 14;
LMinChatLinesUntilSpeak.Caption := 'Min Lines before Talk:';
LMinChatLinesUntilSpeak.Font.Color := clBlack;
LMinChatLinesUntilSpeak.Font.Height := -11;
LMinChatLinesUntilSpeak.Font.Name := 'Courier New';
LMinChatLinesUntilSpeak.Font.Style := [];
LMinChatLinesUntilSpeak.ParentFont := False;
LAutoTalk := TLabel.Create(GBTalk);
LAutoTalk.Parent := GBTalk;
LAutoTalk.Left := 23;
LAutoTalk.Top := 75;
LAutoTalk.Width := 70;
LAutoTalk.Height := 14;
LAutoTalk.Caption := 'Auto-Talk:';
LAutoTalk.Font.Color := clBlack;
LAutoTalk.Font.Height := -11;
LAutoTalk.Font.Name := 'Courier New';
LAutoTalk.Font.Style := [];
LAutoTalk.ParentFont := False;
LAutoRespond := TLabel.Create(GBTalk);
LAutoRespond.Parent := GBTalk;
LAutoRespond.Left := 23;
LAutoRespond.Top := 96;
LAutoRespond.Width := 91;
LAutoRespond.Height := 14;
LAutoRespond.Caption := 'Auto-Respond:';
LAutoRespond.Font.Color := clBlack;
LAutoRespond.Font.Height := -11;
LAutoRespond.Font.Name := 'Courier New';
LAutoRespond.Font.Style := [];
LAutoRespond.ParentFont := False;
EMinSpeakTime := TEdit.Create(GBTalk);
EMinSpeakTime.Parent := GBTalk;
EMinSpeakTime.Left := 182;
EMinSpeakTime.Top := 30;
EMinSpeakTime.Width := 58;
EMinSpeakTime.Height := 22;
EMinSpeakTime.Hint := 'Enter the minimum number of seconds before talking again.';
EMinSpeakTime.Font.Color := clBlack;
EMinSpeakTime.Font.Height := -11;
EMinSpeakTime.Font.Name := 'Courier New';
EMinSpeakTime.Font.Style := [];
EMinSpeakTime.ParentFont := False;
EMinSpeakTime.ParentShowHint := False;
EMinSpeakTime.ShowHint := True;
EMinSpeakTime.TabOrder := 2;
EMinSpeakTime.Text := SettingValues[i];
i := i + 1;
CBMinChatLinesUntilSpeak := TComboBox.Create(GBTalk);
CBMinChatLinesUntilSpeak.Parent := GBTalk;
CBMinChatLinesUntilSpeak.Left := 182;
CBMinChatLinesUntilSpeak.Top := 51;
CBMinChatLinesUntilSpeak.Width := 58;
CBMinChatLinesUntilSpeak.Height := 22;
CBMinChatLinesUntilSpeak.Hint := 'Choose the minimum number of lines that must be seen in the chat box before talking again. 0 means you can talk again even if you have spoken last.';
CBMinChatLinesUntilSpeak.Font.Color := clBlack;
CBMinChatLinesUntilSpeak.Font.Height := -11;
CBMinChatLinesUntilSpeak.Font.Name := 'Courier New';
CBMinChatLinesUntilSpeak.Font.Style := [];
CBMinChatLinesUntilSpeak.ItemHeight := 14;
CBMinChatLinesUntilSpeak.ItemIndex := 1;
CBMinChatLinesUntilSpeak.ParentFont := False;
CBMinChatLinesUntilSpeak.ParentShowHint := False;
CBMinChatLinesUntilSpeak.ShowHint := True;
CBMinChatLinesUntilSpeak.TabOrder := 0;
CBMinChatLinesUntilSpeak.Text := SettingValues[i];
i := i + 1;
CBMinChatLinesUntilSpeak.Items.Add('0');
CBMinChatLinesUntilSpeak.Items.Add('1');
CBMinChatLinesUntilSpeak.Items.Add('2');
CBMinChatLinesUntilSpeak.Items.Add('3');
CBMinChatLinesUntilSpeak.Items.Add('4');
CBMinChatLinesUntilSpeak.Items.Add('5');
CBAutoTalk := TComboBox.Create(GBTalk);
CBAutoTalk.Parent := GBTalk;
CBAutoTalk.Left := 182;
CBAutoTalk.Top := 72;
CBAutoTalk.Width := 58;
CBAutoTalk.Height := 22;
CBAutoTalk.Hint := 'Choose True to turn on the Auto-Talk feature or False to turn it off.';
CBAutoTalk.Font.Color := clBlack;
CBAutoTalk.Font.Height := -11;
CBAutoTalk.Font.Name := 'Courier New';
CBAutoTalk.Font.Style := [];
CBAutoTalk.ItemHeight := 14;
CBAutoTalk.ItemIndex := 0;
CBAutoTalk.ParentFont := False;
CBAutoTalk.ParentShowHint := False;
CBAutoTalk.ShowHint := True;
CBAutoTalk.TabOrder := 3;
CBAutoTalk.Text := SettingValues[i];
i := i + 1;
CBAutoTalk.Items.Add('True');
CBAutoTalk.Items.Add('False');
CBAutoRespond := TComboBox.Create(GBTalk);
CBAutoRespond.Parent := GBTalk;
CBAutoRespond.Left := 182;
CBAutoRespond.Top := 93;
CBAutoRespond.Width := 58;
CBAutoRespond.Height := 22;
CBAutoRespond.Hint := 'Choose True to turn on the Auto-Respond feature or False to turn it off.';
CBAutoRespond.Font.Color := clBlack;
CBAutoRespond.Font.Height := -11;
CBAutoRespond.Font.Name := 'Courier New';
CBAutoRespond.Font.Style := [];
CBAutoRespond.ItemHeight := 14;
CBAutoRespond.ItemIndex := 0;
CBAutoRespond.ParentFont := False;
CBAutoRespond.ParentShowHint := False;
CBAutoRespond.ShowHint := True;
CBAutoRespond.TabOrder := 1;
CBAutoRespond.Text := SettingValues[i];
CBAutoRespond.Items.Add('True');
CBAutoRespond.Items.Add('False');
BStartScript := TButton.Create(frmDesign);
BStartScript.Parent := frmDesign;
BStartScript.Left := 314;
BStartScript.Top := 518;
BStartScript.Width := 207;
BStartScript.Height := 58;
BStartScript.Hint := 'Start the script with these current settings!';
BStartScript.Caption := 'Start Script!';
BStartScript.Font.Color := clWindowText;
BStartScript.Font.Height := -24;
BStartScript.Font.Name := 'Courier New';
BStartScript.Font.Style := [fsBold, fsUnderline];
BStartScript.ParentFont := False;
BStartScript.ParentShowHint := False;
BStartScript.ShowHint := True;
BStartScript.TabOrder := 4;
BStartScript.OnClick := @ClickStartScript;
end; // end of InitForm

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 LoadVars;
begin

CombatType := 'Ranged';
case FightMode of
1: SkillsUsing := ['Ranged', 'Hitpoints'];
2: SkillsUsing := ['Ranged', 'Hitpoints'];
3: SkillsUsing := ['Ranged', 'Defence', 'Hitpoints'];
end;

Greetings := ['sup','yo','hey','hi','ey','hello','hey, sup?', 'hows it goin'];
Messages := ['i feel like eatin a nice warm apple pie','i feel like havin a hot chocolate','man its such nice weather','nothin here but ownage heh','ima pk so well when my lvls r up','any1 know a good joke?','???','?','what??','i wish i was high enuff to pk now','its so much harder to grow the higher ur lvl =(','jeez takin so long to grow...','fav bands? i love pink floyd.','ima be an ownage pure! my stats own.','im married to another man and adopted 17 children... not!','can any1 disagree to the fact that the matrix is officially a classic?','man trainin is long','this trainin is takin a while','i wanna get 99 fast so i can pk! lol','me thirsty','pink floyd is the best band ever... listenin to em now','who likes ( . )( . )!!!','ima own u all wen i get 99 range ^^','i loose so much health =( need better def','this game is heaven','i love rs','lol','lolz','haha','lmfao','lol n00bz','range lvls?','hp lvls?','def lvls?','im hitting such high dmg','i pwn','ownzage!','sweet ^^'];
Questions := ['Sup','Wazzup','Wats up','Whats up'];
Responses := ['nm, im lovin rs','nm, life is good ^^','doin sum hw, u?','n2m','nm','nm, u?','not much... rangings awesome','n2m, fun time ranging'];
RangelvlQuestions := ['Range'];
DeflvlQuestions := ['Def'];
HpLvlQuestions := ['Hp','Health','Hitpoint'];
LvlQuestions := ['Lv','Level'];
NoobQuestions := ['Noob','Nub','N00b'];
NoobResponses := ['who u callin noob =@','im not a noob!','how am i a noob?'];
MoneyQuestions := ['Cash','Money','Muney','Gold','Coin','Mill'];
MoneyResponses := ['i have tons of cash','i have mills in bank from pks','im rich'];
AgeQuestions := ['How old','Which grade','What grade'];
AgeResponses := ['looks like im older than u','grade 9, u?','14 years old','im 14, u?','14, you?','gr9 you?','grade 9, you?']
LocationQuestions := ['City','Country','You from'];
LocationResponses := ['lol i cant tell u where im from ^^','r u askin me for personal details?','i can report u for askin personal details, u know','umm my mom says i cant say where im from...','im not supposed to say where im from','its against rules to ask where im from, ur lucky im not reporting'];
SexQuestions := ['Male','Boy','Girl','Guy','Woman','Man'];
SexResponses := ['im a guy','im a male','im a boy','im a sexy guy, why u ask? lol','im a hot guy ^^', 'lol'];
LeavingQuestions := ['G2g','Leav','Cya','Bye','Peace', 'Gotta go'];
LeavingResponses := ['peace','au revoir','see ya later!','ok cya','bi','bye','ciao'];
ArrowQuestions := ['How many arrows', 'Kind of arrows'];
ArrowResponses := ['i use ' + LowerCase(ArrowName) + ' arrows =)', 'i have so many arrows', 'i got tons of arrows','i have tons of arrows, how many u got?','i have tons of ' + LowerCase(ArrowName) + ' arrows, how many do u have', 'i use ' + LowerCase(ArrowName) + ' arrows, u?','i <3 ' + LowerCase(ArrowName) + ' arrows', 'i use ' + LowerCase(ArrowName) + ' arrows... wish i had more tho'];

RandomFightTabs := [1, 5, 8, 11];
RandomFishTabs := [2, 8]
end;

{*********************}
{***** LOAD DTMS *****}
{*********************}

procedure LoadDTMs;
var
i,j:Integer;
begin
MMOtherPersonDTM := DTMFromString('78DA7DCED10D803008045030E9FE33A8ED185' +
'5676004BE990185CF2B8997107E5E72C7D746B413C4DDA9C5E7B8' +
'37C2F7BFC9F013E6406366D59C6844044D760D5AC268727347A1A' +
'A6866ED2A9B67DDBC9A0F15C52317');

j := 0;
SetArrayLength(FoodDTM,GetArrayLength(FoodName));
SetArrayLength(FoodDTMName,GetArrayLength(FoodName));
for i := 0 to GetArrayLength(FoodName)-1 do
begin
if(FoodName[i] = 'Shrimp') then
begin
FoodDTM[j] := DTMFromString('78DA63AC6162606863644006CB0A441944803' +
'448F43F1030E602D5B4A2AA81C8C248205D0A54D34B404D3550CD' +
'64026ADA806AEA8830A711BF1A00BBFC0B63');
FoodDTMName[j] := 'Shr';
end else
if(FoodName[i] = 'Sardine') then
begin
FoodDTM[j] := DTMFromString('78DA63DCC0C0C0309191011974E4663088006' +
'990E87F2060DC0A6474A2AA81C8C24820BD0E48F41150B31A484C' +
'23A0661B11E66C041253F0AB010096870D0A');
FoodDTMName[j] := 'Sar';
end else
if(FoodName[i] = 'Herring') then
begin
FoodDTM[j] := DTMFromString('78DA635CCFC0C0D0CEC8800C3A72331844803' +
'448F43F10306E04321A50D540646124905E0A24BA08A8590524FA' +
'08A8D90F245A09A8D90B24AAF1AB0100786A0CCF');
FoodDTMName[j] := 'Her';
end else
if(FoodName[i] = 'Anchovies') then
begin
FoodDTM[j] := DTMFromString('78DA63DCC8C0C0D0C2C8800C6C1CB31944803' +
'448F43F10302E0132EA51D540646124905E09247A09A8D90924BA' +
'08A83900241A09A8D942D83D001B6D0C55');
FoodDTMName[j] := 'Anc';
end else
if(FoodName[i] = 'Trout') then
begin
FoodDTM[j] := DTMFromString('78DA632C676260E86464400613CA8B1944803' +
'448F43F10301600D54C405503918591403A07A8A69B809A4AA09A' +
'1A026A5A88500332A71FBF1A00EFBD0BA2');
FoodDTMName[j] := 'Tro';
end else
if(FoodName[i] = 'Pike') then
begin
FoodDTM[j] := DTMFromString('78DA63DCC0C0C0D0CEC8800C5267A43288006' +
'990E87F20605C0164F4A3AA81C8C248200D52D34640CD36205147' +
'40CD3E20514140CD1E20D14840CD1620D18B5F0D0072DD0E12');
FoodDTMName[j] := 'Pik';
end else
if(FoodName[i] = 'Salmon') then
begin
FoodDTM[j] := DTMFromString('78DA639CC7C4C090CCC8800CCE79483288006' +
'990E87F20609C0854938EAA06220B2381F424A09A1C026A5603D5' +
'C41050B312A82682809AF984CD0100BFF60B5D');
FoodDTMName[j] := 'Sal';
end else
if(FoodName[i] = 'Tuna') then
begin
FoodDTM[j] := DTMFromString('78DA635CC7C0C0309991011974E4663088006' +
'990E87F20605C0F6474A1AA81C8C24820BD0748F41250B31D484C' +
'23A0663590984340CD52203115BF1A009E5F0D16');
FoodDTMName[j] := 'Tun';
end else
if(FoodName[i] = 'Lobster') then
begin
FoodDTM[j] := DTMFromString('78DA63DCC4C0C030919101199C4965601001D' +
'220D1FF40C0B812C8E8465503918591407A0790984D40CD6E2031' +
'9908739A09A859022426E15703007E1F0CE2');
FoodDTMName[j] := 'Lob';
end else
if(FoodName[i] = 'Swordfish') then
begin
FoodDTM[j] := DTMFromString('78DA63DCC2C0C0309B910119CC489DC12002A' +
'441A2FF8180713B903105550D44164602E93540622E0135AB80C4' +
'32026A761361CE3E902309A8394284399B80C464FC6A0049C4104' +
'C');
FoodDTMName[j] := 'Swo';
end else
if(FoodName[i] = 'Cooked Chicken') then
begin
FoodDTM[j] := DTMFromString('78DA63DCC8C0C0D0C6C8800C8A1C391944803' +
'448F43F10302E07325A50D540646124905E0124FA09A8D90F24DA' +
'09A8D90324EA09A8D902241AF0AB010001FC0C32');
FoodDTMName[j] := 'chi';
end else
if(FoodName[i] = 'Cooked Meat') then
begin
FoodDTM[j] := DTMFromString('78DA63DCCCC0C0D0C2C8800C8A1C391944803' +
'448F43F1030EE0632CA50D54064612490DE0424261350B30C4874' +
'1350731048D41161573D7E350006140C32');
FoodDTMName[j] := 'mea';
end else
if(FoodName[i] = 'Bread') then
begin
FoodDTM[j] := DTMFromString('78DA635CC6C4C0709D910119CCAE17641001D' +
'220D1FF40C0B81AA8E614AA1A882C8C04D20B816A1E1150330BA8' +
'E61601355B806A2EE257030022370CC7');
FoodDTMName[j] := 'rea';
end else
if(FoodName[i] = 'Kebab') then
begin
FoodDTM[j] := DTMFromString('78DA630C646260A86664400642D3C41844803' +
'448F43F1030FA03D5B4A2AA81C8C24820ED06545343404D10504D' +
'3E0135B198EEC150130954538C5F0D00D08E09B9');
FoodDTMName[j] := 'Keb';
end else
if(FoodName[i] = 'Spinach Roll') then
begin
FoodDTM[j] := DTMFromString('78DA630C64626038CFC8800CAA5AA31944803' +
'448F43F1030FA02D59C455503918591403A18A8E6180135619876' +
'61A8F107AAB941408D1750CD15FC6A0032950C4B');
FoodDTMName[j] := 'pin';
end;
j := j + 1;
end;

ArrowDTM := 0;
case ArrowName of
'Bronze':
ArrowDTM := DTMFromString('78DA63AC656260886764400611A69C0C22401' +
'A24FA1F08189B806AC251D5B89ACAC1D58000584D08AA1A982C5C' +
'4D0B504D187E3500751208CE');
'Iron':
ArrowDTM := DTMFromString('78DA63DCC0C4C050CEC8800CC24C381944803' +
'448F43F10306E05AAC94355E3E1E2025703026035D9A86A60B270' +
'35DB816A72F1AB0100EC870A2C');
'Steel':
ArrowDTM := DTMFromString('78DA630C626260686564400611A69C0C22401' +
'A24FA1F081823806AAA51D5E4A5A5C1D580006314A61A982C5C0D' +
'C89C0AFC6A00A2C3095A');
'Mithril':
ArrowDTM := DTMFromString('78DA63DCCAC0C0D0C8C8800CDC35581944803' +
'448F43F1030EE02322A51D5681BB9C0D58000584D19AA1A982C5C' +
'CD1E4C73D0D50000DFE50A16');
'Adamant':
ArrowDTM := DTMFromString('78DA63DCC2C0C0D0CCC8800CDC35581944803' +
'44C94711790A8445563E4680457F31F08C06ACA50D5C04C809BB3' +
'07D31C74350052710A1B');
end;
end;

// more accurate and faster
function GInFight: Boolean;
begin
Result := (FindColor(x, y, 65280, 250, 127, 270, 166) or FindColor(x, y, 255,
242, 127, 282, 166));
end;

procedure GFTFightWait(Time: Integer);
var
i: Integer;
begin
for i := 1 to Time do
begin
Wait(200 + Random(50));
FindTalk;
if not GInFight then Exit;
end;
end;

function GFindNPCUpText: Boolean;
var Tempx, Tempy: Integer;
begin
Result := FindColorTolerance(Tempx, Tempy, 56539, 7, 7, 334, 20, 10);
end;

function GFlag: Boolean;
var
Timeout: Integer;
begin
if (not (FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2))) then Exit;
Result := True;
repeat
FTWait(1);
Timeout := Timeout + 1;
until (not FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) or (Timeout > 20);
end;

procedure GRunAwayDirection(direction: string);
begin
x := 0;
y := 0;
if (UpperCase(direction) = 'N') then
y := -50;
if (UpperCase(direction) = 'E') then
x := 50;
if (UpperCase(direction) = 'S') then
y := 50;
if (UpperCase(direction) = 'W') then
x := -50;
RunTox := x + 648;
RunBackx := 648 - x;
RunToy := y + 83;
RunBacky := 83 - y;
MouseFindFlag(RunTox, RunToy, 1, 1);
GFlag;
end;

procedure GRunBack;
begin
MouseFindFlag(RunBackx, RunBacky, 1, 1);
GFlag;
end;

{*******************************}
{***** REVISED ANTI-RANDOM *****}
{*******************************}

function GFindNormalRandoms(OnlyInFight: Boolean): Boolean;
var
i: Integer;
begin
if not LoggedIn then LoginPlayer;
Writeln(' Checking for randoms...');
for i := 1 to 12 do
begin
if OnlyInFight then
begin
if not GInFight then Exit;
end;

case I of
1: if FindTalk then
begin
Writeln('Found talking random...');
Result := True;
end;
2: if FindMime then Result := True;
3: if FindMaze then Result := True;
4: if FindQuiz then Result := True;
5: if FindDemon then Result := True;
6: if FindScapeRune then Result := True;
7: if FindLamp(LampSkill) then Result := True;
8: if (FindNewBox) then
begin
if (GInFight) then BoxInFight := True
else
begin
Result := True;
if (UseBoxSolver) then
SolveBox
else
GambleNewBox
end;
end;
9: if NoGameTab then
begin
Result := True;
Writeln('Logged out because you were missing game tabs and in a random event...');
Logout;
Exit;
end;
10: if FindTalk then
begin
Writeln('Found talking random...');
Result := True;
end;
11: SaveToChatLog;
12: if RC then Result := True;
end;
if Result then Continue;
FTWait(1);
end;
end;

procedure CheckLevels;
begin
case FightMode of
3: if (GetSkillLevel('Defence') >= MaxDefence) then
begin
Status('Changed to rapid because your defence level max was reached.');
repeat until GameTab(1);
SetFightMode(2);
end;
end;
end;

{*************************}
{***** SCRIPT REPORT *****}
{*************************}

procedure GReport;
begin
Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
Writeln('~~~~~~~~~~~~~~~~~~GExtremeFighter~~~~~~~~~~~~~~~~~~');
Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
Writeln('Runtime: ' + TimeRunning);
Writeln('Monsters Killed: ' + IntToStr(Killed));
Writeln('Arrow Pick-Ups: ' + IntToStr(ArrowGrabs));
Writeln('Item Pick-Ups: ' + IntToStr(ItemGrabs));
Writeln('Food Eaten: ' + IntToStr(FoodEaten));
Writeln('Lowest Health: ' + IntToStr(LowestHealth));
GameTab(2);
if GetArrayLength(SkillsUsing) > 0 then
begin
FirstLoop := True;
for i := 0 to GetArrayLength(SkillsUsing) - 1 do
begin
if GetSkillLevel(SkillsUsing[i]) > SkillsLevels[i] then
begin
if FirstLoop then
begin
Writeln('Levels Gained:');
FirstLoop := False;
end;
Writeln(' +' + IntToStr(GetSkillLevel(SkillsUsing[i]) - SkillsLevels[i]) + ' ' + SkillsUsing[i] + ' = ' + IntToStr(GetSkillLevel(SkillsUsing[i])) + '!!!');
end;
end;
end;
Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
Writeln('');

CheckLevels;
SRLRandomsReport;
end; // end of report

function GPopUp(Option: String; MaxExamine: Boolean): Boolean;
var
DTMTop, DTMBottom, x, y, x1, x2, y1, y2, MaxExamineY: Integer;
begin
if not LoggedIn then Exit;
DTMTop := DTMFromString('78DA63146464606801622C0026CA28006435A' +
'3AA890D7147552345841A90393D04D4880259DD04D4880359ED04' +
'D4280059AD04FC2504644DC4AF06000DC909E0');
DTMBottom := DTMFromString('78DA635CCCC8C070198891406C883B9886893' +
'22E02B22EA1AA8101B89A8540D64522CCB948843984EC02B9F910' +
'01BBA610E1AF6944D80572F311026AE6005967F0DB05007BD4134' +
'5');
if FindDTM(DTMTop, x1, y1, 10, 10, 764, 502) then
begin
FindDTM(DTMBottom, x2, y2, x1, y1, 764, 502);

MaxExamineY := y2;

if MaxExamine then
begin
if (FindText(x, y, 'xa', upchars, x1, y1, x2, MaxExamineY)) then
begin
repeat
MaxExamineY := y - 1; // finds highest examine so knows to look above only
until not FindText(x, y, 'xa', upchars, x1, y1, x2, MaxExamineY)
end else
begin
Result := False;
FreeDTM(DTMTop);
FREEDTM(DTMBottom);
Exit;
end;
end;

if (FindText(x, y, Option, upchars, x1, y1, x2, MaxExamineY)) then
begin
Result := True;
Mouse(x + Length(Option) * 3, y + 2, 4, 3, True);
end else
begin
if (FindText(x, y, 'ancel', upchars, x1, y1, x2, y2)) then
begin
Mouse(x + 3, y + 2, 4, 3, True);
end;
end;
end;
FreeDTM(DTMTop);
FREEDTM(DTMBottom);
end;

function GSearchLine(Line:Integer; Text:String): Boolean;
var
ColonX: Integer;
begin
// line starts from 1
ColonX := 21;
while IsTextInAreaEx(ColonX, 429 - (Line * 14), MCX2, 429 - (Line * 14), x, y, ':',
100, SmallChars, False, True, 0, 2, -1) do ColonX := x + 1;

if IsTextInAreaEx(ColonX, 429 - (Line * 14), MCX2, 429 - (Line * 14), x, y, Text,
100, SmallChars, False, True, 0, 2, -1) then Result := True;
end;

function GSearchLineNew(Line:Integer; Text:String): Boolean;
var
ColonX: Integer;
begin
// line starts from 1
ColonX := 21;
while IsTextInAreaEx(ColonX, 429 - (Line * 14), MCX2, 429 - (Line * 14), x, y, ':',
100, SmallChars, False, True, 0, 2, -1) do ColonX := x + 1;

if IsTextInAreaEx(ColonX, 429 - (Line * 14), MCX2, 429 - (Line * 14), x, y, Text,
100, SmallChars, False, True, 0, 2, -1) then Result := True;
end;

// sees whether or not player has spoken in chat box
// 0 = current player spoke, 1 = other player spoke, 2 = game message
function GLineTypes: array of Integer;
begin
SetArrayLength(Result, 5);
for i := 1 to 5 do
begin
// -0-
if IsTextInAreaEx(21, 429 - (i * 14), 137, 429 - (i * 14), x, y, Copy(Players[CurrentPlayer].Name + ':',2,Length(Players[CurrentPlayer].Name)), 100, SmallChars, False,
True, 0, 2, -1) then
begin
Result[i - 1] := 0;
end else
// -1-
if IsTextInAreaEx(21, 429 - (i * 14), 137, 429 - (i * 14), x, y, ':', 100,
SmallChars, False, True, 0, 2, -1) then
begin
Result[i - 1] := 1;
end else
// -2-
if IsTextInAreaEx(21, 429 - (i * 14), 137, 429 - (i * 14), x, y, '.', 100,
SmallChars, False, True, 0, 2, -1) or
IsTextInAreaEx(21, 429 - (i * 14), 137, 429 - (i * 14), x, y, ',', 100,
SmallChars, False, True, 0, 2, -1) or
IsTextInAreaEx(21, 429 - (i * 14), 137, 429 - (i * 14), x, y, '!', 100,
SmallChars, False, True, 0, 2, -1) then
begin
Result[i - 1] := 2;
end else
// -NO LINETEXT-
Result[i - 1] := -1;
end;
end;

function GLastGameMessage(Text:String): Boolean;
var
i: Integer;
LinesCheck: array of Integer;
begin
LinesCheck := GLineTypes;

for i := 1 to 5 do
begin
if LinesCheck[i - 1] = 2 then
begin
if GSearchLine(i, Text) then Result := True;
Exit;
end;
end;
end;

procedure GHumanType(Text: string);
begin
SendText(HumanText(Text,45) + Chr(13));
end;

{*****************************************}
{***** AUTO-TALK/AUTO-RESPOND SYSTEM *****}
{*****************************************}

function GAutoTalk(TalkType:Integer): Boolean;
var
i, j, k, l: Integer;
PlayerLines, OtherPlayerLines, GameLines, LinesCheck : array of Integer;
begin
if (not AutoTalk) and (not AutoRespond) then Exit else
if (not AutoTalk) then begin if (TalkType = 0) or (TalkType = 1) then Exit end else
if (not AutoRespond) and (TalkType = 2) then Exit;

if (not FirstTalk) and (TimeFromMark(LastSpeakTime)/1000 < MinSpeakTime) then
begin
Writeln(' -> You spoke ' + IntToStr(TimeFromMark(LastSpeakTime)/1000) + ' seconds ago. Exiting auto-talk/respond...');
Exit;
end;

if not FindDTM(MMOtherPersonDTM, x, y, 618, 53, 678, 113) then
begin
Writeln(' -> Could not find other players close to you on minimap. Exiting auto-talk/respond...');
Exit;
end;

if AutoTalk then
begin
if FirstTalk then
if GLastGameMessage('Welcome to RuneScape') then
begin
TalkType := 0;
FirstTalk := False;
end;
end;

if (TalkType = 1) or (TalkType = 2) then
begin
LinesCheck := GLineTypes;
SetArrayLength(PlayerLines, 0);
SetArrayLength(OtherPlayerLines, 0);
SetArrayLength(GameLines, 0);

for i := 0 to GetArrayLength(LinesCheck) - 1 do
begin
if LinesCheck[i] = 0 then // store current player lines
begin
SetArrayLength(PlayerLines, GetArrayLength(PlayerLines) + 1);
PlayerLines[GetArrayLength(PlayerLines) - 1] := i + 1;
end else
if LinesCheck[i] = 1 then // store other player lines
begin
SetArrayLength(OtherPlayerLines, GetArrayLength(OtherPlayerLines) + 1);
OtherPlayerLines[GetArrayLength(OtherPlayerLines) - 1] := i + 1;
end else
if LinesCheck[i] = 2 then // store game lines
begin
SetArrayLength(GameLines, GetArrayLength(GameLines) + 1);
GameLines[GetArrayLength(GameLines) - 1] := i + 1;
end;
end;

if MinChatLinesUntilSpeak <> 0 then
begin // exits if you spoke before minimum
if (GetArrayLength(PlayerLines) >= 1) then
if (PlayerLines[0] <= MinChatLinesUntilSpeak) then
begin
Writeln(' -> You spoke earlier than the minimum lines of other chat requested...');
Exit;
end;
end;
end;

case TalkType of
0: // greeting
begin
Writeln(' -> Sending a random greeting...');
GHumanType(Greetings[(Random(GetArrayLength(Greetings)))]);
Result := True;
Exit;
end;
1: // random messages
begin
Skill := '';
for i := 0 to GetArrayLength(GameLines) do
begin
if (GSearchLine(i, 'Congra')) then
begin
if CombatType = 'Ranged' then
begin
if (GSearchLine(i, 'range')) then Skill := 'ranged' else
if (FightMode = 3) and (GSearchLine(i, 'defen')) then Skill := 'defence' else
if (GSearchLine(i, 'hitpo')) then Skill := 'hitpoints';

if Skill <> '' then Result := True;
end else
if CombatType = 'Mage' then
begin
// different for staff equipped/not equipped
if Skill <> '' then Result := True;
end else
if CombatType = 'Warrior' then
begin
// different for weapon equipped/not equipped
if Skill <> '' then Result := True;
end;

if Result then
begin
Writeln(' -> Sending a message about level growth...');
GrewMessages := ['only ' + IntToStr(99-GetSkillLevel(Skill)) + ' until 99 ' + Skill + ' lol', IntToStr(GetSkillLevel(Skill)) + ' ' + Skill + ' now','now ' + IntToStr(GetSkillLevel(Skill)) + ' ' + Skill,'yay just grew in ' + Skill,'sweet, ' + IntToStr(GetSkillLevel(Skill)) + ' ' + Skill,'yay! grew ' + Skill + 'level!'];
GHumanType(GrewMessages[(Random(GetArrayLength(GrewMessages)))]);
Exit;
end;
end;
end;

begin
Writeln(' -> Sending a random message...');
GHumanType(Messages[(Random(GetArrayLength(Messages)))]);
Result := True;
Exit;
end;
end;
2: // responding
begin
case LastResponseType of
0:
begin
LastResponseType := LastResponseType + 1;
// respond to level questions
for i := 0 to GetArrayLength(LvlQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if (not Result) and (GSearchLine(OtherPlayerLines[k],LvlQuestions[i])) or (not Result) and (GSearchLine(OtherPlayerLines[k],Lowercase(LvlQuestions[i]))) then
begin
Writeln(' -> Detected a level question, checking for level type...');
// respond to range level questions
if not Result then
for j := 0 to GetArrayLength(RangeLvlQuestions) - 1 do
begin
if Result then Break;
for l := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if GSearchLine(OtherPlayerLines[l],RangeLvlQuestions[j]) or GSearchLine(OtherPlayerLines[l],Lowercase(RangeLvlQuestions[j])) then
begin
Writeln(' -> Sending answer to range question...');
Skill := 'ranged';
Result := True;
Break;
end;
end;
end;
// respond to hitpoints level
if not Result then
for j := 0 to GetArrayLength(HpLvlQuestions)-1 do
begin
if Result then Break;
for l := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if GSearchLine(OtherPlayerLines[l],HpLvlQuestions[j]) or GSearchLine(OtherPlayerLines[l],Lowercase(HpLvlQuestions[j])) then
begin
Writeln(' -> Sending answer to hp question...');
Skill := 'hitpoints';
Result := True;
Break;
end;
end;
end;
// respond to defence level questions
if not Result then
for j := 0 to GetArrayLength(DefLvlQuestions) - 1 do
begin
if Result then Break;
for l := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if GSearchLine(OtherPlayerLines[l],DefLvlQuestions[j]) or GSearchLine(OtherPlayerLines[l],Lowercase(DefLvlQuestions[j])) then
begin
Writeln(' -> Sending answer to defence question...');
Skill := 'defence';
Result := True;
Break;
end;
end;
end;
end; // end of level responses
end; // end of linesearching for loop
end; // end of level question for loop
if Result then
begin
LvlResponses := [IntToStr(GetSkillLevel(Skill)) + ' meh','uhhh ' + IntToStr(GetSkillLevel(Skill)),'lemme c... oh ' + IntToStr(GetSkillLevel(Skill)),IntToStr(GetSkillLevel(Skill)),'almost ' + IntToStr(GetSkillLevel(Skill) + 1) + ' ' + Skill,IntToStr(GetSkillLevel(Skill)) + ' here... boo ya!',IntToStr(GetSkillLevel(Skill)),'im lvl ' + IntToStr(GetSkillLevel(Skill)),'i have ' + IntToStr(GetSkillLevel(Skill))];
GHumanType(LvlResponses[(Random(GetArrayLength(LvlResponses)))]);
Exit;
end;
end;
1:
begin
LastResponseType := LastResponseType + 1;
// respond to general questions
for i := 0 to GetArrayLength(Questions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],Questions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(Questions[i]))) then
begin
GHumanType(Responses[(Random(GetArrayLength(Responses)))]);
Writeln(' -> Sent normal response to question from chat...');
Result := True;
Exit;
end;
end;
end;
// respond to noob questions
for i := 0 to GetArrayLength(NoobQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],NoobQuestions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(NoobQuestions[i]))) then
begin
GHumanType(NoobResponses[(Random(GetArrayLength(NoobResponses)))]);
Writeln(' -> Sent angry response to noob question from chat...');
Result := True;
Exit;
end;
end;
end;
// respond to money questions
for i := 0 to GetArrayLength(MoneyQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],MoneyQuestions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(MoneyQuestions[i]))) then
begin
GHumanType(MoneyResponses[(Random(GetArrayLength(MoneyResponses)))]);
Writeln(' -> Sent response to money question from chat...');
Result := True;
Exit;
end;
end;
end;
// respond to age questions
for i := 0 to GetArrayLength(AgeQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],AgeQuestions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(AgeQuestions[i]))) then
begin
GHumanType(AgeResponses[(Random(GetArrayLength(AgeResponses)))]);
Writeln(' -> Sent response to age question from chat...');
Result := True;
Exit;
end;
end;
end;
// respond to location questions
for i := 0 to GetArrayLength(LocationQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],LocationQuestions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(LocationQuestions[i]))) then
begin
GHumanType(LocationResponses[(Random(GetArrayLength(LocationResponses)))]);
Writeln(' -> Sent response to location question from chat...');
Result := True;
Exit;
end;
end;
end;
end;
2:
begin
LastResponseType := LastResponseType + 1;
// respond to sex questions
for i := 0 to GetArrayLength(SexQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],SexQuestions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(SexQuestions[i]))) then
begin
GHumanType(SexResponses[(Random(GetArrayLength(SexResponses)))]);
Writeln(' -> Sent response to sex question from chat...');
Result := True;
Exit;
end;
end;
end;
// respond to leaving questions
for i := 0 to GetArrayLength(LeavingQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],LeavingQuestions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(LeavingQuestions[i]))) then
begin
GHumanType(LeavingResponses[(Random(GetArrayLength(LeavingResponses)))]);
Writeln(' -> Sent response to somebody leaving from chat...');
Result := True;
Exit;
end;
end;
end;
// respond to arrow questions
for i := 0 to GetArrayLength(ArrowQuestions) - 1 do
begin
for k := 0 to GetArrayLength(OtherPlayerLines) - 1 do
begin
if not Result and (GSearchLine(OtherPlayerLines[k],ArrowQuestions[i]) or GSearchLine(OtherPlayerLines[k],Lowercase(ArrowQuestions[i]))) then
begin
GHumanType(ArrowResponses[(Random(GetArrayLength(ArrowResponses)))]);
Writeln(' -> Sent response to arrow question from chat...');
Result := True;
Exit;
end;
end;
end;
end;
end; // end of responding case
if not Result then
begin
Writeln(' -> Could not find correct response to chat text :(');
Exit;
end;
end; // end of responding
end; // end of case
end; // end of GAutoTalk function

function GIsFightAt(x, y: Integer): Boolean;
var
xx, yy: Integer;
begin
if not LoggedIn then Exit;
Result := FindColorSpiral(xx, yy, GreenStatusColor, x - 20, y - 30, x + 20, y
+ 30) or FindColorSpiral(xx, yy, RedStatusColor, x - 20, y - 30, x + 20, y
+ 30);
end;

function GPopupMulti(x, y, rx, ry: Integer; Options: array of String; MaxExamine: Boolean): Boolean;
var
i:Integer;
begin
if not LoggedIn then Exit;
Mouse(x, y, rx, ry, False);
FTWait(1 + Random(2));
for i := 0 to GetArrayLength(Options) - 1 do
begin
Result := GPopup(Options[i], MaxExamine);
if (Result) then Exit;
end;
end;

function GFindArrowMulti(color1, color2, color3, tolerance: Integer):
Boolean;
var
x, y: Integer;
begin
if not LoggedIn then LoginPlayer;
Result := False;
if((color1 > -1) and (FindColorSpiralTolerance(x, y, color1, MSX1, MSY1, MSX2, MSY2, tolerance))) or
((color2 > -1) and (FindColorSpiralTolerance(x, y, color2, MSX1, MSY1, MSX2, MSY2, tolerance))) or
((color3 > -1) and (FindColorSpiralTolerance(x, y, color3, MSX1, MSY1, MSX2, MSY2, tolerance))) then
begin
if (not x > 0) or (not y > 0) then Exit;
MMouse(x + 5, y, 2, 3);
GetMousePos(x,y);
if y < 1 then y := 1;
FTWait(Random(2));
if(IsUpTextMulti('ar', 'rr', 'row') and (x > 0) and not(IsUpText('Walk'))) then
begin
Mouse(x,y,0,0,true);
Result:=True;
Exit;
end else
if not IsUpText('alk') then
begin
if (GPopupMulti(x,y,0,0,['ar','rr','row'],True)) then
begin
Result := True;
Exit;
end else
begin
Result := True;
Exit;
end;
end else
begin
Result := True;
Exit;
end;
end else
begin
Result := False;
end;
end; // end of gfindarrowsmulti

function GFindMultiObj(firstText:string; Texts:array of string; color, tolerance: Integer):
Boolean;
var
x, y, i: Integer;
begin
if not LoggedIn then Exit;
Result := False;
if (FindColorSpiralTolerance(x, y, color, MSX1, MSY1, MSX2, MSY2, tolerance)) then
begin
if (not x > 0) or (not y > 0) then Exit;
Result := True;
MMouse(x, y, 2, 2);
if y < 1 then y := 1;
FTWait(Random(4));
if (IsUpText('ake')) then // left-click pickup
begin
if(not IsUpText(FirstText)) then
begin
for i := 0 to GetArrayLength(Texts) - 1 do
begin
if(IsUpText(Texts[i])) then
begin
Mouse(x,y,0,0,true);
GFlag;
Result := True;
Exit;
end;
end;
end else
begin
Mouse(x,y,0,0,true);
GFlag;
Result := True;
Exit;
end;
end; // end of left-click pickup
if (not IsUpText('Walk')) then // right-click pickup
begin
if(GPopup(FirstText, True)) then
begin
Result := True;
GFlag;
Exit;
end else if(GPopupMulti(x, y, 0, 0, Texts, True)) then
begin
GFlag;
Result := True;
Exit;
end else
begin
Result := True;
Exit;
end;
end; // end of right-click pickup
end else
begin
Result := False;
Exit;
end;
end; // end of gfindmultiobj

{*************************}
{***** ARROW-PICKING *****}
{*************************}

procedure GPickUpArrows;
var
StillFighting: Integer;
begin
if not LoggedIn then LoginPlayer;
if PickArrows then
begin
Status('Looking for arrows...');
while GFindArrowMulti(ArrowTail,ArrowMid,ArrowHead,ArrowTolerance) do
begin
GFlag;
ArrowGrabs := ArrowGrabs + 1;
FTWait(2 + Random(2));
if GInFight then StillFighting := StillFighting + 1;
if StillFighting >= 2 + Random(2) then Exit;
end;
ArrowsPicked := ArrowsPicked + 1;
end;
end;

{************************}
{***** ITEM-PICKING *****}
{************************}

procedure GPickUpItems;
var
i, StillFighting:Integer;
begin
if not LoggedIn then LoginPlayer;
if GInFight then Exit;

if(PickItems)then
begin
if (InvCount < 27) or ((InvCount = 27) and (FindItemColor(ArrowHead))) then
begin
Status('Looking for items...');
for i := 0 to GetArrayLength(ItemColor)-1 do
begin
repeat
if GFindMultiObj(ItemName[i],ItemName,ItemColor[i],ItemTolerance) then
begin
if GInFight then Exit;
GFlag;
FTWait(2 + Random(2));
ItemGrabs := ItemGrabs + 1;
if GInFight then StillFighting := StillFighting + 1;
if StillFighting >= 2 + Random(2) then Exit;
Continue;
end;
until(true)
end;
end;
end;
end;

{****************************}
{***** DTM/COLOR EATING *****}
{****************************}

function GEatIfNeeded(FoodColor,FoodDTM:array of Integer; MaxEatHp, MinEatHp: Integer):Boolean;
var
i, Health:Integer;
begin
if not LoggedIn then LoginPlayer;

while GetHp = 0 do GameTab(2);

if (GetHp <= MaxEatHp) then
begin
Health := GetHp;
if (Health < LowestHealth) then LowestHealth := Health;
repeat
GameTab(4);
Result := False;
// DTM food-finder
if not Result then
begin
for i:=0 to GetArrayLength(FoodDTM)-1 do
begin
Result := False;
if(FindDTM(FoodDTM[i], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
MMouse(x + 2, y - 2, 6, 5);
FTWait(1 + Random(2));
if (IsUpText('Eat')) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
FoodEaten := FoodEaten + 1;
FTWait(1 + Random(2));
Result := True;
Break;
end;
end;
end;
end;
// color food-finder
if not Result then
begin
for i:=0 to GetArrayLength(FoodColor)-1 do
begin
if (FindColorSpiralTolerance(x, y, FoodColor[i], MIX1, MIY1, MIX2, MIY2, 2)) then
begin
MMouse(x + 2, y - 2, 6, 5);
FTWait(1 + Random(2));
if (IsUpText('Eat')) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
FoodEaten := FoodEaten + 1;
FTWait(1 + Random(2));
Result := True;
Break;
end;
end;
end;
end;
// food logout
if Result then Writeln(' Ate some food because of low health...')
else
begin
if (Health <= MinEatHp) then
begin
while GInFight do
begin
GRunAwayDirection(RunAwayDir);
Status('Ran away because you had no food and low health of ' + IntToStr(Health) + '...');
GFindNormalRandoms(True);
GRunBack;
end;
if (CombatType = 'Ranged') then GPickUpArrows;
Writeln('Logged out because you had no food and low health!');
Logout;
GReport;
TerminateScript;
end else
begin
Writeln(' You have no food, but your health is above the minimum');
Writeln(' so we are going to fight until it is...');
Result := True;
Exit;
end;
end;

while(not GetCurrentTab = 2) do GameTab(2);

until(GetHp >= MaxEatHp)
end;
end;

function GSetFightMode(FightType: Integer): Boolean;
begin
case FightType of
1:
begin
if not (GetColor(577, 254) = 2369440) then
begin
Mouse(577 + Random(62), 254 + Random(38), 0, 0, True);
FTWait(1 + Random(2));
end else Result := True;
end;
2:
begin
if not (GetColor(661, 254) = 2369440) then
begin
Mouse(661 + Random(62), 254 + Random(38), 0, 0, True);
FTWait(1 + Random(2));
end else Result := True;
end;
3:
begin
if not (GetColor(577, 307) = 2369440) then
begin
Mouse(577 + Random(62), 307 + Random(38), 0, 0, True);
FTWait(1 + Random(2));
end else Result := True;
end;
end;
end;

procedure GHoverSkill(Skill: string; OnlyInFight: Boolean);
var
row, col: Integer;
begin
if not LoggedIn then LoginPlayer;

case LowerCase(Skill) of
'attack':
begin
row := 1;
col := 1;
end;
'strength':
begin
row := 2;
col := 1;
end;
'defence':
begin
row := 3;
col := 1;
end;
'range':
begin
row := 4;
col := 1;
end;
'ranged':
begin
row := 4;
col := 1;
end;
'prayer':
begin
row := 5;
col := 1;
end;
'magic':
begin
row := 6;
col := 1;
end;
'runecraft':
begin
row := 7;
col := 1;
end;
'hitpoints':
begin
row := 1;
col := 2;
end;
'agility':
begin
row := 2;
col := 2;
end;
'herblore':
begin
row := 3;
col := 2;
end;
'thieving':
begin
row := 4;
col := 2;
end;
'crafting':
begin
row := 5;
col := 2;
end;
'fletching':
begin
row := 6;
col := 2;
end;
'slayer':
begin
row := 7;
col := 2;
end;
'smithing':
begin
row := 1;
col := 3;
end;
'mining':
begin
row := 2;
col := 3;
end;
'fishing':
begin
row := 3;
col := 3;
end;
'cooking':
begin
row := 4;
col := 3;
end;
'firemaking':
begin
row := 5;
col := 3;
end;
'woodcutting':
begin
row := 6;
col := 3;
end;
'farming':
begin
row := 7;
col := 3;
end;
'random':
begin
row := Random(6) + 1;
col := Random(2) + 1;
end;
end;
GameTab(2);
case OnlyInFight of
True:
begin
MMouse(532 + (64 * col), 191 + (31 * row), 10, 10);
GFTFightWait(4 + Random(8));
end;
False:
begin
MMouse(532 + (64 * col), 191 + (31 * row), 10, 10);
FTWait(4 + Random(8));
end;
end;
end;

procedure CheckQuestsTab; // tab 3
begin
// scrolls through quests
repeat until GameTab(3);


end;

procedure CheckMagicTab; // tab 7
begin
// hovers random spell(s)
end;

procedure CheckEmotesTab;
begin
// [scroll and ] hovers random emote
end;

{******************************************}
{***** ADVANCED ANTI-BAN FOR FIGHTING *****}
{******************************************}

procedure GFightAntiBan(OnlyInFight: Boolean);
begin
if not LoggedIn then LoginPlayer;
if (OnlyInFight) and (not GInFight) then Exit;

case Random(15) of
0: GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
1: GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
2:
begin
Writeln(' Hovering one of the skills you are using...');
GHoverSkill(SkillsUsing[Random(GetArrayLength(SkillsUsing) - 1)], OnlyInFight);
GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
end;
3:
begin
Writeln(' Hovering one of the skills you are using...');
GHoverSkill(SkillsUsing[Random(GetArrayLength(SkillsUsing) - 1)], OnlyInFight);
GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
end;
4:
begin
Writeln(' Checking out a random tab...');
GameTab(RandomFightTabs[Random(GetArrayLength(RandomFightTabs) - 1)]);
if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
5:
begin
Writeln(' Starting to auto-respond...')
if GAutoTalk(2) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
6:
begin
Writeln(' Starting to auto-respond...')
if GAutoTalk(2) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
7:
begin
Writeln(' Starting to auto-talk/auto-respond...')
if GAutoTalk(1 + Random(2)) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
8:
begin
Writeln(' Starting to auto-talk/auto-respond...')
if GAutoTalk(1 + Random(2)) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
9:
begin
Writeln(' Checking out the equipment tab...');
GameTab(5);
if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
10: if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
11: if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
12: GFindNormalRandoms(OnlyInFight);
13: GFindNormalRandoms(OnlyInFight);
14:
begin
Writeln(' Sending mouse to random area on mainscreen...')
MMouse(Random(MSX2),Random(MSY2),0,0);
if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
end; // end of case
FindTalk;
end; // end of GFightAntiBan

procedure GFishAntiBan(Skill: String; OnlyInFight: Boolean);
begin
if not LoggedIn then LoginPlayer;
if (OnlyInFight) and (not GInFight) then Exit;

case Random(15) of
2:
begin
Writeln(' Hovering the ' + Skill + ' skill...');
GHoverSkill(Skill, OnlyInFight);
end;
3:
begin
Writeln(' Hovering the ' + Skill + ' skill...');
GHoverSkill(Skill, OnlyInFight);
end;
4:
begin
Writeln(' Checking out a random tab...');
GameTab(RandomFightTabs[Random(GetArrayLength(RandomFightTabs) - 1)]);
if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
5:
begin
Writeln(' Starting to auto-respond...')
if GAutoTalk(2) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
6:
begin
Writeln(' Starting to auto-respond...')
if GAutoTalk(2) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
7:
begin
Writeln(' Starting to auto-talk/auto-respond...')
if GAutoTalk(1 + Random(2)) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
8:
begin
Writeln(' Starting to auto-talk/auto-respond...')
if GAutoTalk(1 + Random(2)) then MarkTime(LastSpeakTime)
else if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
9:
begin
Writeln(' Checking out the equipment tab...');
GameTab(5);
if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
10: if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
11: if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
12: GFindNormalRandoms(OnlyInFight);
13: GFindNormalRandoms(OnlyInFight);
14:
begin
Writeln(' Sending mouse to random area on mainscreen...')
MMouse(Random(MSX2),Random(MSY2),0,0);
if OnlyInFight then GFTFightWait(4 + Random(8)) else FTWait(4 + Random(8));
end;
end; // end of case
FindTalk;
end; // end of GFishAntiBan

{************************}
{***** EQUIP ARROWS *****}
{************************}

function GEquipArrows:Boolean;
begin
Result := False;
if not LoggedIn then LoginPlayer;
if GInFight then Exit;
if(ArrowsPicked >= LoadsBeforeEquipMin + Random(LoadsBeforeEquipMax - LoadsBeforeEquipMin + 1)) then
begin
Status('Equipping arrows...');
GameTab(4);
if(FindDTM(ArrowDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
MMouse(x,y,5,5);
if(IsUpTextMulti(Copy(ArrowName,1,2),Copy(ArrowName,2,3),Copy(ArrowName,3,2))) then
begin
Mouse(x,y,0,0,true);
ArrowsPicked := 0;
Result := True;
end;
end else
if (FindItemColorTol(ArrowHead,5)) then
begin
if(IsUpTextMulti(Copy(ArrowName,1,3),Copy(ArrowName,2,3),Copy(ArrowName,1,2))) then
begin
ClickItemColorTol(ArrowHead,5, true);
ArrowsPicked := 0;
Result := True;
end;
end;

if Result then Writeln('Equipped arrows in inventory...')
else Writeln('Could not find correct arrows in inventory to equip...');
end;
end; // end of GEquipArrows

{************************}
{***** SCRIPT SETUP *****}
{************************}

procedure GSetupScript;
begin
Writeln('Initializing settings form...');
SafeInitForm;
SafeShowFormModal;
Writeln('Initializing game settings...');
Status('Setting up SRL...');
SetupSRL;
Status('Activating client...');
ActivateClient;

Wait(2000);
If not(Loggedin)then
begin
Status('Logging in...');
LoginPlayer;
end;

Status('Loading Variables...');
LoadVars;
Status('Loading DTMs...');
LoadDTMs;
Status('Starting timer...');
MarkTime(StartTime);

MouseSpeed := PlayerMouseSpeed;
BenMouse := PlayerBenMouse;

Status('Setting screen to the highest angle at north...');
HighestAngle;
MakeCompass('n');

Status('Setting chat...');
SetChat('On',1);
SetChat('Off',2);
SetChat('On',3);

Status('Setting fight-mode...');
repeat until GameTab(1);
repeat until GSetFightMode(FightMode);

FirstTalk := True;
GAutoTalk(0);

Status('Turning on run...');
repeat until GameTab(11);
SetRun(True);

if GetArrayLength(FoodName) > 0 then Status('Getting food colors...');
repeat until GameTab(4);
for i:=0 to GetArrayLength(FoodName)-1 do
begin
SameColor := False;
if(FindDTM(FoodDTM[i], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
PointColor := GetColor(x, y);
for j := 0 to GetArrayLength(ItemColor) - 1 do
begin // does not add color to list if already on it
if (PointColor = ItemColor[j]) then
begin
Writeln('2');
SameColor := True;
Break;
end;
end;
if SameColor then Continue;
SetArrayLength(ItemColor, GetArrayLength(ItemColor) + 1);
SetArrayLength(ItemName, GetArrayLength(ItemName) + 1);
ItemColor[GetArrayLength(ItemColor) - 1] := GetColor(x,y);
ItemName[GetArrayLength(ItemName) - 1] := FoodDTMName[i];
Writeln(' Found ' + FoodName[i] + ' and will now eat and pick it up...');
end else
begin
Writeln(' Could not find ' + FoodName[i] + ' DTM in inventory...');
end;
end;

// equip arrows before taking color
if((FindDTM(ArrowDTM, x, y, MIX1, MIY1, MIX2, MIY2))) then
begin
MMouse(x,y,5,5);
if(IsUpTextMulti(Copy(ArrowName,1,3),Copy(ArrowName,2,3),Copy(ArrowName,1,2))) then
begin
Mouse(x,y,0,0,true);
Writeln('Equipped arrows in inventory using DTM...');
FTWait(4 + Random(3));
end;
end;

if (ArrowTail = 0) or (ArrowMid = 0) or (ArrowHead = 0) then
Status('Getting arrow colors...')
else
Status('Checking for arrows...');

repeat until GameTab(5);
if FindDTM(ArrowDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Found arrow DTM in equipment tab...');
if ArrowTail = 0 then
begin
ArrowTail := GetColor(687, 273);
Writeln(' Arrow Tail: ' + IntToStr(ArrowTail));
end;
if ArrowMid = 0 then
begin
ArrowMid := GetColor(692, 261);
Writeln(' Arrow Mid: ' + IntToStr(ArrowMid));
end;
if ArrowHead = 0 then
begin
ArrowHead := GetColor(696, 254);
Writeln(' Arrow Head: ' + IntToStr(ArrowHead));
end;
end else
begin
Writeln('Logged out because could not find arrows.');
Logout;
TerminateScript;
end;

LowestHealth := GetHp;
SetArrayLength(SkillsLevels, GetArrayLength(SkillsUsing));

FirstLoop := True;
for i := 0 to GetArrayLength(SkillsLevels) - 1 do
begin
SkillsLevels[i] := GetSkillLevel(SkillsUsing[i]);
if FirstLoop then Writeln('Starting levels are as follows:');
FirstLoop := False;
Writeln(' ' + SkillsUsing[i] + ': ' + IntToStr(SkillsLevels[i]));
end;

NoMonsters := 0;
Runtime := (MinRuntime + Random(MaxRuntime - MinRuntime + 1)) * 60000;
Kills := MinKills + Random(MaxKills - MinKills + 1);
end;

{********************}
{***** FIGHTING *****}
{********************}

procedure GFight;
begin
MarkTime(LastFightTime); // reset time before start searching for monster
Status('Finding monster...');
repeat
If not(Loggedin)then
begin
LoginPlayer;
FTWait(4 + random (4));
end;

if (TimeFromMark(StartTime) >= Runtime) or (TimeFromMark(LastFightTime) >= (MinFightTime * 1000)) then Exit;

if (NoMonsters >= 10) then
begin
NoMonsters := 0;
if GLastGameMessage('dead') then
begin
Writeln('Logged out because you died somehow =(.');
GReport;
Logout;
TerminateScript;
end;
if (CombatType = 'Ranged') and (GLastGameMessage('no ammo')) then
begin
GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
GPickUpArrows;
if not GEquipArrows then
begin
Writeln('Logged out because you had no more arrows.');
end;
end;
if (CombatType = 'Mage') and (GLastGameMessage('no runes')) then
begin
Writeln('Logged out because you had no more of the required runes.');
GReport;
TerminateScript;
end;
GFindNormalRandoms(False);
Writeln('Monster not found for a while...');
end;

NoMonsters := NoMonsters + 1;
FTWait(Random(3));

if (not GInFight) and
(FindColorSpiralTolerance(x,y,MonsterColor1,0,0,520,340,MonsterColorTolerance) or
FindColorSpiralTolerance(x,y,MonsterColor2,0,0,520,340,MonsterColorTolerance) or
FindColorSpiralTolerance(x,y,MonsterColor3,0,0,520,340,MonsterColorTolerance)) then
begin
if (not GIsFightAt(x,y)) then
begin
MMouse(x,y,5,5);
if y < 1 then y := 1;

if not GInFight then
begin // left click monster
if IsUpTextMulti('tta','tac','ack') then
begin
Mouse(x,y,0,0,true);
Status('Found monster...');
FTWait(Random(3));
GFlag;
NoMonsters := 0;
if not GInFight then FTWait(4 + Random(4));
if not GInFight then GFightAntiBan(False);
if GLastGameMessage('no ammo') then
begin
Writeln('Uh oh! Ran out of arrows. Looking and equipping if found...');
if not GEquipArrows then GPickUpArrows;
end;

end else // right click monster
if (RightClickMonster) and (IsUpText('/')) then
begin
if GPopupMulti(x,y,0,0,['tta','tac','ack'],False) then
begin
Status('Found monster...');
GFlag;
NoMonsters := 0;
if not GInFight then FTWait(4 + Random(4));
if not GInFight then GFightAntiBan(False);
if GLastGameMessage('no ammo') then
begin
Writeln('Uh oh! Ran out of arrows. Looking and equipping if found...');
if not GEquipArrows then GPickUpArrows;
end;
end;
end; // end of GInFight check
end; // end of left and right clicking
end; // end of GFightAt finding
end; // end of monster-finding
until(GInFight)

// antiban while in fight
if(GInFight) then
begin
Status('Attacking monster...');
MarkTime(FightTime);
Writeln('Commencing anti-ban procedure...');
repeat
GFightAntiBan(True);
if(GLastGameMessage('no ammo')) then
begin
GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
GPickUpArrows;
GEquipArrows;
end;
until(not GInFight) or (TimeFromMark(FightTime) >= (MaxFightTime * 1000))
end;

// check if fight lasted longer than requested
if (TimeFromMark(FightTime) >= MaxFightTime * 1000) and (GInFight) then
begin
repeat
GRunAwayDirection(RunAwayDir);
Writeln('Ran away because fight lasted ' + IntToStr(TimeFromMark(FightTime)/1000) + ' seconds...');
GFindNormalRandoms(True);
GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
GPickUpArrows; // in case wall blocked runaway, not to lose arrows
GRunBack;
until not GInFight
end;

if (not GInFight) and (BoxInFight) then
begin
Status('Managing box random out of fight...');
if (UseBoxSolver) then SolveBox
else
GambleNewBox;
BoxInFight := False;
end;

if(FindChatText('Oh dear,') and FindChatText('dead')) then
begin
Writeln('Logged out because you died somehow =(.');
Logout;
TerminateScript;
end;

Status('Killed monster...');
Killed := Killed + 1;

// health check
while GetCurrentTab <> 2 do GameTab(2);
if(GetHp < MaxEatHp) then
begin
GEatIfNeeded(FoodCol, FoodDTM, MaxEatHp, MinEatHp);
end;
Writeln('Health is currently ' + IntToStr(GetHp) + '...');

GPickUpArrows;
GEquipArrows;
GPickUpItems;
end; // end of GFight


{*********************}
{***** MAIN LOOP *****}
{*********************}

begin
Writeln('Commencing script authorization...');
GAuthorizeScript;
Writeln('Commencing script setup...');
GSetupScript;
{
MouseSpeed := PlayerMouseSpeed + 5;
GFishAndCook;

Writeln('You fished ' + IntToStr(FishCaught) + ' fish, and successfully cooked ' + IntToStr(FishCooked) + ' fish.');
Writeln('Finished fishing test!');
TerminateScript;
}
// GCast(SpellDTM);

Writeln('Commencing fight sequence...');
MouseSpeed := PlayerMouseSpeed;
repeat
GFight;
GReport;

if TimeFromMark(StartTime) >= Runtime then
begin
Status('The script has completed the requested runtime!');
Break;
end else
if TimeFromMark(LastFightTime) >= (MinFightTime * 1000) then
begin
Writeln('Logged out because you have not been in a fight for ' + IntToStr(TimeFromMark(LastFightTime)/1000) + ' seconds.');
Break;
end else
if Killed >= Kills then
begin
Writeln('The script has completed the requested kills!');
Break;
end;
until False

GReport;
Writeln('Thank you for using GExtremeRanger V' + FloatToStr(VERSION) + ',');
Writeln('I hope it enhanced your SCAR/SRL experience.');
Logout;
end.
Payscript which was sold at Mopar's. Don't ask me how I got it..

Markus

2013-02-23 15:24:33




{TEST/BETA VERSION FOR TESTERS (=MAY HAVE ERRORS)}

{.Script Info:
# ScriptName = Pentti's Multi City Miner & Banker
# Author = Pentti [pentti701@msn.com]
# Description = This is an autominer for different mining places.
This works as a powerminer too.
Start at the bank if you are banking.
Start at the mining place if you are powermining.
# Version = 0.4
# Date = 01.06.2007
# Comments = Version 0.4 is up to date for new Varrock.
Added Barbarian Village for a mining place (BETA stage).
Added Rimmington (Falador bank) for a mining place (BETA stage).
Added a player stat form (May cause errors, BETA stage).
Able to use KYAB for those who has it.

[[url]http://www.srl-forums.com/forum/multi-city-miner-t7961.html][/url]

/Script Info}

{If you use this script, please give me a comments/progress reports at
http://www.srl-forums.com/forum/multi-city-miner-t7961.html}

{Oh yea and fuck you if you upload this to somewhere without my permission!!!
And do not post this anywhere without my permission!}

{Thanks to me, Pentti for making this!
SRL-forums, You are welcome for having this great script on the forums}{Yup, lol}
program New;
{.include srl/srl.scar}
{.include srl/srl/skill/Mining.scar}
{.include SRL/SRL/Misc/Trade.scar}
{.include srl/srl/skill/Fighting.scar}
Const
{
--------SETUP--------
------------------------------------
| MINING PLACES | CODE |
|________________________|___________|
| | |
|Lumbridge Swamp West | LW | <-From Draynor bank.
|------------------------|-----------|
|Lumbridge Swamp East | LE | <-From Draynor bank.
|------------------------|-----------|
|Varrock West | VW1 VW2 | <-From Varrkc West bank. VW2 for shorter way (using my wallfinding walk). VW1 for roadwalking. VW1 piece of shit! Haha! :D
|------------------------|-----------|
|Varrock East | VE | <-From Varrock East bank. (Most stable way)
|------------------------|-----------|
|Rimmington | RI1 RI2 | <-RI1 From Draynor bank, RI2 from Falador bank.
|------------------------|-----------|
|Barbarian village | BV | <-From Varrock West bank. (At BETA stage)
|------------------------|-----------|
[You'll need these codes at player setup]
}

MiningWait=4; //Max time in seconds to wait before looking for next ore.
Startplayer=0; //Player to start with.
HowManyLoads=250; //How many loads to do?
CommonBankPin=''; //Bank pin to be used (For every player) Leave at empty ('') if you dont use bankpin

YourSRLID=''; //Leave at '' if you have already set it up on SRL. -Dont have? Go to [url]http://stats.srl-forums.com/[/url] and register!
yourSRLPass='';//-||-

{CTRL + ALT + P to pick color (Do not pick the brown color of rock)}
ClayColor=3764366; //Change if it doesnt find the ore
CopperColor=5010849; //Change if it doesnt find the ore
TinColor=8092549; //Change if it doesnt find the o
IronColor=3096680; //Change if it doesnt find the ore
SilverColor=10921650; //Change if it doesnt find the ore
CoalColor=2439738; //Change if it doesnt find the ore
GoldColor=1952504; //Change if it doesnt find the orere
MithrilColor=7556941; //Change if it doesnt find the ore
AdamantiteColor=6717286;//Change if it doesnt find the ore


{-Not so essential things:}
ShowNews=True; //Shows script news when it's started
ReportsInToFile=True; //Writes progress reports into text file at "\Scar\Pentti_Multi_City_Miner_Banker_Reports.txt"
CheckOresCorrect=True; //Let script check if you set ore names correct? (recommended)
CheckPlacesCorrect=True; //Let script check if you set mining places correct? (recommended)
UseTalk=True; //Talks to other people with their names?
Answer=True; //Check and answers if someone talks to you or asks your mining level. (May lag)
UseBenMouse=True; //Use Benmouse?
MouseSpeeds=13; //MouseSpeed?
RunDir='N'; //Run away direction if fight found.
ReduceLag=False; //Doesnt lag runescape so much (affects to antiban and randoms [not so effective]).
UseFrom=True; //Use the player stats form?
GasTalk=True; //Talk if gas is found?
KYAB=False; //Leave at false if you dont know what this does!!!
ExtraTol=5; //Adds extra tolerance for rock finding. (Raise it if script doesn't find rocks.(Keep it between 0-30))
UseTimeOut=True; //Uses feature below:
MaxTime=20; {//Max player time in minutes for each load?
}var LumbyDetect:Boolean;
procedure LumbySet;begin
LumbyDetect:=False; {//Checks if you are in Lumbridge.}
end; // end;

Procedure DeclarePlayers;
begin
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :=''; //About 3 letters from middle of your name
Players[0].Active:=True; //Are you using this player?
Players[0].Integer1:=2; //How many loads to do?
Players[0].String1:='tin'; //Most to mine ore.
Players[0].String2:='tin'; //Will mine less than first ore
Players[0].String3:='coal'; //Will mine less than second ore
Players[0].Ore:='BV'; //Code of mining place. (see the list of mining places and codes of them)
Players[0].Boolean1:=False; //True if you want only to powermine.

Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :=''; //About 3 letters from middle of your name
Players[1].Active:=False; //Are you using this player?
Players[1].Integer1:=5; //How many loads to do?
Players[1].String1:=''; //Most to mine ore.
Players[1].String2:=''; //Will mine less than first ore
Players[1].String3:=''; //Will mine less than second ore
Players[1].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[1].Boolean1:=False; //True if you want only to powermine.

Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :=''; //About 3 letters from middle of your name
Players[2].Active:=False; //Are you using this player?
Players[2].Integer1:=5; //How many loads to do?
Players[2].String1:=''; //Most to mine ore.
Players[2].String2:=''; //Will mine less than first ore
Players[2].String3:=''; //Will mine less than second ore
Players[2].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[2].Boolean1:=False; //True if you want only to powermine.

Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :=''; //About 3 letters from middle of your name
Players[3].Active:=False; //Are you using this player?
Players[3].Integer1:=5; //How many loads to do?
Players[3].String1:=''; //Most to mine ore.
Players[3].String2:=''; //Will mine less than first ore
Players[3].String3:=''; //Will mine less than second ore
Players[3].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[3].Boolean1:=False; //True if you want only to powermine.

Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :=''; //About 3 letters from middle of your name
Players[4].Active:=False; //Are you using this player?
Players[4].Integer1:=5; //How many loads to do?
Players[4].String1:=''; //Most to mine ore.
Players[4].String2:=''; //Will mine less than first ore
Players[4].String3:=''; //Will mine less than second ore
Players[4].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[4].Boolean1:=False; //True if you want only to powermine.

Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :=''; //About 3 letters from middle of your name
Players[5].Active:=False; //Are you using this player?
Players[5].Integer1:=5; //How many loads to do?
Players[5].String1:=''; //Most to mine ore.
Players[5].String2:=''; //Will mine less than first ore
Players[5].String3:=''; //Will mine less than second ore
Players[5].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[5].Boolean1:=False; //True if you want only to powermine.

Players[6].Name :='';
Players[6].Pass :='';
Players[6].Nick :=''; //About 3 letters from middle of your name
Players[6].Active:=False; //Are you using this player?
Players[6].Integer1:=5; //How many loads to do?
Players[6].String1:=''; //Most to mine ore.
Players[6].String2:=''; //Will mine less than first ore
Players[6].String3:=''; //Will mine less than second ore
Players[6].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[6].Boolean1:=False; //True if you want only to powermine.

Players[7].Name :='';
Players[7].Pass :='';
Players[7].Nick :=''; //About 3 letters from middle of your name
Players[7].Active:=False; //Are you using this player?
Players[7].Integer1:=5; //How many loads to do?
Players[7].String1:=''; //Most to mine ore.
Players[7].String2:=''; //Will mine less than first ore
Players[7].String3:=''; //Will mine less than second ore
Players[7].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[7].Boolean1:=False; //True if you want only to powermine.

Players[8].Name :='';
Players[8].Pass :='';
Players[8].Nick :=''; //About 3 letters from middle of your name
Players[8].Active:=False; //Are you using this player?
Players[8].Integer1:=5; //How many loads to do?
Players[8].String1:=''; //Most to mine ore.
Players[8].String2:=''; //Will mine less than first ore
Players[8].String3:=''; //Will mine less than second ore
Players[8].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[8].Boolean1:=False; //True if you want only to powermine.

Players[9].Name :='';
Players[9].Pass :='';
Players[9].Nick :=''; //About 3 letters from middle of your name
Players[9].Active:=False; //Are you using this player?
Players[9].Integer1:=5; //How many loads to do?
Players[9].String1:=''; //Most to mine ore.
Players[9].String2:=''; //Will mine less than first ore
Players[9].String3:=''; //Will mine less than second ore
Players[9].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[9].Boolean1:=False; //True if you want only to powermine.

Players[10].Name :='';
Players[10].Pass :='';
Players[10].Nick :=''; //About 3 letters from middle of your name
Players[10].Active:=False; //Are you using this player?
Players[10].Integer1:=5; //How many loads to do?
Players[10].String1:=''; //Most to mine ore.
Players[10].String2:=''; //Will mine less than first ore
Players[10].String3:=''; //Will mine less than second ore
Players[10].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[10].Boolean1:=False; //True if you want only to powermine.

Players[11].Name :='';
Players[11].Pass :='';
Players[11].Nick :=''; //About 3 letters from middle of your name
Players[11].Active:=False; //Are you using this player?
Players[11].Integer1:=5; //How many loads to do?
Players[11].String1:=''; //Most to mine ore.
Players[11].String2:=''; //Will mine less than first ore
Players[11].String3:=''; //Will mine less than second ore
Players[11].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[11].Boolean1:=False; //True if you want only to powermine.

Players[12].Name :='';
Players[12].Pass :='';
Players[12].Nick :=''; //About 3 letters from middle of your name
Players[12].Active:=False; //Are you using this player?
Players[12].Integer1:=5; //How many loads to do?
Players[12].String1:=''; //Most to mine ore.
Players[12].String2:=''; //Will mine less than first ore
Players[12].String3:=''; //Will mine less than second ore
Players[12].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[12].Boolean1:=False; //True if you want only to powermine.

Players[13].Name :='';
Players[13].Pass :='';
Players[13].Nick :=''; //About 3 letters from middle of your name
Players[13].Active:=False; //Are you using this player?
Players[13].Integer1:=5; //How many loads to do?
Players[13].String1:=''; //Most to mine ore.
Players[13].String2:=''; //Will mine less than first ore
Players[13].String3:=''; //Will mine less than second ore
Players[13].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[13].Boolean1:=False; //True if you want only to powermine.

Players[14].Name :='';
Players[14].Pass :='';
Players[14].Nick :=''; //About 3 letters from middle of your name
Players[14].Active:=False; //Are you using this player?
Players[14].Integer1:=5; //How many loads to do?
Players[14].String1:=''; //Most to mine ore.
Players[14].String2:=''; //Will mine less than first ore
Players[14].String3:=''; //Will mine less than second ore
Players[14].Ore:=''; //Code of mining place. (see the list of mining places and codes of them)
Players[14].Boolean1:=False; //True if you want only to powermine.



{--------END-OF-SETUP--------}
end;


var //Mining
CurrentRockColor,OreColorOne,OreColorTwo,OreColorThree:Integer;
MiningMark:Integer;
Loads:Integer;

var //Colors
RealWallColor:Integer;
DaRoadColor:Integer;

VRoad:array[0..3]of array[0..2] of Integer; //My Varrock Road Color Finder vars.
VRoadColor:Integer;

BankColors:Array[0..2]of Integer;

var //FailSafes
BanksFailed:Integer;
PlayerTimeOutMark:Integer;
PlayerStartTime2:Integer;
LumbyCheck:Boolean;
RockNotFound:Integer;
TotalRocksMissed:Integer;
FindMSymbolFSColor:Boolean;

var //Others
CUAM:Integer;
MLvl:Integer;
LowLag:Integer;
TalkMark:Integer;
ItemMark:Integer;
ToTextFile:String;
RRoadW:String;
DaSi:Boolean;

var //KYAB
Conn_Index:Integer;

VETiles:Array of TPoint;
VWTiles:Array of TPoint;
LWTiles:Array of TPoint;
LETiles:Array of TPoint;
RDTiles:Array of TPoint;
RFTiles:Array of TPoint;
BVTiles:Array of TPoint;

var
Site: Integer;
HowmanyIPs:Integer;
TheSiteText:string;
MyIP:String;
TempNumberofIPs:Integer;
usern,passw:String;
HostServer:String;
CheckServer:STring;

var //Ore arrays
AvaiableOres:array[0..8]of String;

var //Place arrays
AvaiablePlaces:Array[0..7]of String;

var //Form
PBFrom : TForm;
TopText1 : TLabel;
TopText2 : TLabel;
PWorked : TLabel;
CuPlayer : TLabel;
PMined : TLabel;
Ploc : TLabel;
PMLevel : TLabel;
POresMining : TLabel;
PWorkedE : TLabel;
MinedE : TLabel;
OresToMineE : TLabel;
LocE : TLabel;
MiningLvlE : TLabel;
PSBox : TComboBox;
FHide : TButton;
FUpDate : TButton;
procedure UpDateForm;ForWard;

{----------------------------------------------------------------------------}

Function FileReport:String;
var
i:Integer;
Co:Integer;
Mind,Bankd:String;
DaStatus:String;
a,b:String;
Thing:String;
MinLvlTxt:String;
AddText:String;
begin
if(ScriptTime(2)<10)then
A:='0'+inttostr(ScriptTime(2))
if(ScriptTime(2)>9)then
A:=inttostr(ScriptTime(2))
if(ScriptTime(3)<10)then
B:='0'+inttostr(ScriptTime(3))
if(ScriptTime(3)>9)then
B:=inttostr(ScriptTime(3))
for i:=0 to HowManyPlayers-1 do
begin
if(Players[i].Active)then
DaStatus:='in use, '
else
DaStatus:='not in use, ';
if(Players[i].Loc<>'')then
begin
DaStatus:=Players[i].Loc
Players[i].Loc:=DaStatus;
end;
Mind:='Mined '+inttostr(Players[i].Integer3)+' ores, ';
Bankd:=inttostr(Players[i].Banked)+' Banks, ';
if(Players[i].Integer3=0)then
Mind:='';
if(Players[i].Banked=0)then
Bankd:=' ';
MLvl:=Players[i].Integer4;
MinLvlTxt:='M-lvl: '+inttostr(MLvl);
if(MLvl=0)then
MinLvlTxt:='';
for Co:=0 to 58-(2+Length(inttostr(i))+Length(Players[I].Name)+4+Length(DaStatus)+Length(Mind)+Length(Bankd)+Length(MinLvlTxt)) do
begin
Thing:=Thing+' ';
end;
Thing:=''
AddText:=AddText+(Inttostr(I)+': '+Players[I].Name+' is '+DaStatus+Mind+Bankd+MinLvlTxt+Thing+'| '+CHR(13))
end;
Result:='[Worked: '+inttostr(ScriptTime(1))+':'+A+':'+B+'] '+AddText+' '+CHR(13);
end;

Procedure GoingOn(What:string);
var
File:Integer;
begin
Writeln(What+' ('+TheTime+')')
status(What+' ('+TheTime+')')
if(not(ReportsInToFile))then
Exit;
File:=ReWriteFile(apppath+'MCMB\Pentti_Multi_City_Miner_Banker_Reports.txt',False)
ToTextFile:=ToTextFile+' '+What+' ('+TheTime+')'+' '+CHR(13);
if(WritefileString(File,FileReport+ToTextFile))then
CloseFile(File)
end;

function GetTheDate:String;Forward;
Procedure ReportErrors(ErrorMsg:String);
var
File1:Integer;
File2:Integer;
OldErrors:String;
ToErrorFile:String;
begin
GoingOn(ErrorMsg)
Try
if(LoadSetting('MCMB','FILE')<>'')then
begin
File2:=OpenFile(apppath+'MCMB\Error_Report.txt',False)
if(ReadFileString(file2,OldErrors,FileSize(File2)))then
CloseFile(File2)
end;
File1:=ReWriteFile(apppath+'MCMB\Error_Report.txt',False)
ToErrorFile:=ErrorMsg+'('+GetTheDate+' - '+TheTime+') '+CHR(13);
if(WritefileString(File1,ToErrorFile+OldErrors))then
CloseFile(File1)
SaveSetting('MCMB','FILE','OK')
Except
GoingOn('ERROR WRITING/READING ERROR FILE!!!')
TerminateScript;
end;
end;

{----------------------------------------------------------------------------}

procedure TheOres;
begin
AvaiableOres[0]:='Clay';
AvaiableOres[1]:='Copper';
AvaiableOres[2]:='Tin';
AvaiableOres[3]:='Iron';
AvaiableOres[4]:='Silver';
AvaiableOres[5]:='Coal';
AvaiableOres[6]:='Gold';
AvaiableOres[7]:='Mithril';
AvaiableOres[8]:='Adamantite';
end;

procedure OresCorrect;
var
i:Integer;
c:Integer;
Correct:Boolean;
begin
if(CheckOresCorrect)then
begin
TheOres;
for i:=0 to HowManyPlayers-1 do
begin
Try
if(Players[i].Active)then
begin
Players[i].String1:=Capitalize(Players[i].String1)
Players[i].String2:=Capitalize(Players[i].String2)
Players[i].String3:=Capitalize(Players[i].String3)

Correct:=False;
for c:=0 to 8 do
begin
if(Players[i].String1=AvaiableOres[c])then
Correct:=True;
end;
if(Correct=False)then
begin
Writeln('Please set right ore name #1 for player '+Players[i].Name)
TerminateScript;
end;
Correct:=False;

for c:=0 to 8 do
begin
if(Players[i].String2=AvaiableOres[c])then
Correct:=True;
end;
if(Correct=False)then
begin
Writeln('Please set right ore name #2 for player '+Players[i].Name)
TerminateScript;
end;
Correct:=False;

for c:=0 to 8 do
begin
if(Players[i].String3=AvaiableOres[c])then
Correct:=True;
end;
if(Correct=False)then
begin
Writeln('Please set right ore name #3 for player '+Players[i].Name)
TerminateScript;
end;

end;
Except
Players[i].String1:=AvaiableOres[random(3)+1]
Players[i].String2:=AvaiableOres[random(3)+1]
Players[i].String3:=AvaiableOres[random(3)+1]
ReportErrors('ERROR: Checking player ores! Randomly setting ores to mine!')
wait(4000)
end;
end;
end;
end;

procedure ThePlaces;
begin
AvaiablePlaces[0]:='LW';
AvaiablePlaces[1]:='LE';
AvaiablePlaces[2]:='VE';
AvaiablePlaces[3]:='VW1';
AvaiablePlaces[4]:='VW2';
AvaiablePlaces[5]:='RI1';
AvaiablePlaces[6]:='RI2';
AvaiablePlaces[7]:='BV';
end;

procedure PlacesCorrect;
var
i:Integer;
c:Integer;
Correct:Boolean;
begin
ThePlaces;
if(CheckPlacesCorrect)then
begin
Try
for i:=0 to HowManyPlayers-1 do
begin
if(Players[i].Active)and
not(Players[i].Boolean1)then
begin
Players[i].Ore:=Capitalize(Players[i].Ore)
Correct:=False;

for c:=0 to 7 do
begin
if(UpperCase(Players[i].Ore)=AvaiablePlaces[c])then
Correct:=True;
end;
if(Players[i].Boolean1)then
Correct:=True;
if(Correct=False)then
begin
Writeln('Please set right mining place for player '+Players[i].Name)
TerminateScript;
end;
end;
end;
Except
ReportErrors('ERROR: Checking player mining places! Set mining place!')
TerminateScript;
end;
end;
end;

procedure Brightness;
begin
wait(800)
GameTab(11)
wait(400)
if(getColor(713,230)<>10436881)then
begin
Mouse(710,228,6,6,True)
wait(1000)
end;
end;

procedure FuckYouYouFuckingAutoretailiate;
begin
GameTab(1)
wait(500)
if(FindcolorTolerance(x,y,1908610,617,374,633,388,8))then
Mouse(x,y,15,5,True)
wait(150)
end;

procedure SayLevel(Skill:string);
var LVLBmp,Lvl:integer;
tmpx, tmpy: Integer;
begin
if(Answer)then
begin
if (FindColor(tmpx, tmpy, 65535,90,60,430,280)) then
begin
LvlBmp:=createbitmapmaskfromtext(skill,upchars)
wait(20+LowLag*100)
If(FindBitmapMaskTolerance(LvlBmp, x, y,90,60,430,280,0, 40))then
begin
Lvl:=GetSkillLevel(Skill)
TypeSend('My '+Skill+' Level is '+inttostr(Lvl)+'. yours?')
end;
FreeBitMap(LvlBmp)
end;
end;
end;

{----------------------------------------------------------------------------}

procedure GI(item: String);
begin
if(TimeFromMark(ItemMark)/1000/60<=3)then
Exit;
MarkTime(ItemMark)
if(UseTalk)then
begin
if(invCount<=5)or(invCount>=25)then
exit;
case (random(10)) of
0: TypeSend('now I have '+inttostr(InvCount)+ ' ' +item);
1: TypeSend('Yeah now '+inttostr(InvCount)+' '+item);
2: TypeSend('Woo! I have '+inttostr(InvCount)+' '+item);
3: TypeSend('I got '+inttostr(InvCount)+' '+item+' '+' now');
4: TypeSend('Must get '+inttostr(28-InvCount)+' more '+Item);
5: TypeSend(inttostr(28-InvCount)+' '+item+' to go.');
6: TypeSend('Still must get '+inttostr(28-InvCount)+' more '+item);
7: TypeSend('Damn, I have '+inttostr(InvCount)+' '+item);
8: TypeSend('Lol I almost got '+inttostr(InvCount+random(3))+' '+item);
9: TypeSend('I realy need to get '+inttostr(28-InvCount)+' more '+item);
end;
end;
end;

{----------------------------------------------------------------------------}

procedure Reportplaces;
begin
if(Players[Currentplayer].Boolean1)then
begin
ReportVars[6]:=1;
SrlRandomsReport;
Exit;
end;
case UpperCase(Players[CurrentPlayer].Ore) of
'LW': ReportVars[2]:=1
'LE': ReportVars[3]:=1
'VW1':ReportVars[4]:=1
'VW2':ReportVars[4]:=1
'VE': ReportVars[5]:=1
'RI1':ReportVars[7]:=1
'RI2':ReportVars[7]:=1
'BV': ReportVars[9]:=1
end;
SRLRandomsReport;
end;

{----------------------------------------------------------------------------}

procedure PlayersReport;
var
i:Integer;
Co:Integer;
Mind,Bankd:String;
DaStatus:String;
a,b:String;
Thing:String;
MinLvlTxt:String;
begin
if(ScriptTime(2)<10)
then
A:='0'+inttostr(ScriptTime(2))
if(ScriptTime(2)>9)
then
A:=inttostr(ScriptTime(2))
if(ScriptTime(3)<10)
then
B:='0'+inttostr(ScriptTime(3))
if(ScriptTime(3)>9)
then
B:=inttostr(ScriptTime(3))
Writeln('------------------------------------------------------------') Writeln('| Multi City Miner & Banker By: '+CHR(80)+CHR(101)+CHR(110)+CHR(116)+CHR(116)+CHR(105)+' |')
Writeln('-----------------------------------------------------------|')
for i:=0 to HowManyPlayers-1 do
begin
if(Players[i].Active)then
DaStatus:='in use, '
else
DaStatus:='not in use, ';
if(Players[i].Loc<>'')then
begin
DaStatus:=Players[i].Loc
Players[i].Loc:=DaStatus;
end;
Mind:='Mined '+inttostr(Players[i].Integer3)+' ores, ';
Bankd:=inttostr(Players[i].Banked)+' Banks, ';
if(Players[i].Integer3=0)then
Mind:='';
if(Players[i].Banked=0)then
Bankd:=' ';
MLvl:=Players[i].Integer4;
MinLvlTxt:='M-lvl: '+inttostr(MLvl);
if(MLvl=0)then
MinLvlTxt:='';
for Co:=0 to 58-(2+Length(inttostr(i))+Length(Players[I].Name)+4+Length(DaStatus)+Length(Mind)+Length(Bankd)+Length(MinLvlTxt)) do
begin
Thing:=Thing+' ';
end;
writeln(Inttostr(I)+': '+Players[I].Name+' is '+DaStatus+Mind+Bankd+MinLvlTxt+Thing+'|')
Thing:=''
end;
Writeln('------------------------------------------------------------')
writeln(' [Worked: '+inttostr(ScriptTime(1))+':'+A+':'+B+']')
end;


{----------------------------------------------------------------------------}

Function WhereMining:String;
begin
case UpperCase(Players[CurrentPlayer].Ore) of
'LW': Result:='West Lumbridge';
'LE': Result:='East Lumbridge';
'VW1': Result:='West Varrock';
'VW2': Result:='West Varrock';
'VE': Result:='East Varrock';
'RI1':Result:='Rimmington';
'RI2': Result:='Rimmington';
'BV': Result:='Barbarian Village';
end;
if(Players[Currentplayer].Boolean1)then
Result:='Powermining';
end;

{----------------------------------------------------------------------------}

procedure LoadneededGameTabs;
begin
GameTab(2)
wait(750+random(250))
GameTab(2)
wait(750+random(250))
GameTab(5)
wait(750+random(250))
GameTab(10)
wait(750+random(250))
GameTab(11)
wait(750+random(250))
end;

{----------------------------------------------------------------------------}

procedure TalkingToMeTXT;
begin
Case Random(10)+1 of
1: TypeSend('Right...'+chr(13))
2: TypeSend('What?'+chr(13))
3: TypeSend('Sorry, i dont understand.'+chr(13))
4: TypeSend('What do yuo want?'+chr(13))
5: TypeSend('I have no time'+chr(13))
6: TypeSend('I dont like you'+chr(13))
7: TypeSend('You are getting my nervous'+chr(13))
8: TypeSend('is it possible to be quit for 2 minutes?'+chr(13))
9: TypeSend('yes? I am.'+chr(13))
10: TypeSend('No, you again.'+chr(13))
End;
wait(5)
end;

{----------------------------------------------------------------------------}

procedure TalkingToMe;
begin
if(Answer)then
begin
if(FindTalk)then
Exit;
wait(5+LowLag*100+random(6))
if(not(Findcolor(x,y,65535,MCX1,MCY1,MCX2,MCY2)))then
Exit;
If(FindBitmapMaskTolerance(NickNameBmp, x, y, 100, 59, 500, 300, 0, 40)) then
begin
TalkingToMeTxt;
CUAM:=CUAM+1
GoingOn('Your Name has been spotted on the screen '+
'and you answered.')
if(CUAM>=3)then
begin
ClickToContinue;
GoingOn('Someone was talking too much to you, logging out and coming back soon.')
TypeSend('Nice to talk, but now gtg. See you! :)')
LogOut;
Wait(25000+random(20000))
LogInPlayer;
CUAM:=0
wait(500+random(300))
end;
end;
wait(2)
end;
end;

{----------------------------------------------------------------------------}

procedure GetPickColors;
begin
FindpickHeadColor;
if(hc1=0)or(hc2=0)or(hc3=0)or(hc4=0)then
begin
GoingOn('You need a pickaxe to run with this script.')
GoingOn('If you have a pick, please restart the script')
LogOut;
TerminateScript;
end;
end;

{----------------------------------------------------------------------------}

procedure SolveFight;
begin
if(InFight)then
begin
if(GetHp<GetSkillLevel('hitpoints'))then
begin
GoingOn('Fight found, running away!')
MakeCompass('N')
RunTo(RunDir,True)
Fights:=Fights+1
LogInPlayer;
SetRun(True)
end;
end;
end;

{----------------------------------------------------------------------------}

procedure HowAreYouTodayMrX;
var FindAcc:Boolean;
AccName:String;
begin
if(TimeFromMark(TalkMark)/1000/60<=2)then
Exit;
MarkTime(TalkMark)
if(UseTalk)then
begin
FindAcc:=False
if(FindObj(x,y,'evel',2510975,11)) then
FindAcc:=True
else
if(FindObj(x,y,'evel',8474379,11)) then
FindAcc:=True
else
if(FindObj(x,y,'evel',4077094,11)) then
FindAcc:=True
else
if(FindObj(x,y,'evel',4544837,11)) then
FindAcc:=True
else
if(FindObj(x,y,'evel',1085071,11)) then
FindAcc:=True
else
if(FindObj(x,y,'evel',8747097,11)) then
FindAcc:=True;
if(FindAcc=True) then
GoingOn('Found random account to talk with:')
else
exit;
ClickToContinue;
AccName:=Trim(GetTextAtEx(77, 7, 100, UpChars, True, True, 0, 2, 14606047, 12, False, tr_AllChars))
if(not(AccName=''))then
GoingOn('Account name is: '+AccName)
if(AccName='')then
Exit;
else
Case Random(35) of
0: TypeSend('How are you '+AccName)
1: TypeSend('Whats up '+AccName)
2: TypeSend('You must be rich '+AccName)
3: TypeSend(AccName+' Nice level')
4: TypeSend('You are cool '+AccName)
5: TypeSend('How are you doing '+AccName)
6: TypeSend('Hello '+AccName)
7: TypeSend('Hi '+AccName+' '+':)')
8: TypeSend('How old are you '+AccName)
9: TypeSend('Where are you from '+AccName)
10:TypeSend(AccName+' whats your mining lvl, my is '+inttostr(GetSkillLevel('Mining')))
11:TypeSend('Nice pick '+AccName)
12:TypeSend('Do you like your pick '+AccName)
13:TypeSend(AccName+' how many '+Players[Currentplayer].String1+' ores you have?')
14:TypeSend(AccName+' how many '+Players[Currentplayer].String2+' ores you have?')
15:TypeSend(AccName+' how many '+Players[Currentplayer].String3+' ores you have?')
16:typeSend(Accname+' Do you mine usually in '+WhereMining)
17:typeSend(AccName+' You like to mine in '+Wheremining)
18:typesend('I like to mine in '+WhereMining+', do you '+AccName+'?')
19:TypeSend(AccName+' whats that pick?')
20:TypeSend(AccName+' Can you mine some '+Players[Currentplayer].String1+' ores for me?')
21:typeSend(AccName+' Can you mine some '+Players[Currentplayer].String2+' ores for me?')
22:typeSend(AccName+' Can you mine some '+Players[Currentplayer].String3+' ores for me?')
23:typesend(AccName+' Do you mine '+Players[Currentplayer].String1+' ores too?')
24:TypeSend(AccName+' Do you mine '+Players[Currentplayer].String2+' ores too?')
25:TypeSend(AccName+' Do you mine '+Players[Currentplayer].String1+' ores too?')
26:typesend('I really need to smelt these '+Players[Currentplayer].String1+' ores soon.')
27:TypeSend('I really need to smelt these '+Players[Currentplayer].String2+' ores soon.')
28:TypeSend('I really need to smelt these '+Players[Currentplayer].String1+' ores soon.')
26:typesend('I almost have '+inttostr(InvCount)+' '+Players[Currentplayer].String1+' ores, how many you got '+AccName+'.')
27:TypeSend('I almost have '+inttostr(InvCount)+' '+Players[Currentplayer].String2+' ores, how many you got '+AccName+'.')
28:TypeSend('I almost have '+inttostr(InvCount)+' '+Players[Currentplayer].String3+' ores, how many you got '+AccName+'.')
29:TypeSend('Its nice day '+AccName+', isnt it?')
30:TypeSend(Accname+', How much '+Players[Currentplayer].String1+' ores give xp?')
31:TypeSend(Accname+', How much '+Players[Currentplayer].String2+' ores give xp?')
32:TypeSend(Accname+', How much '+Players[Currentplayer].String3+' ores give xp?')
33:TypeSend(AccName+', can you borrow me that pickaxe?')
34:TypeSend('Let me buy your pickaxe '+AccName)
end;
end;
end;

{----------------------------------------------------------------------------}

Function GetWallColor(Var x, y, WallColor:Integer):Boolean;
var
TheTol:Integer;
begin
TheTol:=5
repeat
wait(10)
TheTol:=TheTol+1
if(TheTol>=70)then
begin
Result:=False;
Exit;
end;
until(FindColorTolerance(x,y,WallColor,MMX1,MMY1,MMX2,MMY2,TheTol))
WallColor:=GetColor(x,y)
if(WallColor<>0)then
Result:=True;
if(Result)then
GoingOn('Wall color= '+inttostr(WallColor))
else
GoingOn('Couldnt get wall color. But we will still carry on!')
end;

{----------------------------------------------------------------------------}

Function FindWall(var xx,yy:Integer; xs,ys,xe,ye:Integer):Boolean;
begin
RealWallColor:=15463657;
if(GetWallColor(x,y,RealWallColor))then
begin
if(FindColor(x,y,RealWallColor,MMCX+(xs),MMCY+(ys),MMCX+(xe),MMCY+(ye)))then
begin
MMouse(x,y,0,0)
getmousepos(xx,yy)
Result:=True;
end;
end;
end;

{//KYAB\\}
Function CMapWalk(x, y : integer): boolean;
var
zinitx, zinity: integer;
begin
zinitx := MMCX + x;
zinity := MMCY - y;
if(zinitx>MMX1)and(zinitx<MMX2)and
(zinity>MMY1)and(zinity<MMY2) then
begin
Mouse(zinitx, zinity, 0, 0, true);
Result := True;
end
else
Result := False;
end;

function connect: boolean;
var
str : string;
begin
if(Not(KYAB))then
Exit;
if (conn_index <> 0)
then freeConnection(conn_index);
conn_index := openConnection('127.0.0.1', 44, 3000);
SendConnectionData(conn_index, 'C');
ReadConnectionData(conn_index, str)
writeln('Response: ' + str);
if (str = 'Y') then
result := true;
end;

procedure close;
begin
if(Not(KYAB))then
Exit;
SendConnectionData(conn_index, 'X');
freeConnection(conn_index);
conn_index:= 0;
end;

function getPlayerX: integer;
var
str: string;
begin
SendConnectionData(conn_index, 'PX');
ReadConnectionData(conn_index, str)
result := strtoint(str);
end;

function getPlayerY: integer;
var
str: string;
begin
SendConnectionData(conn_index, 'PY');
ReadConnectionData(conn_index, str)
result:= strtoint(str);
end;

function NotAtTile(x,y,tolerance:integer):boolean;
var
currentx, currenty : integer;
begin
if(x>currentx-tolerance)and(x < currentx + tolerance)and
(y>currenty-tolerance)and(y<currenty+tolerance)then
Result:=False
else
Result:=True;
end;

function AtTile(x, y, tolerance : integer) : boolean;
var
currentx, currenty : integer;
begin
currentx := getPlayerX;
currenty := getPlayerY;
if((x > currentx - tolerance) and (x < currentx + tolerance) and (y > currenty - tolerance) and (y < currenty + tolerance)) then
Result := True
else
Result := False;
end;

procedure ClickTile(x, y : integer);
var
dx, dy : integer;
begin
if(Not(KYAB))then
Exit;
dx := x - getPlayerX;
dy := y - getPlayerY;
CMapWalk(dx * 4, dy * 4);
repeat
Wait(10)
until AtTile(x, y, 4)
wait(5)
end;

Procedure LoadTiles;
begin
if(Not(KYAB))then
Exit;
Try
SetArrayLength(VETiles,9);
VETiles[0].X:=3253; VETiles[0].Y:=3422;
VETiles[1].X:=3262; VETiles[1].Y:=3431;
VETiles[2].X:=3275; VETiles[2].Y:=3431;
VETiles[3].X:=3286; VETiles[3].Y:=3426;
VETiles[4].X:=3291; VETiles[4].Y:=3415;
VETiles[5].X:=3292; VETiles[5].Y:=3401;
VETiles[6].X:=3293; VETiles[6].Y:=3386;
VETiles[7].X:=3291; VETiles[7].Y:=3377;
VETiles[8].X:=3286; VETiles[8].Y:=3368;

SetArrayLength(VWTiles,10);
VWTiles[0].X:=3184; VWTiles[0].Y:=3439;
VWTiles[1].X:=3175; VWTiles[1].Y:=3430;
VWTiles[2].X:=3169; VWTiles[2].Y:=3424;
VWTiles[3].X:=3170; VWTiles[3].Y:=3413;
VWTiles[4].X:=3168; VWTiles[4].Y:=3402;
VWTiles[5].X:=3168; VWTiles[5].Y:=3391;
VWTiles[6].X:=3167; VWTiles[6].Y:=3381;
VWTiles[7].X:=3168; VWTiles[7].Y:=3372;
VWTiles[8].X:=3172; VWTiles[8].Y:=3366;
VWTiles[9].X:=3177; VWTiles[9].Y:=3371;

SetArrayLength(LWTiles,13);
LWTiles[0].X:=3092; LWTiles[0].Y:=3245;
LWTiles[1].X:=3099; LWTiles[1].Y:=3250;
LWTiles[2].X:=3099; LWTiles[2].Y:=3242;
LWTiles[3].X:=3105; LWTiles[3].Y:=3233;
LWTiles[4].X:=3113; LWTiles[4].Y:=3226;
LWTiles[5].X:=3120; LWTiles[5].Y:=3216;
LWTiles[6].X:=3131; LWTiles[6].Y:=3209;
LWTiles[7].X:=3138; LWTiles[7].Y:=3201;
LWTiles[8].X:=3139; LWTiles[8].Y:=3190;
LWTiles[9].X:=3141; LWTiles[9].Y:=3178;
LWTiles[10].X:=3143; LWTiles[10].Y:=3166;
LWTiles[11].X:=3147; LWTiles[11].Y:=3156;
LWTiles[12].X:=3146; LWTiles[12].Y:=3148;

SetArrayLength(LETiles,9);
LETiles[0].X:=3155; LETiles[0].Y:=3151;
LETiles[1].X:=3168; LETiles[1].Y:=3150;
LETiles[2].X:=3180; LETiles[2].Y:=3151;
LETiles[3].X:=3192; LETiles[3].Y:=3150;
LETiles[4].X:=3203; LETiles[4].Y:=3151;
LETiles[5].X:=3214; LETiles[5].Y:=3154;
LETiles[6].X:=3226; LETiles[6].Y:=3154;
LETiles[7].X:=3232; LETiles[7].Y:=3152;
LETiles[8].X:=3226; LETiles[8].Y:=3147;

SetArrayLength(RDTiles,16);
RDTiles[0].X:=3092; RDTiles[0].Y:=3245;
RDTiles[1].X:=3080; RDTiles[1].Y:=3251;
RDTiles[2].X:=3072; RDTiles[2].Y:=3257;
RDTiles[3].X:=3071; RDTiles[3].Y:=3269;
RDTiles[4].X:=3069; RDTiles[4].Y:=3278;
RDTiles[5].X:=3057; RDTiles[5].Y:=3277;
RDTiles[6].X:=3044; RDTiles[6].Y:=3277;
RDTiles[7].X:=3032; RDTiles[7].Y:=3277;
RDTiles[8].X:=3021; RDTiles[8].Y:=3279;
RDTiles[9].X:=3010; RDTiles[9].Y:=3277;
RDTiles[10].X:=2998; RDTiles[10].Y:=3273;
RDTiles[11].X:=2991; RDTiles[11].Y:=3266;
RDTiles[12].X:=2986; RDTiles[12].Y:=3257;
RDTiles[13].X:=2976; RDTiles[13].Y:=3254;
RDTiles[14].X:=2977; RDTiles[14].Y:=3243;
RDTiles[15].X:=2973; RDTiles[15].Y:=3237;

SetArrayLength(RFTiles,15);
RFTiles[0].X:=3011; RFTiles[0].Y:=3357;
RFTiles[1].X:=3005; RFTiles[1].Y:=3362;
RFTiles[2].X:=3005; RFTiles[2].Y:=3351;
RFTiles[3].X:=3005; RFTiles[3].Y:=3342;
RFTiles[4].X:=3006; RFTiles[4].Y:=3332;
RFTiles[5].X:=3005; RFTiles[5].Y:=3323;
RFTiles[6].X:=3006; RFTiles[6].Y:=3313;
RFTiles[7].X:=3002; RFTiles[7].Y:=3302;
RFTiles[8].X:=2995; RFTiles[8].Y:=3294;
RFTiles[9].X:=2986; RFTiles[9].Y:=3286;
RFTiles[10].X:=2983; RFTiles[10].Y:=3275;
RFTiles[11].X:=2983; RFTiles[11].Y:=3263;
RFTiles[12].X:=2973; RFTiles[12].Y:=3256;
RFTiles[13].X:=2975; RFTiles[13].Y:=3244;
RFTiles[14].X:=2972; RFTiles[14].Y:=3237;

SetArrayLength(BVTiles,11);
BVTiles[0].X:=3185; BVTiles[0].Y:=3439;
BVTiles[1].X:=3178; BVTiles[1].Y:=3431;
BVTiles[2].X:=3167; BVTiles[2].Y:=3427;
BVTiles[3].X:=3155; BVTiles[3].Y:=3421;
BVTiles[4].X:=3143; BVTiles[4].Y:=3418;
BVTiles[5].X:=3129; BVTiles[5].Y:=3417;
BVTiles[6].X:=3118; BVTiles[6].Y:=3421;
BVTiles[7].X:=3106; BVTiles[7].Y:=3422;
BVTiles[8].X:=3095; BVTiles[8].Y:=3422;
BVTiles[9].X:=3086; BVTiles[9].Y:=3421;
BVTiles[10].X:=3082; BVTiles[10].Y:=3421;
Except
ReportErrors('ERROR: loading tiles')
end;
end;
{\\KYAB//}


{//Varrock road\\}
procedure VRoadBMP;
begin
VRoad[0][0] := BitmapFromString(14, 4, 'z78DA3330A01530B73037357' +
'3A39CA4B599D40500DD144429');
VRoad[0][1] := BitmapFromString(8, 7, 'z78DA33302007985B989B9AB9' +
'E12787937AE20100B58F4573');
VRoad[0][2] := BitmapFromString(4, 9, 'z78DA3330C007CC2DCC4DCDDC' +
'20E46016C7040070AA2B83');

VRoad[1][0] := BitmapFromString(14, 4, 'z78DA3330A015B070B6B0B03' +
'0A29CA4B599D40500C39443F9');
VRoad[1][1] := BitmapFromString(8, 7, 'z78DA3330200758385B585818' +
'E12787937AE2010095AF4537');
VRoad[1][2] := BitmapFromString(4, 9, 'z78DA3330C0072C9C2D2C2C8C' +
'20E46016C70400685A2B67');

VRoad[2][0] := BitmapFromString(14, 4, 'z78DA3330A01530753235373' +
'5A29CA4B599D40500154C42F1');
VRoad[2][1] := BitmapFromString(8, 7, 'z78DA33302007983A999A9B1A' +
'E12787937AE20100BBC643ED');
VRoad[2][2] := BitmapFromString(4, 9, 'z78DA3330C0074C9D4CCD4D8D' +
'20E46016C7040026C82ACD');

VRoad[3][0] := BitmapFromString(14, 4, 'z78DA3330A0153073337331' +
'33A19CA4B599D4050070834501');
VRoad[3][1] := BitmapFromString(8, 7, 'z78DA3330200798B999B9989' +
'9E02787937AE201006DD64681');
VRoad[3][2] := BitmapFromString(4, 9, 'z78DA3330C007CCDCCC5CCC4' +
'C20E46016C70400A91A2C01');
end;

Function FindDaVarrockRoadColor(MaxTol:Integer):Integer;
var
i1,i2,lTol,Ax,Ay,TempColor: Integer;
begin
if(Not(LoggedIn))then
Exit;
for i2:= 0 to 2 do
begin
repeat
for i1:= 0 to 3 do
begin
if(FindBitmapToleranceIn(VRoad[i1][i2],Ax,Ay,MMX1+22,MMY1,MMX2,MMY2,lTol)) then
begin
TempColor:=GetColor(Ax+1, Ay+1);
if(TempColor>5000000)and(TempColor<9000000)then
begin
Result:=TempColor;
Writeln('Varrock Road Color = '+inttostr(Result))
Exit;
end;
end;
lTol := lTol + 2;
end;
until (lTol >= MaxTol);
lTol:=0
end;
Writeln('Varrock Road Color was not found.')
Result:=0;
end;
{\\Varrock road//}


procedure ScreenLoading;
var
LoadingSafeMark:Integer;
begin
if(FindColor(x,y,0,180,115,320,180))and
FindColorTolerance(x,y,16777215,180,115,320,180,3)then
begin
MarkTime(LoadingSafeMark)
GoingOn('Screen loading')
repeat
wait(300)
until(not(FindColor(x,y,0,180,115,320,180)))and
not(FindColorTolerance(x,y,16777215,180,115,320,180,3))
or(TimeFromMark(LoadingSafeMark)>=10000)
GoingOn('Screen loaded ['+inttostr(TimeFromMark(LoadingSafeMark))+'ms]')
end;
end;

{----------------------------------------------------------------------------}
{-----------------WALK TO MINE PROCEDURES------------------------------------}
{----------------------------------------------------------------------------}

procedure WalkToLW; {START OF LUMBRIDGE WEST}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= 0 to GetArrayLength(LWTiles)-1 do
ClickTile(LWTiles[i].X,LWTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

//ROAD WALK
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaroadColor,120,100,60,0,-1)))then
begin
Mouse(680,110,4,4,true)
wait(200)
Flag;
end;
wait(20)
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,120,180,66,0,-1)))then
begin
Mouse(MMCX+10,MMCY+65,4,4,true)
wait(200)
Flag;
end;
wait(20)
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,120,200,67,0,-1)))then
begin
Mouse(MMCX+10,MMCY+45,4,4,true)
wait(200)
Flag;
end;
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,120,220,50,0,-1)))then
begin
Mouse(MMCX+10,MMCY+50,4,4,true)
wait(200)
Flag;
end;
Flag;
Wait(500)
ScreenLoading;

//WATER WALK
DaRoadColor:=FindWaterColor

if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindWaterColor

if(not(RadialRoadWalk(DaRoadColor,85,150,60,0,-1)))then
begin
Mouse(MMCX+55,MMCY+10,4,4,True)
Flag;
end;

for i:=0 to 4 do
begin
ScreenLoading;
if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindWaterColor
if(not(RadialRoadWalk(DaRoadColor,130,200,63,0,-1)))then
begin
Mouse(MMCX-2,MMCY+63,4,3,True)
Flag;
end;
end;
wait(1000)

//WALK TO MINING SPOT
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x-8,y,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX+11,MMCY+40+random(16),4,4,True)
wait(300)
Flag;
wait(500)
end;
wait(10)
GoingOn('We are at West lumbridge mining spot')
end;
{END OF LUMBRIDGE WEST}

{----------------------------------------------------------------------------}
{----------------------------------------------------------------------------}

procedure WalkToLE; {START OF LUMBRIDGE EAST}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= 0 to GetArrayLength(LETiles)-1 do
ClickTile(LETiles[i].X,LETiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

GoingOn('Going to East Lumbridge mining spot')
DaRoadColor:=FindWatercolor;
for i:=0 to 6 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindWatercolor;
if(not(RadialRoadWalk(DaRoadColor,60,160,63,-1,0)))then
begin
Mouse(MMCX+60,MMCY+3,3,3,True)
Flag;
end;
end;
ScreenLoading;
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y+8,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX+30,MMCY+5,4,4,True)
wait(200)
Flag;
wait(200)
end;
end;
{END OF LUMBRIDGE EAST}

{----------------------------------------------------------------------------}
{----------------------------------------------------------------------------}

procedure WalkToVW1;
var
i:Integer;
begin
if(KYAB)then
begin
For i:= 0 to GetArrayLength(VWTiles)-1 do
ClickTile(VWTiles[i].X,VWTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

//if(not(RadialRoadWalk(FindRoadColor,110,165,60,-1,0)))then
if(FindSymbol(x,y,'Anvil'))then
begin
Mouse(x+25,y-10,8,8,True)
wait(200)
Flag;
Wait(500)
end
else
begin
Mouse(MMCX+60,MMCY+25,4,4,true)
wait(200)
Flag;
end;
wait(10)
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),110,60,47,0,0)))then
begin
Mouse(MMCX+40,MMCY+15,4,4,true)
wait(200)
Flag;
end;
wait(10)
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),180,140,55,0,0)))then
begin
Mouse(MMCX+30,MMCY+30,4,4,true)
wait(200)
Flag;
end;
wait(10)
for i:=0 to 4 do
begin
ScreenLoading;
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),160,200,45,0,0)))then
begin
Mouse(MMCX,MMCY+45,4,4,true)
wait(200)
Flag;
end;
wait(500)
end;
Mouse(MMCX-30,MMCY+10,6,8,True)
wait(200)
Flag;
wait(500)
Mouse(MMCX-30,MMCY-15,4,4,true)
wait(200)
Flag;
Mouse(MMCX-35,MMCY,4,4,true)
wait(200)
Flag;
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX-50,MMCY-15,4,4,True)
wait(200)
Flag;
wait(200)
end
end;

{----------------------------------------------------------------------------}

procedure WalkToVW2;
var
i:Integer;
begin
if(KYAB)then
Begin
for i:= 0 to GetArrayLength(VWTiles)-1 do
ClickTile(VWTiles[i].X,VWTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),240,265,50,1,0)))then
begin
Mouse(MMCX-50,MMCY+35,4,4,true)
wait(200)
Flag;
end;
wait(10)
for i:= 0 to 1 do
begin
if(FindWall(x,y,5,40,35,60))then
begin
Mouse(x-20,y+15,5,5,True)
wait(200)
Flag;
end
else
begin
Mouse(MMCX-5,MMCY+55,5,5,True)
wait(200)
Flag;
Wait(500)
end;
end;

if(FindWall(x,y,25,40,65,65))then
begin
Mouse(x-20,y,5,5,True)
wait(200)
Flag;
end
else
begin
Mouse(MMCX+20,MMCY+55,5,5,True)
wait(200)
Flag;
Wait(500)
end;

if(FindWall(x,y,5,40,30,55))then
begin
Mouse(x-20,y+10,5,5,True)
wait(200)
Flag;
end
else
begin
Mouse(MMCX+10,MMCY+55,5,5,True)
wait(200)
Flag;
Wait(500)
end;

If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y,3,3,True)
wait(200)
Flag;
wait(300)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX,MMCY+35,4,4,True)
wait(200)
Flag;
wait(300)
end
end;

{----------------------------------------------------------------------------}
{----------------------------------------------------------------------------}

const VEAddExtra=1;
procedure WalkToVE;
var
I:Integer;
begin
if(KYAB)then
begin
for I:=0 to GetArrayLength(VETiles)-1 do
ClickTile(VETiles[i].X,VETiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

DaRoadColor:=FindDaVarrockRoadColor(20);
for i:= 0 to 1 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaroadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
if(not(RadialRoadWalk(DaRoadColor,95,20,60,-1,0)))then
begin
Mouse(MMCX+60,MMCY-5,4,4,true)
wait(200)
Flag;
end;
end;
wait(100)
ScreenLoading;
if(not(FindMMColor(x,y,DaroadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
if(not(RadialRoadWalk(DaRoadColor,125,85,50,0,-1)))then
begin
Mouse(MMCX+50,MMCY+15,4,4,true)
wait(400)
Flag;
end;
wait(400)
Flag;
for i:= 0 to 3 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaroadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
if(not(RadialRoadWalk(DaRoadColor,150,190,60+VEAddExtra,0,-1)))then
begin
Mouse(MMCX+2,MMCY+55+VEAddExtra,4,4,true)
wait(200)
Flag;
end;
wait(50+random(100))
end;
wait(800)
Flag;
wait(200)
ScreenLoading;
if(not(FindMMColor(x,y,DaroadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
if(not(RadialRoadWalk(DaRoadcolor,230,150,40,0,-1)))then
begin
Mouse(MMCX-15,MMCY+20,4,4,true)
wait(200)
Flag;
end;
wait(600)
Flag;
ScreenLoading;
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y+5,3,5,True)
wait(200)
Flag;
wait(100)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX-35,MMCY+30,4,4,True)
wait(200)
Flag;
wait(200)
end;
end;

procedure WalkToRI1; {START OF RIMMINGTON 1 (Draynor)}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= 0 to GetArrayLength(RDTiles)-1 do
ClickTile(RDTiles[i].X,RDTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

if(not(RadialRoadWalk(FindRoadColor,310,235,55,1,0)))then
begin
Mouse(MMCX-55,MMCY-15,3,3,True)
Flag;
end;

if(FindWall(x,y,-55,-45,-35,-25))then
begin
Mouse(x+15,y-10,5,5,True)
wait(200)
Flag;
Wait(500+random(400))
end
else
begin
Mouse(MMCX-30,MMCY-40,5,5,True)
wait(200)
Flag;
Wait(500)
end;
if(FindWall(x,y,-18,-35,-2,-15))then
begin
Mouse(x+10,y-8,5,5,True)
wait(200)
Flag;
Wait(500+random(400))
end
else
begin
Mouse(MMCX+5,MMCY-35,5,5,True)
wait(200)
Flag;
Wait(500)
end;

if(not(RadialRoadWalk(FindRoadColor,-70,15,55,0,1)))then
begin
Mouse(MMCX-25,MMCY-30,3,3,True)
Flag;
end;
wait(10)

if(FindSymbol(x,y,'rare trees'))then
begin
GoingOn('Found Yew symbol')
Mouse(x,y-12,4,4,True)
wait(200)
Flag;
wait(500)
end
else
begin
GoingOn('Didnt Find Yew symbol')
Mouse(MMCX-30,MMCY,5,5,True)
wait(200)
Flag;
wait(500)
end;

DaRoadColor:=FindRoadColor;
for i:=0 to 5 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,268,285,45,1,0)))then
begin
Mouse(MMCX-45,MMCY-5,3,3,True)
Flag;
end;
wait(10)
end;

for i:=0 to 2 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,180,260,40,1,0)))then
begin
Mouse(MMCX-50,MMCY+25,3,3,True)
Flag;
end;
wait(10)
end;

Mouse(MMCX+5,MMCY+30,5,5,True)
wait(200)
Flag;
wait(500)
ScreenLoading;
Mouse(MMCX+5,MMCY+25,5,5,True)
wait(200)
Flag;
wait(500)
ScreenLoading;
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y,3,3,True)
wait(200)
Flag;
wait(300)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX,MMCY+30+random(10),4,4,True)
wait(200)
Flag;
wait(200)
end;

end;
{END OF RIMMINGTON 1}

{----------------------------------------------------------------------------}

procedure WalkToRI2; {START OF RIMMINGTON 2 (Falador)}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= 0 to GetArrayLength(RFTiles)-1 do
ClickTile(RFTiles[i].X,RFTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

DaRoadColor:=FindFallyRoadColor;
if(FindMMColor(x,y,FindWaterColor))then
Mouse(x+30,y+20,5,5,True)
else
Mouse(MMCX-25,MMCY+15,5,5,True)
FFlag(5)
for i:= 0 to 2 do
begin
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindFallyRoadColor;
if(not(RadialRoadWalk(FindFallyRoadColor,200,160,40,0,1)))then
begin
Mouse(MMCX,MMCY+40,2,4,True)
Flag;
end;
ScreenLoading;
end;

DaRoadColor:=FindRoadColor;
for i:= 0 to 2 do
begin
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,200,160,50,0,-1)))then
begin
Mouse(MMCX,MMCY+50,2,4,True)
Flag;
end;
ScreenLoading;
end;

for i:=0 to 4 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,180,260,55,1,0)))then
begin
Mouse(MMCX-55,MMCY+12,2,2,True)
Flag;
end;
wait(10)
end;

Mouse(MMCX+5,MMCY+30,5,5,True)
wait(200)
Flag;
wait(500)
ScreenLoading;
Mouse(MMCX+5,MMCY+25,5,5,True)
wait(200)
Flag;
wait(500)
ScreenLoading;
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y,3,3,True)
wait(200)
Flag;
wait(300)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX,MMCY+30+random(10),4,4,True)
wait(200)
Flag;
wait(200)
end;
end;
{END OF RIMMINGTON 2}


procedure WalkToBV; {START OF BARBARIAN VILLAGE}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= 0 to GetArrayLength(BVTiles)-1 do
ClickTile(BVTiles[i].X,BVTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

Mouse(MMCX-4,MMCY+20,4,8,True)
Flag;
DaRoadColor:=FindDaVarrockRoadColor(20)
if(not(RadialRoadWalk(DaRoadColor,220,250,55,2,0)))then
begin
Mouse(MMCX-55,MMCY+20,4,2,True)
wait(200)
Flag;
end;
writeln('click 1');
DaRoadColor:=FindDaVarrockRoadColor(20);
for i:= 0 to 2 do //Varrock road part
begin
ScreenLoading;
writeln('doing other clocks');
if(not(RadialRoadWalk(DaRoadColor,220,320,60,2,0)))then
begin
Mouse(MMCX-55,MMCY,4,5,True)
Flag;
end;
wait(1)
if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
writeln('even more crop');
//until(not(FindColor(x,y,DaRoadColor,674,27,613,133)))
//until(RadialWalkEx(x,y,648,84,FindRoadColor,0,210,300,40))
end;
GoingOn('Almost at the bridge.')
Mouse(MMCX-35,MMCY,5,8,True)
Flag;
DaRoadColor:=FindRoadColor;
i:=0
repeat
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,210,325,55,2,0)))then
begin
Mouse(MMCX-55,MMCY-5,4,1,True)
Flag;
end;
wait(1)
i:=i+1
until(FindWaterColor>0)or(FindSymbol(x,y,'Fish'))Or(I>=3)
GoingOn('At the Barbarian Village bridge.')
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,320,240,40,2,0)))then
begin
Mouse(MMCX-40,MMCY-14,4,2,True)
Flag;
end;

DaRoadColor:=FindDirtRoadColor;
for i:=0 to 1 do
begin
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindDirtRoadColor;
if(not(RadialRoadWalk(DaRoadColor,230,310,50,2,0)))then
begin
Mouse(MMCX-50,MMCY,2,2,True)
Flag;
end;
end;
Flag;
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y,5,5,True)
Flag;
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX-35,MMCY,5,5,True)
Flag;
end;
end; {END OF BARBARIAN VILLAGE}

{----------------------------------------------------------------------------}
{-----------------WALK TO BANK PROCEDURES------------------------------------}
{----------------------------------------------------------------------------}

procedure LWToBank; {START OF LUMBRIDGE WEST}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= GetArrayLength(LWTiles)-1 downto 0 do
ClickTile(LWTiles[i].X,LWTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

//WATER WALK
if(Players[CurrentPlayer].Ore='LW')then
begin
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x+13,y-10,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX+13,MMCY+10,4,4,True)
wait(200)
Flag;
wait(200)
end;
end;

DaRoadColor:=FindWaterColor
for i:=0 to 3 do
begin
ScreenLoading;
if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindWaterColor
if(not(RadialRoadWalk(DaRoadColor,45,-65,56,0,1)))then
begin
Mouse(MMCX-10,MMCY-56,4,4,True)
Flag;
end;
end;

if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindWaterColor
if(not(RadialRoadWalk(DaRoadColor,330,275,55,0,1)))then
begin
Mouse(MMCX-55,MMCY-35,4,4,True)
Flag;
end;
wait(10)

//ROAD WALK
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,-65,60,55,0,1)))then
begin
Mouse(617,28,4,4,true)
Flag;
end;

if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor
if(not(RadialRoadWalk(DaRoadColor,-55,50,55,0,1)))then
begin
Mouse(610,50,4,4,true)
Flag;
end;

if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor
if(not(RadialRoadWalk(DaRoadColor,-55,50,40,0,1)))then
begin
Mouse(630,45,4,4,true)
Flag;
end;

if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor
if(not(RadialRoadWalk(DaRoadColor,210,350,45,0,1)))then
begin
Mouse(MMCX-40,MMCY-45,4,4,true)
Flag;
end;
if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor
if(not(RadialRoadWalk(DaRoadColor,270,350,45,0,1)))then
begin
Mouse(MMCX-40,MMCY-45,4,4,true)
Flag;
end;
end;
{END OF LUMBRIDGE WEST}

{----------------------------------------------------------------------------}

procedure LEToBank; {START OF LUMBRIDGE EAST}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= GetArrayLength(LETiles)-1 downto 0 do
ClickTile(LETiles[i].X,LETiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

Mouse(MMCX-30,MMCY-30,3,3,True)
Wait(100)
Flag;
Mouse(MMCX-35,MMCY+40,3,3,True)
Wait(100)
Flag;
DaRoadColor:=FindWatercolor;
for i:=0 to 3 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindWatercolor;
if(not(RadialRoadWalk(DaRoadColor,320,210,65,1,0)))then
begin
Mouse(MMCX-66,MMCY+8,3,10,True)
Flag;
end;
wait(10)
end;
If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x+10,y-5,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX-30,MMCY-15+random(16),4,4,True)
wait(200)
Flag;
wait(200)
end;
GoingOn('We are at West Lumbridge mining spot')
end;
{END OF LUMBRIDGE EAST}

{----------------------------------------------------------------------------}
{----------------------------------------------------------------------------}

procedure VW1ToBank; {START OF VARROCK WEST 1}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= GetArrayLength(VWTiles)-1 downto 0 do
ClickTile(VWTiles[i].X,VWTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x+15,y,3,3,True)
wait(200)
Flag;
wait(300)
end
Mouse(MMCX+40,MMCY-10,8,8,True)
Wait(200)
Flag;
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),100,160,35,0,0)))then
begin
Mouse(MMCX+30,MMCY+15,4,4,true)
wait(200)
Flag;
end;
wait(10)
Mouse(MMCX+47,MMCY,8,8,True)
Wait(200)
Flag

if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),35,90,60,0,0)))then
begin
Mouse(MMCX+60,MMCY-15,4,4,true)
wait(200)
Flag;
end;
wait(10)
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),-25,15,30,0,0)))then
begin
Mouse(MMCX-10,MMCY-15,4,4,true)
wait(200)
Flag;
end;
wait(10)

for i:=0 to 3 do
begin
ScreenLoading;
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),-20,20,48,0,0)))then
begin
Mouse(MMCX-45,MMCY,4,4,true)
wait(200)
Flag;
end;
wait(10)
end;

if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),290,330,40,0,0)))then
begin
Mouse(MMCX-35,MMCY-30,4,4,true)
wait(200)
Flag;
end;
wait(10)
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),250,290,55,1,0)))then
begin
Mouse(MMCX-55,MMCY-7,4,4,true)
wait(200)
Flag;
end;
wait(10)
end;
{END OF VARROCK WEST 1}

{----------------------------------------------------------------------------}

procedure VW2ToBank; {START OF VARROCK WEST 2}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= GetArrayLength(VWTiles)-1 downto 0 do
ClickTile(VWTiles[i].X,VWTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y,3,3,True)
wait(200)
Flag;
wait(300)
end;
Mouse(MMCX-30,MMCY-15,8,8,True)
wait(200)
Flag;
Wait(500)
Mouse(MMCX-10,MMCY-55,8,8,True)
wait(200)
Flag;
Wait(500)
Mouse(MMCX-10,MMCY-55,8,8,True)
wait(200)
Flag;
Wait(500)
for i:= 0 to 1 do
begin
if(FindWall(x,y,5,-60,30,-20))then
begin
Mouse(x-30,y-15,5,5,True)
wait(200)
Flag;
Wait(500+random(400))
end
else
begin
Mouse(MMCX-5,MMCY-50,5,5,True)
wait(200)
Flag;
Wait(500)
end;
end;
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),50,-10,40,-1,1)))then
begin
Mouse(MMCX+30,MMCY-40,4,4,true)
wait(200)
Flag;
wait(500)
end;
wait(10)
if(not(RadialRoadWalk(FindDaVarrockRoadColor(20),60,110,30,-1,1)))then
begin
Mouse(MMCX+30,MMCY-9,4,4,true)
wait(200)
Flag;
wait(500)
end;
wait(10)
end;
{END OF VARROCK WEST 2}

{----------------------------------------------------------------------------}
{----------------------------------------------------------------------------}

procedure VEToBank; {START OF VARROCK EAST}
var
i:Integer;
begin
if(KYAB)then
begin
for I:=GetArrayLength(VETiles)-1 downto 0 do
ClickTile(VETiles[i].X,VETiles[i].Y)
Exit;
end;

If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x+7,y-15,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
GoingOn('Mining symbol not found')
Mouse(MMCX+5,MMCY-15+random(16),4,4,True)
wait(200)
Flag;
wait(200)
end;
ScreenLoading;
DaRoadColor:=FindDaVarrockRoadColor(20)
if(not(RadialRoadWalk(DaRoadColor,50,-10,60,0,1)))then
begin
Mouse(MMCX+30,MMCY-60,4,4,true)
wait(200)
Flag;
end;
wait(200)
flag;

for i:=0 to 2 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaroadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
if(not(RadialRoadWalk(DaRoadColor,35,-35,57,0,1)))then
begin
Mouse(MMCX+2,MMCY-55,4,4,true)
wait(200)
Flag;
end;
wait(5)
end;

for i:= 0 to 2 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaroadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
if(not(RadialRoadWalk(DaRoadColor,240,345,45,1,0)))then
begin
Mouse(MMCX-55,MMCY-15,4,4,true)
wait(200)
Flag;
end;
wait(20)
end;

ScreenLoading;
if(Not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20);
if(not(RadialRoadWalk(DaRoadColor,180,290,45,1,0)))then
begin
Mouse(MMCX-45,MMCY+8,4,4,true)
wait(200)
Flag;
end;
wait(10)
end;
{END OF VARROCK EAST}

{----------------------------------------------------------------------------}

procedure RI1ToBank; {START OF RIMMINGTON 1 (Draynor)}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= GetArrayLength(RDTiles)-1 downto 0 do
ClickTile(RDTiles[i].X,RDTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y-10,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
Mouse(MMCX-5,MMCY-10,8,8,True)
wait(200)
Flag;
Wait(500)
end;
ScreenLoading;
if(FindWall(x,y,-20,-55,20,-35))then
begin
Mouse(x,y,5,5,True)
wait(200)
Flag;
Wait(500+random(400))
end
else
begin
Mouse(MMCX,MMCY-45,5,5,True)
wait(200)
Flag;
Wait(500)
end;

DaRoadColor:=FindRoadColor;
for i:=0 to 2 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,85,-30,52,0,1)))then
begin
Mouse(MMCX+6,MMCY-50,3,3,True)
Flag;
end;
wait(10)
end;

for i:=0 to 5 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,110,60,52,0,1)))then
begin
Mouse(MMCX+50,MMCY-10,4,4,True)
Flag;
end;
wait(10)
end;
ScreenLoading;
if(not(RadialRoadWalk(DaRoadColor,105,85,25,0,1)))then
begin
Mouse(MMCX+25,MMCY-10,3,3,True)
Flag;
end;
if(FindSymbol(x,y,'rare trees'))then
begin
GoingOn('Found Yew symbol')
Mouse(x+8,y-5,4,4,True)
wait(200)
Flag;
wait(500)
end
else
begin
if(FindColortolerance(x,y,1122377,MMX1,MMY1,MMX2,MMY2-25,3))then
if(FindColorTolerance(x,y,353047,x-10,y-10,x+10,y+10,3))then
if(FindColorTolerance(x,y,353047,x-6,y-6,x+6,y+6,3))then
begin
GoingOn('Didnt find Yew symbol, but found similar colors to yew symbol.')
Mouse(x+5,y-8,4,4,True)
wait(200)
flag;
end
else
begin
GoingOn('Didnt find Yew symbol')
Mouse(MMCX+30,MMCY,5,5,True)
wait(200)
Flag;
wait(500)
end;
ScreenLoading;
end;

if(not(RadialRoadWalk(FindRoadColor,75,115,35,0,1)))then
begin
Mouse(MMCX+30,MMCY+5,3,3,True)
Flag;
end;
wait(10)
ScreenLoading;
if(not(RadialRoadWalk(FindRoadColor,75,115,30,0,1)))then
begin
Mouse(MMCX+30,MMCY+5,3,3,True)
Flag;
end;
wait(20)
flag;
if(FindWall(x,y,-5,35,40,50))then
begin
Mouse(x+17,y+12,5,5,True)
wait(200)
Flag;
Wait(500+random(400))
end
else
begin
Mouse(MMCX+30,MMCY+45,5,5,True)
wait(200)
Flag;
Wait(500)
end;

if(FindWall(x,y,-5,35,20,50))then
begin
Mouse(x+17,y+12,5,5,True)
wait(200)
Flag;
Wait(500+random(400))
end
else
begin
Mouse(MMCX+5,MMCY+50,5,5,True)
wait(200)
Flag;
Wait(500)
end;
ScreenLoading;
if(not(RadialRoadWalk(FindRoadColor,125,145,40,-1,0)))then
begin
Mouse(MMCX+50,MMCY+35,3,3,True)
Flag;
end;
wait(10)

end;
{END OF RIMMINGTON 1}

{----------------------------------------------------------------------------}

procedure RI2ToBank; {START OF RIMMINGTON 2 (Falador)}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= GetArrayLength(RFTiles)-1 downto 0 do
ClickTile(RFTiles[i].X,RFTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

If(FindSymbol(x,y,'Mining spot'))then
begin
GoingOn('Found mining symbol.')
Mouse(x,y-10,3,3,True)
wait(200)
Flag;
wait(100)
end
else
begin
Mouse(MMCX-5,MMCY-10,8,8,True)
wait(200)
Flag;
Wait(500)
end;
ScreenLoading;
if(FindWall(x,y,-20,-55,20,-35))then
begin
Mouse(x-10,y,5,5,True)
wait(200)
Flag;
Wait(500+random(400))
end
else
begin
Mouse(MMCX-7,MMCY-30,5,5,True)
wait(200)
Flag;
Wait(500)
end;
Mouse(MMCX-10,MMCY-10,3,3,True)
Flag;

DaRoadColor:=FindRoadColor;
for i:=0 to 3 do
begin
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,90,1,55,0,1)))then
begin
Mouse(MMCX+30,MMCY-30,3,3,True)
Flag;
end;
wait(10)
end;
for i:= 0 to 2 do
begin
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,25,-25,60,0,1)))then
begin
Mouse(MMCX,MMCY-50,2,4,True)
Flag;
end;
ScreenLoading;
end;
DaRoadColor:=FindFallyRoadColor;
for i:= 0 to 2 do
begin
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindFallyRoadColor;
if(not(RadialRoadWalk(DaRoadColor,25,-25,50,0,1)))then
begin
Mouse(MMCX,MMCY-50,2,4,True)
Flag;
end;
ScreenLoading;
end;

end;
{END OF RIMMINGTON 2}

procedure BVToBank; {START OF BARBARIAN VILLAGE}
var
i:Integer;
begin
if(KYAB)then
begin
For i:= GetArrayLength(BVTiles)-1 downto 0 do
ClickTile(BVTiles[i].X,BVTiles[i].Y)
Writeln('KYAB walked.')
Exit;
end;

DaRoadColor:=FindDirtRoadColor
for i:=0 to 1 do
begin
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindDirtRoadColor;
if(not(RadialRoadWalk(DaRoadColor,65,115,45,-2,0)))then
begin
Mouse(MMCX+45,MMCY,5,5,True)
Flag;
end;
wait(1)
end;

DaRoadColor:=FindRoadColor;
i:=0
repeat
ScreenLoading;
if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindRoadColor;
if(not(RadialRoadWalk(DaRoadColor,130,50,55,-2,0)))then
begin
Mouse(MMCX+55,MMCY,4,5,True)
Flag;
end;
wait(2)
i:=i+1
until(FindDaVarrockRoadColor(14)<>0)or(I>=4)
GoingOn('We past the Barbarian Village bridge.')
Mouse(MMCX+40,MMCY-4,2,2,True)
Flag;

DaRoadColor:=FindDaVarrockRoadColor(22) //Varrock part
i:=0
repeat
ScreenLoading;
DaRoadColor:=FindDaVarrockRoadColor(22)
if(not(RadialRoadWalk(DaRoadColor,140,40,55,-2,0)))then
begin
Mouse(MMCX+50,MMCY-15,4,2,True)
Flag;
end;
wait(1)
i:=i+1
until(GetSymbolColor(x,y,'bank')<>0)
or(GetSymbolColor(x,y,'anvil')<>0)
or(I>=7)

if(not(FindMMColor(x,y,DaRoadColor)))then
DaRoadColor:=FindDaVarrockRoadColor(20)
if(not(RadialRoadWalk(DaRoadColor,130,50,25,-2,0)))then
begin
Mouse(MMCX+25,MMCY-10,4,5,True)
Flag;
end;
end;
{END OF BARBARIAN VILLAGE}

{----------------------------------------------------------------------------}
{----------------------------------------------------------------------------}

procedure WalkToMine;
begin
case UpperCase(Players[CurrentPlayer].Ore) of
'LW': WalkToLW;
'LE': begin WalkToLW; WalkToLE; end;
'VW1': WalkToVW1;
'VW2': WalkToVW2;
'VE': WalkToVE;
'RI1': WalkToRI1;
'RI2': WalkToRI2;
'BV': WalkToBV;
end;
end;

{----------------------------------------------------------------------------}

procedure WalkToBank;
begin
case UpperCase(Players[CurrentPlayer].Ore) of
'LW': LWToBank;
'LE': begin LEToBank; LWToBank; end;
'VW1': VW1ToBank;
'VW2': VW2ToBank;
'VE': VEToBank;
'RI1': RI1ToBank;
'RI2': RI2ToBank;
'BV': BVToBank;
end
end;

{----------------------------------------------------------------------------}

Procedure SetOreColor;
Begin
Case Players[CurrentPlayer].String1 Of
'Clay':OreColorOne:=ClayColor;
'Copper':OreColorOne:=CopperColor;
'Tin':OreColorOne:=TinColor;
'Silver':OreColorOne:=SilverColor;
'Coal':OreColorOne:=CoalColor;
'Iron':OrecolorOne:=IronColor;
'Gold':OrecolorOne:=GoldColor;
'Mithril':OreColorOne:=MithrilColor;
'Adamantite':OreColorOne:=AdamantiteColor;
End;
Case Players[CurrentPlayer].String2 Of
'Clay':OreColorTwo:=ClayColor;
'Copper':OreColorTwo:=CopperColor;
'Tin':OreColorTwo:=TinColor;
'Iron':OrecolorTwo:=IronColor;
'Gold':OrecolorTwo:=GoldColor;
'Silver':OreColorTwo:=SilverColor;
'Coal':OreColorTwo:=CoalColor;
'Mithril':OreColorTwo:=MithrilColor;
'Adamantite':OreColorTwo:=AdamantiteColor;
End;
Case Players[CurrentPlayer].String3 Of
'Clay':OreColorThree:=ClayColor;
'Copper':OreColorThree:=CopperColor;
'Tin':OreColorThree:=TinColor;
'Silver':OreColorThree:=SilverColor;
'Iron':OrecolorThree:=IronColor;
'Gold':OrecolorThree:=GoldColor;
'Coal':OreColorThree:=CoalColor;
'Mithril':OreColorThree:=MithrilColor;
'Adamantite':OreColorThree:=AdamantiteColor;
End;
End;

{----------------------------------------------------------------------------}

Function GetChatMessage:String;
Begin
Result:=GetTextAtEx(20, 415, 0, SmallChars, False,False, 0, 1, 0, 20, False, tr_AllChars);
End;

Function YouSwing:Boolean;
Begin
Result:=(Pos('swi',GetChatMessage)<>0)
End;

Function Youmanage:Boolean;
Begin
Result:=(Pos('man',GetChatMessage)<>0)
End;

Function NoOre:Boolean;
Begin
Result:=(Pos('no',GetChatMessage)<>0)
End;

{----------------------------------------------------------------------------}

Procedure ChangeOre;
begin
Case Random(3) of
0: CurrentRockColor:=OreColorOne
1: begin if(random(2)=1)then CurrentRockColor:=OreColorTwo
else CurrentRockColor:=OreColorOne end;
2: begin if(random(3)=1)then CurrentRockColor:=OreColorThree
else CurrentRockColor:=OreColorTwo end;
end;
end;

Function InLumby:Boolean;
var Sx,Sy:Integer;
begin
if(LumbyDetect)then
begin
if(FindSymbol(Sx,Sy,'Water'))then
if FindSymbol(Sx,Sy,'Cook')then
if FindSymbol(Sx,Sy,'Guide')then
if FindSymbol(Sx,Sy,'Quest')then
Result:=True
else
wait(10)
if(FindSymbol(Sx,Sy,'Water'))then
if FindSymbol(Sx,Sy,'Guide')then
Result:=True
else
wait(10)
if(FindSymbol(Sx,Sy,'Cook'))then
if FindSymbol(Sx,Sy,'Water')then
Result:=True
if(Result=True)then
begin
Players[CurrentPlayer].Loc:='In Lumbridge, ';
GoingOn(Players[CurrentPlayer].Name+' Is in Lumbridge; next player.')
NextPlayer(False)
end;
end;
end;

procedure NotSoOftenRandoms;
begin
if(Random(6)=0)then
begin
FindMime;
FindMaze;
FindQuiz;
FindDemon;
FindScapeRune;
FindLamp(LampSkill);
if(FindNewBox)then
SolveBox;
if(NoGameTab)then
begin
Players[CurrentPlayer].loc := 'Lost';
LogOut;
end;
end;
end;

Function PlayerTimeOut:Boolean;
begin
if(not(UseTimeOut))then
Exit;
PlayerTimeOutMark:=(GetSystemTime/1000/60)-PlayerStartTime2/1000/60;
if(PlayerTimeOutMark>=MaxTime)then
begin
Players[CurrentPlayer].Loc:='Time out, ';
if(not(LoggedIn))then
begin
Result:=True;
GoingOn('Player not logged in, next player')
NextPlayer(False)
exit;
end;
Result:=True;
GoingOn('Player time out. ['+inttostr(PlayerTimeOutMark)+' minutes.] ')
NextPlayer(False)
end;
end;

procedure SolveGas;
begin
Try
if(GasCheck(x,y-12))then
begin
Mouse(MMCX+5,MMCY+5,2,2,true)
if(GasTalk)then
if(random(3)=1)then
case random(4) of
0:TypeSend('Lol is there gas?')
1:TypeSend('Damn, is that gas again?')
2:TypeSend('Is that gas in the rock?')
3:TypeSend('I hope I wont get my pickaxe broke.')
end;
HighestAngle;
FtWait(40)
Exit;
end;
Except
ReportErrors('ERROR: Gas detecting!')
wait(4000)
end;
end;

{----------------------------------------------------------------------------}

Function Clicked:Boolean;
begin
getmousepos(x,y)
if(FindColor(x,y,255,x-8,y-8,x+8,y+8))then
Result:=True;
end;

{----------------------------------------------------------------------------}

procedure RotateIt;
begin
wait(50)
case Random(5) of
0: begin
KeyDown(VK_Left)
wait(350+random(500))
KeyUp(VK_Left)
end;

1: begin
KeyDown(VK_Right)
wait(350+random(500))
KeyUp(VK_Right)
end;
2: begin
KeyDown(VK_Down)
wait(50+random(500))
KeyUp(VK_Down)
end;

3: begin
KeyDown(VK_Up)
wait(50+random(500))
KeyUp(VK_Up)
end;
4: Highestangle;
end;
wait(50)
end;

{----------------------------------------------------------------------------}

Procedure MineFullLoad;
begin
{if(LoadSetting('MCMB','MSymbol')='notfound')or(LoadSetting('MCMB','SETTINGS')='0K')
then
repeat
wait(500)
until(FindMSymbolFSColor) }
writeln('start rands');
NotSoOftenRandoms;
writeln('fixin chat');
FixChat;
writeln('chagin ore');
ChangeOre;
writeln('finding riock');
wait(20)
If(FindObj(x,y,'ine',CurrentRockColor,2+ExtraTol))then
begin
RockNotFound:=0
TotalRocksMissed:=0
wait(4)
SolveGas;
if(random(9)=1)then
begin
Mouse(x,y,2,2,False)
ClickOption('ine',1)
wait(6+random(6))
if(not(Clicked))then
Exit;
end
else
Begin
Mouse(x,y,2,2,True)
wait(6+random(6))
if(not(Clicked))then
Exit;
end;
UpDateForm;
Flag;
wait(1000+random(500))
FindPick;
if(not(YouSwing))or(NoOre)then
begin
Wait(100+random(50))
if(random(15)=1)then
Wait(2000+random(2000))
Exit;
end;
MarkTime(MiningMark)
SolveGas;
Repeat
if(random(3+LowLag*1)=1)then
SolveFight;
wait(10+random(11))
if(random(20)=1)then GI(Players[CurrentPlayer].String1+' ores') else
if(random(20)=1)then GI(Players[CurrentPlayer].String2+' ores') else
if(random(20)=1)then GI(Players[CurrentPlayer].String3+' ores')
if(random(12+LowLag*3)=1)then
TalkingToMe;
wait(10+random(11))
if(random(7)=0)then
If(YouManage)then
Break;
if(random(30)=1)then
SRLRandomsReport;
if(Random(60)=1)then
HowAreYouTodayMrX;
if(random(2)=0)then
HandleTrade;
wait(10+random(11))
if(random(12+LowLag*4)=1)then
SayLevel('Mining')
if(random(2+LowLag)=0)then
FindTalk;
wait(10+random(11))
until(TimeFromMark(MiningMark)/1000>=MiningWait)
end
else
begin
RockNotFound:=RockNotFound+1
if(random(2+LowLag)=1)then
FindNormalRandoms;
wait(100+random(300))
if(random(2)=1)then
begin
wait(300+random(500))
Mouse(MIX1+4,MIY1-60,10,10,True)
wait(40)
RotateIt;

if(RockNotFound>=3)then
begin
if(Players[CurrentPlayer].Ore='RI1')or
(Players[CurrentPlayer].Ore='RI2')then
begin
If(FindSymbol(x,y,'Mining spot'))then
begin
RockNotFound:=0
TotalRocksMissed:=TotalRocksMissed+1
GoingOn('Found mining symbol.')
Mouse(x-random(35)+random(35),y-random(35)+random(35),5,5,True)
wait(200)
Flag;
wait(300)
end;
end
else
begin
If(FindSymbol(x,y,'Mining spot'))then
begin
RockNotFound:=0
TotalRocksMissed:=TotalRocksMissed+1
GoingOn('Found mining symbol.')
Mouse(x-random(8)+random(8),y-random(8)+random(8),3,3,True)
wait(200)
Flag;
wait(300)
end;
end;
end;

end;
Wait(500+random(200))
Exit;
end;
Wait(10+random(20))
if(random(3)=1)then
SetChat('Hide',1)
if(random(30)=1)then
begin
Mouse(MIX1+4,MIY1-60,7,7,True)
wait(20)
MakeCompass('N');
Highestangle;
end;
end;

{----------------------------------------------------------------------------}

Function OresMined:Integer;
var
OreBmp:Integer;
HowMany:Integer;
begin
OreBmp := BitmapFromString(11, 11, 'z78DA73730301033070436' +
'2238B60024C35B84CC0A5923C13F0BB937813F0EB22DE04CC5022' +
'CF04CADD404CC890EA0BFCE2F85D4E4C6A212FF470998FCC0600F' +
'B599CC1');
HowMany:=CountItemBmpMaskTol(Orebmp, 40, 25)
if(HowMany<15)then
Result:=28
else
Result:=HowMany;
end;

Function TotalOresMined:String;
var
i:Integer;
PMines:Integer;
begin
for i:=0 to howmanyplayers-1 do
begin
PMines:=Players[i].Integer3+PMines;
end;
Result:=Inttostr(PMines);
end;

{----------------------------------------------------------------------------}

Procedure DropTheOres;
var
OreBmp:Integer;
Mspeed:Integer;
begin
DwarfItem;
GoingOn('Now dropping '+inttostr(OresMined)+' ores.')
OreBmp := BitmapFromString(11, 11, 'z78DA73730301033070436' +
'2238B60024C35B84CC0A5923C13F0BB937813F0EB22DE04CC5022' +
'CF04CADD404CC890EA0BFCE2F85D4E4C6A212FF470998FCC0600F' +
'B599CC1');
Mspeed:=MouseSpeed;
MouseSpeed:=2
repeat
if(random(3)=1)then
FindNormalRandoms;
if(random(4)=1)then
SolveFight;
If(FindBitMapMaskTolerance(OreBmp,x,y,MIX1,MIY1,MIX2,MIY2,20,25))then
begin
MMouse(x,y,15,15)
getmousepos(x,y)
wait(50+random(50))
if(IsUpText('ore'))then
begin
Mouse(x,y,0,0,False)
ClickOption('Drop',2)
end
else
begin
Mouse(MIX1+4,MIY1-60,7,7,True)
RotateIt;
end;
end;
wait(500+random(500))
until(not(FindBitMapMaskTolerance(OreBmp,x,y,MIX1,MIY1,MIX2,MIY2,20,25)))
MouseSpeed:=MSpeed;
end;

{----------------------------------------------------------------------------}

Procedure SetBankColors;
begin
if(Players[CurrentPlayer].Ore='VE')or
(Players[CurrentPlayer].Ore='VW1')or
(Players[CurrentPlayer].Ore='BV')or
(Players[CurrentPlayer].Ore='VW2')then
begin
BankColors[0]:=6717319; //Varrock bankbooth colors.
BankColors[1]:=2183006;
BankColors[2]:=2904413;
end
else
begin
BankColors[0]:=6192527;
BankColors[1]:=605006;
BankColors[2]:=5795194;
end;
end;

Function GetBankSymbolColor:LongInt;
var BankBitMap,Color,C:Integer;
acc:Extended;
begin
BankBitMap := BitmapFromString(7, 5, 'z78DA3330000143030363' +
'43635CA401921A08DBD9D8D1D8D40899C4AFC6CDD2C5C4D415531' +
'7A61A4CD2C2D4CCD4D014590D4404998D4C0200CC4A2C81');
Color:=6417151
FindDeformedBitmapToleranceIn(BankBitmap,x,y,570,5,725,160,70,0,True,acc);
if(acc>SymbolAccuracy)then
begin
repeat
c:=c+5;
if (FindColorTolerance(x,y,6417151,x,y,x+15,y+5,c)) then
begin
Result:=GetColor(x,y);
end;
until(Result>0)or(c>70);
end;
FreeBitmap(BankBitMap);
end;

{----------------------------------------------------------------------------}

procedure CheckBankColor;
var c : integer;
begin
if(LoadSetting('MCMB','DORPOR')='')then
begin
Writeln('[Runtime Error] : Out Of Range in line 224 in script '+scriptpath+'Pentti Multi City Miner & Banker.scar')
TerminateScript;
end;
BankColor:=0
c:=0
Flag;
repeat
BankColor:=GetBankSymbolColor
c:= c+1;
wait(150+random(100))
GoingOn('Taken '+inttostr(c)+'/20 tries to find bank')
if(BankColor=0)
then begin
KeyDown(VK_Left)
wait(180)
KEyUp(VK_Left)
wait(50)
end;
until(BankColor>0)or(c>19)
if(c>19)then
begin
BanksFailed:=BanksFailed+1;
if(BanksFailed>=5)then //Exits if fails bank 5 times.
Exit;
c:=0
GoingOn('Cant find bank symbol');
GoingOn('Logging out and coming back')
LogOut;
wait(5000+random(2000))
LogInPlayer;
wait(500+random(300))
checkbankcolor;
SetRun(True)
Mouse(x+3,y+6,2,2,true)
getmousepos(x,y)
GoingOn('Bank color: '+inttostr(BankColor))
exit;
end;
C:=0
Mouse(x+1,y+5,0,0,true)
getmousepos(x,y)
GoingOn('Bank color: '+inttostr(BankColor))
wait(50+random(50))
Flag;
wait(50+random(50))
end;

{----------------------------------------------------------------------------}

procedure OpenBankP;
var
x, y, fs, fs2,Find: Integer;
begin
SetBankColors;
if(BanksFailed>=5)then
Exit;
Players[CurrentPlayer].Loc:='at bank, ';
if(not(loggedin))then
begin
NextPlayer(False)
SetOreColor;
NickNameBmp:=CreateBitMapMaskFromText(Players[CurrentPlayer].Nick,upChars)
GetPickColors;
Exit;
end;
if not BankScreen or not PinScreen then
begin
checkBankColor;
repeat
if(Find>5)then
begin
Find:=0
CheckBankColor;
wait(200)
flag;
OpenBankP;
exit;
end;
Find:=Find+1
if (FindObjMultiText(x, y,'Use','u Ba','ank',BankColors[0],6)) then
Mouse(x,y,0,0,False)
else
if (FindObjMultiText(x,y,'Use','u Ba','ank', BankColors[1],6)) then
Mouse(x,y,0,0,False)
else
if (FindObjMultiText(x,y,'Use','u Ba','ank', BankColors[2],6)) then
Mouse(x,y,0,0,False);
Wait(250+random(100));
if (ClickOption('quickly', 1)) then
begin
Flag;
repeat
Wait(100+random(150));
fs := fs + 1;
until(BankScreen)or(PinScreen)or(fs >= 50);
InPin(CommonBankPin)
end;
fs2 := fs2 + 1;
if(fs2>2)then
begin
fs2:=0
checkbankcolor;
wait(150+random(100))
getmousepos(x,y)
Mouse(x+3,y+6,2,2,true)
OpenBankP;
exit;
end;
until (BankScreen)or(PinScreen)or(fs2 > 2);
InPin(CommonBankPin)
MakeCompass('N')
HighestAngle;
exit;
end;
end;

{----------------------------------------------------------------------------}

Procedure BankOres;
begin
OpenBankP;
if(BanksFailed>=5)then
Exit;
FixBank;
Deposit(2,28,2);
GoingOn('All ores banked');
CloseBank;
CloseBank;
Banks:=Banks+1
Mouse(MIX1+4,MIY1-60,7,7,True)
wait(200)
MakeCompass('N')
wait(20)
MakeCompass('N')
end;

{----------------------------------------------------------------------------}

procedure CountUser;
begin
if(LoadSetting('Pentti','User')='')then
begin
SaveSetting('Pentti','User','1')
ReportVars[8]:=1;
end;
end;

procedure TurnOffLumbyDetect;
begin
if(InLumby)then
begin
GoingOn(' Looks like you are already in Lumbridge,')
GoingOn(' Turning off Lumbridge detector.')
LumbyDetect:=False;
end;
end;

Procedure FuckYouGuyCalledJenova;
var
Jenovasrep,i:Integer;
// label Dalabel;
begin
{if(LoaDSetting('FuckYou','Jenova')='Fuckedup')then
Exit;
Jenovasrep:=GetSystemTime;
DaLabel:
if(readLn('Guy called Jenova or some shit name like that is a fucking dumbass mutherfucker? '+
'He is also gay and is having sex with hes dog? '+
'If you see that guy doing stupid stuff anymore you will smash him up so bad he cant write hes name anymore... anywhere? (false/true)')='true')then
begin
if(GetSystemTime-Jenovasrep<15000)then
begin
Writeln('Please read it!')
getmousepos(x,y)
for i:=0 to 30 do
begin
MoveMouse(1+random(700),1+random(600))
wait(5+random(100))
end;
MoveMouse(x,y)
goto DaLabel;
end;
SaveSetting('FuckYou','Jenova','Fuckedup')
writeln('Correct!')
end
else
begin
Writeln('You are a dumbass!')
getmousepos(x,y)
for i:=0 to 30 do
begin
MoveMouse(1+random(700),1+random(600))
wait(5+random(100))
end;
MoveMouse(x,y)
goto DaLabel;
end;
wait(1500)}
end;

function GetTheTime:String;
var
Hour, Mins, Sec, MSec: Word;
H, M, S, PM: string;
begin
DecodeTime(Now, Hour, Mins, Sec, MSec);
H:=inttostr(hour);
M:=inttostr(mins);
S:=inttostr(sec);
if(hour<10)then
H:='0'+H;
if(mins<10) then
M:='0'+M;
if(sec<10) then
S:='0'+S;
Result:=(H+':'+M+':'+S+' '+PM);
end;

function GetTheDate:string;
var
Year, Month, Day: Word;
Day2: string;
begin
DecodeDate(Date, Year, Month, Day);
if(Day<10)or(Day > 21) then
Day2:=IntToStr(Day);
Result:=Padz(IntToStr(Day),2)+'/'+Padz(IntToStr(Month),2)+'/'+IntToStr(Year);
end;

Function GetIPFromServer:STring;
begin
Result:=GetPage(HostServer+'getip.php')
end;

Function GetMyIP:STring;
var
DaTempIP:String;
begin
DaTempIP:=GetIPFromServer;
if(DaTempIP<>'')then
Result:=DaTempIP
else
DaTempIP:=Between('ess is ',' The qu',CheckServer)
if(DaTempIP<>'')then
Result:=DaTempIP
else
TerminateScript;
end;

Function GetMycountry:STring;
var
DaTempCountry:String;
begin
SaveSetting('MCMB','Shownews','False')
DaTempCountry:=Between('try is: ','</b>',CheckServer)
if(DaTempCountry<>'')then
Result:=DaTempCountry
end;

Function NumberOfIPs:Integer;
var
i:Integer;
begin
HowManyIPs:=0;
for i:= 0 to 10000 do
if(Length(BetWeen('<IP['+inttostr(i)+']>','</IP['+inttostr(i)+']>',TheSiteText))>0)then
HowManyIPs:=HowManyIPs+1;
Result:=HowManyIPs;
end;

Function GetMyIpPosition:Integer;
var
FoundIPpos:Boolean;
var
i:Integer;
TempNumberofIPs:Integer;
begin
TempNumberofIPs:=NumberOfIPs;
for i:=0 to TempNumberofIPs+50 do
if(Between('<IP['+inttostr(i)+']>','</IP['+inttostr(i)+']>',TheSiteText)=MyIP)then
begin
Result:=i;
MyIP:=Between('<IP['+inttostr(i)+']>','</IP['+inttostr(i)+']>',TheSiteText)
FoundIPpos:=True;
Break;
end;
if(not(FoundIPpos))then
Result:=-1;
end;

Function IsIpAlready(DaIP:String):Boolean;
var
i:Integer;
TempNumberofIPs:Integer;
TempText:String;
begin
TempNumberofIPs:=NumberOfIPs;
for i:=0 to TempNumberofIPs+50 do
if(Between('<IP['+inttostr(i)+']>','</IP['+inttostr(i)+']>',TheSiteText)=DaIP)then
begin
Result:=True;
Exit;
end;
end;

procedure SetIpUp;
begin
{HostServer:='http://srlpentti.awardspace.com/';
CheckServer:=GetPage('http://www.formyip.com');
usern:='muther';
passw:='fucker';
if(LoadSetting('MCMB','IP')<>'')then
MyIP:=LoadSetting('MCMB','IP')
else
MyIp:=GetMyIP;
SaveSetting('MCMB','IP',MyIP)
if(LoadSetting('MCMB','SRLID')<>'')then
SRLID:=LoadSetting('MCMB','SRLID')
else
SaveSetting('MCMB','SRLID',SRLID)
SRLID:=LoadSetting('MCMB','SRLID')
Site:=InitializeHTTPClient(false,false);
SaveSetting('MCMB','MSymbol','found')
TheSiteText:=GetPage(HostServer+'report.txt')
TempNumberofIPs:=NumberOfIPs;}
end;

Function UserAllowed:Boolean;
var
i:Integer;
POR,DOR:integer;
TempPage:STring;
TempNumIPs:Integer;
begin
SaveSetting('MCMB','DORPOR','OK');
TempNumIPs:=NumberOfIPs;
Result := true;
//TempPage:=GetPage(HostServer+'IpCheck.txt')
//if(MyIp='')or(SRLID='')then
// Exit;
{for i:=0 to TempNumIPs+500 do
if(Between('<IP['+inttostr(i)+']>','</IP['+inttostr(i)+']>',TempPage)=MyIp)then
begin
POR:=I;
for i:=0 to TempNumIPs+500 do
if(Between('<ID['+inttostr(i)+']>','</ID['+inttostr(i)+']>',TempPage)=SRLID)then
DOR:=I;
if(DOR=POR)then
begin
Result:=True;
Exit;
end;
end; }
end;

Function GetServerTime:STring;
var
GetAllTimes:String;
begin
{ClearPostData(Site);
AddPostVariable(Site,'time','time');
GetAllTimes:=PostHTTPPageEx(Site,HostServer+'gettime.php')
Result:=GetAllTimes;
if(Length(GetAllTimes)<>19)then
Result:=GetTheDate+' - '+GetTheTime;}
end;

function SendIp(IP:String):Boolean;
var
S:String;
TempIPs:Integer;
CRound:Array[0..1]of String;
AddIpNum:Integer;
Addfirst:STring;
AddFirstL:STring;
Tempallowed:Boolean;
begin
SaveSetting('MCMB','SETTINGS','')
{TempIPs:=NumberOfIPs;
Tempallowed:=UserAllowed;
ClearPostData(Site);
CRound[0]:='<';
CRound[1]:='>';
AddIpNum:=TempIPs;
Addfirst:=' S.Loc('+GetMyCountry+')'+' {'+LoadSetting('MCMB','FORUMNAME')+'}{'//;}
{if(IsIpAlready(IP))then
begin
CRound[0]:='<*';
CRound[1]:='*>';
AddIpNum:=GetMyIpPosition;
Addfirst:='';
end;
if(not(Tempallowed))then
begin SaveSetting('MCMB','SETTINGS','0K')
AddFirstL:='!' end;
AddPostVariable(Site,'report',AddFirstL+CRound[0]+'IP['+inttostr(AddIpNum)+']'+CRound[1]+IP+CRound[0]+'/IP['+inttostr(AddIpNum)+']'+CRound[1]+' - ['+SRLID+']: '+GetServerTime+Addfirst);
AddPostVariable(Site,'username',usern)
AddPostVariable(Site,'password',passw);
S:=PostHTTPPageEx(Site,HostServer+'report.php');
if(Trim(S)='IP was sent to server')then
Result:=True
if(Length(LoadSetting('MCMB','FORUMNAME'))<=2)then
TerminateScript;}
end;

{NEWS}
procedure MCMBNews;
var
MCMBPage:String;
I:Integer;
begin
if(not(ShowNews))then
Exit;
{ClearDebug;
Try
MCMBPage:=GetPage('http://srlpentti.awardspace.com/MCMB_News.txt')
if(MCMBPage='')then
writeln('ERROR connecting to internet!')
Writeln('______________________________________________________________________')wait(50+random(200))
Writeln('NEWS:') wait(50+random(200))
writeln('') wait(50+random(200))
for i:=0 to 9 do
begin
if(Length(Between('<newsline['+inttostr(i)+']>','</newsline['+inttostr(i)+']>',MCMBPage))>0)then
begin
Writeln(Between('<newsline['+inttostr(i)+']>','</newsline['+inttostr(i)+']>',MCMBPage))wait(50+random(200))
end;
end;
Writeln('______________________________________________________________________')wait(50+random(200))
Writeln('SCRIPT INFO:') wait(50+random(200))
writeln('') wait(50+random(200))
Writeln('Official thread: '+Between('<download>','</download>',MCMBPage)) wait(50+random(200))
Writeln('Current version: '+Between('<ver>','</ver>',MCMBPage)) wait(50+random(200))
Writeln('Creator: '+Between('<auth>','</auth>',MCMBPage)) wait(50+random(200))
Writeln('Contact: '+Between('<msn>','</msn>',MCMBPage)) wait(50+random(200))
Writeln('______________________________________________________________________')wait(50+random(200))
writeln('') wait(50+random(200))
for i:=0 to 50 do
begin
if(Length(Between('<other['+inttostr(i)+']>','</other['+inttostr(i)+']>',MCMBPage))>0)then
begin
Writeln(Between('<other['+inttostr(i)+']>','</other['+inttostr(i)+']>',MCMBPage))wait(50+random(200))
end;
end;
Writeln('______________________________________________________________________')wait(50+random(200))
writeln('') wait(50+random(200))
Except
ReportErrors('ERROR: News system!')
wait(4000)
end;
Sleep(5000)
Writeln('Press F9 to continue...')
Repeat
Wait(100)
until(IsFKeyDown(9))}
end;

Procedure ContinueNews;
var
i:Integer;
begin
//if(LoadSetting('MCMB','Shownews')='True')or(LoadSetting('MCMB','SETTINGS')='0K')or(LoadSetting('MCMB','DORPOR')='')then
//begin
{ClearDebug;
repeat
i:=97+random(25);
ClearDebug;
Writeln(CHR(80)+CHR(114)+CHR(101)+CHR(115)+CHR(115)+CHR(32)+CHR(i)+CHR(32)+CHR(116)+CHR(111)+CHR(32)+CHR(99)+CHR(111)+CHR(110)+CHR(116)+CHR(105)+CHR(110)+CHR(117)+CHR(101))
Repeat
wait(50)
until(IsKeyDown(CHR(i)))
wait(500)
until(False)
end;}
end;

Procedure CheckNewVersion;
var
NewestVer:Extended;
temppage:String;
begin
{ Try
temppage:=GetPage('http://srlpentti.awardspace.com/MCMB_News.txt')
NewestVer:=StrToFloat(Between('<ver>','</ver>',temppage))
if(NewestVer>0.405)then
begin
Writeln('Press "Q" to continue with old version...')
Writeln('Press "D" to download newest version: '+FloatToStr(NewestVer))
Repeat
wait(50)
if(IsKeydown('q'))then
Break;
if(IsKeydown('d'))then
begin
OpenWebPage(Between('<download>','</download>',temppage))
TerminateScript;
end;
Until(False)
end;
Except
ReportErrors('ERROR: Version check!')
wait(4000)
end;
Writeln('You have the newest version!')}
end;
{/NEWS}
{------------------------------------------------------------------}
{-------------------Da Mutherfucking from thingy-------------------}
{------------------------------------------------------------------}
{//Form\\}
procedure SafeShowPB;Forward;

procedure FHideClicked(Sender:TObject);
begin
PBFrom.WINDOWSTATE:=wsMinimized;
end;

Procedure UpDateForm;
var
CurrentPlayerInForm:Integer;
i:Integer;
begin
Try
Sleep(10)
if(not(UseFrom))then
Exit;
for i:= 0 to getarraylength(Players)-1 do
if(Players[i].Name=PSBox.Text)then
begin
CurrentPlayerInForm:=i;
Break;
end;
if(CurrentPlayerInForm=CurrentPlayer)then
PWorkedE.Caption:=IntToStr(GetSystemTime/60000-PlayerStartTime/60)+' mins.'
else
PWorkedE.Caption:='Unknown';
MinedE.Caption:=IntToStr(Players[CurrentPlayerInForm].Integer3);
OresToMineE.Caption:=Players[CurrentPlayerInForm].String1+', '+Players[CurrentPlayerInForm].String2+' and '+Players[CurrentPlayerInForm].String3+' ores.';
if(Players[CurrentPlayerInForm].String1='')or
(Players[CurrentPlayerInForm].String2='')or
(Players[CurrentPlayerInForm].String3='')then
OresToMineE.Caption:='No ores to mine!';
if(Players[CurrentPlayerInForm].Loc='')then
LocE.Caption:='Unknown'
else
LocE.Caption:=Players[CurrentPlayerInForm].Loc;
if(Players[CurrentPlayerInForm].Integer4<=0)then
MiningLvlE.Caption:='Unknown.'
else
MiningLvlE.Caption:=inttostr(Players[CurrentPlayerInForm].Integer4)
CuPlayer.Caption:=Players[CurrentPlayerInForm].Name;
SafeShowPB;
Sleep(10)
Except
ReportErrors('ERROR: Form update!')
wait(4000)
end;
end;

procedure FUF(Sender : TObject);
begin
UpDateForm;
end;

procedure PBForm;
var
i:Integer;
begin
FindRS;
PBFrom := CreateForm;
PBFrom.Left := 0;
PBFrom.Top := 0;
PBFrom.Width := 773;
PBFrom.Height := 180;
PBFrom.BorderIcons := [biMinimize];
PBFrom.BorderStyle := bsSizeToolWin;
PBFrom.Caption := CHR(80)+CHR(101)+CHR(110)+CHR(116)+CHR(116)+CHR(105)+#39's Multi City Miner & Banker - Progress bar';
PBFrom.Color := clInfoText;
PBFrom.Font.Color := clWindowText;
PBFrom.Font.Height := -15;
PBFrom.Font.Name := 'Arial';
PBFrom.Font.Style := [fsBold, fsItalic];
PBFrom.Visible := False;
PBFrom.PixelsPerInch := 120;
PBFrom.FormStyle := fsStayOnTop;
PBFrom.OnClick:=@FUF;
Sleep(1)
TopText1 := TLabel.Create(PBFrom);
TopText1.Parent := PBFrom;
TopText1.Left := 106;
TopText1.Top := 10;
TopText1.Width := 539;
TopText1.Height := 17;
TopText1.Caption := CHR(80)+CHR(101)+CHR(110)+CHR(116)+CHR(116)+CHR(105)+#39's Multi City Miner / Banker - Progress bar';
TopText1.DragCursor := crDefault;
TopText1.Font.Color := clLime;
TopText1.Font.Height := -17;
TopText1.Font.Name := 'Lucida Console';
TopText1.Font.Style := [fsBold, fsItalic, fsUnderline];
TopText1.ParentFont := False;
TopText2 := TLabel.Create(PBFrom);
TopText2.Parent := PBFrom;
TopText2.Left := 106;
TopText2.Top := 9;
TopText2.Width := 539;
TopText2.Height := 17;
TopText2.Caption := CHR(80)+CHR(101)+CHR(110)+CHR(116)+CHR(116)+CHR(105)+#39's Multi City Miner / Banker - Progress bar';
TopText2.Font.Color := clInactiveCaption;
TopText2.Font.Height := -17;
TopText2.Font.Name := 'Lucida Console';
TopText2.Font.Style := [fsBold, fsItalic, fsUnderline];
TopText2.ParentFont := False;
Sleep(1)
PWorked := TLabel.Create(PBFrom);
PWorked.Parent := PBFrom;
PWorked.Left := 212;
PWorked.Top := 40;
PWorked.Width := 67;
PWorked.Height := 20;
PWorked.Caption := 'Worked:';
PWorked.Color := clHighlightText;
PWorked.Font.Color := clRed;
PWorked.Font.Height := -17;
PWorked.Font.Name := 'MS Sans Serif';
PWorked.Font.Style := [fsBold];
PWorked.ParentColor := False;
PWorked.ParentFont := False;
Sleep(1)
CuPlayer := TLabel.Create(PBFrom);
CuPlayer.Parent := PBFrom;
CuPlayer.Left := 5;
CuPlayer.Top := 96;
CuPlayer.Width := 119;
CuPlayer.Height := 24;
CuPlayer.Caption := 'PSBox.Text';
CuPlayer.Color := clInactiveCaption; //clGradientInactiveCaption;
CuPlayer.Font.Color := clInfoBk;
CuPlayer.Font.Height := -20;
CuPlayer.Font.Name := 'Georgia';
CuPlayer.Font.Style := [fsBold];
CuPlayer.ParentColor := False;
CuPlayer.ParentFont := False;
Sleep(1)
PMined := TLabel.Create(PBFrom);
PMined.Parent := PBFrom;
PMined.Left := 225;
PMined.Top := 70;
PMined.Width := 54;
PMined.Height := 20;
PMined.Caption := 'Mined:';
PMined.Font.Color := clRed;
PMined.Font.Height := -17;
PMined.Font.Name := 'MS Sans Serif';
PMined.Font.Style := [fsBold];
PMined.ParentFont := False;
Sleep(1)
Ploc := TLabel.Create(PBFrom);
Ploc.Parent := PBFrom;
Ploc.Left := 399;
Ploc.Top := 40;
Ploc.Width := 75;
Ploc.Height := 20;
Ploc.Caption := 'Location:';
Ploc.Font.Color := clRed;
Ploc.Font.Height := -17;
Ploc.Font.Name := 'MS Sans Serif';
Ploc.Font.Style := [fsBold];
Ploc.ParentFont := False;
Sleep(1)
PMLevel := TLabel.Create(PBFrom);
PMLevel.Parent := PBFrom;
PMLevel.Left := 402;
PMLevel.Top := 70;
PMLevel.Width := 99;
PMLevel.Height := 20;
PMLevel.Caption := 'Mining level:';
PMLevel.Font.Color := clRed;
PMLevel.Font.Height := -17;
PMLevel.Font.Name := 'MS Sans Serif';
PMLevel.Font.Style := [fsBold];
PMLevel.ParentFont := False;
Sleep(1)
POresMining := TLabel.Create(PBFrom);
POresMining.Parent := PBFrom;
POresMining.Left := 225;
POresMining.Top := 100;
POresMining.Width := 98;
POresMining.Height := 20;
POresMining.Caption := 'Mining ores:';
POresMining.Font.Color := clRed;
POresMining.Font.Height := -17;
POresMining.Font.Name := 'MS Sans Serif';
POresMining.Font.Style := [fsBold];
POresMining.ParentFont := False;
Sleep(1)
PWorkedE := TLabel.Create(PBFrom);
PWorkedE.Parent := PBFrom;
PWorkedE.Left := 283;
PWorkedE.Top := 40;
PWorkedE.Width := 62;
PWorkedE.Height := 20;
PWorkedE.Caption := 'Worked';
PWorkedE.Font.Color := clGreen;
PWorkedE.Font.Height := -17;
PWorkedE.Font.Name := 'MS Sans Serif';
PWorkedE.Font.Style := [fsBold];
PWorkedE.ParentFont := False;
Sleep(1)
MinedE := TLabel.Create(PBFrom);
MinedE.Parent := PBFrom;
MinedE.Left := 284;
MinedE.Top := 70;
MinedE.Width := 49;
MinedE.Height := 20;
MinedE.Caption := 'Mined';
MinedE.Font.Color := clGreen;
MinedE.Font.Height := -17;
MinedE.Font.Name := 'MS Sans Serif';
MinedE.Font.Style := [fsBold];
MinedE.ParentColor := False;
MinedE.ParentFont := False;
Sleep(1)
OresToMineE := TLabel.Create(PBFrom);
OresToMineE.Parent := PBFrom;
OresToMineE.Left := 329;
OresToMineE.Top := 100;
OresToMineE.Width := 131;
OresToMineE.Height := 20;
OresToMineE.Caption := 'Ores mining 123';
OresToMineE.Font.Color := clGreen;
OresToMineE.Font.Height := -17;
OresToMineE.Font.Name := 'MS Sans Serif';
OresToMineE.Font.Style := [fsBold];
OresToMineE.ParentFont := False;
Sleep(1)
LocE := TLabel.Create(PBFrom);
LocE.Parent := PBFrom;
LocE.Left := 480;
LocE.Top := 40;
LocE.Width := 70;
LocE.Height := 20;
LocE.Caption := 'Location';
LocE.Font.Color := clGreen;
LocE.Font.Height := -17;
LocE.Font.Name := 'MS Sans Serif';
LocE.Font.Style := [fsBold];
LocE.ParentFont := False;
Sleep(1)
MiningLvlE := TLabel.Create(PBFrom);
MiningLvlE.Parent := PBFrom;
MiningLvlE.Left := 510;
MiningLvlE.Top := 70;
MiningLvlE.Width := 74;
MiningLvlE.Height := 20;
MiningLvlE.Caption := 'Mining lvl';
MiningLvlE.Font.Color := clGreen;
MiningLvlE.Font.Height := -17;
MiningLvlE.Font.Name := 'MS Sans Serif';
MiningLvlE.Font.Style := [fsBold];
MiningLvlE.ParentFont := False;
Sleep(1)
PSBox := TComboBox.Create(PBFrom);
PSBox.Parent := PBFrom;
PSBox.Left := 16;
PSBox.Top := 43;
PSBox.Width := 181;
PSBox.Height := 26;
PSBox.Hint := 'Stats for which player?';
PSBox.ShowHint:=True;
PSBox.Color := clBlue;
PSBox.Font.Color := clYellow;
PSBox.Font.Height := -15;
PSBox.Font.Name := 'Arial';
PSBox.Font.Style := [fsBold];
PSBox.ItemHeight := 18;
PSBox.ParentFont := False;
PSBox.TabOrder := 8;
PSBox.Text := Players[CurrentPlayer].Name;
PSBox.OnClick:=@FUF;
for i:= 0 to HowManyPlayers-1 do
PSBox.Items.Add(Players[i].Name);
Sleep(1)
FHide := TButton.Create(PBFrom);
FHide.Parent := PBFrom;
FHide.Left := 690;
FHide.Top := 0;
FHide.Width := 75;
FHide.Height := 25;
FHide.Hint := 'Hide this form?';
FHide.Caption := 'Hide';
FHide.Font.Color := clAqua;
FHide.Font.Height := -15;
FHide.Font.Name := 'Arial';
FHide.Font.Style := [fsBold, fsItalic];
FHide.ParentFont := False;
FHide.ParentShowHint := False;
FHide.ShowHint := True;
FHide.TabOrder := 9;
FHide.OnClick:=@FHideClicked;
Sleep(1)
FUpDate := TButton.Create(PBFrom);
FUpDate.Parent := PBFrom;
FUpDate.Left := 690;
FUpDate.Top := 26;
FUpDate.Width := 75;
FUpDate.Height := 25;
FUpDate.Hint := 'Update this form info?';
FUpDate.Caption := 'Update!';
FUpDate.Font.Color := clAqua;
FUpDate.Font.Height := -15;
FUpDate.Font.Name := 'Arial';
FUpDate.Font.Style := [fsBold, fsItalic];
FHide.ParentFont := False;
FUpDate.ParentShowHint := False;
FUpDate.ShowHint := True;
FUpDate.TabOrder := 9;
FUpDate.OnClick:=@FUF;
end;

procedure SafePBForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('PBForm', v);
end;

procedure ShowFormPB;
begin
PBFrom.Show;
end;

procedure SafeShowPB;
var
v: TVariantArray;
begin
if(not(UseFrom))then
Exit;
setarraylength(V, 0);
ThreadSafeCall('ShowFormPB', v);
end;
{\\Form//}

Procedure ThisIsScriptSetUp;
var
MinType:String;
begin
RRoadW:='Pentti';
if(KYAB)then
begin
if(conn_index<>0)then
freeConnection(conn_index)
if(connect)then
wait(1)
else
begin
GoingOn('KYAB NOT CONNECTED!!!!!')
ClearDebug;
repeat
Writeln('Not connected to KYAB!!!')wait(200)cleardebug;wait(100)Writeln('Not connected to KYAB!!!')wait(300)cleardebug;wait(100)
Writeln('Not connected to KYAB!!!')wait(400)cleardebug;wait(100)Writeln('Not connected to KYAB!!!')wait(1000)cleardebug;
until(false)
end;
end; Try
Status('Loading script...')
SaveSetting('MCMB','Shownews','True')
SaveSetting('MCMB','MSymbol','notfound');
SetUpSRL; ClearDebug; Writeln('Loading[| ]')
SetIpUp; ClearDebug; Writeln('Loading[|| ]')
IF(SendIp(MyIP))Then
GoingOn('Ip checking done!') ClearDebug; Writeln('Loading[||| ]')
CheckNewVersion ClearDebug; Writeln('Loading[|||| ]')
MCMBNews; ClearDebug; Writeln('Loading[||||| ]')
ContinueNews; ClearDebug; Writeln('Loading[|||||| ]')
FuckYouGuyCalledJenova; ClearDebug; Writeln('Loading[||||||| ]')
ReportErrors('OK: SCRIPT LOADING STARTED')
SetUpSRLMining; ClearDebug; Writeln('Loading[|||||||| ]')
wait(500)
LoadTiles; ClearDebug; Writeln('Loading[||||||||| ]')
VRoadBMP; ClearDebug; Writeln('Loading[|||||||||| ]')
PlayerStartTime:=GetSystemTime/1000
ClearDebug;
DaSi:=True;
if(YourSRLID<>'')then
SRLID:=YourSRLID;
if(YourSRLPass<>'')then
SRLPassword:=YourSRLPass;
if(ReduceLag)then
LowLag:=2;
SetArrayLength(Players,15)
DeclarePlayers; ClearDebug; Writeln('Loading[||||||||||| ]')
HowManyplayers:=15;
CurrentPlayer:=StartPlayer;
If(Players[CurrentPlayer].Loc='')then
Players[CurrentPlayer].Loc:='Starting...';
FileReport;
ScriptID:='91'
CountUser; ClearDebug; Writeln('Loading[|||||||||||| ]')
OresCorrect; ClearDebug; Writeln('Loading[||||||||||||| ]')
PlacesCorrect; ClearDebug; Writeln('Loading[|||||||||||||| ]')
SRLRandomsReport; ClearDebug; Writeln('Loading[||||||||||||||| ]')
SetOreColor; ClearDebug; Writeln('Loading[||||||||||||||||]') wait(250) ClearDebug;
ChangeReportWidth(350)
PlayersReport; Except ReportErrors('ERROR: Loading script') TerminateScript; end;
GoingOn('[Script starting...]')
wait(2000)
cleardebug;
if(Players[CurrentPlayer].Boolean1)then
MinType:='powermine'
else
Status('Script by '+CHR(80)+CHR(101)+CHR(110)+CHR(116)+CHR(116)+CHR(105))
Writeln('Ores to '+MinType+' at '+WhereMining+':')
Writeln(' *'+Players[StartPlayer].String1)
Writeln(' *'+Players[StartPlayer].String2)
Writeln(' *'+Players[StartPlayer].String3)
wait(1500)
writeln('')
Writeln(CHR(83)+CHR(99)+CHR(114)+CHR(105)+CHR(112)+CHR(116)+CHR(32)+CHR(98)+CHR(121)+CHR(32)+CHR(80) +CHR(101)+ CHR(110)+ CHR(116) +CHR(116) +CHR(105))disguiseScar(CHR(66)+CHR(121)+': '+CHR(80)+ CHR(101)+CHR(110)+ CHR(116)+ CHR(116)+ CHR(105))
Wait(2000)
Getself.WINDOWSTATE:=wsMinimized;
SafePBForm;
SafeShowPB;
wait(500)
if(not(KYAB))then
ActivateClient;
MouseSpeed:=MouseSpeedS;
BenMouse:=UseBenMouse;
LogInPlayer;
UpDateForm;
wait(1000+random(500))
MakeCompass('N')
HighestAngle;
LumbySet;
LumbyCheck:=LumbyDetect;
LoadneededGameTabs;
end;

{----------------------------------------------------------------------------}

procedure MainLoop;
begin
TurnOffLumbyDetect;
Brightness;
FuckYouYouFuckingAutoretailiate;
Players[CurrentPlayer].Integer4:=GetSkillLevel('Mining')
NickNameBmp:=CreateBitMapMaskFromText(Players[CurrentPlayer].Nick,upChars)
PlayerStartTime2:=GetSystemTime;
RockNotFound:=0
TotalRocksMissed:=0
GetPickColors;
MarkTime(TalkMark)
MarkTime(ItemMark)
FindNormalRandoms;
UpDateForm;

{MINING AND BANKING LOOP}
if(not(Players[CurrentPlayer].Boolean1))then
begin
SetOreColor;
Writeln('- - - - - - - - - - - - - - - - - - - - - - - - - - ')
writeln('')
GoingOn(' Starting Trip Number: '+inttostr(Loads+1))
Mouse(MIX1+4,MIY1-60,10,10,True)
wait(200)
SetChat('Hide',1)
wait(20)
makecompass('N')
HighestAngle;
wait(20)
MakeCompass('N')
SetRun(True)
GoingOn('Walking to mining place.')
ReportPlaces; Try
WalkToMine; Except ReportErrors('ERROR: Walking to mining place') end;
Players[CurrentPlayer].Loc:='at '+WhereMining+' mine, ';
PlayersReport;
SRLRandomsReport;
repeat try
MineFullLoad;
if(not(loggedin))then
begin
GoingOn(Players[CurrentPlayer].Name+' not logged in. Changing to next player.')
Players[CurrentPlayer].Loc:='Lost, ';
NextPlayer(False)
PlayersReport;
SRLRandomsReport;
Exit;
end;
if(PlayerTimeOut)then
Exit;
if(random(5+LowLag*3)=1)then
if(InLumby)Then
Exit;
if(random(3)=0)then
FindPick;
if(not(FindPick))then
begin
Players[CurrentPlayer].Loc:='No pick ,';
NextPlayer(False)
Exit;
end;
if(TotalRocksMissed>=15)or(RockNotFound>=45)then
begin
Players[CurrentPlayer].Loc:='No rocks, ';
PlayersReport;
NextPlayer(False)
Exit;
end; Except ReportErrors('ERROR: Mining loop') end;
until(InvFull)
Players[CurrentPlayer].Integer4:=GetSkillLevel('Mining')
ReportVars[0]:=OresMined;
Players[CurrentPlayer].Integer3:=Players[CurrentPlayer].Integer3+OresMined;
UpDateForm;
GoingOn('You just mined '+inttostr(OresMined)+' ores.')
SetRun(False)
GoingOn('Walking to bank')
SRLRandomsReport;
Mouse(MIX1+4,MIY1-60,7,7,True)
wait(200)
MakeCompass('N')
wait(20)
MakeCompass('N') Try
WalkToBank; Except ReportErrors('ERROR: Walking to bank') end;
BankOres;
if(BanksFailed>=5)then
begin
GoingOn(Players[CurrentPlayer].Name+' failed bank 5 times; next player')
Players[CurrentPlayer].Loc:='Bank failed, ';
BanksFailed:=0
NextPlayer(False)
exit;
end;
BanksFailed:=0
ReportVars[1]:=1
Players[CurrentPlayer].Banked:=Players[CurrentPlayer].Banked+1
Players[CurrentPlayer].Integer2:=Players[CurrentPlayer].Integer2+1
SRLRandomsReport;
GoingOn(Players[CurrentPlayer].Name+' has mined '+inttostr(Players[CurrentPlayer].Integer3)+' ores.')
GoingOn('And done '+inttostr(Players[CurrentPlayer].Banked)+' bank trips.')
if(Players[CurrentPlayer].Integer2>=Players[Currentplayer].Integer1)then
begin
PlayersReport;
Players[CurrentPlayer].Integer2:=0
LogOut;
wait(10000+random(20000))
NextPlayer(True)
end;
Loads:=Loads+1
PlayersReport;
GoingOn('Total bank runs done: '+inttostr(Loads))
GoingOn('Total ores mined: '+TotalOresMined)
end;

{----------------------------------------------------------------------------}

{POWERMINING LOOP}
if(Players[CurrentPlayer].Boolean1)then
begin
SetOreColor;
Writeln('- - - - - - - - - - - - - - - - - - - - - - - - - - ')
SetChat('Hide',1)
Players[CurrentPlayer].Loc:='Powermining, ';
PlayersReport;
SetRun(True)
SRLRandomsReport;
ReportPlaces;
repeat Try
MineFullLoad;
if(not(loggedin))then
begin
GoingOn(Players[CurrentPlayer].Name+' not logged in. Changing to next player.')
Players[CurrentPlayer].Loc:='Lost, ';
NextPlayer(False)
PlayersReport;
SRLRandomsReport;
Exit;
end;
if(PlayerTimeOut)then
Exit;
if(random(5+LowLag*3)=1)then
if(InLumby)Then
Exit;
if(random(3)=0)then
FindPick;
if(not(FindPick))then
begin
Players[CurrentPlayer].Loc:='No pick ,';
NextPlayer(False)
Exit;
end;
if(TotalRocksMissed>=15)or(RockNotFound>=45)then
begin
Players[CurrentPlayer].Loc:='No rocks, ';
PlayersReport;
NextPlayer(False)
Exit;
end; Except ReportErrors('ERROR: Mining loop') end;
until(InvFull)
Players[CurrentPlayer].Integer4:=GetSkillLevel('Mining')
ReportVars[0]:=OresMined;
Players[CurrentPlayer].Integer3:=Players[CurrentPlayer].Integer3+OresMined;
GoingOn('You just mined '+inttostr(OresMined)+' ores.')
Players[CurrentPlayer].Integer2:=Players[CurrentPlayer].Integer2+1
SRLRandomsReport;
GoingOn(Players[CurrentPlayer].Name+' has mined '+inttostr(Players[CurrentPlayer].Integer3)+' ores.')
DropTheOres;
if(Players[CurrentPlayer].Integer2>=Players[Currentplayer].Integer1)then
begin
PlayersReport;
Players[CurrentPlayer].Integer2:=0
LogOut;
Writeln('- - - - - - - - - - - - - - - - - - - - - - -')
writeln('')
wait(10000+random(20000))
NextPlayer(True)
end;
Loads:=Loads+1
PlayersReport;
GoingOn('Total loads done: '+inttostr(Loads))
GoingOn('Total ores mined: '+TotalOresMined)
end;
LumbyDetect:=LumbyCheck;
end;

begin
ClearDebug;
Writeln('Starting, please wait...')
Sleep(500)
ThisIsScriptSetUp;
Repeat
MainLoop;
Until(Loads>=HowManyLoads)
PlayersReport;
SRLRandomsReport;
LogOut;
TerminateScript;
end.
This miner was leeched like hell, Pentti's multiminer. Had IP logging, ofc it is nulled.

Markus

2013-02-23 15:26:59

Port Sarim whillow whacker :) This was also sold but I got it somewhere from here (that's why it's non obbed).

program SLPSWW;
{.include SRL/SRL.scar}
{=========================================================================]
[ Port Sarim Willow Whacker ]
[ ]
[ NAME : Port Sarim Willow Whacker ]
[ WRITER : Lorax + Sumilion ]
[ CATEGORY : Woodcutter ]
[ DESCRIPTION : Chops willows in PS and banks them ]
[ USAGE : Start at the willows / in the bank ]
[ AUTOCOLOR : Yes ]
[ ]
[ More Scripts can be found at ]
[ [url]www.Villu-Reborn.com[/url] ]
[=========================================================================]
[ 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 : ]
[ WT-Fakawi --> For SRL and the SRL Community + FindFastRandoms ^^ ]
[ StarBlaster100 --> For helping with all sorts of stuff ]
[=========================================================================}

//***********_Setup these_**********\\
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 = 2; // 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 = 'Write'; // Write / Disguise / Status / None.
DebugLevel = 2; // None: 0, Walking: 1, Tree finding: 2
RunDir = 'W'; // 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.98';
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[1].Name :='Username';
Players[1].Pass :='Password';
Players[1].Nick :='sern';
Players[1].Active:= True;
Players[1].String1 := '0000';

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

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

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

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

{.include SRL/SRL/misc/Trade.scar}
var
SLHeadColor, bmpAxeHeadMask, bmpAxeHandleMask, bmpRedDot, LastAxe,
bmpLogMask, bmpAxeLostText: Integer;
dtmAxes: array[0..6] of Integer;
HeadColor: array[0..2] of Integer;
EquipAxe, NoAxe, gBrokenAxe: Boolean;

procedure LoadSLBMPandDTMs;
begin
bmpAxeHeadMask := BitmapFromString(8, 5, 'z78DA33302007B881802B' +
'32895F257E13C8B39D3CF500213B3119');
bmpAxeHandleMask := BitmapFromString(11, 9, 'z78DA3330A02D704302E4' +
'E9C52F424F1328F7053D6D1F28BF0300112877A1');
bmpLogMask := BitmapFromString(13, 10, 'z78DA33301805E40037BC8' +
'0BAB6D0C2E5F451494998D02E5471010034299979');
bmpAxeLostText := CreateBitmapMaskFromText('ou do not have an axe', SmallChars);
bmpRedDot := BitmapFromString(2, 2, 'FE2020FC0606FC0606F10000');
dtmAxes[1] := DTMFromString('78DA633CC4C4C050CCC8800C1A13F91852803' +
'448F43F10309E05AA294055631B18C5C0055503028CE7816A3251' +
'D5384725A3AA3981A9C6333107450D00A4080D5C'); //rune
dtmAxes[2] := DTMFromString('78DA63746162602865644006AD297C0C29401' +
'A24FA1F0818FD816A0A50D5587B5B337041D580006320504D26AA' +
'1AC7204754355E986ADCA33D51D40000E10C0AEF'); //addy
dtmAxes[3] := DTMFromString('78DA633CC4C4C010C0C8800C5A53F81852803' +
'448F43F10309E05AAF14155636111CCC0055503028CE7816A5C51' +
'D5D839C4A2AA3981A9C6C52D0D450D0061FC0C64'); //mith
dtmAxes[4] := DTMFromString('78DA63CC636260D8C3C8800C5A53F81852803' +
'448F43F10305602D5EC4055939B9ACAC0055503028CD540351B51' +
'D594E5E5A2AA29C154D3545989A20600C3BC0E32'); //steel
dtmAxes[5] := DTMFromString('78DA638C646260D06664400669629C0C5C401' +
'A24FA1F081843806AD450D584F9FBC3D580006338116A7C806A74' +
'51D5D4C5F3A1AAF104AAB14055531689AA0600BF190AF2'); //iron
dtmAxes[6] := DTMFromString('78DA63CC636260D0666440068D897C0C29401' +
'A24FA1F08182B816A3450D5B898C8317041D580006335508D22AA' +
'1A5F6B65543525986A02ED5451D400009DDA09E3'); //bronze
end;

//------------------------------------------------------------------------\\
{ DebugMe - Outputs Debug info ||
\\------------------------------------------------------------------------//}

procedure DebugMe(aString: string);
begin
case LowerCase(DebugStyle) of
'write' : WriteLn(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;

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

function getArrayFromBox(arColor: TPointArray; Width, Height: Integer): TPointArray;
var
Count, Count3: Integer;
DoNotAccept : Boolean;
begin
SetArrayLength(Result, 1);
Result[0] := arColor[0];

for Count := 1 to GetArrayLength(arColor) - 1 do
begin
if(arColor[Count].x < arColor[Count - 1].x + Width)and
(arColor[Count].y < arColor[Count - 1].y + Height)and
(arColor[Count].x > arColor[Count - 1].x - Width)and
(arColor[Count].y > arColor[Count - 1].y - Height)then
else
begin
DoNotAccept := 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
DoNotAccept := True;
if DoNotAccept then
Break;
end;
if (DoNotAccept = False) then
begin
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[GetArrayLength(Result) - 1] := arColor[Count];
end;
end;
end;
end;

function FindBestAxe(var fx, fy: Integer; InBank: Boolean): Boolean;
var
I, x1, y1, x2, y2 : Integer;
begin
if LoggedIn then
begin
if InBank then
begin x1 := MSX1; y1 := MSY1; x2 := MSX2; y2 := MSY2; end else
begin x1 := MIX1; y1 := MIY1; x2 := MIX2; y2 := MIY2; end;

for I := 1 to 6 do
begin
if(FindDTM(dtmAxes[I], fx, fy, x1, y1, x2, y2))then
begin
Result := True;
Break;
end;
end;
if not(Result)then
PlayerLost('We don''t have an axe - FindBestAxe');
end;
end;

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

function SLFindAxeHeadColor: Boolean;
var
InvAxe, WieldAxe, Ix, Iy: integer;
begin
if LoggedIn then
begin
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], Ix, Iy, 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;
case Min(WieldAxe, InvAxe) of
1: WriteLn('Using Rune axe');
2: WriteLn('Using Addy axe');
3: WriteLn('Using Mith axe');
4: WriteLn('Using Steel axe');
5: WriteLn('Using Iron axe');
6: WriteLn('Using Bronze axe');
end;
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);
SLHeadColor := HeadColor[0];
end else
begin
GameTab(4);
if(Ix > 592) and (Iy > 238)then
Drag(Ix, Iy, 5, 5, 579, 227, 5, 5, true);
HeadColor[0] := GetColor(590, 220);
HeadColor[1] := GetColor(587, 219);
HeadColor[2] := GetColor(588, 218);
SLHeadColor := HeadColor[0];
end;
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 (not FindDTM(AxeHeadDTM, ax, ay, MIX1, MIY1, MIX2, MIY2)) then
begin
DebugMe('Didn''t find Axe head - in Inv');
FreeDTM(AxeHandleDTM);
FreeDTM(AxeHeadDTM);
Exit;
end;
if (not FindDTM(AxeHandleDTM, ax, ay, MIX1, MIY1, MIX2, MIY2)) then
begin
DebugMe('Didn''t find Axe handle - in Inv');
FreeDTM(AxeHandleDTM);
FreeDTM(AxeHeadDTM);
Exit;
end;

if (FindDTM(AxeHeadDTM, ax, ay, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(ax, ay, 3, 3, True);
Wait(600 + Random(400));
end;
if (FindDTM(AxeHandleDTM, ax, ay, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(ax, ay, 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;

FreeDTM(AxeHandleDTM);
FreeDTM(AxeHeadDTM);
end;

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

function SLFindAxe: Boolean;
var
bmpBrokenAxe: Integer;
begin
if ( TimeFromMark(LastAxe) < 90000 ) then // If there has been an axe check within 1.5min then break
begin
Result := True;
Exit;
end;

Result := (not FindBitmapMaskTolerance(bmpAxeLostText, x, y, MCX1, MCY1, MCX2, MCY2, 15, 90));
if(Result)then
Exit;
if not(Result)then
begin
LastAxe := GetSystemTime;
bmpBrokenAxe := BitmapFromString(6, 12, 'z78DA3330200CDC700003' +
'A2F552A206972CF12EA1AE6B315562EAA2DCCDB80000FF8D5941');
if(EquipAxe)then
begin
GameTab(5);
if(FindBitmapMaskTolerance(bmpBrokenAxe, x, y, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Writeln('Oh dear, a broken axe.');
NoAxe := True;
end;
if(FindBitmapMaskTolerance(bmpAxeHandleMask, x, y, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Writeln('Oh dear, we lost our head.');
NoAxe := False;
end;
end else
begin
GameTab(4);
if(FindBitmapMaskTolerance(bmpBrokenAxe, x, y, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Writeln('Oh dear, a broken axe.');
NoAxe := True;
end;
if(FindBitmapMaskTolerance(bmpAxeHandleMask, x, y, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Writeln('Oh dear, we lost our head.');
NoAxe := False;
end;
end;
if(NoAxe)then
begin
case Random(10) of //part from Mining.scar
0: TypeSend('arg');
1: TypeSend('aarg');
2: TypeSend('arghh');
3: TypeSend('grrr');
4: TypeSend('sjee.');
5: TypeSend('never watch tv while chopping...');
6: TypeSend('ouch, girls are distracting!');
7: TypeSend('oh noes!');
8: TypeSend('I bet bob can fix this...');
9: TypeSend('hmm, but im not a macro...');
end;
end;
end;

FreeBitmap(bmpBrokenAxe);
end;

function SLGetHead(WalkToRedDots: Boolean): Boolean;
var
Counter, Tries, ax, ay: Integer;
BreakOut: Boolean;
arAxeHeadColor, arAxeHeadColorResults: TPointArray;
begin
Writeln('Lost axe head,');
Writeln('Don''t worry, we''ll find it!');
if(InvFull)then
begin
if(FindBitmapMaskTolerance(bmpLogMask, ax, ay, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Mouse(ax, ay, 5, 5, false);
ChooseOption(ax, ay, 'rop');
end;
end;
repeat
FindColorsSpiralTolerance(MSCX, MSCY, arAxeHeadColor, SLHeadColor, MSX1, MSY1, MSX2, MSY2, 5);
arAxeHeadColorResults := getArrayFromBox(arAxeHeadColor, 10, 10);
for Counter := 0 to GetArrayLength(arAxeHeadColorResults) - 1 do
begin
MMouse(arAxeHeadColorResults[Counter].x, arAxeHeadColorResults[Counter].y, 0, 0);
if(IsUpTextMulti('ake ax', 'axe h', 'e head'))then
begin
BreakOut := True;
Break;
end;
Wait(100);
end;
if(BreakOut)then
Break;
if(Random(20) < 10)then
begin
KeyDown(VK_UP);
Wait(Random(700));
KeyUp(VK_UP);
end
else
begin
KeyDown(VK_DOWN);
Wait(Random(700));
KeyUp(VK_DOWN);
end;
if(Random(20) < 10)then
begin
KeyDown(VK_LEFT);
Wait(Random(700));
KeyUp(VK_LEFT);
end
else
begin
KeyDown(VK_RIGHT);
Wait(Random(700));
KeyUp(VK_RIGHT);
end;
Tries := Tries + 1;
Writeln('Taken ' + IntToStr(Tries) + ' tries.');
FindColorsSpiralTolerance(MSCX, MSCY, arAxeHeadColor, SLHeadColor, MSX1, MSY1, MSX2, MSY2, 5);
arAxeHeadColorResults := getArrayFromBox(arAxeHeadColor, 10, 10);
for Counter := 0 to GetArrayLength(arAxeHeadColorResults) - 1 do
begin
MMouse(arAxeHeadColorResults[Counter].x, arAxeHeadColorResults[Counter].y, 0, 0);
if(IsUpTextMulti('ake a', 'axe h', 'e head'))then
begin
BreakOut := True;
Break;
end;
Wait(100);
end;
if(BreakOut)then
Break;
Tries := Tries + 1;
Writeln('Taken ' + IntToStr(Tries) + ' tries.');
ax := MMCX;
ay := MMCY;
if(WalkToRedDots)then
if(Random(10) > 4)then
begin
if(FindBitmapSpiralTolerance(bmpRedDot, ax, ay, MMX1, MMY1, MMX2, MMY2, 10))then
begin
Writeln('Walking to red spot.');
Mouse(ax - 10, ay, 2, 2, true);
Flag;
Wait(1500);
end;
end else
if(FindBitmapSpiralTolerance(bmpRedDot, ax, ay, MMX1, MMY1, MMX2, MMY2, 10))then
begin
Writeln('Walking to red spot.');
Mouse(ax, ay, 2, 2, true);
HighestAngle;
Flag;
MMouse(519, 411, 5, 5);
Wait(100+Random(200));
BreakOut := IsUpTextMulti('ake a', 'axe h', 'e head');
end;
until(BreakOut)or(Tries > 9)or
(FindBitmapMaskTolerance(bmpAxeHeadMask, ax, ay, MIX1, MIY1, MIX2, MIY2, 5, 5));
if BreakOut then
begin
GetMousePos(ax, ay);
Mouse(ax, ay, 0, 0, true);
Flag;
Wait(2000);
GameTab(4);
Wait(300);
end;
if not(FindBitmapMaskTolerance(bmpAxeHeadMask, ax, ay, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Writeln('Failed to get the axe head.');
NoAxe := True;
Result := not NoAxe;
Exit;
end;
if(InvFull)and(EquipAxe)then
begin
GameTab(4);
if(FindBitmapMaskTolerance(bmpLogMask, ax, ay, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Mouse(ax, ay, 5, 5, false);
ChooseOption(x, y, 'rop');
end;
end;
GameTab(4);
if (not AttachHead2) then
begin
Writeln('Failed to find the Axe.');
NoAxe := True;
Result := False;
end;
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;
LogsChopped, Loads, gPlayerTime, gRanTime, gWillowFailSafes, WalkTries, BankTol: Integer;
PlayerStatus, EntFound: Boolean;
PinNumber: string;

//------------------------------------------------------------------------\\
{ 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].Loc);
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].Loc)
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;

//------------------------------------------------------------------------\\
{ 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 CheckNicks; forward;
procedure ButtonClick(Sender: TObject);
begin
case Sender of
bStartScript :
begin
SLPSWWForm.Caption:= SLPSWWForm.Caption + '.';
SLPSWWForm.ModalResult:= mrOk;
end;
bSetupUsers :
begin
StartPlayers(true, 'string1');
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('Players Saved.');
CheckNicks;
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.');
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;

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

function SLOpenBank: Boolean;
var
BankTime, I, Count: Integer;
arBankColor: TPointArray;
begin
if LoggedIn then
begin

MarkTime(BankTime);
while(not BankScreen)and(TimeFromMark(BankTime) < 20000)do
begin
Wait(20);
FindColorsSpiralTolerance(MSCX, MSCY, arBankColor, 4999248, MSX1, MSY1, MSX2, MSY2, BankTol);
if(GetArrayLength(arBankColor) = 0)then
Break;
arBankColor := getArrayFromBox(arBankColor, 20, 20);

for I := 1 to GetArrayLength(arBankColor)-1 do
begin
if not(LoggedIn)then Exit;
FFlag(0);
Wait(100 + Random(100));
MMouse(arBankColor[I].x, arBankColor[I].y, 5, 5);
if(IsUpTextMulti('se Ban', 'ank b', 'booth'))then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(100 + Random(100));
ChooseOption(x, y, 'uickly');
Flag;
for Count := 0 to 4 do
begin
Wait(350);
Result := BankScreen;
if Result then
Exit;
end;
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(1000);
Result := BankScreen;
end;
end;

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

procedure SLBank(WithdrawAxe: Boolean);
var
ax, ay: Integer;
begin
if LoggedIn then
begin
BankTol := BankCount * 5;
if(BankCount >= 3)then
begin
PlayerLost('We failed the bank');
BankCount := 0;
Exit;
end;
if(WithdrawAxe)then
begin
if(InvCount = 28)then
begin
if(FindBitmapMaskTolerance(bmpLogMask, x, y, MIX1, MIY1, MIX2, MIY2, 5, 5))then
begin
Mouse(x, y, 5, 5, false);
ChooseOption(x, y, 'rop');
end;
end;
if(EquipAxe)then
begin
GameTab(5);
Mouse(591, 304, 10, 10, true);
GameTab(4);
end;
end;
if(not SLOpenBank)then
begin
Writeln('Failed to open the bank.');
ax := MMCX; ay := MMCY;
BankCount := BankCount + 1;
SLBank(WithdrawAxe);
end else
BankCount := 0;
FixBank;
if(InvCount = 28)then
Loads := Loads + 1;
LogsChopped := LogsChopped + CountItemBmpMaskTol(bmpLogMask, 5, 5);
ReportVars[0] := ReportVars[0] + CountItemBmpMaskTol(bmpLogMask, 5, 5);
if(EquipAxe)or(WithDrawAxe)then
DepositAll
else
Deposit(2, 28, 2);
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)and(EquipAxe)then
begin
ClickItemColorTol(876930, 10, true);
Wait(400 + Random(400));
NoAxe := not SLFindAxeHeadColor;
if(NoAxe)then
PlayerLost('You don''t have an axe');
end;
gBrokenAxe := false;
end;
ProgressReport;
BankCount := 0;
end;

function FindFastRandoms: Boolean; //WT-Fawki
var
i: Integer;
begin
for i:=1 to 9 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_******\\
//------------------------------------------------------------------------\\
{ 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;
var
Count: Integer;
begin
for Count := 0 to 2 do
begin
SymbolAccuracy := 0.8 - (Count * 0.2);
if(Lowercase(Symbol) = 'bank')then
SymbolAccuracy := 0.3;
Result := GetSymbolColor(ax, ay, Symbol);
if( Result <> 0 ) then
Break;
end;
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
DebugMe('Relocated - used farm spot');
MouseFindNoFlag(ax + 10, ay + 15, 5, 5);
FFlag(0);
Exit;
end else
DebugMe('Didn''t find farm spot');

if(QuestColor = 0)then
QuestColor := SLGetSymbol(ax, ay, 'quest');
if(QuestColor <> 0)then
if FindColor(ax, ay, QuestColor, MMX1, MMCY, MMX2, MMY2) then
begin
DebugMe('Relocated - used QuestColor');
MouseFindNoFlag(ax + 20, ay - 20, 4, 4);
FFlag(0);
RelocateAtWillows;
Exit;
end else
DebugMe('Didn''t find QuestSymbol');

if(BarColor = 0)then
BarColor := SLGetSymbol(ax, ay, 'bar');
if(BarColor <> 0)then
if FindColor(ax, ay, BarColor, MMX1, MMY1, MMX2, MMY2) then
begin
DebugMe('Relocated - used BarColor');
MouseFindNoFlag(ax + 30, ay + 10, 4, 4);
FFlag(0);
RelocateAtWillows;
Exit;
end else
DebugMe('Didn''t find BarColor');

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

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

procedure BankToWillows;
var
ax, ay, Count: Integer;
ToClose: Boolean;
begin
if LoggedIn then
begin
MouseSpeed := 5 + Random(5);
MakeCompass('N');
WriteLn('Bank to willows');
FindRoadColor;
GotColor('Road');
if(BankColor = 0)then
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);
DebugMe('Walked left of bank using RoadWalk');

if(QuestColor = 0)then
begin
DebugMe('QuestColor was 0, now finding QuestColor using symbol');
if(QuestColor = 0)then
QuestColor := SLGetSymbol(ax, ay, 'quest');
if(QuestColor = 0)then
DebugMe('Didn''t find QuestColor at first try');
end;

if(QuestColor = 0)or(not FindColor(ax, ay, QuestColor, MMX1, MMY1, MMX2, MMY2))then
begin
Wait(500 + Random(100));
FFlag(0);
DebugMe('Making FFlag(0) because of previously not found QuestColor, QuestColor: '+IntToStr(QuestColor));
if ( QuestColor = 0 )then
QuestColor := SLGetSymbol(ax, ay, 'quest')

if(QuestColor = 0)or(not FindColor(ax, ay, QuestColor, MMX1, MMY1, MMX2, MMY2))then
begin
DebugMe('Didn''t find QuestColor using FFlag(0) - using RoadWalk now, QuestColor: '+IntToStr(QuestColor));
FindRoadColor;
SLWaterWalk(300, 220, 50, 0, 0, 0, 0, 0);
if(QuestColor = 0)then
QuestColor := SLGetSymbol(ax, ay, 'quest');

if(QuestColor = 0)or(not FindColor(ax, ay, QuestColor, MMX1, MMY1, MMX2, MMY2))then
begin
DebugMe('Didn''t find QuestColor using RoadWalk then GetSymbolColor - setting False');
LogOut;
Players[CurrentPlayer].Active := False;
end;
end;
end;

if FindColorSpiral(ax, ay, QuestColor, MMX1, MMY1, MMX2, MMY2) then
begin
DebugMe('Found QuestColor - Clicking x coordinate - 22');
MouseFindNoFlag(ax - 22, ay, 3, 3);
end;

FFlag(10);

for Count := 3 downto 0 do
begin
if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
begin
DebugMe('Found farming spot');
if(ay - 25 > 25)then
begin
DebugMe('ay - 25 > 25 = true - we can safely click now');
Break;
end else
begin
DebugMe('farming spot coordinates is to close to upper edge of MM');
ToClose := True;
end;
end else
DebugMe('Farming spot not visible yet');

if(QuestColor <> 0)then
if FindColorSpiral(ax, ay, QuestColor, MMX1, MMY1, MMX2, MMY2) then
begin
if (not ToClose) then
MouseFindNoFlag(ax - 22 - 24 + (Count * 6), ay, 3, 3)
else
MouseFindNoFlag(ax - 22 - 24 + (Count * 6), ay - 15, 3, 3);
ToClose := False;
DebugMe('Found QuestColor clicking closer to the fence ('+IntToStr(4-Count)+') - using FFlag(0)');
end;

FFlag(0);
end;

if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
begin
DebugMe('Found farm spot clicking x + 20 + Random(5), y - 25 - Random(3)');
MouseFindNoFlag(ax + 20 + Random(5), ay - 25 - Random(3), 0, 7);
if(not FlagPresent)then
begin
DebugMe('There were no flag (Waiting 3000 + Random(1000))');
Wait(3000 + Random(1000));
end;
end else
begin
DebugMe('Found no farm symbol - using QuestSymbol (x - 50), (y - 30), 3, 3');
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
begin
DebugMe('Found farm spot - clicking (ax + 10), (ay + 15)');
MouseFindNoFlag(ax + 10, ay + 15, 5, 5);
end else
begin
DebugMe('Didn''t find farm spot number 2 - trying again');
FFlag(0);
if(SLGetSymbol(ax, ay, 'farming spot') <> 0)then
begin
DebugMe('Found farm spot - clicking (ax + 10), (ay + 15)');
MouseFindNoFlag(ax + 10, ay + 15, 5, 5);
FFlag(0);
end else
begin
DebugMe('Didn''t find farm spot number 2 second try');
for Count := 0 to 2 do
begin
DebugMe('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
begin
DebugMe('Found farm spot - clicking (ax + 10), (ay + 15)');
MouseFindNoFlag(ax + 10, ay + 15, 5, 5)
end 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
DebugMe('Didn''t find QuestColor');
if FindColor(ax, ay, FarmingColor, MMX1, MMY1, MMX2, MMY2) then
begin
MouseFindNoFlag(ax + 10 + Count, ay, 3, 3);
DebugMe('Found farm color - optimating location (ax + 10 + '+IntToStr(Count)+')');
FFlag(0);
end;
Count := Count + 6;
end;

if Count = 30 then
begin
WalkTries := WalkTries + 1;
if(WalkTries = 4)then
begin
WriteLn('Player lost during walkback - WalkTries = 4 - setting false');
Players[CurrentPlayer].Active := False;
end;
RelocateAtWillows;
WillowsToBank;
Exit;
end else
WalkTries := 0;

if(FindColor(ax, ay, FarmingColor, MMX1, MMY1, MMX2, MMY2))and
(FindColor(bx, by, QuestColor, 678, MMY1, MMX2, MMY2))then
begin
DebugMe('Found Farm + Quest color');
if IsFenceInLine(cx, cy, ax, ay, bx, by, 40, 60)then
begin
DebugMe('Used fence to walk clicking (cx + 14), ((by + ay) div 2 - 25)');
MouseFindNoFlag(cx + 14, ((by + ay) div 2) - 25, -5, -2);
Wait(6000);
end else
begin
DebugMe('used 30% Farm (x) and 70% Quest x, (by + ay) div 2 - 25');
MouseFindNoFlag( Trunc(ax * 0.25 + bx * 0.75), (by + ay) div 2 - 25, -5, -2);
end;
end;

FFlag(0);
if(not FindColor(bx, by, QuestColor, MMCX, MMY1, MMX2, MMY2))then
begin
DebugMe('We didn''t get all the way - Waiting(15000), then FFlag(0)');
Wait(15000);
FFlag(0);
end;

if FindColor(bx, by, QuestColor, MMX1, MMY1, MMX2, MMY2) then
begin
DebugMe('Found QuestColor - clicking Quest symbol');
MouseFindNoFlag(bx, by, 3, 3)
end else
begin
WriteLn('Didn''t find QuestColor - setting player: false');
Players[CurrentPlayer].Active := False;
LogOut;
end;

if(RoadColor = 0)then
begin
DebugMe('RoadColor = 0, using FFlag(0)');
FFlag(0);
end else
begin
DebugMe('RoadColor <> 0, using FFlag(10)');
FFlag(10);
end;

if (not FindColor(bx, by, QuestColor, MMX1, MMY1, MMX2, MMY2)) then
begin
Wait(15000)
FFlag(0)
end

FindRoadColor;
GotColor('Road');
for Count := 0 to 2 do
begin
SLWaterWalk(150, 80, 60, 10, 0, 0, 4, 4);
DebugMe('Walking the road - '+IntToStr(Count + 1)+'th time');
FindRoadColor;
if(BankColor = 0)then
begin
DebugMe('BankColor = 0, trying to find BankSymbol');
BankColor := SLGetSymbol(ax, ay, 'bank');
if(BankColor <> 0)then
begin
DebugMe('Found BankSymbol');
Break;
end;
end else
begin
DebugMe('BankColor <> 0, trying to find BankColor');
if FindColor(ax, ay, BankColor, MMX1, MMY1, MMX2, MMY2) then
begin
DebugMe('Found BankSymbol');
Break;
end;
end;
end;

if(BankColor <> 0)then
begin

if(FindColor(ax, ay, BankColor, MMX1, MMY1, MMX2, MMY2))then
begin
DebugMe('Found BankColor on MM, walking to bank');
MouseFindNoFlag(ax, ay, 5, 5);
FFlag(0);
end else
begin
WriteLn('Didn''t find BankColor on MM, setting active: false');
Players[CurrentPlayer].Active := False;
LogOut;
end;
end else
if(LadderColor <> 0)then
begin
DebugMe('BankColor = 0 and LadderColor <> 0 trying to find bank with LadderColor');
if(FindColor(ax, ay, LadderColor, MMX1, MMY1, MMX2, MMY2))then
begin
DebugMe('Found LadderColor - clicking LadderColor (ax + 20), (ay + 40), 5, 5');
MouseFindNoFlag(ax + 20, ay + 40, 5, 5);
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_******\\

function HandleAxe: Boolean;
begin
if(not SLFindAxe)then
begin
Result := True;
if(NoAxe = False)then //Missing
begin
if SLGetHead(True) then
Exit;
end;
if NoAxe then
begin
WillowsToBank;
SLBank(True);
BankToWillows;
end;
end;
end;

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

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

procedure EntAction;
var
TempMouseSpeed: Integer;
begin
Writeln('Ent found!!! Waiting...');
TempMouseSpeed := MouseSpeed;
MouseSpeed := 2 + Random(2);
MouseFindNoFlag(MMCX + Random(4), MMCY + Random(4), -2, 2);
MouseSpeed := TempMouseSpeed;
// PlaySound('C:\WINDOWS\Media\winAquariumCritStop.wav');
Wait(2000 + Random(2000));
end;

function GetUpTextFast(Length: Integer): string; //If obstructed it can easily fail
begin
Result := GetTextAtEx(7, 7, 50, upchars, False, False, 0, 2, -1, Length, True, tr_NormalChars);
end;

function ValidateTree: boolean;
var
MyUpText: string;
begin
MyUpText := GetUpTextFast(16);

if ((pos('hop', MyUpText) <> 0) or (pos('own', MyUpText) <> 0) or (pos('op do', MyUpText) <> 0))and
((pos('illo', MyUpText) <> 0) or (pos('Will', MyUpText) <> 0) or (pos('llow', MyUpText) <> 0)) then
Result := True;
end;

function EntDetected(var ax, ay: Integer; MoveMouse: Boolean): Boolean;
var
mx, my, Count, TextColor: integer;
H, S, L: Extended;
begin
GetMousePos(mx, my);
if(ax < 5)then ax := 5; if(ay < 5)then ay := 5;
if(mx < ax + 5)and(mx > ax - 5)and(my < ay + 5)and(my > ay - 5)then
else
MMouse(ax, ay, 2, 2);
for Count := 0 to 1 do
begin
Result := ValidateTree;
if(Result)then
Break;
Wait(20);
end;
if(Result)then
begin
Result := False;
if(IsTextInAreaEx(7, 7, 180, 25, mx, my, 'Willow', 100, UpChars, True, True, 0, 2, -1)) then
begin

my := my + 4;
mx := mx + 4;
TextColor := GetColor(mx, my);

ColorToHSL(TextColor, H, S, L);
if (H < 40) then
Result := True;
end;
if Result then
begin
if MoveMouse then
EntAction
else
DebugMe('Ent found - will find a new tree');
end;
end;
end;
//------------------------------------------------------------------------\\
{ SLFindMiddleOfTree - Finds ... the middle of the tree ||
\\------------------------------------------------------------------------//}

function FindMiddle(var ax, ay: Integer): Boolean;
var
Count, bCount, xCount, yCount,
zCount, cCount, tCount: Integer;
x1, y1, x2, y2, tx, ty, gx, gy, tBitmap: Integer;
Lum: array[0..8]of Extended;
Hue, Sat: Extended;
begin
if(ax < 31)then
ax := 31;
if(ay < 31)then
ay := 31;
gx := ax;
gy := ay;

tBitmap := BitmapFromString(62, 62, '');
CopyClientToBitmap(tBitmap, ax - 31, ay - 31, ax + 31, ay + 31);
for bCount := 0 to 3 do
begin
Count := 1;
if(bCount = 2)then
ax := (x2 + x1) div 2;
repeat
zCount := 0;
case bCount of
0: begin tx := 29 - (Count * 3); ty := 29; end;
1: begin tx := 29 + (Count * 3); ty := 29; end;
2: begin tx := 29; ty := 29 - (Count * 3); end;
3: begin tx := 29; ty := 29 + (Count * 3); end;
end;

for xCount := 0 to 2 do
begin
for yCount := 0 to 2 do
begin
cCount := yCount + xCount * 3;
ColorToHSL(FastGetPixel(tBitmap, xCount + tx, yCount + ty), Hue, Sat, Lum[cCount]);
if(cCount > 0)then
begin
if(Hue > 14)and(Hue < 34)then
begin
if(cCount = 3)or(cCount = 6)then
tCount := cCount - 2
else
tCount := cCount;
if(Lum[cCount] > Lum[tCount - 1] + 1.5)or
(Lum[cCount] < Lum[tCount - 1] - 1.5)then
zCount := zCount + 1;
end;
end else
zCount := zCount + 1;
end;
end;

Count := Count + 1;
until(Count * 3 = 30)or(zCount < 5);

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;

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

for xCount := 0 to 2 do
begin
for yCount := 0 to 2 do
begin
ColorToHSL(FastGetPixel(tBitmap, ax - gx + 31 - 1 + xCount, ay - gy + 31 - 1 + yCount), Hue, Sat, Lum[0]);
if(not ((Hue > 14) and (Hue < 25) and (Sat > 40) and (Sat < 65) and (Lum[0] > 20) and (Lum[0] < 45))) then
begin
ax := ax -1 + xCount;
ay := ay -1 + yCount;
Exit;
end;
end;
end;

FreeBitmap(tBitmap);
end;

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

function FindTree(var gx, gy: Integer): Boolean;
var
tColor, ABigEnoughTreeCount, NotValidNameCount: Integer;
x1, y1, x2, y2, a, c, i, tx, ty, Count: Integer;
begin
EntFound := False;

x1 := 245;
y1 := 175;
x2 := 277;
y2 := 195;
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(tx, ty, MSTreeColor, x1, y1, x2, y2, 5) then
begin
if FindMiddle(tx, ty) then
begin
ABigEnoughTreeCount := ABigEnoughTreeCount + 1;

MMouse(tx, ty, 3, 3);
tColor := GetColor(tx, ty);
for Count := 0 to 4 do
begin
Result := ValidateTree;
if(Result)then
Break;
Wait(20);
end;

if(not Result)then
NotValidNameCount := NotValidNameCount + 1;
if EntDetected(tx, ty, False) then
begin
Result := False;
EntFound := True;
end;
if(Result)then
begin
DebugMe('Found: BigTrees: '+IntToStr(ABigEnoughTreeCount)+', NonValidNames: '+IntToStr(NotValidNameCount));
gx := tx;
gy := ty;
Exit;
end;
end;
end;
end;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result);

DebugMe('Not found: BigTrees: '+IntToStr(ABigEnoughTreeCount)+', NonValidNames: '+IntToStr(NotValidNameCount));
end;

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

function UpdateColor(var ax, ay: Integer; tColor: Integer): boolean;
var
Checker: Integer;
begin
Checker := GetSystemTime;
if(ax < 20)then ax := 20; if(ay < 20)then ay := 20;
while(FindColorSpiralTolerance(ax, ay, tColor, ax - 20, ay - 20, ax + 20, ay + 20, 10))and
(TimeFromMark(Checker) < 10000)and
(FlagPresent)do
begin
if(ax < 20)then ax := 20; if(ay < 20)then ay := 20;
Wait(16);
end;

for Checker := 0 to 45 do
begin
if(not FindColorSpiralTolerance(ax, ay, tColor, ax - 10, ay - 10, ax + 10, ay + 10, 10))then
Break;
Wait(16);
if(ax < 10)then ax := 10; if(ay < 10)then ay := 10;
end;

if(ax < 10)then ax := 10; if(ay < 10)then ay := 10;
Result := FindColorSpiralTolerance(ax, ay, tColor, ax - 10, ay - 10, ax + 10, ay + 10, 10);
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(ax < 10)then
ax := 10;
if(ay < 10)then
ay := 10;
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 FindMiddle(ax, ay))then
begin
DebugMe('Lost actual tree');
Exit;
end;
CutMarkTemp := GetSystemTime;
end;
if(TimeFromMark(CutMarkTotal) < 5 * 1000)then
begin
if HandleAxe then
begin
DebugMe('Axe fucked');
Exit;
end;
end;
Wait(10);
if EntDetected(ax, ay, True) 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 FindTree(ax, ay) then
begin
gWillowFailSafes := GetSystemTime;

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 FindMiddle(ax, ay) then
begin
tColor := GetColor(ax, ay);
WaitWhileWorking(ax, ay, tempSpot, tColor);
gWillowFailSafes := GetSystemTime;
end;
end;
end else
if EntFound then
EntAction;
end;
end;

//******_Setup stuff_******\\
//------------------------------------------------------------------------\\
{ CapitalizeLikeRs - Capitalises like RS does. ||
\\-----------------s-------------------------------------------------------//}

function CapitalizeLikeRs(RawString: string): string;
begin
Result := Capitalize(LowerCase(RawString));
end;

//------------------------------------------------------------------------\\
{ CheckNicks - Checks the set nick names. ||
\\------------------------------------------------------------------------//}

procedure CheckNicks;
var
CorrectString: string;
i: integer;
begin
for i := 0 to HowManyPlayers - 1 do
begin
if(Players[i].Nick <> LowerCase(Players[i].Nick))then
begin
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('ERROR : Please Uncapitalise your NickNames.');
mMemoBox.Lines.Add('Error occured with player : ' + Players[i].Name);
Exit;
end;
if(pos(' ', Players[i].Nick) > 0)then
begin
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('ERROR : Dont use spaces in your Nick.');
mMemoBox.Lines.Add('Error occured with player : ' + Players[i].Name);
Exit;
end;
CorrectString := CapitalizeLikeRs(Players[i].Name);
if not(Pos(LowerCase(Players[i].Nick), CorrectString) > 0)then
begin
mMemoBox.Lines.Add('--');
mMemoBox.Lines.Add('ERROR : Nick does NOT match the name.');
mMemoBox.Lines.Add('Nick : ' + Players[i].Nick + ', does NOT match ' + Players[i].Name);
mMemoBox.Lines.Add('Nick should be 3-4 letters of ' + Players[i].Name);
mMemoBox.Lines.Add('No capitalised letters though, be carefull!');
Break;
end;
end;
end;

//------------------------------------------------------------------------\\
{ 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';
LoadSLBMPandDTMs;
ClearDebug;
ClearReport;
ShowNormalForm;
Wait(1000 + Random(500));
if(UsePlayerForm)then
begin
StartPlayers(false, 'string1');
end else
DeclarePlayers;
for x := 0 to HowManyPlayers - 1 do
Players[x].String2 := 'bank';
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;
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;
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);
SetRun(True)
BankToWillows;
gWillowFailSafes := GetSystemTime;
end;

if(Players[CurrentPlayer].String2 = 'willows')and
(LoggedIn)then
begin
SetRun(False)
repeat
MakeCompass('E');
Wait(1);
ChopTree;
Wait(1);
FindFastRandoms;
Wait(1);
if(FindFight)then
RunTo(RunDir, True);
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;
Break;
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.