what is wrong here?

Discussion in 'Scar/Simba Help' started by simonbelgers, Dec 29, 2010.

what is wrong here?
  1. Unread #1 - Dec 29, 2010 at 2:08 PM
  2. simonbelgers
    Joined:
    Dec 29, 2010
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0

    simonbelgers Newcomer

    what is wrong here?

    I get error
    Failed when compiling
    Line 12: [Error] (12:9): Close round expected in script
    but i can't find what's wrong here.
    i'm pretty new to this so help would be nice:)
    (for who wants to know it's supposed to be a script for Button in Anti-idle, the game)




    program New;
    var x,y:integer;
    begin
    x:=535;
    y:=469;
    repeat ;
    //going rigth
    repeat;
    x:=x+21;
    movemouse (x,y);
    clickmouse (x,y,true);
    until (x:=724);
    //going left
    repeat;
    x:=x-21;
    movemouse (x,y);
    clickmouse (x,y,true);
    until (x:=346);
    //going middle
    repeat;
    x:=x+21;
    movemouse (x,y);
    clickmouse (x,y,true);
    until (x:=724);
    //repair
    movemouse(334, 676);
    clickmouse(334, 676,true);
    until (false);
    end.
     
  3. Unread #2 - Dec 29, 2010 at 11:20 PM
  4. TheAccMaker
    Joined:
    Nov 30, 2010
    Posts:
    266
    Referrals:
    0
    Sythe Gold:
    0

    TheAccMaker Forum Addict

    what is wrong here?

    you are using : in the brackets when it should be until(x=number);

    also insted of using x:=x+27; you can do incex(x,27); and insted of doing x:=x-21; you can do decex(x,21); also making a procedure to movemouse then click would remove alot of clutter by doing that you could do this

    Code:
    procedure mouse(x,y:integer;click:boolean);
    begin
         movemouse(x,y);
         wait(10);
         clickmouse(x,y,click);
    end;
    
    then just use it as mouse(x,y,true);

    hope i showed you something usefull and goodluck with scar scripting

    also this is how i would make that script

    Code:
    program New;
    var
       x,y:integer;
    
    procedure mouse(x,y:integer;click:boolean);
    begin
         movemouse(x,y);
         wait(10);
         clickmouse(x,y,click);
    end;
    
    
    begin
         x:=535;
         y:=469;
         repeat;
    //going rigth
         while(not(x=724))do
         begin
              incex(x,21);
              mouse(x,y,true);
         end;
    //going left
         while(not(x=346))do
         begin
              decex(x,21);
              mouse(x,y,true);
         end;
    //going middle
         while(not(x=724))do
         begin
              incex(x,21);
              mouse (x,y,true);
         end;
    //repair
         mouse(334, 676,true);
    until (false);
    end.
    
    although i would put waits in there for it doesnt lag but thats your choice :).
     
  5. Unread #3 - Feb 12, 2011 at 10:18 AM
  6. Nis
    Joined:
    Nov 15, 2008
    Posts:
    270
    Referrals:
    0
    Sythe Gold:
    0

    Nis Forum Addict
    $5 USD Donor New

    what is wrong here?

    I don't know much about scar but you did mispell Right and that might be a small cause of the problem, ill point out where it is for ya. btw if its supposed to be like that, sorry.

     
  7. Unread #4 - Feb 14, 2011 at 10:46 PM
  8. TheAccMaker
    Joined:
    Nov 30, 2010
    Posts:
    266
    Referrals:
    0
    Sythe Gold:
    0

    TheAccMaker Forum Addict

    what is wrong here?

    well nis no reason in trying but let me correct your, the spelling of the word "right" would not effect the script let me explain why.

    before the sentence "going right repeat" their is a "//" that is the start of a comment in the coding. explaining what the bit of code does. it does not have any runtime value so it would not effect the script :) always nice for people to try though.
     
  9. Unread #5 - Aug 31, 2011 at 4:09 PM
  10. p0werpete
    Joined:
    Aug 31, 2011
    Posts:
    26
    Referrals:
    0
    Sythe Gold:
    0

    p0werpete Member

    what is wrong here?

    you forgot ; that is very important
     
< back to the same old problem!! | SCAR and FTP >

Users viewing this thread
1 guest


 
 
Adblock breaks this site