lanadekat
2014-08-23 14:24:17
my new script keep crashing cus this error:


program Clayminer;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
var
x, y: integer;
I: Integer;
LoadsDone: integer;
Function Antiban: Boolean;
Var
I: Integer;
begin
case random(700) of
1:
begin
boredHuman(true);
minimap.clickCompass();
end;
4..45:
Begin
hoverSkill(Skill_mining);
Wait(GaussRangeInt(1000,2000));
End;
46..48: mouseMovingObject;
49..100: SleepAndMoveMouse(RandomRange(100,500));
101..270:
Begin
MouseOffClient(Random(4));
Wait(RandomRange(2000, 500));
End;
271..331:
wait(randomRange(1000, 4000));
331..333:
randomRClickItem();
339..341:
smallRandomMouse();
342..344:
randomGameTab(true);
345..349:
smallRandomMouse;
350..419:
pickUpMouse;
420..440:
begin
mouseOffClient(OFF_CLIENT_RANDOM);
writeln('Pretending to looking at another (good) website.');
wait(randomRange(5051, 14081));
end;
end;
end;
Procedure runmine();
var
I: Integer;
pathmine: TpointArray;
begin
pathmine := [Point(711, 547), Point(668, 545), Point(638, 547), Point(630, 530), Point(613, 523), Point(577, 522), Point(555, 522), Point(520, 509), Point(490, 507), Point(464, 507), Point(436, 508), Point(422, 507), Point(426, 528), Point(431, 548)]
if SPS.walkPath(pathmine) then
writeLn('Walking to the mine!');
minimap.waitPlayerMoving();
end;
Procedure rundeposit();
var
I: Integer;
pathdeposit: TpointArray;
begin
pathdeposit := [Point(428, 533), Point(425, 515), Point(438, 507), Point(478, 496), Point(518, 496), Point(535, 516), Point(558, 522), Point(597, 521), Point(623, 522), Point(636, 541), Point(703, 543)]
if SPS.walkPath(pathdeposit) then
minimap.waitPlayerMoving();
end;
procedure mineclay();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
repeat
if not isLoggedIn() then
exit;
findColorsSpiralTolerance(x, y, TPA, 7448261, mainScreen.getBounds(), 20, colorSetting(15, 0.06, 1.25));
if (Length(TPA) < 1) then
writeLn('no clay rocks found!');
runmine();
ATPA := TPA.toATPA(35, 35);
ATPA.filterBetween(8, 10);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['Clay', 'lay'], 500) then
begin
fastClick(MOUSE_LEFT);
writeLn('Clayrock clicked!');
smartImage.clear;
Antiban();
tabBackpack.waitForShift(8000);
end;
until
tabBackpack.isFull()
end;
procedure deposit();
begin
smartImage.clear;
if not mainscreen.findObject(x, y, 4611183, 8, colorSetting(2, 0.07, 0.15), mainscreen.playerPoint, 30, 50, 50, ['eposit', 'box'], MOUSE_LEFT) then
rundeposit();
wait(randomRange(1000, 2000));
if not depositBox.isOpen() then
rundeposit();
if depositbox.quickDeposit(QUICK_DEPOSIT_INVENTORY) then
begin
inc(LoadsDone);
ClearDebug();
depositbox.close();
end;
end;
procedure progressReport();
var
oreMined, profit, profitPerHour: integer;
begin
oreMined := LoadsDone * 28;
profit := (oreMined * 305);
ClearDebug();
writeLn('========================================================');
writeLn('Lanadekat"s amazing clay miner aka stolen clay miner from the mayor xD');
writeLn('Time Run: ' + timeRunning);
writeLn('Ores Mined: ' + intToStr(oreMined));
writeLn('Loads Done: ' + intToStr(loadsDone));
writeLn('========================================================');
end;
begin
addOnTerminate('scriptTerminate');
ClearDebug();
smartPlugins := ['d3d9.dll'];
smartEnableDrawing := true;
SetupSRL();
Players.Setup(['sh1r'], 'lol');
currentPlayer := 0;
SPS.setup('clayportsarim', RUNESCAPE_OTHER);
for i := 0 to high(players) do
begin
players[i].isActive := true;
end;
while (players.getActive() > 0) do
begin
if (not isLoggedIn()) then
begin
if (not players[currentPlayer].login()) then break;
mainscreen.setangle(MS_ANGLE_HIGH);
exitSquealOfFortune();
end;
runmine();
mineclay();
rundeposit();
ClearDebug();
deposit();
progressReport();
end;
End.