Results 1 to 8 of 8

Thread: Comma expected?

  1. #1
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default Comma expected?

    SCAR Code:
    begin
        DTM := LoadDTM('ubow');//both these are integers
        DTM2 := LoadDTM('bs');
        if finddtm(dtm,x,y,mix1,miy1,mix2,miy2) then
        begin
          case random(3) of
            0,1:
              begin
                Mouse(x,y,4,4,true);
                waitFunc(@ItemClicked(x,y),10+random(15), 500);//HERE
                  writeln('Waited for the first item');
              end;
            2:
              begin
                mouse(x,y,4,4,false);
                waitOption('se', 500);
              end;
          end;
        if finddtm(dtm2,tx,ty,mix1,miy1,mix2,miy2) then
        begin
          case random(3) of
            0,1:
              begin
                Mouse(tx,ty,4,4,true);
                waitFunc(@ItemClicked(tx,ty),10+random(15), 500);''hERE
              end;
            2:
              begin
                mouse(tx,ty,4,4,false);
                waitOption('se', 500);
              end;
           end;
        end;
      end;
    end;

    and item clicked is

    SCAR Code:
    Function ItemClicked(cx,cy:integer): boolean;
    var D:integer;
    begin
      D := CoordsToItem(cx,cy);
      Result := ItemActivated(D);
    end;

    NO clue what this could be

  2. #2
    Join Date
    Apr 2007
    Location
    Melbourne, Aus
    Posts
    202
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    waitFunc(@ItemClicked(tx,ty),10+random(15), 500);''hERE
    change the '' at the end to //

  3. #3
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by jimmy_mac View Post
    SCAR Code:
    waitFunc(@ItemClicked(tx,ty),10+random(15), 500);''hERE
    change the '' at the end to //
    That was just a typo when putting it on here. Theres still an error, any ideas?

  4. #4
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    case statements need an end to.. So at least your code-spacing is wrong.

    And!! You cannot address a function with parameters... What I mean is @Func(x) is wrong; the @<func> has to be a procedure without parameters.
    Last edited by mastaraymond; 01-10-2010 at 06:04 PM.
    Verrekte Koekwous

  5. #5
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wtf is WaitFunc

  6. #6
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    case statements need an end to.. So at least your code-spacing is wrong.

    And!! You cannot address a function with parameters... What I mean is @Func(x) is wrong; the @<func> has to be a procedure without parameters.
    orly ... Thats the problem.. thanks...

    You have a idea how i can make that function without parameters?

    WaitFunc is in srl, it waits until func is true..

  7. #7
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    can't you just take out wait function then and use a loop until the function is true? that way you can still use your parameters

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    waitFunc(@ItemClicked(tx,ty),10+random(15), 500)

    Would have to be changed, or something similar to:

    SCAR Code:
    T := GetSystemTime;
    While Not ItemClicked(tx,ty) Do
    Repeat
      Wait(10 + Random(15));
    Until((GetSystemTime - T) > 500);

    EDIT: You cant use parameters when using pointer in WaitFunc, however if you're really willing you could read up on ThreadSafeCall (Which accepts that method).
    Last edited by Naum; 01-10-2010 at 07:31 PM. Reason: OOOps, wrote wrong stuff :/

Thread Information

Users Browsing this Thread

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

Posting Permissions

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