SRL Archive - RS3 Help

Need a little help


Battousai

2015-02-12 15:11:40

Maybe someone here can help me, This code seems to keep clicking the action bar to drop ores even tho none are left in my inventory, And unless i am mistaken about a piece of code somewhere here, It should look for the DTM, if it finds the DTM then it should start dropping until the DTM count = 0


Procedure dropOre();
Var
x, y, i: Integer;
Begin
If findDTM(oreDTM, x, y, tabBackPack.getBounds()) Then
Begin
writeLn('Dropping ' + toStr(tabBackPack.countDTM(oreDTM)));
For i := 0 To high(oreDTM) Do
Repeat
sendKeys(toStr(1), randomRange(60, 120), randomRange(60, 120));
tabBackPack.waitForShift(1500);
Until(tabBackPack.countDTM(oreDTM) = 0)
End;
End;

The Mayor

2015-02-12 15:26:21

high(oreDTM) is not doing what you think it does here. oreDTM is your actual DTM, it's not an array. High returns the index of the last item in an array;

I think what you re trying to do is:

for i := 1 to (tabBackpack.countDTM(oreDTM)) do

But why not just:


procedure dropOre();
var
x, y: Integer;
begin
if findDTM(oreDTM, x, y, tabBackPack.getBounds()) then
repeat
sendKeys('1', randomRange(60, 120), randomRange(60, 120));
until (tabBackPack.countDTM(oreDTM) = 0); // Spam 1 until there is no more ore?
end;