PDA

View Full Version : Minimap Colors change at each Login



WT-Fakawi
05-17-2006, 11:08 PM
Desided to devote a thread to this one. After all, it is the reason why our scripts didnt survive a single logout/in.
This is not good. It means we will need to come with some kind of plan for 100% solid colorfinders.This will be a challenge.

Think about it.

We will need to concentrate on shape detection I thiink. First find the shape/edge and then sample colors. Maybe even sample a 2 bits bitmap of the entire minimap and use bens edge detection to determine where the colors are.

All our energy into ColorFinding, if we want to survive this.

WhiteShadow
05-17-2006, 11:21 PM
What about just using more tolerance? =( or is that no longer an option either?

Starblaster100
05-17-2006, 11:23 PM
or just make the script keep on running even if it doesn't find a color ;)

I've recently completed my Guildminer (Just today) which uses auto color detection, but if it cant find the color, it will attempt to carry on the script anyway, and so far it is working magnificantly :) . as for login and logout, maybe we should reset all colors at logout so the scripts are forced to autopick all colors again?

Cheesehunk
05-17-2006, 11:24 PM
So, let me get this straight?

We have to get the Color for an item every time we log in? So, we would have to do something like this?


begin
if(NextPlayer) and
Players[CurrentPlayer].Loc:='Bank' then
begin
FindVarrockWestColors;
end;
begin
if(NextPlayer) and
Players[CurrentPlayer].Loc:='Mine' then
begin
WalkToBank; {Using Laggy Bitmap, or Dtm FUnctions, will be fixed once player is in bank, and colors can be found.}
end;
end;
end;

WhiteShadow
05-17-2006, 11:30 PM
Interesting bit of code Chuck, I never knew NextPlayer could be used like that.

WT-Fakawi
05-17-2006, 11:40 PM
I think the colors only change the first time you log out and in. So maybe we are lucky after all...

WhiteShadow
05-17-2006, 11:42 PM
I think the colors only change the first time you log out and in. So maybe we are lucky after all...

I'll do a test. Colorpicking a fish icon, logging out move colorpicker to exact coord, and repeat, I'll post results!

Cheesehunk
05-17-2006, 11:59 PM
I'll do a test. Colorpicking a fish icon, logging out move colorpicker to exact coord, and repeat, I'll post results!


Color Picked: 15123344 at (-1243463, -5095044)
Color Picked: 5328986 at (-1243538, -5094744)
Color Picked: 7171959 at (-1243547, -5094747)
Color Picked: 7434361 at (-1243539, -5094745)
User specified a new RS window
Color Picked: 7434361 at (797, -6)
Color Picked: 7302519 at (789, -5)

Sorry Fakawi, I think they just tried to trick us, the first time you log in it is really dark, all the next times you login it's lighter.

This was a test I used with the road colour manually...

WhiteShadow
05-18-2006, 12:06 AM
program New;
var
tcol : Integer;
begin
tcol :=GetColor(646, 104);
Writeln(IntToStr(tcol));

end.




Color Picked: 15818497 at (646, 104)
Successfully compiled
15818497
Successfully executed
Successfully compiled
5417394
Successfully executed
Successfully compiled
5747902
Successfully executed
Successfully compiled
15970836
Successfully executed


Fish Icon, I said I was going to do it. What happened there Chuck? :p

WT-Fakawi
05-18-2006, 12:21 AM
its even worse. Colors change at each ...loading please wait... screen. Confirm please...

Cheesehunk
05-18-2006, 12:29 AM
Not everyone, sometimes it just randomly changes...


Color Picked: 7171959 at (635, 44)
Color Picked: 7171959 at (600, 60)
Color Picked: 7302519 at (653, 42)
Color Picked: 7302519 at (649, 28)
Color Picked: 7302519 at (638, 34)
Color Picked: 7434361 at (604, 85)
Color Picked: 7302519 at (614, 72)
Color Picked: 7302519 at (608, 67)
Color Picked: 7302519 at (659, 83)
Color Picked: 7302519 at (700, 102)
Color Picked: 7302519 at (663, 125)
Color Picked: 7369081 at (637, 73)
Color Picked: 7369081 at (654, 59)
Color Picked: 7369081 at (652, 51)
Color Picked: 7369081 at (665, 119)
Color Picked: 7171959 at (660, 34)
Color Picked: 7171959 at (637, 84)
Color Picked: 7171959 at (587, 60)
Color Picked: 7171959 at (590, 67)
Color Picked: 7171959 at (623, 93)
Color Picked: 7369081 at (637, 52)

I was picking the raod colour while running a script, and helping it walk back, and forth..

Already tested that Fakawi...

It's true, the colors randomly* change, SRL will need some major overhauling now..

*=Not sure if its completely random...

WT-Fakawi
05-18-2006, 12:36 AM
yup.

Thus ends our quest.

Avaphi
05-18-2006, 12:49 AM
Couldnt you make a small function that runs like every 5 seconds... and it will check for black screen, Then autocoloring function will run. Just an idea :D

Cheesehunk
05-18-2006, 12:53 AM
Not sure if this would work, but from my understand it should.

For every loading screen, the script would no where they were, and have a bitmap set for each place were the loading screens apply.

Then they would use colorfinding at each loading screen?

May be a bit farfetched, but I am just trying..

Renax
05-18-2006, 12:53 AM
not a big problem in my opinion but you should ask pplsuqbawlz if anything big arises he's your man on this subject.

depending on how much the color changes per loading screen just re-pick the color at the login and use tolerance, or you can just use a solid dtm/bmp/color tolerance each time.

the best way to get a good color is to take about 50 samples of a color and screen them together and get a perfect color and tolerance.

WT-Fakawi
05-18-2006, 01:17 AM
Our new engine will be based around the ...loading please wait... screen.

Renax
05-18-2006, 01:19 AM
i honestly believe that it should be fixed script side :rolleyes:

WhiteShadow
05-18-2006, 01:42 AM
sounds good! :). hopefully everything goes well. Im still trying to figure out the player switching thinggy so colors are one of my last worrys. lol.

Currently, because of the Runescape update, logging in doesn't work anymore. Learn PlayerArrays, a couple [..when we get a solution and totally fixing a bunch of stuff in SRL] later.

Cheesehunk
05-18-2006, 02:04 AM
Our new engine will be based around the ...loading please wait... screen.

Fakawi, please do not detect the screen by finding the text "Loading please wait" on the screen. I suggest that if it finds the color 0 on the minimap at anytime (the colour of the blackness that you see before you hit the loading screen,) this will be better detection for the Loading screen.

Just my suggestion..

Edit: Most colorfinding can be done using tolerances now, such as these two MapWalkers.

{************************************************* *****************************}

function RadialWalkTol(TheColor:Integer; Tol:Integer; StartRadial,EndRadial:Integer; Radius:Integer; Xmod,Ymod:integer): Boolean;// By Wizzup? and WT-Fakawi.

var i: Integer;
var X1,Y1: integer;
begin

Result:=False;

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 FindColorTolerance(X,Y,TheColor,X1,Y1,X1+1,Y1+1, Tol) then
begin
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result:=True;
FFlag(10);
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 FindColorTolerance(X,Y,TheColor,X1,Y1,X1+1,Y1+1,To l) then
begin
MouseFindNoFlag(X,Y,Xmod,Ymod);
Result:=True;
FFlag(10);
Exit;
end
end
Radius:=Radius-4;
until Radius<=1;
end
end;

{************************************************* *****************************}

function LinearWalkTol(TheColor : Integer; Tol : Integer; Direction : Integer; Radius : Integer; Xmod, Ymod : Integer) : Boolean;// By Wizzup? and WT-Fakawi.

var
i, StartRadial, EndRadial, InitRadius : Integer;
var
X1, Y1, Count : Integer;
begin

InitRadius := Radius;

repeat
StartRadial := 360 + Direction - Count;
EndRadial := 360 + Direction + Count;
repeat
for i := StartRadial to EndRadial do
begin
x1:=Round ( Radius * Sine[i]) + 646;
y1:=Round (- Radius * Cose[i]) + 84;
if FindColorTolerance(X, Y, TheColor, X1, Y1, X1 + 1, Y1 + 1, Tol) then
begin
MouseFindNoFlag(X, Y, Xmod, Ymod);
FFlag(10);
Result := True;
Exit;
end;
Wait(1);
end;
Radius := Radius - 4;
// UNBLANK THIS LINE TO UNDERSTAND THE WAY LINEARWALK WORKS
// writeln('1R = '+inttostr(Radius)+' SR ='+(inttostr(StartRadial-360))+' ER = '+(inttostr( EndRadial-360)));
for i := EndRadial downto StartRadial do
begin
x1:=Round ( Radius * Sine[i]) + 646;
y1:=Round (- Radius * Cose[i]) + 84;
if FindColorTolerance(X, Y, TheColor, X1, Y1, X1 + 1, Y1 + 1, Tol) then
begin
MouseFindNoFlag(X, Y, Xmod, Ymod);
FFlag(10);
Result := True;
Exit;
end;
Wait(1);
end;
Radius := Radius - 4;
// writeln('2R = '+inttostr(Radius)+' SR ='+inttostr( StartRadial)+' ER = '+inttostr( EndRadial));
until Radius <= 10;
Radius := InitRadius;
Count := Count + 2;
until ((StartRadial < 2) or (EndRadial > 720));

end;

{************************************************* *****************************}