Results 1 to 3 of 3

Thread: Type Mismatch error

  1. #1
    Join Date
    Jul 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Type Mismatch error

    keep getting a type mismatch error on line 7
    SCAR Code:
    program Distillery;//By RaptorBlaze(my first script w00t)
    var
    a,b,x,y,c,d,e,f: Integer;//a,b=Left piece coords, x,y=Right piece coords c,d,e,f=Inputs for formulae
    procedure moveright;
     begin
      c:=a+40;
      d:=b<y;
      e:=a-40;
      f:=(b>d);

       if findcolor(a,b;12645373,0,0,899,1439) then
        clickmouse(a,b,true);
         if findcolor(x,y;8829120,a,b,c,d) then
          clickmouse(x,y,true);
        else
         if findcolor(x,y;4245488,a,b,e,f) then
          clickmouse(x,y,true);
     end;

    repeat
     moveright
     wait(500+random(200))//added random for more humanity(just in case)
    until(iskeydown('a'));
    I think its because of the greater than/less than signs i am trying to use but i don't know how to do a greater than/less than formula in the variables without them and i can't find a tutorial on it.

  2. #2
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Fixed it up a bit... plus I moved your variables from global to local, which is in general a better place for them, if you are just using those variables for the one procedure/function.

    SCAR Code:
    program Distillery;//By RaptorBlaze(my first script w00t)

    //a,b=Left piece coords, x,y=Right piece coords c,d,e,f=Inputs for formula

    procedure moveright;
    var
    a,b,x,y,c,d,e,f: Integer;
    begin
      c:=a+40;
      d:=b<y;
      e:=a-40;
      f:=(b>d);
     if(findcolor(a,b;12645373,0,0,899,1439))then
      clickmouse(a,b,true);
     if(findcolor(x,y;8829120,a,b,c,d))then
      clickmouse(x,y,true);
     else
      if(findcolor(x,y;4245488,a,b,e,f))then
       clickmouse(x,y,true);
    end;

    begin
     repeat
      moveright
      wait(500+random(200))//added random for more humanity(just in case)
     until(iskeydown('a'));
    end.

    I don't have any clue what you are trying to accomplish with the grater than or less than statements. Can you explain it please?

    usually you have to use a statement like:
    SCAR Code:
    if(a > b)then
    ....

    So you are really not accomplishing anything with:
    SCAR Code:
    d:=b<y;

  3. #3
    Join Date
    Jul 2007
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah, realized a bit late to stop your post that i just needed to add +40,-40 instead of < or > and it would work better too. Sorry lol newb mistake.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ERROR type mismatch
    By shaman in forum OSR Help
    Replies: 5
    Last Post: 12-17-2008, 01:02 AM
  2. Type Mismatch Error?
    By crossback7 in forum OSR Help
    Replies: 2
    Last Post: 06-23-2007, 05:28 PM
  3. Type mismatch error...
    By Hobbit in forum OSR Help
    Replies: 8
    Last Post: 02-13-2007, 04:45 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
  •