maky369
2013-04-09 05:37:01
Hey everyone, thanks for all the help you've already given me. Hopefully, this will be the last thread I make here concerning this script.
Firstly, I've sort of got a basic script set up for my CutAndBurner, right here.
Unfortunately, I'm getting the following error.
Anyone can enlighten me? Also, if you have anything to say about the actual script, that would be helpful too - keep in mind i'm still very new to this. I am aware that one of my PixelShift commands isn't set up properly - I haven't found that yet.
Yes, I know there's not antiban, failsafes, 6 hour fix, random solver, but I'm going to add those later.
Firstly, I've sort of got a basic script set up for my CutAndBurner, right here.
program CutAndLight;
{$DEFINE SMART}
{$i srl/srl.simba}
Var
PBox: TBox;
Procedure Setup;
begin
SetAngle (SRL_ANGLE_HIGH);
MakeCompass ('N');
end;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Function InvEmpty: Boolean;
begin
Result:= FindColor (dx, dy, 2770782, 20, MIX1, MIY1, MIX2, MIY2);
end;
Function DetectCutting: Boolean; //Detects if you're cutting trees.
begin
PBox:= IntToBox(245, 130, 285, 195);
Result:= (AveragePixelShift (PBox, 250, 300) > 190);
end;
Function FireOnFloor: Boolean; //Checks if theres a fire under you.
var (FBox: TBox; fx, fy: integer);
begin
FBox:= IntToBox (250, 173, 272, 187);
Result:= FindObj (fx, fy, 2258409, 87, FBox);
end;
Function DetectBurning: Boolean; //Detects if you're burning logs.
begin
PBox:= IntToBox(245, 130, 285, 195);
Result:= (AveragePixelShift (PBox, 250, 300) > BurningPShift);
end;
Procedure CutAndBurnLogs;
var x, y: integer;
begin
Setup;
repeat
begin
repeat
if FindObj (x, y, ree, 1795912, 35, MSX1, MSY1, MSX2, MSY2) then
Mouse (x, y, 2, 2, true);
if DetectCutting then
Wait (300 + random(100));
until (InvFull);
end;
begin
repeat
if not DetectBurning and if not FireOnFloor then
begin
TypeByte (49);
if FindObj (x, y, 6316644, 1, MSX1, MSY1, MSX2, MSY2) then
Mouse (x, y, 2, 2, true);
end;
else
if DetectBurning and if not FireOnFloor then
Wait (200 + random (100));
else
if not DetectBurning and if FireOnFloor then
begin
If (FindColor (x, y, 2379333, 10, MMX1, MMY1, MMX2, MMY2)) then
Mouse (x, y, 0, 0, true;)
end;
until not (InvEmpty);
end;
until (false);
end;
begin
SetupSRL;
DeclarePlayers;
ActivateClient;
Repeat
if not LoggedIn then LoginPlayer;
CutAndBurnLogs;
until (false);
end.Unfortunately, I'm getting the following error.
[Error] C:\Users\Matt\Desktop\Cut and Light.simba(28:10): Duplicate identifier 'INVEMPTY' at line 27
Compiling failed.Anyone can enlighten me? Also, if you have anything to say about the actual script, that would be helpful too - keep in mind i'm still very new to this. I am aware that one of my PixelShift commands isn't set up properly - I haven't found that yet.
Yes, I know there's not antiban, failsafes, 6 hour fix, random solver, but I'm going to add those later.