SRL Archive - SRL Archives

VarrockToFalador + Some Color Finding.


XxKanexX

2006-03-28 11:42:06

I hope this works for everyone. It worked flawless for me, and it was so easy to script.

It auto picks every color. The road color, barbarains road colors all the way to the new falador road color. On 100% Energy from the Varrock West bank you should be able to reach falador on 10%+.

As soon as i get everyone elses approaval on if it works i will add it to SRL. (If it dosn't work try moving until you get the, "Loading, Please wait…" screen. As this makes the colors brighter, (If it already hasn't).

The color picking functions are also good for other scripts. (As for Fally smelters, You can use the FindMMLimeRoadColor function. ;))

I hope it works for everyone and please leave a comment.
Start in the South area of the Varrock West bank and press start. If you are using a low leveled character beware, you could be attacked in Barbarain village. V-BRIGHT!

Everything in this was Made By XxKanexX.


{.include SRL/SRL.scar}

function FindMMColorDTMBase(DTM, Base: Integer): Integer;
var Buff, i: Integer;
begin
if FindDTM(DTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
for i:= 1 to 5 do
begin
if i = 1 then
Buff:= GetColor(x, y)
else
Buff:= GetColor(x - random(i), y + random(i));

if SimilarColors(Buff, Base, 7 + i) then
begin
result:= Buff;
exit;
end;
end;
end;
FreeDTM(DTM);
end;

function FindMMColorDTMBaseDouble(DTM, DTM2, Base, Base2: Integer): Integer;
var Buff, i: Integer;
begin
if FindDTM(DTM, x, y, MMX1, MMY1, MMX2, MMY2) or FindDTM(DTM2, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
for i:= 1 to 5 do
begin
if i = 1 then
Buff:= GetColor(x, y)
else
Buff:= GetColor(x - random(i), y + random(i));

if SimilarColors(Buff, Base, 7 + i) then
begin
result:= Buff;
exit;
end else
if SimilarColors(Buff, Base2, 5 + i) then
begin
result:= Buff;
exit;
end;

end;
end;
FreeDTM(DTM);
FreeDTM(DTM2);
end;

function FindMMRoadColor: Integer;
var RoadDTM, RoadDTM2, RoadDTM3, RoadDTM4: Integer;
begin
RoadDTM := DTMFromString('78DA632C606260C8644001C1DEDE609A11CA6' +
'72C06AAC925A0A61AA82683809A3CA09A74DC6A80B20C002D8107' +
'28');
RoadDTM2 := DTMFromString('78DA639CCDC4C0E0C18002F2D2D2C0342394C' +
'FD80754E34340CD5CA01A2F026A1610615737508D377E3500EF49' +
'0A99');
RoadDTM3 := DTMFromString('78DA632C61626088634001D5C545609A11CA6' +
'7CC04AA4924A0A600A82609BF1A007DF4069B');
RoadDTM4 := DTMFromString('78DA632C666260886340016579B9609A11CA6' +
'7AC00AA8922A0A610A8269A809A7CC27601008CA20891');
Result:= FindMMColorDTMBaseDouble(RoadDTM, RoadDTM2, 4934483, 6710894);

if Result < 1 then
Result:= FindMMColorDTMBase(RoadDTM3, 7500667);

if Result < 1 then
Result:= FindMMColorDTMBase(RoadDTM4, 7171702);
end;

function FindMMBridgeColor: Integer;
var BridgeDTM, BridgeDTM2, BridgeDTM3: Integer;
begin
BridgeDTM := DTMFromString('78DA638C636260F063400141E602609A11CA6' +
'74C01AA0926A0269D087332816A82F0AB01009F0C0548');
BridgeDTM2 := DTMFromString('78DA63F4606260706040018E0A109A11CA677' +
'424428D13508D2D7E3500A93002B8');
BridgeDTM3 := DTMFromString('78DA634C62626088644001EE06BC609A11CA6' +
'78C03AA8922A02601A8260CBF1A00E8ED03C2');

Result:= FindMMColorDTMBaseDouble(BridgeDTM, BridgeDTM2, 1062738, 8257);

if Result < 1 then
Result:= FindMMColorDTMBase(BridgeDTM3, 864327);

end;

function FindMMWaterColor: Integer;
var WaterDTM, WaterDTM2: Integer;
begin
WaterDTM := DTMFromString('78DA630C61626028654001619913C1342394C' +
'FE803545348404D20504D2E013561403525F8D50000779C085F');
WaterDTM2 := DTMFromString('78DA634C656260A860400111D993C0342394C' +
'F08525344404D2C11E624103607009A5308C0');
Result:= FindMMColorDTMBaseDouble(WaterDTM, WaterDTM2, 9595478, 9595736);
end;

function FindMMMudRoadColor: Integer;
var MudDTM, MudDTM2, MudDTM3, MudDTM4: Integer;
begin
MudDTM := DTMFromString('78DA6374676260F0654001AD69B6609A11CA6' +
'70C24428D1B508D0B01353E40355EF8D5000010EC0703');
MudDTM2 := DTMFromString('78DA635CCDC4C0E0C480024CD525C0342394C' +
'FB819A8C696809A8D40352E04D42C07AA71C7AF0600CC4B05A1');
MudDTM3 := DTMFromString('78DA630C65626008634001018E3A609A11CA6' +
'7F405AA8920A02600A82618BF1A00FC4E0437');
MudDTM4 := DTMFromString('78DA63F467626088674001A5C9CE609A11CA6' +
'77407AA4924A0C60BA82616BF1A0036E7055B');

Result:= FindMMColorDTMBaseDouble(MudDTM, MudDTM2, 1582901, 4023941);
if Result < 1 then
Result:= FindMMColorDTMBaseDouble(MudDTM3, MudDTM4, 4416373, 2900304);
end;

function FindMMSludgeColor: Integer;
var SludgeDTM, SludgeDTM2, SludgeDTM3: Integer;
begin
SludgeDTM := DTMFromString('78DA63AC636260C867400149714E609A11CA6' +
'72C06AAC924A0A693083520BBB208A86902AA2924A0A692B01A00' +
'2A130BA5');
SludgeDTM2 := DTMFromString('78DA63AC66626028604001D3AB5DC1342394C' +
'FD80A549347404D1B504D360135E5403545F8D50000BD7E0925');
SludgeDTM3 := DTMFromString('78DA639CC4C4C090CD80022A4B83C0342394C' +
'FD80D54934340CD04A09A74FC6A008E3D06B8');
Result:= FindMMColorDTMBaseDouble(SludgeDTM, SludgeDTM2, 4349538, 4553623);

if Result < 1 then
Result:= FindMMColorDTMBase(SludgeDTM3, 5404025);

end;

function FindMMLimeRoadColor: Integer;
var LimeDTM, LimeDTM2, LimeDTM3, LimeDTM4: Integer;
begin
LimeDTM := DTMFromString('78DA63EC66626028644001ADCDD9609A11CA6' +
'76C07AAC926A0A607A82687809A89403505F8D50000E92709C4');
LimeDTM2 := DTMFromString('78DA63E460666078CC8002C2031CC0342394C' +
'FC80D54F392801A01A09A5704D4B001D53CC5AF060040E20775');
LimeDTM3 := DTMFromString('78DA63EC60626098CB80028A7363C0342394C' +
'F0852339D809A4EA09A8904D4B402D5CCC4AF0600E252097D');
LimeDTM4 := DTMFromString('78DA63EC656260A8644001DD4DF9609A11CA6' +
'7EC07AA2927424D010135DD403545F8D5000001E10A09');
Result:= FindMMColorDTMBaseDouble(LimeDTM, LimeDTM2, 7046021, 4214871);

if Result < 1 then
Result:= FindMMColorDTMBaseDouble(LimeDTM3, LimeDTM4, 60573313, 7307915);

end;

function FindMMFaladorColor: Integer;
var FallyDTM: Integer;
begin
FallyDTM := DTMFromString('78DA634C67626048654001EB5677836946289' +
'FB108A82691809A1CA09A34FC6A00CCF7082A');

Result:= FindMMColorDTMBase(FallyDTM, 9153454);

if Result < 1 then
begin
if FindColorTolerance(x, y, 9679544, MMX1, MMY1, MMX2, MMY2, 5)or
FindColorTolerance(x, y, 9678521, MMX1, MMY1, MMX2, MMY2, 5)then
Result:= GetColor(x, y);
end;
end;

//Start near the SOUTH of the Varrock WEST bank. Mapcompass NORTH.
//Auto Detects Colors.
function VarrockToFalador(TheRoadColor: Integer): Boolean;
var TheWaterColor, TheBridgeColor, TheSludgeColor, TheRoadColor2, TheLimeColor, TheRoadColor3: Integer;
var Breaker: Integer;
begin
ActivateClient;
if TheRoadColor = -1 then
begin
TheRoadColor:= FindMMRoadColor;
end;
Writeln('Road Color: '+ Inttostr(TheRoadColor));

if TheRoadColor < 1 then
begin
Writeln('Unable to detect roadcolor, User setup.');
exit;
end;

Face('N');
repeat
RoadWalkTol(TheRoadColor, 'SW', 6);
Wait(50 + Random(50));
TheWaterColor:= FindMMWaterColor;
Breaker:= Breaker + 1;
if Breaker > 20 then
break;
until(TheWaterColor > 0);

Writeln('Water Color: ' + Inttostr(TheWaterColor));
Breaker:= 0;

repeat
RoadWalkTol(TheRoadColor, 'N', 6);
Wait(50 + Random(50));
TheBridgeColor:= FindMMBridgeColor;
Breaker:= Breaker + 1;
if Breaker > 10 then
break;
until(TheBridgeColor > 0);

Writeln('Bridge Color: '+Inttostr(TheBridgeColor));
Breaker:= 0;
TheRoadColor2:= FindMMMudRoadColor;
Writeln('Mud Road Color: '+ Inttostr(TheRoadColor2));

repeat
RoadWalkTol(TheRoadColor2, 'W', 6);
Wait(50 + Random(50));
TheSludgeColor:= FindMMSludgeColor;
Breaker:= Breaker + 1;
if Breaker > 10 then
break;
until(TheSludgeColor > 0) and (Breaker > 4);

Writeln('Sludge Color: '+Inttostr(TheSludgeColor));
Breaker:= 0;

repeat
RoadWalkTol(TheRoadColor2, 'NW', 6);
Wait(50 + Random(50));
Breaker:= Breaker + 1;
if Breaker > 20 then
break;
until(FindColor(x, y, TheRoadColor2, 608, 126, 626, 141) and
(FindColor(x, y, 982782, 639, 10, 621, 136)));

Writeln('Directioning South');
Breaker:= 0;

TheRoadColor2:= FindMMMudRoadColor;
repeat
RoadWalkTol(TheRoadColor2, 'SW', 6);
Wait(50 + Random(50));
TheRoadColor3:= FindMMRoadColor;
Breaker:= Breaker + 1;
if Breaker > 10 then
break;
until(TheRoadColor3 > 0);

Writeln('New Road Color: '+Inttostr(TheRoadColor3));
Breaker:= 0;

repeat
RoadWalkTol(TheRoadColor3, 'S', 4);
Wait(50 + Random(50));
TheLimeColor:= FindMMLimeRoadColor;
Breaker:= Breaker + 1;
if Breaker > 20 then
break;
until(TheLimeColor > 0);

Writeln('Lime Color: '+Inttostr(TheLimeColor));
Breaker:= 0;

repeat
RoadWalkTol(TheLimeColor, 'S', 4);
Wait(50 + Random(50));
Breaker:= Breaker + 1;
if Breaker > 20 then
break;
until(FindMMFaladorColor > 0);

Writeln('Falador Color: '+Inttostr(FindMMFaladorColor));

Result:= True;
Writeln('Hopefully Reached Falador.');
end;

begin
VarrockToFalador(-1);
end.

I will be making more things like this later on. But things that are actually useful.

Wizzup?

2006-03-28 11:51:56

Cool, but why don't you use RadialWalk?

XxKanexX

2006-03-28 11:58:32

Because i can't get it to work.

And i found Stupids alot more easier. :) Yes, I've read the tutorial. Still confusing.

Excellent procedure though, i must say.

I just updated the script. It can now find the Lime and Mud colors even when you havn't been through the loading sign. (So the darkest, and lightest)

solemn wishes

2006-03-28 12:02:20

nice one kane, or as they say "owned"? lol….im using radial walk and it works perfect sometimes then completely changes the next…

XxKanexX

2006-03-28 12:22:08

I found some errors, I'm fixing them now.

Dam those colors. I realised that they change more than i thought ;)
Edit: Fixed

Pwnd

2006-03-28 13:49:19

Kane, did Fakawi teach you how to code like a homo?
That's enough out of you. I will see: if ()then from now on.
There will be none of this if then crap. ;p

Thanks, by the way. With all these new functions I'm pretty sure I'd get that flaxer finished,
plus we need the new randoms..

Neonknight77

2006-03-28 19:24:24

From: XxKanexX
Because i can't get it to work.

And i found Stupids alot more easier. :) Yes, I've read the tutorial. Still confusing.

Excellent procedure though, i must say.

I just updated the script. It can now find the Lime and Mud colors even when you havn't been through the loading sign. (So the darkest, and lightest)

Yes I agree, I've looked at it also, and I still find RoadWalkTol is easier.

XxKanexX

2006-03-28 21:29:19

From: Pwnd
Kane, did Fakawi teach you how to code like a homo?
That's enough out of you. I will see: if ()then from now on.
There will be none of this if then crap. ;p

Thanks, by the way. With all these new functions I'm pretty sure I'd get that flaxer finished,
plus we need the new randoms..

No, who tought you to act like a Homo though?

I will code how i want to. Kay? Don't like it? Don't view my scripts.

And i didn't think it'd really need Randoms in it, But i will add them in.

XxKanexX

2006-03-29 00:21:26

Added New version. (Better Color picking).

I'm going to switch worlds for a bit and get every color i can to work. (With tolerance of course). ;)

Pwnd

2006-03-29 00:23:27

Just playing with you, sir ;P

That good times have passed. :o