Hey I'm trying to make a chicken killer and got it work , but theres a few problems: it keeps clicking chickens even if its in a fight and the mouse aint accurate it clicks other objects like ground and farmers sometimes, could any1 help me with these?
heres the script:
SCAR Code:
program ChickenTest;
{.include srl/srl.scar}
var
MCX, MCY: Integer;
const
TimeToWaitChicken = 2000;
RdClr = 857971;
BrwnClr = 2309199;
PlayerName ='---';
PassWord ='---';
NickName ='---';
PlayerName1 ='---';
PassWord1 ='---';
NickName1 ='---';
procedure declareplayers;
begin
HowManyPlayers :=2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;
Players[0].Name :=(PlayerName);
Players[0].Pass :=(PassWord);
Players[0].Nick :=(NickName);
Players[0].Active:=True;
Players[1].Name :=(PlayerName1);
Players[1].Pass :=(PassWord1);
Players[1].Nick :=(NickName1);
Players[1].Active:=True;
end;
Procedure FightChicken;
begin
if(FindColorSpiral(MCX,MCY, RdClr, MSX1,MSY1,MSX2,MSY2))or
(FindColorSpiral(MCX, MCY, BrwnClr, MSX1-10, Msy1+10, MSX2+10, MCY2-10))then
begin
MMouse(MCX, MCY, 3, 3);
Wait(20+random(10));
end;
if(IsUpText('cken'))then
begin
Wait(5+random(30));
Mouse(MCX, MCY, 2, 2, true)
Wait(TimeToWaitChicken+random(100));
end;
end;
begin
SetupSRL;
DeclarePlayers;
Repeat
FightChicken;
until(False)
end.
end.