WT-Fakawi
2006-09-27 10:58:13
Just to show you guys we are not pining for the fjords I quickly wrote a very crude new Compass routine, based on simple colorfinding of the compass needle. I am not sure whether it is a stable color, but this wont be a problem to implement ofcourse.
Please test this little script. It is far from done yet (No failsafes…) but it works on my machine!
More to come. Anyone that can enhance the newcompass or has a better idea, please, now is the time to be creative. We need your help.
Please test this little script. It is far from done yet (No failsafes…) but it works on my machine!
program NewCompass;
{.include SRL/SRL.scar}
Function NewCompass(Direction: string): boolean;
begin
Case lowercase(Direction) of
'n':
begin
repeat
KeyDown(VK_RIGHT);
wait(10+Random(10));
until FindColor(x,y,723587,567,14,567,14);
KeyUp(VK_RIGHT);
Result:=True;
end;
'e':
begin
repeat
KeyDown(VK_RIGHT);
wait(10+Random(10));
until FindColor(x,y,723587,572,21,572,21);
KeyUp(VK_RIGHT);
Result:=True;
end;
's':
begin
repeat
KeyDown(VK_RIGHT);
wait(10+Random(10));
until FindColor(x,y,723587,565,26,565,26);
KeyUp(VK_RIGHT);
Result:=True;
end;
'w':
begin
repeat
KeyDown(VK_RIGHT);
wait(10+Random(10));
until FindColor(x,y,723587,559,20,559,20);
KeyUp(VK_RIGHT);
Result:=True;
end;
end
end;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
SetupSRL;
//LoginPlayer;
MouseSpeed:=15;
Wait(1000);
If NewComPass('n') then writeln('North Found');
Wait(3000);
if NewComPass('e') then writeln('East Found');
Wait(3000);
if NewComPass('s') then writeln('South Found');
Wait(3000);
if NewComPass('w') then writeln('West Found');
end.More to come. Anyone that can enhance the newcompass or has a better idea, please, now is the time to be creative. We need your help.