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]
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]