SRL Archive - RS3 Help

script crash "access violation"


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.

Lipcot

2014-08-23 14:37:17

@lanadekat first of all have you updated SRL ??

the error line is here from what i understand:

line 100 column 18:
  mouse(middleTPA([COLOR="#FF0000"]ATPA[i][/COLOR]), MOUSE_MOVE);
I think you are missing a "begin" and some other stuff, why dont you try replacing with this

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);
[COLOR="#FF0000"]for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);[/COLOR]
if isMouseOverText(['Clay', 'lay'], 500) then
begin
fastClick(MOUSE_LEFT);
smartImage.clear;
break;
end;
end;
until
tabBackpack.isFull()
end;

lanadekat

2014-08-23 15:08:52

From: undorak7
@lanadekat first of all have you updated SRL ??

the error line is here from what i understand:

line 100 column 18:
  mouse(middleTPA([COLOR="#FF0000"]ATPA[i][/COLOR]), MOUSE_MOVE);
I think you are missing a "begin" and some other stuff, why dont you try replacing with this

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);
[COLOR="#FF0000"]for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);[/COLOR]
if isMouseOverText(['Clay', 'lay'], 500) then
begin
fastClick(MOUSE_LEFT);
smartImage.clear;
break;
end;
end;
until
tabBackpack.isFull()
end;

It used to be like that, but I removed it by accident… :garfield:

Olly

2014-08-23 15:30:15

You missed a begin..end, and a exit.

if (Length(TPA) < 1) then
writeLn('no clay rocks found!');
runmine();

Should be:


if (Length(TPA) < 1) then
begin
writeLn('no clay rocks found!');
runmine();
exit();
end;

cosmasjdz

2014-08-24 11:03:27

From: Olly
You missed a begin..end, and a exit.

if (Length(TPA) < 1) then
writeLn('no clay rocks found!');
runmine();

Should be:


if (Length(TPA) < 1) then
begin
writeLn('no clay rocks found!');
runmine();
exit();
end;


I am having exzactly the same problem with my blue drags bots, it doesnt crash everytime but it crashes like 1/100 times roughly. usually my bots do 10-400 drags before this crash. length tpa doesnt help, still crashes…… but what is funniest iv like 5 looting functions different ones for bones, hides and other stuff. and all it craches is at one place, where tries to loot d hide line 485 for me eveytime despite the similar functions are everywhere in the script. However i dont use atpa, i justy use atpa[0], because i merge tpas before this and usually there is one atpa in screen, if there is 2 then my second loot function responsible for other stuff picks other loot haha., he loots randomly whatever first, but crashes at the same line everytime. Maybe its Lape compiling error?

Edit: actually u right, i found one line i didnt made failsafe to :(