Has a few known kinks

one is that there is a pesky (0,0) point result in there

two there is an error when using the main block as a function Semicolon (';') expected at line xx




when used as a procedure i do not get that error, check for yourself





whell heres the function i made//
Simba Code:
function one: tpointarray;

  var

    a,b,x,y,i,w,h: integer;
    tpoint1,tpoint2,tpoint3:tpoint;
    tpa1,tpa2,tpa3,tpa4 :tpointarray;
    atpa1,atpa2,atpa3:t2dpointarray;
    box1,box2,box3:tbox;
    tba1,tba2,tba3:tboxarray;

      begin

        GetClientDimensions(w,h);
        FindColors(tpa1,65536,mmx1,mmy1,mmx2,mmy2);
        splittpaWrap(tpa1,1,atpa1);

          for i:=0 to high(atpa1) do

            begin

              SetArrayLength(tba1, i+1);
              SetArrayLength(atpa2, i+1);
              SetArrayLength(tpa2, i+1);
              SetArrayLength(tpa3, i+1);
              tba1[i]:=GetTPABounds(atpa1[i]);
              TPAFromBoxWrap(tba1[i], atpa2[i]);
              tpa2[i]:=MiddleTPA(atpa2[i]);
              FilterPointsDist(atpa2[i],6,12,tpa2[i].x,tpa2[i].y);
              tpa3[i]:=MiddleTPA(atpa2[i]);
              RAaSTPAEx(tpa3,10,10);

            end;

              result:= tpa3;

      end;




wehlp heres the error procedure
Simba Code:
procedure two;

  var

    x,y,i,h:integer;

      begin

        i:=0
        mmouse(one[i].x,one[i].y, 5, 5);

      end;


now if i made that all into one procedure i dunnot get that smicolin message



my main oncern is that pesky (0,0) coord i get... lol


//http://paste.villavu.com/show/hUehs96G8jawr2RCh8IE/


Simba Code:
//http://paste.villavu.com/show/hUehs96G8jawr2RCh8IE/

program keyboardmacro;

{$i srl/srl.simba}

procedure one;

  var

    a,b,x,y,i,w,h: integer;
    tpoint1,tpoint2,tpoint3:tpoint;
    tpa1,tpa2,tpa3,tpa4 :tpointarray;
    atpa1,atpa2,atpa3:t2dpointarray;
    box1,box2,box3:tbox;
    tba1,tba2,tba3:tboxarray;

      begin

        GetClientDimensions(w,h);
        FindColors(tpa1,65536,mmx1,mmy1,mmx2,mmy2);
        splittpaWrap(tpa1,1,atpa1);

          for i:=0 to high(atpa1) do

            begin

              SetArrayLength(tba1, i+1);
              SetArrayLength(atpa2, i+1);
              SetArrayLength(tpa2, i+1);
              SetArrayLength(tpa3, i+1);
              tba1[i]:=GetTPABounds(atpa1[i]);
              TPAFromBoxWrap(tba1[i], atpa2[i]);
              tpa2[i]:=MiddleTPA(atpa2[i]);
              FilterPointsDist(atpa2[i],6,12,tpa2[i].x,tpa2[i].y);
              tpa3[i]:=MiddleTPA(atpa2[i]);
              RAaSTPAEx(tpa3,10,10);

            end;

              writeln(tpa3);
              h:=length(tpa3);
              i:=0

                repeat

                  if IsKeyDown(16) then    //shift

                    begin

                      wait(500);
                      mmouse(tpa3[i].x,tpa3[i].y, 5, 5);
                      inc(i);

                        if i>=h then

                        i:=0;

                    end;

                      if IsKeyDown(17) then      //control

                        begin

                          wait(500);
                          ClickMouse2(1);

                            if FindFlag(x,y) then

                              begin

                                  repeat

                                  until(not(FindFlag(x,y)));

                                    wait(2500);

                              end else break;

                                break;

                        end;

                until(false);

                  one;

      end;



begin

  activateclient;
  setupsrl;
  wait(2000+random(500));
  one;

end.




//