Log in

View Full Version : Need a hand with an error. :-)



phrost69
09-26-2012, 10:48 PM
I'm making my first script ever for an RSPS and get getting the error "[Error] C:\Simba\Scripts\MAGICCUTTTERRRRR.simba(11:4): Duplicate identifier 'MoveMouse' at line 10" . I looked at another script and they said the problem was there was a comma after the y in his "x, y : Integer" but I don't have that. Hand anyone? Here is the script (Yes I know it's probably terrible and I havenn't put in the wait commands yet :p)


[Error] program New;
{$i srl/srl.simba}





Procedure teleport;
var x, y: Integer;
MoveMouse(572, 360);
ClickMouse(572, 360, 1);
MoveMouse(301, 430);
ClcikMouse(301, 430, 1);
end;

procedure ChopTree;
var x, y: integer;
begin
if FindObj(x, y, 'hop', 12056824, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
end;

Procedure bank;
MoveMouse(570, 285);
ClickMouse(570,285, 1);
MoveMouse(278, 203);
ClickMouse(278, 203, 1);
MoveMouse(660, 414);
ClickMouse(660, 414, 1);
end;

phrost69
09-26-2012, 11:00 PM
Nvm found out my error!Feel accomplished :-)

Le Jingle
09-26-2012, 11:02 PM
program New; // don't know if this '[Error]' was suppose to be there, but it's NOT when in Simba
{$i srl/srl.simba}

Procedure teleport;
begin // forgot to place a 'begin here,' indicating this is the beginning of the labeled procedure
MoveMouse(572, 360);
ClickMouse(572, 360, 1);
MoveMouse(301, 430);
ClickMouse(301, 430, 1);
end;

procedure ChopTree;
var
x, y: integer;
begin
if FindObj(x, y, 'hop', 12056824, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);
end; // we need 'end' here to close the begin used within the procedure's begin end
end;

Procedure bank;
begin // we need a begin here to accompany the end at the end of the procedure
MoveMouse(570, 285);
ClickMouse(570,285, 1);
MoveMouse(278, 203);
ClickMouse(278, 203, 1);
MoveMouse(660, 414);
ClickMouse(660, 414, 1);
end;


{
var
loop, c: integer;}

begin // we now need a main method of begin end. that specifically indicates what to execute in our program when we press play
setupSRL; // sets up SRL, to use the srl include and let our mouse move at a defined mouse speed


teleport; // this will be carried out only 1 time,
choptree; // this will be carried out only 1 time,
bank; // this will be carried out only 1 time.

// ^ if you want the above to occur more than 1 time, or multiple times, then remove the squiggly brackets from the below...
// you will also have to remove the squiggly brackets that are around the loop and c global script vars
{
loops := 1000; // will do the following loop 1000 times before ending.
repeat
teleport;
choptree;
bank;
inc(c);
until(loops = c);
}
end.


Commented in some text to perhaps help explain potentially unknown code.
Cheers,
Lj