Log in

View Full Version : [Error] C:\Simba\Scripts\Autofightteser.simba(31:8): 'BEGIN'



rj
11-23-2012, 07:04 PM
When i try to add failsafes.. It ends up failing.
I get this error:

[Error] C:\Simba\Scripts\Autofightteser.simba(31:8): 'BEGIN' expected at line 30
Compiling failed.


http://i49.tinypic.com/5aey9s.jpg

program fite;
Var
X, Y, charm: Integer;
Const
// fill out
NPC=1122383;
loot=14079706;
tolerence=15;
time=7; // in seconds
rwait=1000;
tleft= 41;
tright = 44;
bleft=426;
bright=280;

procedure pickup;
Begin
charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59m MJMl' +
'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
WriteLn('Looking for bones . . . ');
Wait(1700 + Random(1200));
if FindColorTolerance(X,Y,loot,184,123,294,197,15) then
WriteLn('Found bones');
movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, Mouse_right);
End;
else
Begin
clicknpc;
End;
Begin
WriteLn('Looking for charm . . . ');
wait(1100);
if FindBitMapToleranceIn(charm, X, Y,161, 95, 330, 205, 75) then
movemouse(X, Y);
WriteLn('Found charm ');
wait(500);
ClickMouse(X, Y, Mouse_left)
FreeBitMap(charm);
wait(3000);
End;
else
Begin
clicknpc;
End;
End;
procedure checkcombat;
begin
Wait((time*500) + Random(rwait));
WriteLn('Waiting for loot . . .');
Wait((time*500) + Random(rwait));
pickup;
End;
procedure clicknpc;
var
X, Y, charm: Integer;
begin // kill npc
WriteLn('Attacking skeleton . . .');
if FindColorTolerance(X,Y,NPC,tleft,tright,bleft,brig ht,tolerence) then
movemouse(x, y);
Wait(20 + Random(50));
ClickMouse(x, y, Mouse_Left)
checkcombat;
End else;
Begin
clicknpc;
End;
Begin
repeat
clicknpc;
until (False);
End.

Janilabo
11-23-2012, 07:38 PM
Try this:

// fill out const's
const
NPC = 1122383;
loot = 14079706;
tolerence = 15;
time = 7; // in seconds
rwait = 1000;
tleft = 41;
tright = 44;
bleft = 426;
bright = 280;

var
charm: Integer;

procedure PickUp;
var
X, Y: Integer;
begin
Wait(1700 + Random(1200));
WriteLn('Looking for bones...');
if FindColorTolerance(X, Y, loot, 184, 123, 294, 197, 15) then
begin
WriteLn('Found bones!');
Movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, mouse_Right);
end;
WriteLn('Looking for charm...');
Wait(1100);
if FindBitmapToleranceIn(charm, X, Y,161, 95, 330, 205, 75) then
begin
Movemouse(X, Y);
WriteLn('Found charm!');
Wait(500);
ClickMouse(X, Y, mouse_Left);
Wait(3000);
end;
end;

procedure CheckCombat;
begin
Wait((time * 500) + Random(rwait));
WriteLn('Waiting for loot...');
Wait((time * 500) + Random(rwait));
PickUp;
end;

procedure ClickNPC;
var
X, Y: Integer;
begin // kill npc
WriteLn('Attacking skeleton...');
if FindColorTolerance(X, Y, NPC, tleft, tright, bleft, bright, tolerence) then
begin
MoveMouse(X, Y);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
WriteLn('Attacked skeleton!');
CheckCombat;
end;
end;

begin
charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59m MJMl' +
'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
repeat
ClearDebug;
ClickNPC;
until False;
FreeBitmap(charm);
end.

rj
11-23-2012, 07:52 PM
Try this:

// fill out const's
const
NPC = 1122383;
loot = 14079706;
tolerence = 15;
time = 7; // in seconds
rwait = 1000;
tleft = 41;
tright = 44;
bleft = 426;
bright = 280;

var
charm: Integer;

procedure PickUp;
var
X, Y: Integer;
begin
Wait(1700 + Random(1200));
WriteLn('Looking for bones...');
if FindColorTolerance(X, Y, loot, 184, 123, 294, 197, 15) then
begin
WriteLn('Found bones!');
Movemouse(x, y);
Wait(120 + Random(80));
ClickMouse(x, y, mouse_Right);
end;
WriteLn('Looking for charm...');
Wait(1100);
if FindBitmapToleranceIn(charm, X, Y,161, 95, 330, 205, 75) then
begin
Movemouse(X, Y);
WriteLn('Found charm!');
Wait(500);
ClickMouse(X, Y, mouse_Left);
Wait(3000);
end;
end;

procedure CheckCombat;
begin
Wait((time * 500) + Random(rwait));
WriteLn('Waiting for loot...');
Wait((time * 500) + Random(rwait));
PickUp;
end;

procedure ClickNPC;
var
X, Y: Integer;
begin // kill npc
WriteLn('Attacking skeleton...');
if FindColorTolerance(X, Y, NPC, tleft, tright, bleft, bright, tolerence) then
begin
MoveMouse(X, Y);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
WriteLn('Attacked skeleton!');
CheckCombat;
end;
end;

begin
charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59m MJMl' +
'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
repeat
ClearDebug;
ClickNPC;
until False;
FreeBitmap(charm);
end.

Thanks