SRL Archive - Jr. Member RS3 Script Requests

RuneSpan


TimeRiders

2014-12-14 21:26:29

A JR Community Project making a functional RuneSpan script everyone could chip in on each level of RuneSpan ;)


With permission we could combine the code from Rlagk's LazySiphon! & ClarityEsswraith (Not exatly take the codes that's plagiarism)

just change the set up , update colors etc.

Lemme know what you think :)

The Mayor

2014-12-14 22:03:50

Or you could just tweak @Ashaman88;'s runespan script. IIRC it was finished but just needed a few mods.

TimeRiders

2014-12-14 22:13:53

From: The Mayor
Or you could just tweak @Ashaman88;'s runespan script. IIRC it was finished but just needed a few mods.


Had no idea Ashaman88 had a RuneSpan script :O

GRIM

2014-12-14 23:54:32

Not to mention rlagks is functional enough.. o.O
i used it the other night and woke up to 900k+ rc

but as the mayor said you can always mod other scripts.
It's fairly simple and there's A LOT of people here willing to help.

The Mayor

2014-12-15 03:41:33

From: TimeRiders
Had no idea Ashaman88 had a RuneSpan script :O


Yea he posted it on some random thread somewhere on the forums but I can't remember where. I guess he can post it here when he gets the mention.

J_R

2014-12-15 15:56:08

Is it this one:
https://villavu.com/forum/showthread.php?t=109033&highlight=ashaman+runespan

But Rglak's one works for all my runespan needs anyway, the only issue is it sometimes takes a few seconds to switch nodes/wraiths but I think that's fine.

The Mayor

2014-12-15 21:54:45

From: J_R
Is it this one:
https://villavu.com/forum/showthread.php?t=109033&highlight=ashaman+runespan

But Rglak's one works for all my runespan needs anyway, the only issue is it sometimes takes a few seconds to switch nodes/wraiths but I think that's fine.



Yep, that's the one! Should be very easy to fix (if it's actually broken) as most of it is node constants


///////////////////////////////////////////////////////////////////////
// //
// READ THE DIRECTIONS IN THE OP FIRST OR ELSE //
// Make sure you have setup your player file //
// Under SRL>PlayerManager //
// Fill out the array of objects you want to search for below //
// DO NOT TOUCH THIS SECTION, SKIP TO THE NEXT BLUE SECTION //
// //
///////////////////////////////////////////////////////////////////////

program AshamanRunespan;
{$DEFINE SMART}
{$DEFINE FAILSAFE}
{$I SRL-6/SRL.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}

const
SCRIPT_VERSION = '1.0';
ISLAND_FLOOR = 2;

UNDEAD_SOUL = 0;
LIVING_SOUL = 1;
BLOODY_SKULLS = 2;
BLOOD_POOL = 3;
SKULLS = 4;
JUMPER = 5;
SOUL_ESSWRAITH = 6;
SHIFTER = 7;
NEBULA = 8;
BLOOD_ESSWRAITH = 9;
CHAOTIC_CLOUD = 10;
DEATH_ESSWRAITH = 11;
LAW_ESSHOUND = 12;
NATURE_ESSHOUND = 13;
FIRE_STORM = 14;
FLESHY_GROWTH = 15;
VINE = 16;
ASTRAL_ESSHOUND = 17;
FIREBALL = 18;
CHAOS_ESSHOUND = 19;
COSMIC_ESSHOUND = 20;
ROCK_FRAGMENT = 21;
WATER_POOL = 22;
BODY_ESSHOUND = 23;
MIND_STORM = 24;
CYCLONE = 25;
EARTH_ESSLING = 26;
WATER_ESSLING = 27;
MIND_ESSLING = 28;
AIR_ESSLING = 29;

////////////////////////////////////////////////////////////////////////////////////////////////
// //
// Fill out the search objects array with all of the objects //
// you want to search for. It doesn't matter order, but the smaller the list, //
// the less chances for false positives. Fill out array with exact phrase as objects above. //
// Ex: WATER_POOl, LIVING_SOUL, etc etc. //
// //
////////////////////////////////////////////////////////////////////////////////////////////////

SEARCH_OBJECTS = [mind_essling, fleshy_growth, fire_storm, air_essling, cosmic_esshound, body_esshound, rock_fragment, water_pool, cyclone, mind_storm, vine];

///////////////////////////////////////////////////////////////////////////////////////////
// //
// Don't touch below this line unless you know what you're doing!! //
// //
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////

const
DEBUG_SIPHON = false;
DEBUG_XP = false;

type
TObj = record
numberOfColors : integer;
outerColor: TColorData;
innerColor: TColorData;
name: string;
overText : TStringArray;
lvlReq, imax, imin, omax, omin, iXP, split: Integer;
node: boolean;
end;

type
TObjectArray = array of TObj;

var
objects: TObjectArray;
debug: boolean;
timeout, currentBTime: TTimeMarker;
startingXP, essenceDTM: integer;
W, X, Y, Z, RealBTime, BreakRounds, TotalBreaks: Integer;
itemCount, XP, itemsPH, XPH, Bir, Bfr: Integer;
toSearch: TIntegerArray;



function TRSChatBox.getXP: Integer;
var
b: TBox;
s: String;
tpa : TPointArray;
atpa : T2DPointArray;
i,cts,p: Integer;
begin
b := self.getBounds();
b.edit(+(b.x2-b.x1)-140, +10, -5, -94);

findColorsTolerance(tpa, 14013909, b, 4,colorSetting(2, 0.00, 0.00));

if length(tpa) < 2 then
begin
print('chatBox.getXP(): No XP found', TDebug.SUB);
Exit;
end;

atpa := tpa.cluster(5);

b:= atpa.getbounds;
b.edit(-2,-2,+2,+3);

s:=Replace(tesseractgettext(b.x1,b.y1,b.x2,b.y2, FILTER_SMALL_CHARS), ' ', '', [rfReplaceAll]);

P := Pos('x', S);
if P > 0 then
Result := StrToIntDef(ExtractFromStr(Copy(s, P, Length(S)), Numbers), 0)
else
Result := StrToIntDef(ExtractFromStr(S, Numbers), 0);

if DEBUG_XP then
print('chatBox.getXP(): XP found: ' + tostr(result), TDebug.SUB);
end;

function waitXPChange(startingXP: integer; waitTime: Integer = 2000): boolean;
var
t: TTimeMarker;
begin
t.start;
repeat
wait(50 + random(100));

if startingXP <> chatBox.getXP then
begin
print('XP has changed');
exit(true);
end;
until t.getTime > waitTime;
end;

procedure setDTMs;
begin
essenceDTM := DTMFromString('mVAEAAHicpYzbCkBQEEW3e0hI+QlELrm86JD//yXj2EpeTa2mmVl7EgCB4AsRe8qdg7tswRBcOjGdjLPLnE8vFCxmTd7DV/b6672coe8wjYOmqStsakXbNppnf+wKyzxpntvlVmWBXH78wfjJt06/9AyA');
end;

procedure releaseDTMS;
begin
freeDTM(essenceDTM);
end;

procedure setupObjects;
begin
print('Setting up objects');

setLength(objects, 30);

print('high objects: ' + toStr(high(objects)));

toSearch := SEARCH_OBJECTS;
toSearch.sortQuick;

print(toStr(toSearch));

print('Sorted objects you''re going to search for');

if toSearch.isInArray(UNDEAD_SOUL) then
with objects[UNDEAD_SOUL] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 0;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(LIVING_SOUL) then
with objects[LIVING_SOUL] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(BLOODY_SKULLS) then
with objects[BLOODY_SKULLS] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(BLOOD_POOL) then
with objects[BLOOD_POOL] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(SKULLS) then
with objects[SKULLS] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(JUMPER) then
with objects[JUMPER] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(SOUL_ESSWRAITH) then
with objects[SOUL_ESSWRAITH] do
begin
numberOfColors := 2;
outerColor := [9813180, 13, [2, [0.20, 0.38, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(SHIFTER) then
with objects[SHIFTER] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(NEBULA) then
with objects[NEBULA] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(BLOOD_ESSWRAITH) then
with objects[BLOOD_ESSWRAITH] do
begin
numberOfColors := 2;
outerColor := [9813180, 13, [2, [0.20, 0.38, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(CHAOTIC_CLOUD) then
with objects[CHAOTIC_CLOUD] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(DEATH_ESSWRAITH) then
with objects[DEATH_ESSWRAITH] do
begin
numberOfColors := 2;
outerColor := [9813180, 13, [2, [0.20, 0.38, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(LAW_ESSHOUND) then
with objects[LAW_ESSHOUND] do
begin
numberOfColors := 2;
outerColor := [16493733, 3, [2, [0.40, 2.84, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(NATURE_ESSHOUND) then
with objects[NATURE_ESSHOUND] do
begin
numberOfColors := 2;
outerColor := [16493733, 3, [2, [0.40, 2.84, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(FIRE_STORM) then //done
with objects[FIRE_STORM] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [2705085, 8, [2, [0.25, 1.87, 0.00]]];
name := 'Fire Storm';
overText := ['Siphon Fire', 'ire S', 'torm', 'ire '];
lvlReq := 27;
omin := 5;
omax := 200;
imin := 5;
imax := 100;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(FLESHY_GROWTH) then
with objects[FLESHY_GROWTH] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [4478132, 4, [2, [0.12, 0.53, 0.00]]];
name := 'Fleshy Growth';
overText := ['Siphon Fleshy', 'eshy g', 'eshy', 'owth'];
lvlReq := 20;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(VINE) then
with objects[VINE] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [932404, 7, [2, [0.45, 2.93, 0.00]]];
name := 'Vine';
overText := ['Siphon Vine', 'Vine', 'ine'];
lvlReq := 1;
omin := 5;
omax := 200;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(ASTRAL_ESSHOUND) then
with objects[ASTRAL_ESSHOUND] do
begin
numberOfColors := 2;
outerColor := [16493733, 3, [2, [0.40, 2.84, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(FIREBALL) then
with objects[FIREBALL] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(CHAOS_ESSHOUND) then
with objects[CHAOS_ESSHOUND] do
begin
numberOfColors := 2;
outerColor := [16493733, 3, [2, [0.40, 2.84, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(COSMIC_ESSHOUND) then //done
with objects[COSMIC_ESSHOUND] do
begin
numberOfColors := 2;
outerColor := [16493733, 3, [2, [0.40, 2.84, 0.00]]];
innerColor := [8381928, 17, [2, [0.04, 1.80, 0.00]]];
name := 'Cosmic Esshound';
overText := ['Siphon Cosmic', 'osmic', 'mic e'];
lvlReq := 35;
omin := 30;
omax := 400;
imin := 1;
imax := 30;
iXP := 1200;
node := false;
end;

if toSearch.isInArray(ROCK_FRAGMENT) then //done
with objects[ROCK_FRAGMENT] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [4300938, 5, [2, [0.05, 0.19, 0.00]]];
name := 'Rock Fragment';
overText := ['Siphon Rock', 'ock f', 'ragm', 'ment'];
lvlReq := 9;
omin := 5;
omax := 200;
imin := 50;
imax := 250;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(WATER_POOL) then //done
with objects[WATER_POOL] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [11839084, 7, [2, [0.22, 1.11, 0.00]]];
name := 'Water Pool';
overText := ['Siphon Water', 'ater P', 'ool', 'ater'];
lvlReq := 1;
omin := 5;
omax := 200;
imin := 10;
imax := 200;
iXP := 1200;
node := true;
end;

if toSearch.isInArray(BODY_ESSHOUND) then //done
with objects[BODY_ESSHOUND] do
begin
numberOfColors := 2;
outerColor := [16493733, 3, [2, [0.40, 2.84, 0.00]]];
innerColor := [10635569, 13, [2, [0.19, 0.86, 0.00]]];
name := 'Body Esshound';
overText := ['Siphon Body', 'ody ', 'ody ess'];
lvlReq := 20;
omin := 30;
omax := 400;
imin := 0;
imax := 20;
iXP := 1200;
node := false;
end;

if toSearch.isInArray(MIND_STORM) then //done
with objects[MIND_STORM] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [2767682, 11, [2, [0.70, 1.35, 0.00]]];
name := 'Mind Storm';
overText := ['Siphon Mind', 'mind s', 'storm', 'clone'];
lvlReq := 1;
omin := 5;
omax := 200;
imin := 4;
imax := 100;
iXP := 960;
node := true;
end;

if toSearch.isInArray(CYCLONE) then //done
with objects[CYCLONE] do
begin
numberOfColors := 2;
outerColor := [10070968, 13, [2, [0.75, 0.73, 0.00]]];
innerColor := [2767682, 11, [2, [0.70, 1.35, 0.00]]];
name := 'Cyclone';
overText := ['Siphon Cyclone', 'clone', 'yclone', 'cyclone'];
lvlReq := 1;
omin := 5;
omax := 200;
imin := 4;
imax := 100;
iXP := 960;
node := true;
end;

if toSearch.isInArray(EARTH_ESSLING) then
with objects[EARTH_ESSLING] do
begin
numberOfColors := 1;
outerColor := [7852929, 21, [2, [0.33, 0.87, 0.00]]];
name := 'Earth Essling';
overText := ['rth ess', 'iphon Ear', 'Siphon Earth essling', 'arth essl'];
lvlReq := 1;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 29;
end;

if toSearch.isInArray(WATER_ESSLING) then
with objects[WATER_ESSLING] do
begin
numberOfColors := 1;
outerColor := [7956398, 12, [2, [0.04, 1.08, 0.00]]];
name := 'Water Essling';
overText := ['Water Essling', 'ater', 'er essl', 'ssling'];
lvlReq := 5;
omin := 5;
omax := 1000;
imin := 0;
imax := 1000;
iXP := 25;
end;

if toSearch.isInArray(MIND_ESSLING) then //done
with objects[MIND_ESSLING] do
begin
numberOfColors := 1;
outerColor := [7191242, 11, [2, [0.11, 1.78, 0.00]]];
name := 'Mind Essling';
overText := ['nd ess', 'iphon Min', 'Siphon Mind essling'];
lvlReq := 1;
omin := 30;
omax := 350;
iXP := 19;
end;

if toSearch.isInArray(AIR_ESSLING) then //done
with objects[AIR_ESSLING] do
begin
numberOfColors := 1;
outerColor := [14922350, 11, [2, [0.11, 2.95, 0.00]]];
name := 'Air Essling';
overText := ['ir ess', 'iphon Air', 'Siphon Air essling'];
lvlReq := 1;
omin := 30;
omax := 300;
imin := 0;
imax := 1000;
iXP := 19;
end;

print('objects setup');
print('objects: ' + toStr(objects));
print('high objects: ' + toStr(high(objects)));
end;

procedure declarePlayers();
var
i,j: integer;
begin
players.setup(playerForm.playerNames, playerForm.playerFile); // load the SPF players from the SRL Player Manager
currentPlayer := 0; // player to use first

// set player attributes based on the settings from the form
for i := 0 to high(players) do
with players[i] do
begin
// convert the integers
integers[0] := strToInt(playerForm.players[i].settings[2]); //minutes until break
integers[1] := strToInt(playerForm.players[i].settings[3]); //minutes to break
ismember:=true;

integers[3] := strToInt(playerForm.players[i].settings[1]); //minutes to break


World := strToInt(playerForm.players[i].settings[4]); //world


// booleans
booleans[0] := strToBool(playerForm.players[i].settings[5]);
booleans[1] := strToBool(playerForm.players[i].settings[6]);
FindMod := strToBool(playerForm.players[i].settings[7]);
debug := strToBool(playerForm.players[i].settings[8]);

// any other data types you've decided to use
strings[0] := playerForm.players[i].settings[0]; //quickkey
end;
end;

// initiates the SRL player form (you aren't restricted to the procedure name; it can be whatever you want)
procedure initPlayerForm();
begin
with playerForm do
begin
name := 'AshamanRunespan v'+toStr(SCRIPT_VERSION); // the title of the SPF, usually the name of your script
scriptHelpThread := ''; // a link to a help thread, if set to '' will link to my setup guide
scriptSettingsPath := ''; // where you want the settings file to be saved; saved in script's path by default

editBoxLabels := ['Current Level', 'Floor', 'Minutes until Break', '# of Minutes to Break', 'World']; // edit boxes are created for each array element
editBoxDefaults := [ '50', '1', '600', '15','0']; // optional default values for each edit box; array length must equal editBoxLabel length
checkBoxLabels := ['Take Breaks', 'Switch Worlds (After Break)', 'Logout if Mod is near', 'Debug']; // same as editBoxLabels but for check boxes
checkBoxDefaults := ['True','True','True', 'False'];
end;
end;

procedure findNormalRandoms;
begin
print('checking for treasure stuff');
exitTreasure;
claimTicket;
end;

procedure failsafe;
begin
Mouse(Point(289+GaussRangeInt(-10,10),203+GaussRangeInt(-10,10)),Mouse_Left,Mouse_Human);
Wait(GaussRangeInt(1000,3000));
end;

procedure progressReport;
var
TTB: Integer;
begin
if not debug then
clearDebug;

inc(itemCount);

TTB := (((W) + (Y) + BreakRounds)-GetTimeRunning);

XP := (chatBox.getXP - startingXP);
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
ItemsPH := Round((ItemCount * (3600.0 / (GetTimeRunning / 1000.0))));

writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
writeln('| AshamanRunespan v'+PadR(toStr(SCRIPT_VERSION), 24), '|');
writeln('|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|');
writeln(padR('| Running For: '+TimeRunning, 60)+'|');
writeln(padR('| Objects''s Caught: ' + groupDigits(itemCount, ','), 40) + padR('Caught/H: ' + groupDigits( ItemsPH, ','), 20) + '|');
writeln(padR('| Exp Earned: ' + GroupDigits(XP,','), 40) + padR('Exp/Hour: ' + GroupDigits(XPH,','), 20) + '|');
writeln('|___________________________________________________________|');
writeln('|___________________________________________________________|');

If Players[CurrentPlayer].Booleans[0] Then
Writeln('Time until break: '+MsToTime(TTB, Time_Bare));
End;

function islandBounds: tbox;
var
floorColor: TColorData;
tpa: TPointArray;
atpa: T2DPointArray;
splitLength: integer;
i: integer;
begin
if not isLoggedIn then
exit;

print('searching for island bounds');

result := mainscreen.getBounds;

case ISLAND_FLOOR of
1: begin floorColor := [2782836, 10, [2, [0.23, 0.71, 0.00]]]; splitLength := 10; end;
2: begin floorColor := [7171653, 10, [2, [5.01, 0.16, 0.00]]]; splitLength := 5; end;
end;

floorColor.gatherIn(tpa, mainscreen.getBounds);

atpa := tpa.cluster(splitLength);
atpa.filterbetween(0, 200);
atpa.sortBySize(true);

if debug then
try
smartImage.debugATPA(atpa);
except
print('failed drawing');
end;

print('length of island atpas: ' + tostr(length(atpa)));

for i := 0 to high(atpa) do
if pointInBox(mainscreen.playerPoint, atpa[i].getBounds) then
begin
print('found my island');
result := atpa[i].getBounds;
if debug then
begin
smartimage.clear;
smartimage.drawbox(result);
end;
exit;
end;

print('failed to find my island');
end;

function findEssence: boolean;
const
FLOATING_ESSENCE: TCOLORDATA = [4804176, 11, [2, [0.44, 0.06, 0.00]]];
var
tpa: TPointArray;
atpa: T2DPointArray;
i, h, x, y: integer;
begin
if not isLoggedIn then
exit;

print('searching for floating essence');

result := findDTM(essenceDTM, x, y, tabBackpack.getBounds);

if result then
exit;

FLOATING_ESSENCE.gatherIn(tpa, mainscreen.getBounds);

atpa := tpa.cluster(10);
atpa.sortBySize;

if debug then
smartimage.debugatpa(atpa);

h := high(atpa);

for i := 0 to h do
begin
print('lenght of possible floating essence: ' + toStr(length(atpa[i])));

result := findDTM(essenceDTM, x, y, tabBackpack.getBounds);

if result then
exit;
mouseBox(atpa[i].getBounds);

if isMouseOverText(['Collect', 'loating', 'ting', 'loat']) then
begin
print('found correct mouseovertext, clicking');
if didClick(true) then
begin
print('successfully found essence');
timeout.start;
result := tabBackpack.waitForShift(randomRange(7000, 9000));
if result then
exit;
end;
end;
end;
end;

function waitFindDTM(DTM, x, y: integer; bounds: tbox; time: integer): boolean;
var
t: ttimemarker;
begin
t.start;
repeat
wait(random(200));

result := findDTM(DTM, x, y, bounds);

until (result) or (t.getTime > time);
end;

function checkEssence: boolean;
var
x, y, slot, amount: integer;
begin
if not isLoggedIn then
exit;

tabBackpack.open;


if not waitfindDTM(essenceDTM, x, y, tabBackpack.getBounds, randomRange(1500, 2000)) then
begin
print('did not find essence dtm, searching for essence dude');
if not waitFunc(@findEssence, 10, randomRange(5000, 10000)) then
begin
print('failed to get the essence');
if (isLoggedIn) and (not findDTM(essenceDTM, x, y, tabBackpack.getBounds)) then
begin
writeln('Failed to get more essence, shutting down');
terminateScript;
end;
end
else
begin
wait(randomRange(4000, 5000));
if not findDTM(essenceDTM, x, y, tabBackpack.getBounds) then
begin
writeln('Still no essence, shutting down');
terminateScript;
end;
end;
end;

amount := getItemAmount(tabBackpack.getSlotBox(tabBackpack.pointToSlot([x, y])));

if (amount < 30) and (amount = -1) then
result := false else
result := (amount < 30);


print('check essence: ' + toStr(result) + ', for amount ' + toStr(getItemAmount(tabBackpack.getSlotBox(tabBackpack.pointToSlot([x, y])))) + ' slot: ' + toStr(tabBackpack.pointToSlot([x, y])));
end;

function findObject(whichObject: integer): boolean;
var
b, innerBounds, mouseBounds: tbox;
tba: TBoxArray;
tpa, tpa2: TPointArray;
atpa, atpa2: T2DPointArray;
i, j, startXP: integer;
begin
if not isLoggedIn then
exit;

if not toSearch.isInArray(whichObject) then
begin
print('object: ' + toStr(whichObject) + ' is not in search array, exiting');
exit;
end;

print('searching for objects');

b := islandBounds;

with objects[whichObject] do
begin
print('Trying to find object: ' + name);

if checkEssence then
if node then
exit(false);

if (node) and (ISLAND_FLOOR = 2) then
outerColor := [8948645, 9, [2, [0.17, 0.76, 0.00]]];

outerColor.gatherIn(tpa, b);

atpa := tpa.cluster(15);
atpa.sortBySize;

print('outerlength: ' + toStr(length(atpa)));

if debug then
try
smartImage.debugATPA(atpa);
except
print('failed drawing');
end;

if length(atpa) = 0 then
exit;

if numberOfColors > 1 then
begin
print('searching for second color');
for i := 0 to high(atpa) do
begin
print('outerlength: ' + toStr(length(atpa[i])) + ' for i: ' + toStr(i));

if (length(atpa[i]) < omin) or (length(atpa[i]) > omax) then
continue;

innerBounds := atpa[i].getBounds;

innerBounds.edit(-15, -15, +15, +15);
innerBounds.setLimit(mainscreen.getBounds);

if debug then
try
smartimage.drawbox(innerbounds);
except
print('failed drawing');
end;

innerColor.gatherIn(tpa2, innerBounds);

atpa2 := tpa2.cluster(5);
atpa2.sortBySize;


print('innerlength: ' + toStr(length(atpa2)) + ' for i: ' + toStr(i));

if debug then
try
smartImage.debugATPA(atpa2);
except
print('failed drawing');
end;

for j := 0 to high(atpa2) do
begin
print('innerlength: ' + toStr(length(atpa2[j])) + ' for j: ' + toStr(j));

if (length(atpa2[j]) < imin) or (length(atpa2[j]) > imax) then
continue;

print('attempting to move mouse in position');

mouseBounds := atpa[i].getBounds;
mouseBounds.edit(-3, -3, +3, +3);
mouseBounds.setLimit(mainscreen.getBounds);


mouseBox(mouseBounds);

if isMouseOverText(overText) then
begin
print('found object text, clicking');

if (random(5) = 1) then
begin
fastClick(MOUSE_RIGHT);

if (not chooseOption.select(['Siphon', 'iphon', 'phon'])) then
continue;
end else
if not didclick(true) then
failsafe;

timeout.start;
print('clicked successfully, waiting for xp change');
startXP := chatBox.getXP;
wait(randomRange(0,1000));
mouseOffClient(4);
result:= waitXPChange(startXP, randomRange(4000, 6000));
if result then
exit;
end;
end;
end;
end else
begin
for i := 0 to high(atpa) do
begin
print('outerlength: ' + toStr(length(atpa[i])) + ' for i: ' + toStr(i));
if (length(atpa[i]) > omin) and (length(atpa[i]) < omax) then
begin
mouseBounds := atpa[i].getBounds;
mouseBounds.edit(-3, -3, +3, +3);
mouseBounds.setLimit(mainscreen.getBounds);
mouseBox(mouseBounds);

if isMouseOverText(overText) then
begin
print('found object text, clicking');
if (random(5) = 1) then
begin
fastClick(MOUSE_RIGHT);

if (not chooseOption.select(['Siphon', 'iphon', 'phon'])) then
continue;
end else
if not didclick(true) then
failsafe;

timeout.start;
print('clicked successfully, waiting for xp change');
startXP := chatBox.getXP;
wait(randomRange(0,1000));
mouseOffClient(4);
result:= waitXPChange(startXP, randomRange(10000,15000));
if result then
exit;
end;
end;
end;
end;
end;
end;

function waitForPuff: boolean;
var
siphonBall: TColorData;
b: tbox;
tpa: TPointArray;
t: ttimemarker;
time: integer;
begin
if not isLoggedIn then
exit;

case ISLAND_FLOOR of
1: begin siphonBall := [4279378, 16, [2, [0.38, 0.57, 0.00]]]; end;
2: begin siphonBall := [7368037, 16, [2, [2.69, 0.28, 0.00]]]; end;
end;

b := mainscreen.playerBox;
b.edit(0, 0, 0, -5);
time := gaussRangeInt(2000, 3000);
t.start;
repeat
if not isLoggedIn then
exit;

siphonBall.gatherIn(tpa, b);

if DEBUG_SIPHON then
print('Length of siphon ball: ' + tostr(length(tpa)));

result := (length(tpa) > 20);
setLength(tpa, 0);

if result then
exit;

wait(randomRange(50, 100));
until t.getTime > time;
end;


procedure waiting(objID: integer);
var
time, startXP: integer;
t: ttimemarker;
begin
smartimage.clear;
time := gaussRangeInt(4000, 5000);
startXP := chatBox.getXP;
t.start;
repeat
if not isLoggedIn then
break;

if not waitForPuff then
exit;

if startXP <> chatBox.getXP then
begin
t.start;
startXP := chatBox.getXP;
end;

if (checkEssence) and (objects[objID].node) then
exit;

wait(randomRange(100, 800));
until t.getTime > time;
end;

procedure setup;
begin
clearDebug;
smartEnableDrawing := True;

initPlayerForm(); // initiate your settings
runPlayerForm(); // run the form

// use this so the script doesn't continue if the user exits out of the form
if (not playerForm.isScriptReady) then
terminatescript;

declarePlayers();

smartPlugins := ['OpenGL32.dll','d3d9.dll'];

setupSRL;

if not isLoggedIn then
begin
if not players[currentPlayer].login then
terminateScript;

writeln('Just loggedin, waiting a bit');
wait(randomRange(6000, 10000));
end;

if not debug then
disableSRLDebug := true else
disableSRLDebug := false;

clearDebug;
setDTMs;
addOnTerminate('releaseDTMS');

mainScreen.setAngle(MS_ANGLE_HIGH);
findNormalRandoms;

if conversationBox.continue(true, true) then
wait(randomRange(3000, 2000));

bir:= 20; // ***Random minutes to add/subtract from how long until we break***
bfr:= 30; // ***Random minutes to add/subjtract from break duraction***

w := (players[currentPlayer].integers[0] * 60000);
x := (players[currentPlayer].integers[1] * 60000);
y := randomRange(-bIR * 60000, bIR * 60000);
z := randomRange(-bFR * 60000, bFR * 60000);

tabBackpack.Open;

startingXP := chatBox.getXP;
setupObjects;
end;

procedure mainLoop;
var
i, h: integer;
begin
print('entering mainloop');

findNormalRandoms;

if not isLoggedIn then
begin
if debug then
print('logged out attempting to login');
wait(5000);

disableSRLDebug := false;

if not players[currentPlayer].login then
begin
{$IFDEF FAILSAFE}
terminateScript;
{$ENDIF}
end;

mainScreen.setAngle(MS_ANGLE_HIGH);
if not debug then
disableSRLDebug := true;

timeout.start;
end;

h := high(objects);
for i := 0 to h do
if findObject(i) then
begin
waiting(i);
progressReport;
break;
end;
end;

begin
setup;
while (players.getActive() > 0) do
mainloop;
end.