So I'm writing a very basic defend your castle script (remember that game where you fling stick people in the air), I got everything working like a charm with the code like this:
program CastleDefence;
procedure clickok;
var
q, w, e, t: integer;
begin
if FindColorSpiralTolerance(q, w, 10066329, 910, 650, 1015, 711, 0) then
begin
MoveMouse(q, w);
ClickMouse(q, w, 1);
end;
wait(2000);
if FindColorSpiralTolerance(e, t, 10066329, 1175, 680, 1280, 730, 0) then
begin;
MoveMouse(e, t);
ClickMouse(e, t, 1);
end;
end;
procedure Protect;
var
x, y, r: integer;
begin
if FindColorSpiralTolerance(x, y, 13421772, 280, 500, 880, 700, 0) and
FindColorSpiralTolerance(x, r, 0, 280, 500, 880, 700, 0) then
begin
MoveMouse(x, y);
HoldMouse(x,y,1);
MoveMouse(1100,10);
wait(10);
ReleaseMouse(1100,10,1);
end;
end;
var
q, w, e, t: integer;
begin
repeat
Protect;
until FindColorSpiralTolerance(q, w, 10066329, 910, 650, 1015, 711, 0) or
FindColorSpiralTolerance(e, t, 10066329, 1175, 680, 1280, 730, 0)
end.
Yet whenever I change my protect procedure to add more enemies, making it this:
procedure Protect;
var
x, y, r, g, h: integer;
begin
if FindColorSpiralTolerance(g, h, 6710886, 280, 500, 880, 700, 0) then
begin
MoveMouse(g, h)
ClickMouse(g, h, 1)
end
if FindColorSpiralTolerance(x, y, 13421772, 280, 500, 880, 700, 0) and
FindColorSpiralTolerance(x, r, 0, 280, 500, 880, 700, 0) then
begin
MoveMouse(x, y);
HoldMouse(x,y,1);
MoveMouse(1100,10);
wait(10);
ReleaseMouse(1100,10,1);
end;
end;
It says this [Error] C:\Simba\Scripts\Castledefence1.simba(28:5): Semicolon (';') expected at line 27. This even happens if I add a semicolon to the end of line 27: the line that says "if FindColorSpiralTolerance(x, y, 13421772, 280, 500, 880, 700, 0) and"
What did I do wrong? Sorry for being a noob. I probably posted this script wrong too, I'll fix it if I did.


Reply With Quote


