I am trying to make a very simple chicken killer but I am getting this line
Simba Code:
[Hint] (82:10): Variable 'Result' never used at line 81
[Error] (119:1): 'BEGIN' expected at line 118
Compiling failed.
Here is the script itself.
Simba Code:
program ChickenKiller;
{.include/SRL/SRL.simba}
{.include SRL/SRL/Misc/SMART.simba}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}
const
SmartWorld = 15; // Which World/Server do you want to use?
SmartMembers = True; // Are you a Member?
SmartSigned = True; // Signed/UnSigned Client?
SmartSuperDetail = False; // Use Super Detail?
Version = '1.0';
NumbOfPlayers = 1;
StartPlayer = 0;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Active := True;
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
Procedure Antiban; //Antiban, Credits to YoHo
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False); //skill
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;
Function ChickenColor: Integer; //Credits to ACA
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 1.07);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 5480128, MMX1, MMY1, MMX2, MMY2, 25);
if (Length(arP) = 0) then
begin
Writeln('Failed to find chicken.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 8.79) and (X <= 69.31) and (Y >= 8.51) and (Y <= 74.97) and (Z >= 3.75) and (Z <= 44.55) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function KillChicken: Boolean;
var
x, y: Integer;
begin;
x:= MSCX;
y:= MSCY;
If FindObjTPA(x, y, ChickenColor, 3, 1, 12, 1, 1, ['attack']) Then
Begin
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
Wait(100+Random(100));
WaitOption('attack', 500);
End;
end;
Flag;
begin
DeclarePlayers;
Smart_Server := SmartWorld;
Smart_Members := SmartMembers;
Smart_Signed := SmartSigned;
Smart_SuperDetail := SmartSuperDetail;
SetupSRL;
If not (LoggedIn) then
LoginPlayer;
ChickenColor;
Repeat
KillChicken;
Until (False);
end;
end;
end;
Any help and or constructive criticism is appreciated.
Okay, I got it working. Now, what is a better way to find a chicken? I'm using aca and I couldn't find a great color so it's kinda clicking all over the place