Adblock breaks this site

what is wrong here?

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

  1. simonbelgers

    simonbelgers Newcomer

    Joined:
    Dec 29, 2010
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  2. TheAccMaker

    TheAccMaker Forum Addict

    Joined:
    Nov 30, 2010
    Posts:
    266
    Referrals:
    0
    Sythe Gold:
    0
    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 :).
     
  3. Nis

    Nis Forum Addict
    $5 USD Donor New

    Joined:
    Nov 15, 2008
    Posts:
    270
    Referrals:
    0
    Sythe Gold:
    0
    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.

     
  4. TheAccMaker

    TheAccMaker Forum Addict

    Joined:
    Nov 30, 2010
    Posts:
    266
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  5. p0werpete

    p0werpete Member

    Joined:
    Aug 31, 2011
    Posts:
    26
    Referrals:
    0
    Sythe Gold:
    0
    what is wrong here?

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


 
 
Adblock breaks this site