Results 1 to 4 of 4

Thread: whats wrong?

  1. #1
    Join Date
    Jun 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default whats wrong?

    well i just started having a go with this today..

    Code:
    program DTClicker;
    
    var
    c,x,y: Integer;
    
    begin
    c:= 0;
    x:=640;
    y:=470;
    repeat
    if(FindColor(580,460,144164,0,0,100,18)) then
       Begin
        MoveMouseSmooth(x+random(10),y +random(6));
        Wait(50+random(50));
        ClickMouse(x,y,true);
        c:=c+1;
        Wait(50);
        SendKeys('2');
        end else
      Begin
      Writeln('did not find the button.');
      end;
     until (c >=350);
    end.
    when i compile it, it says variable expected at line 12

    its meant to click in a set area and then press 2

  2. #2
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    FindColor(580,460,144164,0,0,100,18)
    You filled the parameters incorrectly.
    function FindColor(var x, y: Integer; color, xs, ys, xe, ye: Integer): Boolean;
    Find color in box specified by xs, ys, xe, ye starting from left to right. Returns True if color found, the coordinates of the color if found is put in x,y.
    Try:
    SCAR Code:
    FindColor(x, y, 144164, 0, 0, 100, 18)

    OFFTOPIC:
    Edit: Darn you Ramage

  3. #3
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    if(FindColor(580,460,144164,0,0,100,18)) then

    Should be something like:

    SCAR Code:
    if(FindColor(Variable, Variable,144164,0,0,100,18)) then

    The variables are what you store the coordinates the color was found, in.

    Edit: Darn you Ramage

  4. #4
    Join Date
    Jun 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thx for the help... bit weird that x and y have to be vcariables though

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [PHP] whats wrong with this.
    By XcanadamanX in forum General
    Replies: 14
    Last Post: 01-21-2008, 11:40 PM
  2. Whats Wrong???
    By bilbobaggins in forum OSR Help
    Replies: 12
    Last Post: 04-10-2007, 10:05 AM
  3. Replies: 8
    Last Post: 03-23-2007, 04:20 PM
  4. Can someone tell me whats wrong with this?
    By Hey321 in forum OSR Help
    Replies: 5
    Last Post: 12-17-2006, 09:49 PM

Posting Permissions

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