SRL Archive - OSR Help

Where is the Error?


Example

2012-04-11 14:38:19

Sitting here for 15 minutes trying to find this error which Simba is showing. Im new to scripting so it might be something i don't know about, hopefully one of the more experienced scripters can help me out.

Private Server Script.


begin
if(FindColor(x,y,HP,220,120,286,153)) then
begin
Writeln('Eating > Using selected food.')
Wait(randomrange(1200, 1300));

if (FindColor(x,y,Sword,556,256,724,451)) then
begin
MoveMouse(x,y+random(3));
Wait(randomrange(500, 700));
ClickMouse(x,y,mouse_Left);
Wait(randomrange(300, 450));
end;

MoveMouse(642,183); //Move to BackPack
Wait(randomrange(20, 30));
ClickMouse(642,183,1); //Click BackPack
end;
end; //Showing Error Here.

Thanks in advance, Example

Total

2012-04-11 14:48:29

Did you call it in a procedure? I just compiled this in Simba


procedure blahblah;
var
x, y : Integer;
begin
if(FindColor(x,y,111,220,120,286,153)) then
begin
Writeln('Eating > Using selected food.')
Wait(randomrange(1200, 1300));

if (FindColor(x,y,111,556,256,724,451)) then
begin
MoveMouse(x,y+random(3));
Wait(randomrange(500, 700));
ClickMouse(x,y,mouse_Left);
Wait(randomrange(300, 450));
end;

MoveMouse(642,183); //Move to BackPack
Wait(randomrange(20, 30));
ClickMouse(642,183,1); //Click BackPack
end;
end; //Showing Error Here.
Compiled successfully in 546 ms.

Example

2012-04-11 14:51:00

From: TotalKillz
Did you call it in a procedure? I just compiled this in Simba


procedure blahblah;
var
x, y : Integer;
begin
if(FindColor(x,y,111,220,120,286,153)) then
begin
Writeln('Eating > Using selected food.')
Wait(randomrange(1200, 1300));

if (FindColor(x,y,111,556,256,724,451)) then
begin
MoveMouse(x,y+random(3));
Wait(randomrange(500, 700));
ClickMouse(x,y,mouse_Left);
Wait(randomrange(300, 450));
end;

MoveMouse(642,183); //Move to BackPack
Wait(randomrange(20, 30));
ClickMouse(642,183,1); //Click BackPack
end;
end; //Showing Error Here.
Compiled successfully in 546 ms.


Literally just figured it out, as you say i was missing the procedure. Been a long day and im tired, it just didn't click at first :duh:

Lesson Learned. Don't attempt to script or you will be sitting there for a few hours trying to figure out a simple mistake.