Clutch
2015-05-19 23:30:54
So, I am trying to use @Obscurity;'s Walk procedure, after adding it to the code though it will run through once and then error out under Method Include as seen here;
[ATTACH=CONFIG]25972[/ATTACH]
I am not sure if it's the way I have my script written with two different - "mainLoops" as within my other script the walk procedure works perfectly fine. Although this question is probably more geared towards @Obscurity; or @Clarity; anyone else with some ideas, would be appreciated!
I continued to write the script despite that I couldn't get it to walk… anyways now it's throwing up errors about unknown declaration 'models' OR 'textures' whichever I try to set the debug too AND even when its commented out…? I didn't even think that was possible.
[ATTACH=CONFIG]25972[/ATTACH]
I am not sure if it's the way I have my script written with two different - "mainLoops" as within my other script the walk procedure works perfectly fine. Although this question is probably more geared towards @Obscurity; or @Clarity; anyone else with some ideas, would be appreciated!
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 = '';
var
Banker1, funcModelArray: glModelArray;
clientCenter: TPoint;
SClay: glTextureArray;
position:array[0..2] of int32;
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));
end;
procedure pPosition;
begin
writeLN('[procedure] pPosition');
position:=[71, 84, 270];
canPosition.setTime(random(9000));
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
Banker1 := ogl.getModels(Banker);
mouse.click(Banker1[0].toPoint().randomizePointEllipse(5), 1);
wait(RandomRange(1200,2000));
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 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();
ogl.setDebugMode('textures');
if Loop = '1' then
repeat
mainLoop;
until False
else
repeat
writeLn(minimap.getLocalPosition());
mainLoop2;
until False;
end.I continued to write the script despite that I couldn't get it to walk… anyways now it's throwing up errors about unknown declaration 'models' OR 'textures' whichever I try to set the debug too AND even when its commented out…? I didn't even think that was possible.
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 = '';
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
PWheel := ogl.getModels(2328382469);
mouse.click(PWheel[0].toPoint().randomizePointEllipse(5), 1);
wait(RandomRange(3000,5000));
if production.hasProduction then
begin
canMould.setTime(600);
exit;
end else
canOpen.setTime(1000);
end;
procedure Open;
begin
Door:= ogl.getModels(2524031219);
mouse.click(Door[0].toPoint().randomizePointEllipse(5), 1);
wait(RandomRange(3000,5000));
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
Banker1 := ogl.getModels(Banker);
mouse.click(Banker1[0].toPoint().randomizePointEllipse(5), 1);
wait(RandomRange(1200,2000));
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();
{ogl.setDebugMode('models');}
if Loop = '1' then
repeat
mainLoop;
until False
else
repeat
writeLn(minimap.getLocalPosition());
mainLoop2;
until False;
end.