Results 1 to 4 of 4

Thread: help with if-then else statement

  1. #1
    Join Date
    May 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default help with if-then else statement

    [SCAR]program New;

    var
    x,y,x1,y1: Integer;

    const
    logcolor = 1853263;

    procedure findlog;
    begin
    x:= 708;
    y:= 446;
    x1:=666
    y1:=54
    MoveMouse(x,y);
    wait(1000)
    if FindColor(x,y,logcolor,683,433,728,459):True; then
    MoveMouse(x1,y1);
    ClickMouse(x1,y1,true);
    end;

    begin
    findlog;
    end.SCAR]

    and i got:
    Line 17: [Error] (17:43): 'THEN' expected in script
    can any1 explain?

  2. #2
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if FindColor(x,y,logcolor,683,433,728,459):True; then
    SCAR Code:
    if FindColor(x,y,logcolor,683,433,728,459):True then

    you had to remove the '';''

  3. #3
    Join Date
    May 2007
    Location
    Netherlands, Amersfoort
    Posts
    2,701
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if FindColor(x,y,logcolor,683,433,728,459) then
    begin
      WriteLn('found your color!');
      Status('color found.');
    end
    else
    begin
      WriteLn('not found your color!');
      Status('color not found.');
    end;

    this will tell you how to correct use the boolean and the 'else' function.

  4. #4
    Join Date
    May 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ty
    so if i was tryign to make it check to see if the color is there, if its then i want it to move to a certain location, bu if false i want it to go back to the previous task

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What is wrong here? (if- statement)
    By marpis in forum C/C++ Help and Tutorials
    Replies: 3
    Last Post: 12-06-2008, 01:26 AM
  2. WT-Fakawi statement on KYAB
    By WT-Fakawi in forum News and General
    Replies: 83
    Last Post: 06-23-2007, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •