I've tried ~10 different ways (and different methods within those ways) of changing the end of my script. It continues to throw up an error - Error: Found unexpected token "", expected "End" at line 202
Compiling failed.
I've looked through the script, ensured there are ends on all my procedures.
Attempted Loops, Cases, creating loops through seperate procedures that contain the loop.
Nothing seems to be working.
The other big issue which I believe to be related. When typing ogl.setDebug('Models') or even 'Textures' it throws an error - Error: Unknown declaration "Models" at line 196. So that made me think it was a const/var that I had added that broke everything. Unfortunately I have no idea what to do besides scrap it at this point. Ideas?
Compiling failed.
Simba Code:
program ClutchCrafting;
{$include_once ogLib/lib/core/core.simba}
{See Thread for Instructions}
{ https://villavu.com/forum/showthread.php?t=113141&p=1343183#post1343183}
const
ItemSlot = 2; {first slot begins at 0}
PresetOption = 2; {Bank Preset 1 or 2}
Item = 45135; {See Thread for Instructions}
Banker = 3377138974;
Loop = '2';
var
Banker1, funcModelArray: glModelArray;
clientCenter: TPoint;
SClay: glTextureArray;
Door, PWheel: glModelArray;
position:array[0..2] of int32;
canMould, canPW, canOpen, canPosition, canWalk, canBank, canRotateCamera: countDown = [0];
procedure Check;
begin end;
procedure pWalk;
var
funcDirection:ansiString;
funcIndex:uInt32=0;
funcMapX,
funcMapY:array[0..3] of single;
funcPlayer:tPoint;
funcTextureArray:glTextureArray;
begin
writeLN('[procedure] pWalk');
funcPlayer:=minimap.getLocalPosition();
if funcPlayer.y<position[1]-3 then
funcDirection:='south'
else if funcPlayer.y>position[1]+2 then
funcDirection:='north';
if funcPlayer.x<position[0]-3 then
funcDirection:=funcDirection+'east'
else if funcPlayer.x>position[0]+3 then
funcDirection:=funcDirection+'west';
if funcDirection then
minimap.clickDirection(funcDirection);
canWalk.setTime(random(1500,2500));
canPW.setTime(Random(1000,2000));
end;
procedure pPosition;
begin
writeLN('[procedure] pPosition');
position:=[71, 84, 270];
canPosition.setTime(random(9000));
end;
procedure PWCheck;
begin
if ogl.getModels(2328382469) then
begin
PWheel := ogl.getModels(2328382469);
mouse.click(PWheel[0].toPoint().randomizePointEllipse(5), 1);
wait(RandomRange(3000,5000));
end;
if production.hasProduction then
begin
canMould.setTime(600);
exit;
end else
canOpen.setTime(1000);
end;
procedure Open;
begin
if ogl.getModels(2524031219) then
begin
Door:= ogl.getModels(2524031219);
mouse.click(Door[0].toPoint().randomizePointEllipse(5), 1);
wait(RandomRange(3000,5000));
end;
end;
procedure Mould;
begin
if production.getProduct()=(ItemSlot) then
begin
production.clickMake;
wait(RandomRange(600,1500));
while production.HasProgress() do
wait(RandomRange(600,1200));
end
else
begin
production.setProduct(ItemSlot);
end;
end;
procedure CTool;
begin
production.SetTool(0)
end;
procedure CItem;
begin
inventory.clickItem(Item);
wait(RandomRange(600,1200));
end;
procedure Craft;
begin
if production.getProduct()=(ItemSlot) then
begin
production.clickMake;
wait(RandomRange(600,1500));
while production.HasProgress() do
wait(RandomRange(600,1200));
end
else
begin
production.setProduct(ItemSlot);
end;
canBank.SetTime(600);
end;
procedure OBank;
begin
if ogl.getModels(Banker) then
begin
Banker1 := ogl.getModels(Banker);
mouse.click(Banker1[0].toPoint().randomizePointEllipse(5), 1);
wait(RandomRange(1200,2000));
end;
canBank.setTime(15000);
end;
procedure Withdraw;
begin
bank.clickpreset(PresetOption);
wait(RandomRange(600,1000));
end;
procedure RotateCamera;
begin
writeLn('Rotating Camera');
mainScreen.setDegrees(normalRandom(0,360),normalRandom(0,50));
canRotateCamera.setTime(random(120000));
WriteLn('Done Rotating Camera');
end;
Procedure mainLoop;
var
Reaction : Procedure() =@Check;
begin
if production.hasChooseATool() then
Reaction:=@CTool
else if production.hasProduction then
Reaction:=@Craft
else if inventory.isFull() and (not canBank.isFinished()) then
Reaction:=@CItem
else if bank.HasBank() then
Reaction:=@Withdraw
else if ogl.getModels(Banker).isEmpty or canRotateCamera.isFinished() then
Reaction:=@RotateCamera
else if (Length (ogl.getModels(Banker))) or (canBank.isFinished()) then
Reaction:=@OBank;
Reaction();
end;
Procedure mainLoop2;
var
Reaction : Procedure() =@Check;
begin
SClay:= ogl.getTextures(93840);
if canPosition.isFinished() then
Reaction:=@pPosition
else if (not SClay.isEmpty()) and canWalk.isFinished() then
Reaction:=@pWalk
else if (ogl.getModels(PWheel)) and (canPW.isFinished()) then
Reaction:=@PWCheck
else if canOpen.isFinished() then
Reaction:=@Open
else if (canMould.isFinished()) then
Reaction:=@Mould
else if canRotateCamera.isFinished() then
Reaction:=@RotateCamera
else if bank.HasBank() then
Reaction:=@Withdraw
else if (Length (ogl.getModels(Banker))) or (canBank.isFinished()) then
Reaction:=@OBank;
Reaction();
end;
begin
ogl.setup();
case Loop of
1: mainLoop;
2: mainLoop2;
end;
end.