SRL Archive - Test corner

loading screen detector and color updater - need's further testing :)


solemn wishes

2006-05-23 11:58:25

hi,

well i know that some of you are having trouble with your script's or atleasts the ones that encounter loading screens. I took this into affect and thought of a way to update these color's so that the script will not stop working due to a color loss e.g roadcolor.

If you do want to test it just put a color in and a max tol then run it when your in a loading screen. From my testing it has proved that 3/5 of the time the colors on the minimap do change and the script is able to get the new color around 100% of the time.

If you want to inplement this into your script i would advise making the "Cresult" var a global.



[PHP]program resetloadcolors;
{.include SRL/SRL.scar}

{*******************************************************************************
function resetloadcolors(color : integer; maxtol : integer):boolean;
By: Solemn Wishes
Description: uses the inputted color before a loading screen to determine its
posistion on the Mini-Map and directly after laoading results the
new *updated* color.
*******************************************************************************}
function resetloadcolors(color : integer; maxtol : integer):boolean;
var tol ,x1, y1 : integer;
c, b , Cresult : integer;
begin
if(findcolorspiral(x , y, 0 ,185, 125, 385, 230)and
findcolorspiral(x , y, 16777215 ,185, 125, 385, 230))then
begin
result:= true;
end;
if result then
begin;
repeat
if(findcolorspiraltolerance(x1, y1, color, mmx1, mmy1, mmx2, mmy2, tol))then
begin
c:= x1;
b:= y1;
result:= true;
end;
if not result then
tol:= tol+1;
wait(10)
until result or (tol=maxtol)
repeat
wait(25+random(25))
until(not(findcolorspiral(x , y, 0 ,185, 125, 385, 230)and
not(findcolorspiral(x , y, 16777215 ,185, 125, 385, 230))))
end;
Cresult:= getcolor(c,b)
writeln('resulting color is: '+IntToStr(Cresult))
end;


begin

resetloadcolors(color, maxtol);
end.[/PHP]

leader

2006-05-23 12:39:45

Will test it when I get home.

shaunthasheep

2006-05-24 21:22:52

i dont no about this idea, and i think the text would be to small and screw up the bitmap, but what if u had like a bitmap mask of the Loading… thingy.:cool: and had find bitmap.

solemn wishes

2006-05-25 03:20:36

im not using a bitmap because the 2 main colors on the loading screen font are white and black, these will not be reconised by scar withing a bitmap, a mask may work but simply identifying the 2 colors of the screen seem's fine to me.