Log in

View Full Version : Very little help needed.



spin3x
05-28-2012, 04:12 PM
As you lot know I'm new to this and I'm eager to learn how to code :)

I've posted quite a few threads which has really helped me learn.

I've got this script and I'm having a bit of problems.

[simba]
Program Thiev;
{$i SRL/srl.simba} // < you forgot to call this

function Thiev: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.32);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 10658737, MSX1, MSY1, MSX2, MSY2, 3);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
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 >= 30.97) and (X <= 35.82) and (Y >= 31.29) and (Y <= 36.17) and (Z >= 32.40) and (Z <= 37.45) 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;

procedure StealStall;
var x, y, Thiev: integer; (Error here)
begin
AutoColor := Thiev;
if FindObj(x, y,'teal', AutoColor, 35) then
begin
Mouse(x, y, 0, 0, true);
end;
end;
begin
StealStall;
end.program new;
begin
end.
[simba]

Error:

[Error] (49:11): Duplicate identifier 'Thiev' at line 48
Compiling failed.

And is that a finished script? Cause I tried running it before the error and it just did nothing :S It compiled successfully. The script is suppose to find the thieving stall and click on it.

Abu
05-28-2012, 04:23 PM
You can find the solution here (http://villavu.com/forum/showthread.php?t=82793)

spin3x
05-28-2012, 04:38 PM
Close this

Ty