• Log in or sign up for an account here: https://www.sythe.org/login

what is wrong here?

simonbelgers

Newcomer
Joined
Dec 29, 2010
Sythe Gold
0
Messages
1
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.
 
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 :).
 
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.

program New;
var x,y:integer;
begin
x:=535;
y:=469;
repeat ;
//going rigthrepeat;
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.
 
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.
 
Runescape Gamblingrunescape gambling
Back
Top