SCAR Code:
program New;
{.include SRL\SRL.scar}
var
x,y,tx,ty,i,a,food1color,food2color:integer;
Minotaur: array [0..3] of integer;
Note: array [0..3] of integer;
var p: array of Tpoint;
const
eathp = 10;
Procedure DeclarePlayers;
Begin
NumberOfPlayers( 1 ); // DO NOT TOUCH!
CurrentPlayer :=( 0 ); // DO NOT TOUCH!
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
End;
procedure setupcolors;
begin
Minotaur[0]:= 8753039;
Minotaur[1]:= 2171172;
Minotaur[2]:= 1579034;
Minotaur[3]:= 5460826;
Note[0]:= 7115681;
Note[1]:= 8103864;
Note[2]:= 7510697;
Note[3]:= 7708334;
food1color:= 1666249;
food2color:= 1400499;
end;
function FindMinotaur:boolean;
var l,m,TestColor,red,green,blue,ClickColor:integer;
begin
Wait(50);
Status('Finding Minotaur');
l:=GetArrayLength(Minotaur);
if l>0 then
begin
for i:= 0 to l-1 do
begin
FindColorsSpiralTolerance(tx,ty,p,Minotaur[i],MSX1,MSY1,MSX2,MSY2,0);
m:=GetArrayLength(p);
if m>0 then
begin
for a:= 0 to m-1 do
begin
if findcolortolerance(tx,ty,Minotaur[a],MSX1,MSY1,MSX2,MSY2,0)then
begin
MMouse(tx,ty,0,0);
if isuptext('ttack Minotaur')then
begin
GetmousePos(x,y);
result:=true;
if i>0 then
begin
m:=Minotaur[i-1];
Minotaur[i-1]:= Minotaur[i];
Minotaur[i]:= m;
end;
exit;
end;
end;
end;
end;
end;
end;
FindColorsSpiralTolerance(tx,ty,p,10266792,MSX1,MSY1,MSX2,MSY2,25);
l:=GetArrayLength(p);
if l>0 then
begin
for i:= 0 to l-1 do
begin
TestColor:=GetColor(p[i].x,p[i].y); //Additional autocoloring to reduce wrong points. (Optional)
red:=(TestColor mod 256);
green:=((TestColor/256) mod 256);
blue:=((TestColor/256) / 256);
if ((green-blue)<=46) then if ((green-blue)>=24) then
if ((red-green)>=26) then if ((red-green)<=51) then
if ((red-blue)>55) then if ((red-blue)<=94) then
begin
Wait(20);
ClickColor:=GetColor(p[i].x,p[i].y);
MMouse(p[i].x,p[i].y,1,1);
if isuptext('ttack')then
begin
GetMousePos(x,y);
result:=true;
FindColorsSpiralTolerance(x,y,p,ClickColor,MSX1,MSY1,MSX2,MSY2,0);
if GetArrayLength(p)<20 then //Make sure that the color is somewhat rare, and doesn't take up half the screen
begin
a:=GetArrayLength(Minotaur);
for i:= 0 to a-1 do
begin
if ClickColor=Minotaur[i] then //If color is already in the array...
begin
if i>0 then
begin // Move it up one spot in the array search priority
m:=Minotaur[i-1];
Minotaur[i-1]:=Minotaur[i];
Minotaur[i]:=m;
end;
exit;
end;
end;
// if it's not in the array yet, then add it to the end of the array
SetArrayLength(Minotaur,a+1);
Minotaur[a]:=ClickColor;
Writeln(IntToStr(ClickColor)+' added to Minotaur Color array');
end;
exit;
end;
end;
end;
end;
end;
function FindNote:boolean;
var l,m,TestColor,red,green,blue,ClickColor:integer;
begin
Wait(50);
Status('Finding Note');
l:=GetArrayLength(Note);
if l>0 then
begin
for i:= 0 to l-1 do
begin
FindColorsSpiralTolerance(tx,ty,p,Note[i],MSX1,MSY1,MSX2,MSY2,0);
m:=GetArrayLength(p);
if m>0 then
begin
for a:= 0 to m-1 do
begin
if findcolortolerance(tx,ty,Note[a],MSX1,MSY1,MSX2,MSY2,0)then
begin
MMouse(tx,ty,0,0);
if isuptext('ake')then
begin
GetmousePos(x,y);
result:=true;
if i>0 then
begin
m:=Note[i-1];
Note[i-1]:= Note[i];
Note[i]:= m;
end;
exit;
end;
end;
end;
end;
end;
end;
FindColorsSpiralTolerance(tx,ty,p,7510697,MSX1,MSY1,MSX2,MSY2,25);
l:=GetArrayLength(p);
if l>0 then
begin
for i:= 0 to l-1 do
begin
TestColor:=GetColor(p[i].x,p[i].y); //Additional autocoloring to reduce wrong points. (Optional)
red:=(TestColor mod 256);
green:=((TestColor/256) mod 256);
blue:=((TestColor/256) / 256);
if ((green-blue)<=46) then if ((green-blue)>=24) then
if ((red-green)>=26) then if ((red-green)<=51) then
if ((red-blue)>55) then if ((red-blue)<=94) then
begin
Wait(20);
ClickColor:=GetColor(p[i].x,p[i].y);
MMouse(p[i].x,p[i].y,1,1);
if isuptext('ake')then
begin
GetMousePos(x,y);
result:=true;
FindColorsSpiralTolerance(x,y,p,ClickColor,MSX1,MSY1,MSX2,MSY2,0);
if GetArrayLength(p)<20 then //Make sure that the color is somewhat rare, and doesn't take up half the screen
begin
a:=GetArrayLength(Note);
for i:= 0 to a-1 do
begin
if ClickColor=Note[i] then //If color is already in the array...
begin
if i>0 then
begin // Move it up one spot in the array search priority
m:= Note[i-1];
Note[i-1]:= Note[i];
Note[i]:= m;
end;
exit;
end;
end;
// if it's not in the array yet, then add it to the end of the array
SetArrayLength(Note,a+1);
Note[a]:=ClickColor;
Writeln(IntToStr(ClickColor)+' added to Note Color array');
end;
exit;
end;
end;
end;
end;
end;
procedure fight;
begin
if not(LoggedIn)then exit;
if not(FindFight)then
begin
if FindMinotaur then
begin
Mouse(x,y,0,0,True);
FFlag(0);
end;
end;
end;
procedure pickup;
begin
if not(LoggedIn)then exit;
if not(FindFight)then
begin
if FindNote then
begin
Mouse(x,y,0,0,True);
FFlag(0);
end;
end;
end;
procedure eat;
var ate:boolean;
begin
while FindFight do
begin
if not(LoggedIn)then exit;
GameTab(2);
if (GetHp <= EatHp)then
begin
GameTab(4);
Wait(10 + Random(20));
if (FindColorTolerance(x,y,food1color,MIX1,MIY1,MIX2,MIY2,10)) or
(FindColorTolerance(x,y,food2color,MIX1,MIY1,MIX2,MIY2,10)) then
begin
MMouse(x,y,0,0);
if (IsUpText('Eat')) then
begin
GetMousePos(x, y);
Mouse(x, y, 3, 2, True);
//AutoResponder;
ate:=true;
end;
end;
if not ate then
begin
logout;
writeln('Ran out of food...')
terminatescript;
end;
end;
end;
end;
begin
setupsrl;
setupcolors;
DeclarePlayers;
LoginPlayer;
repeat
fight;
pickup;
Eat;
until(false);
end.