Jump to content
Eleflump

Identifier expected

Recommended Posts

ok so i it doesnt except else or end else commands, this is my script

 

program New;

var

x, y: Integer;

begin

if findcolor(x, y, 16777214, 115, 285, 215, 285)then;

begin

writeLn('found it :D')

movemousesmooth(972, 387);

clickmouse(972, 387, true);

end else

begin

writeLn('couldnt find it, trying again');

if findcolor(x, y, 16777215, 115, 285, 215, 285)then;

WriteLn('found it');

movemousesmooth(30, 1016);

end;

Link to comment
Share on other sites

U should properly indent your script:

program New;
var
 x, y: Integer;
begin
 if FindColor(x, y, 16777214, 115, 285, 215, 285) then
 begin
   WriteLn('found it ')
   MoveMouseSmooth(972, 387);
   ClickMouse(972, 387, true);
 end else
 begin
   WriteLn('couldnt find it, trying again');
   if FindColor(x, y, 16777215, 115, 285, 215, 285) then
   begin
     WriteLn('found it');
     MoveMouseSmooth(30, 1016);
   end;
 end;
end.

Link to comment
Share on other sites

Am I reading this right? You are checking for a color in one spot, then ignoring the location it was found in, and specifying the location to click at?

 

Freddy's version compiles just fine. In fixing up your indenting he fixed another error along the way. You don't put a ; after the then statement. The compiler doesn't like it.

if findcolor(x, y, 16777214, 115, 285, 215, 285)then;

 

I highly recommend you get into the habit of indenting your code. Once a script gets beyond a few lines it becomes a nightmare to maintain if you don't.

Link to comment
Share on other sites

Am I reading this right? You are checking for a color in one spot, then ignoring the location it was found in, and specifying the location to click at?

 

Freddy's version compiles just fine. In fixing up your indenting he fixed another error along the way. You don't put a ; after the then statement. The compiler doesn't like it.

 

I highly recommend you get into the habit of indenting your code. Once a script gets beyond a few lines it becomes a nightmare to maintain if you don't.

 

Wasn't just that... There's also "end." missing. I figured the "MoveMouseSmooth(30, 1016);" probably belonged inside of the last if statement.

Link to comment
Share on other sites

Sounds like this:

program New;
var
 x, y: Integer;
begin
 if FindColor(x, y, 16777214, 115, 285, 215, 285) then
 begin
   WriteLn('found it ')
   MoveMouseSmooth(x, y);
   ClickMouse(x, y, true);
 end else
 begin
   WriteLn('couldnt find it, trying again');
   if FindColor(x, y, 16777215, 115, 285, 215, 285) then
   begin
     WriteLn('found it');
     MoveMouseSmooth(x, y);
     ClickMouse(x, y, true);
   end;
 end;
end.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...