Cheesehunk
2007-03-23 22:19:27
Alright, I am starting to get back into scripting more. I decided to start of again by doing my favourite thing to get me in the groove(Walking.) However, I am done the path now, but the testing is impossible. A couple of my accounts have high enough magic for Varrock teleport, but currently don't have the runes..
I would really appreciate if you could test this and report back. Also, if any of your accounts mess up, please send me a screen shot of the MiniMap where they stopped walking. I just added Multi-players just in case you don't want to have to walk back between tests, not sure if it works yet..
Anyways, to run this place your players in Varrock East bank, most western bank booth. Align the MiniMap to north, and try to get the lines as straight as possible (Haven't added a rotation function yet.) Please watch the entire process, so you can comment where it had trouble/what went wrong.\
The walking uses 4 colors, RoadColor (Duh!), RockColor (For nearly everything), WaterColor (A couple small sections), and HouseColor (Better callibration.) Please make sure Road, Rock, and House are set right at the start as they are Auto-colored.
Thanks tons, Cheesehunk.:)
Almost forgot to post it:p :
Also, the above wouldn't be possible if it wasn't for RRW, thanks Wiz and Fakawi! P.S. Everything except the first click was done with my Chuck judging skills, not using Yakman's tool.:p
EDIT: Put up a new version, small changes..
I would really appreciate if you could test this and report back. Also, if any of your accounts mess up, please send me a screen shot of the MiniMap where they stopped walking. I just added Multi-players just in case you don't want to have to walk back between tests, not sure if it works yet..
Anyways, to run this place your players in Varrock East bank, most western bank booth. Align the MiniMap to north, and try to get the lines as straight as possible (Haven't added a rotation function yet.) Please watch the entire process, so you can comment where it had trouble/what went wrong.\
The walking uses 4 colors, RoadColor (Duh!), RockColor (For nearly everything), WaterColor (A couple small sections), and HouseColor (Better callibration.) Please make sure Road, Rock, and House are set right at the start as they are Auto-colored.
Thanks tons, Cheesehunk.:)
Almost forgot to post it:p :
program New;
{.include SRL\SRL.scar}
var RockColor, HouseColor: Integer;
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Active:=True;
Writeln(IntToStr(HowManyPlayers) + ' Players' );
end;
function FindVarrockRockColor: Boolean;
var BMPRock, C, TX, TY: Integer;
begin
BMPRock := BitmapFromString(5, 5, 'z78DA33B2303632723531327' +
'1363145268D7088134FE23701228BAC0659040062C61FD7')
while (C<100) do
begin
C:=C+5;
If FindBitMapToleranceIn(BMPRock,TX,TY,600,40,630,90,C) then
begin
RockColor:=GetColor(TX + 1,TY + 1);
Result:=True;
break;
end
end
if not Result then writeln('Rock NOT Found');
FreeBitMap(BMPRock);
end;
function FindVarrockHouseColor: Integer; //Taken from Fakawi's ColorFinder
var
c, TX, TY, DraynorHouse: Integer;
begin
DraynorHouse := BitmapFromString(5, 5, 'z78DA337536B63432301D6424006825' +
'1FD7');
while (c < 65) do
begin
c := c + 5;
if FindBitmapToleranceIn(DraynorHouse, TX, TY, 580, 40, 610, 100, c) then
begin
HouseColor := GetColor(TX, TY);
Result := HouseColor;
break;
end
end
if Result = 0 then
begin
WriteLn('ERROR: HouseColor NOT Found');
TerminateScript;
FreeBitmap(DraynorHouse);
end;
FreeBitmap(DraynorHouse);
end;
function FindRockGroups(WhichGroup: Integer): Boolean;
var T, R: TPoint;
Rx: array[0..2] of Integer;
Ry: array[0..2] of Integer;
RockBox: TBox;
begin
if (WhichGroup = 1) then
begin
if FindColor(T.x, T.y, RockColor, 600, 10, 665, 55) then
if FindColor(R.x, R.y, RockColor, T.x - 3, T.y + 8, T.x + 20, T.y + 20) then
if (not FindColor(T.x, T.y, RockColor, T.x, T.y + 25, T.x + 40, T.y + 45)) then
Result := True;
Exit;
end;
if (WhichGroup = 2) then
begin
if FindColor(T.x, T.y, RockColor, 630, 70, 690, 120) then
if FindColor(R.x, R.y, RockColor, T.x + 9, T.y, T.x + 25, T.y + 15) then
Result := True;
Exit;
end;
if (WhichGroup = 3) then
begin
if FindColor(T.x, T.y, RockColor, MMX1 + 30, MMY1, MMX2, 65) then
begin
RockBox := CBox2(T.x - 5, T.y - 5, T.x + 13, T.y + 13);
if not FindColorSkipBox(R.x, R.y, RockColor, 605, MMY1, MMX2, MMY2, RockBox) then
Result := True;
end;
Exit;
end;
if (WhichGroup = 4) then
begin
if FindColor(T.x, T.y, RockColor, MMCX - 15, MMCY, MMX2, MMY2 - 25) then
begin
RockBox := CBox2(T.x - 5, T.y - 5, T.x + 13, T.y + 13);
if not FindColorSkipBox(R.x, R.y, RockColor, MMX1, MMY1, MMX2, MMY2 - 30, RockBox) then
Result := True;
end;
Exit;
end;
if (WhichGroup = 5) then
begin
if FindColor(T.x, T.y, RockColor, 610, MMY1, 690, 65) then
if FindColor(R.x, R.y, RockColor, T.x, T.y - 10, T.x + 40, T.y + 20) then
if (not FindColor(R.x, R.y, WaterColor, MMX1, MMY1, MMX2, MMY2)) then
if FindColor(R.x, R.y, RockColor, T.x - 5, T.y + 50, T.x + 40, T.y + 100) then
Result := True;
Exit;
end;
if (WhichGroup= 6) then
begin
if not FindMMColor(x, y, WaterColor) then
if FindColor(Rx[0], Ry[0], RockColor, MMX1, 30, MMCX, MMCY + 40) then
if FindColor(Rx[1], Ry[1], RockColor, Rx[0] + 25, Ry[0] - 20, Rx[0] + 55, Ry[0] + 25) then
if (Distance(Rx[0], Ry[0], Rx[1], Ry[1]) < 50) then
if FindColor(Rx[2], Ry[2], RockColor, Rx[0], Ry[0] + 25, Rx[1] + 10, Ry[0] + 75) then
Result := True;
Exit;
end;
end;
function VarrockEastBankToSheeps: Boolean;
var WalkFailSafe, Wx, Wy: Integer;
begin
if not LoggedIn then Exit;
if LinearRoadWalk(RoadColor, 10, 50, 0, 1) then
begin
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 70, 110, 45, -1, 0)
if (TimeFromMark(WalkFailSafe) > 60000) or (not LoggedIn) then Exit;
until FindRockGroups(1);
WriteLn('FindRockGroups(1)!');
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 110, 200, 55 + Random(2), 0, -1);
if (TimeFromMark(WalkFailSafe) > 180000) or (not LoggedIn) then Exit;
until FindRockGroups(2);
WriteLn('FindRockGroups(2)!');
LinearRoadWalk(RoadColor, 180, 45 + Random(2), 0, -1);
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 235, 310, 45 + Random(2), 1, 0);
if (TimeFromMark(WalkFailSafe) > 120000) or (not LoggedIn) then Exit;
until FindRockGroups(3);
WriteLn('FindRockGroups(3)!');
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 165, 265, 45 + Random(2), 1, -1);
if (TimeFromMark(WalkFailSafe) > 120000) or (not LoggedIn) then Exit;
until FindRockGroups(4);
WriteLn('FindRockGroups(4)!');
RadialRoadWalk(RoadColor, 140, 200, 62 + Random(2), 0, -1);
if (FindWaterColor = 0) then
begin
Logout;
Exit;
end;
WaterWalk(180, 250, 62, 5, 4 + Random(2), 3 + Random(2), 1, -1);
if not FindColor(Wx, Wy, WaterColor, MMCX - 50, MMCY - 15, MMCX, MMCY + 10) then
begin
LogOut;
Exit;
end;
MouseFindNoFlag(Wx - Random(5), Wy + 5 + Random(4), -1, 1); //Sketchy part
FFlag(2);
WriteLn('Finised Water clicking!');
if not FindMMColor(x, y, RoadColor) then
FindRoadColor;
WriteLn('Back on road!');
LinearRoadWalk(RoadColor, 268 + Random(2), 60, 1, 0);
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 395, 320, 35, 1, 1);
if (TimeFromMark(WalkFailSafe) > 60000) or (not LoggedIn) then Exit;
until FindColor(x, y, HouseColor, 660, MMY1, MMX2, MMY1 + 50);
WriteLn('Found HouseColor, turning!');
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 230, 305, 47 + Random(2), 1, 0);
if (TimeFromMark(WalkFailSafe) > 220000) or (not LoggedIn) then Exit;
until FindRockGroups(5);
WriteLn('FindRockGroups(5)!');
RadialRoadWalk(RoadColor, 200, 300, 63 + Random(2), 1, 0);
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 165, 290, 45, 0, -1);
if (TimeFromMark(WalkFailSafe) > 60000) or (not LoggedIn) then Exit;
FFlag(2);
until not FindMMColor(x, y, HouseColor);
WriteLn('Walked past house!');
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 300, 240, 45 + Random(2), 1, 0);
if (TimeFromMark(WalkFailSafe) > 230000) or (not LoggedIn) then Exit;
until FindRockGroups(6);
WriteLn('FindRockGroups(6)!');
MarkTime(WalkFailSafe);
repeat
RadialRoadWalk(RoadColor, 375, 270, 45 + Random(2), 1, 1);
if (TimeFromMark(WalkFailSafe) > 160000) or (not LoggedIn) then Exit;
until not FindMMColor(x, y, RockColor);
WriteLn('Done!');
Result := True;
end;
end;
procedure WhatHappened;
var i: Integer;
begin
for i := 1 to HowManyPlayers - 1 do
WriteLn(IntToStr(i) + ' - | Active: ' + BoolToStr(Players[i].Active) +
' - | Loc: ' + Players[i].Loc);
end;
begin
ClearDebug;
SetupSRL;
DeclarePlayers;
ActivateClient;
if FindVarrockRockColor then WriteLn(IntToStr(RockColor))
else TerminateScript;
WriteLn(IntToStr(FindVarrockHouseColor));
repeat
FindRoadColor;
if not VarrockEastBankToSheeps then LogOut;
if not LoggedIn then
Players[CurrentPlayer].Loc := 'Not LoggedIn'
else
begin
Players[CurrentPlayer].Loc := 'Succesfull!';
LogOut;
end;
NextPlayer(False);
WhatHappened;
until False;
end.Also, the above wouldn't be possible if it wasn't for RRW, thanks Wiz and Fakawi! P.S. Everything except the first click was done with my Chuck judging skills, not using Yakman's tool.:p
EDIT: Put up a new version, small changes..

