Results 1 to 10 of 10

Thread: Syntax error?

  1. #1
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Exclamation Syntax error?

    My DDTMWalk function, ive looked through it, ive done everything that i can do, but it keeps comming up when i try to run my script
    SCAR Code:
    Failed when compiling
    Line 127: [Error] (27669:1): Syntax error in script C:\Program Files\SCAR 3.21\Scripts\my catherby woodcutter v1.1.scar
    here is the function:
    SCAR Code:
    function DDTMWalk(BankWalkNumber: Integer): Integer; //<--this is where the syntax error is called
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..4] of TDTMPointDef;
      TempTDTM: TDTM;

    case BankWalkNumber of
      1: begin
           dtmMainPoint.x := 938;
           dtmMainPoint.y := 269;
           dtmMainPoint.AreaSize := 5;
           dtmMainPoint.AreaShape := 0;
           dtmMainPoint.Color := FindDDTMColor(1);
           dtmMainPoint.Tolerance := 10;

           dtmSubPoints[0].x := 938;
           dtmSubPoints[0].y := 269;
           dtmSubPoints[0].AreaSize := 5;
           dtmSubPoints[0].AreaShape := 0;
           dtmSubPoints[0].Color := FindDDTMColor(1);
           dtmSubPoints[0].Tolerance := 10;

           dtmSubPoints[1].x := 939;
           dtmSubPoints[1].y := 268;
           dtmSubPoints[1].AreaSize := 0;
           dtmSubPoints[1].AreaShape := 0;
           dtmSubPoints[1].Color := FindDDTMColor(1);
           dtmSubPoints[1].Tolerance := 0;

           dtmSubPoints[2].x := 937;
           dtmSubPoints[2].y := 269;
           dtmSubPoints[2].AreaSize := 0;
           dtmSubPoints[2].AreaShape := 0;
           dtmSubPoints[2].Color := FindDDTMColor(1);
           dtmSubPoints[2].Tolerance := 0;

           dtmSubPoints[3].x := 938;
           dtmSubPoints[3].y := 270;
           dtmSubPoints[3].AreaSize := 0;
           dtmSubPoints[3].AreaShape := 0;
           dtmSubPoints[3].Color := FindDDTMColor(1);
           dtmSubPoints[3].Tolerance := 0;

           TempTDTM.MainPoint := dtmMainPoint;
           TempTDTM.SubPoints := dtmSubPoints;
           Result := AddDTM(TempTDTM);
         end;
      2: begin
           dtmMainPoint.x := 924;
           dtmMainPoint.y := 223;
           dtmMainPoint.AreaSize := 8;
           dtmMainPoint.AreaShape := 0;
           dtmMainPoint.Color := FindDDTMColor(2);
           dtmMainPoint.Tolerance := 10;

           dtmSubPoints[0].x := 924;
           dtmSubPoints[0].y := 223;
           dtmSubPoints[0].AreaSize := 8;
           dtmSubPoints[0].AreaShape := 0;
           dtmSubPoints[0].Color := FindDDTMColor(2);
           dtmSubPoints[0].Tolerance := 10;

           dtmSubPoints[1].x := 924;
           dtmSubPoints[1].y := 220;
           dtmSubPoints[1].AreaSize := 0;
           dtmSubPoints[1].AreaShape := 0;
           dtmSubPoints[1].Color := FindDDTMColor(2);
           dtmSubPoints[1].Tolerance := 0;

           dtmSubPoints[2].x := 928;
           dtmSubPoints[2].y := 225;
           dtmSubPoints[2].AreaSize := 0;
           dtmSubPoints[2].AreaShape := 0;
           dtmSubPoints[2].Color := FindDDTMColor(2);
           dtmSubPoints[2].Tolerance := 0;

           dtmSubPoints[3].x := 922;
           dtmSubPoints[3].y := 224;
           dtmSubPoints[3].AreaSize := 0;
           dtmSubPoints[3].AreaShape := 0;
           dtmSubPoints[3].Color := FindDDTMColor(2);
           dtmSubPoints[3].Tolerance := 0;

           TempTDTM.MainPoint := dtmMainPoint;
           TempTDTM.SubPoints := dtmSubPoints;
           Result := AddDTM(TempTDTM);
         end;
      3: begin
           dtmMainPoint.x := 904;
           dtmMainPoint.y := 324;
           dtmMainPoint.AreaSize := 11;
           dtmMainPoint.AreaShape := 0;
           dtmMainPoint.Color := FindDDTMColor(3);
           dtmMainPoint.Tolerance := 10;

           dtmSubPoints[0].x := 904;
           dtmSubPoints[0].y := 324;
           dtmSubPoints[0].AreaSize := 11;
           dtmSubPoints[0].AreaShape := 0;
           dtmSubPoints[0].Color := FindDDTMColor(3);
           dtmSubPoints[0].Tolerance := 10;

           dtmSubPoints[1].x := 910;
           dtmSubPoints[1].y := 322;
           dtmSubPoints[1].AreaSize := 0;
           dtmSubPoints[1].AreaShape := 0;
           dtmSubPoints[1].Color := FindDDTMColor(3);
           dtmSubPoints[1].Tolerance := 0;

           dtmSubPoints[2].x := 905;
           dtmSubPoints[2].y := 326;
           dtmSubPoints[2].AreaSize := 0;
           dtmSubPoints[2].AreaShape := 0;
           dtmSubPoints[2].Color := FindDDTMColor(3);
           dtmSubPoints[2].Tolerance := 0;

           dtmSubPoints[3].x := 903;
           dtmSubPoints[3].y := 321;
           dtmSubPoints[3].AreaSize := 0;
           dtmSubPoints[3].AreaShape := 0;
           dtmSubPoints[3].Color := FindDDTMColor(3);
           dtmSubPoints[3].Tolerance := 0;

           TempTDTM.MainPoint := dtmMainPoint;
           TempTDTM.SubPoints := dtmSubPoints;
           Result := AddDTM(TempTDTM);
         end;
      4: begin
           dtmMainPoint.x := 916;
           dtmMainPoint.y := 276;
           dtmMainPoint.AreaSize := 6;
           dtmMainPoint.AreaShape := 0;
           dtmMainPoint.Color := FindDDTMColor(4);
           dtmMainPoint.Tolerance := 10;

           dtmSubPoints[0].x := 916;
           dtmSubPoints[0].y := 276;
           dtmSubPoints[0].AreaSize := 6;
           dtmSubPoints[0].AreaShape := 0;
           dtmSubPoints[0].Color := FindDDTMColor(4);
           dtmSubPoints[0].Tolerance := 10;

           dtmSubPoints[1].x := 912;
           dtmSubPoints[1].y := 275;
           dtmSubPoints[1].AreaSize := 0;
           dtmSubPoints[1].AreaShape := 0;
           dtmSubPoints[1].Color := FindDDTMColor(4);
           dtmSubPoints[1].Tolerance := 0;

           dtmSubPoints[2].x := 918;
           dtmSubPoints[2].y := 276;
           dtmSubPoints[2].AreaSize := 0;
           dtmSubPoints[2].AreaShape := 0;
           dtmSubPoints[2].Color := FindDDTMColor(4);
           dtmSubPoints[2].Tolerance := 0;

           dtmSubPoints[3].x := 915;
           dtmSubPoints[3].y := 278;
           dtmSubPoints[3].AreaSize := 0;
           dtmSubPoints[3].AreaShape := 0;
           dtmSubPoints[3].Color := FindDDTMColor(4);
           dtmSubPoints[3].Tolerance := 0;

           TempTDTM.MainPoint := dtmMainPoint;
           TempTDTM.SubPoints := dtmSubPoints;
           Result := AddDTM(TempTDTM);
         end;
      5: begin
           dtmMainPoint.x := 924;
           dtmMainPoint.y := 232;
           dtmMainPoint.AreaSize := 10;
           dtmMainPoint.AreaShape := 0;
           dtmMainPoint.Color := FindDDTMColor(5);
           dtmMainPoint.Tolerance := 10;

           dtmSubPoints[0].x := 924;
           dtmSubPoints[0].y := 232;
           dtmSubPoints[0].AreaSize := 10;
           dtmSubPoints[0].AreaShape := 0;
           dtmSubPoints[0].Color := FindDDTMColor(5);
           dtmSubPoints[0].Tolerance := 10;

           dtmSubPoints[1].x := 927;
           dtmSubPoints[1].y := 234;
           dtmSubPoints[1].AreaSize := 0;
           dtmSubPoints[1].AreaShape := 0;
           dtmSubPoints[1].Color := FindDDTMColor(5);
           dtmSubPoints[1].Tolerance := 0;

           dtmSubPoints[2].x := 929;
           dtmSubPoints[2].y := 231;
           dtmSubPoints[2].AreaSize := 0;
           dtmSubPoints[2].AreaShape := 0;
           dtmSubPoints[2].Color := FindDDTMColor(5);
           dtmSubPoints[2].Tolerance := 0;

           dtmSubPoints[3].x := 928;
           dtmSubPoints[3].y := 228;
           dtmSubPoints[3].AreaSize := 0;
           dtmSubPoints[3].AreaShape := 0;
           dtmSubPoints[3].Color := FindDDTMColor(5);
           dtmSubPoints[3].Tolerance := 0;

           TempTDTM.MainPoint := dtmMainPoint;
           TempTDTM.SubPoints := dtmSubPoints;
           Result := AddDTM(TempTDTM);
         end;
       end;
    Last edited by Bionicle; 09-11-2009 at 09:41 AM.
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  2. #2
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ive just had a thought, it could also be in my FindDDTMColor function aswell, so here it is:

    SCAR Code:
    function FindDDTMColor(FindTheDDTMColor: Integer): Integer;
    var
      TPA: TPointArray;
      I, Col: Integer;

    begin
      case FindTheDDTMColor of
        1: begin
             if FindColorsTolerance(TPA, 2654058, MMX1, MMY1, MMX2, MMY2, 10) then
             begin
               Col := GetColor(TPA[I].X, TPA[I].Y);
               Result:= Col;
             end;
           end;
        2: begin
             if FindColorsTolerance(TPA, 7236721, MMX1, MMY1, MMX2, MMY2, 10) then
             begin
               Col := GetColor(TPA[I].X, TPA[I].Y);
               Result:= Col;
             end;
           end;
        3: begin
             if FindColorsTolerance(TPA, 2917252, MMX1, MMY1, MMX2, MMY2, 10) then
             begin
               Col := GetColor(TPA[I].X, TPA[I].Y);
               Result:= Col;
             end;
           end;
        4: begin
             if FindColorsTolerance(TPA, 2449517, MMX1, MMY1, MMX2, MMY2, 10) then
             begin
               Col := GetColor(TPA[I].X, TPA[I].Y);
               Result:= Col;
             end;
           end;
        5: begin
             if FindColorsTolerance(TPA, 7764087, MMX1, MMY1, MMX2, MMY2, 10) then
             begin
               Col := GetColor(TPA[I].X, TPA[I].Y);
               Result:= Col;
             end;
           end;
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I bet you're missing a begin/end or something on the lines of code before that function.

    Please post some more code please if you still can't find it

  4. #4
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Well, the second function you posted, you are missing 2 ends. Not sure if you just forgot to copy that part, or you've actually left them out. You also don't need all the begin..end nests you for each case.

    SCAR Code:
    function FindDDTMColor(FindTheDDTMColor: Integer): Integer;
    var
      TPA: TPointArray;
      I, Col: Integer;

    begin
      case FindTheDDTMColor of
     
        1: if FindColorsTolerance(TPA, 2654058, MMX1, MMY1, MMX2, MMY2, 10) then
           begin
             Col := GetColor(TPA[i].X, TPA[i].Y);
             Result:= Col;
           end;
           
        2: if FindColorsTolerance(TPA, 7236721, MMX1, MMY1, MMX2, MMY2, 10) then
           begin
             Col := GetColor(TPA[i].X, TPA[i].Y);
             Result:= Col;
           end;

        3: if FindColorsTolerance(TPA, 2917252, MMX1, MMY1, MMX2, MMY2, 10) then
           begin
             Col := GetColor(TPA[i].X, TPA[i].Y);
             Result:= Col;
           end;

        4: if FindColorsTolerance(TPA, 2449517, MMX1, MMY1, MMX2, MMY2, 10) then
           begin
             Col := GetColor(TPA[i].X, TPA[i].Y);
             Result:= Col;
           end;

        5: if FindColorsTolerance(TPA, 7764087, MMX1, MMY1, MMX2, MMY2, 10) then
           begin
             Col := GetColor(TPA[i].X, TPA[i].Y);
             Result:= Col;
           end;

      end; // Here.
    end; // And here.
    If that doesn't fix it, posting your whole script will help us out a lot.

  5. #5
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kk, i got that fixed, ty Coh3n, it worked
    i got a few more, and fixed em, but one poped up that i have no idea how to fix, its another syntax error.

    SCAR Code:
    procedure WalkToBank;
    begin
      begin
        ClearDebug;
        Setrun(true);
        DDTM1 := DDTMWalk(1);
          If DTMRotated(DDTM1, x, y, MMX1, MMY1, MMX2, MMY2) then
            WriteLn('Step one of WalkToBank successful');
            MoveMouse(x, y,);//<--this is where
            ClickMouse(x, y, true);
      end;
      wait(7000)
      begin
        DDTM2 := DDTMWalk(2);
          If DTMRotated(DDTM1, x, y, MMX1, MMY1, MMX2, MMY2) then
            WriteLn('Step two of WalkToBank successful');
            MoveMouse(x, y,);
            ClickMouse(x, y, true);
      end;
      wait(7000)
      begin
        DDTM3 := DDTMWalk(3);
          If DTMRotated(DDTM1, x, y, MMX1, MMY1, MMX2, MMY2) then
            WriteLn('Step three of WalkToBank successful');
            MoveMouse(x, y,);
            ClickMouse(x, y, true);
      end;
      wait(7000)
      begin
        DDTM4 := DDTMWalk(4);
          If DTMRotated(DDTM1, x, y, MMX1, MMY1, MMX2, MMY2) then
            WriteLn('Step four of WalkToBank successful');
            MoveMouse(x, y,);
            ClickMouse(x, y, true);
      end;
      wait(7000)
      begin
        DDTM5 := DDTMWalk(5);
          If DTMRotated(DDTM1, x, y, MMX1, MMY1, MMX2, MMY2) then
            WriteLn('Step five of WalkToBank successful');
            MoveMouse(x, y,);
            ClickMouse(x, y, true);
      end;
      ProgressReport;
      wait(7000);
    end;
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  6. #6
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    MoveMouse(x, y,);//<--this is where

    MoveMouse(x,y,);

    SCAR Code:
    MoveMouse(x, y);

    You have another comma there.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  7. #7
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ooooh rofl.. wow cant belive i missed that, thx roger lmao
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  8. #8
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post

    You have another comma there.
    Yeah, you should use SRL's move mouse though as it has a randomness to it, and doesn't go to the exact point every time:
    SCAR Code:
    MMouse(x, y, 4, 4);

  9. #9
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i got it all working, thx all and it runs perfectly!
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  10. #10
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by bionicle1800 View Post
    i got it all working, thx all and it runs perfectly!
    That's great to hear, good luck with the rest of you script.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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