SRL Archive - OSR Help

PowerMiner Function help


Synikk

2011-12-19 06:59:26

Hello, i have written the function of the powerminer that i am making that clicks on the ores to mine them, but for some reason i dont understand if it has clicked all three of the veins in range before the first one has respawned again, it just sits there. Would be grateful if someone could help me correct this (:

Function MineIronOre:Boolean
;Var
X, Y, PlusOne: Integer;
Begin
PlusOne:=InvCount+1
If FindObjCustom(x, y, ['ine', 'ocks', 'e R'], [2898786, 3557497], 10) Then
Begin
StatsGuise('Found ore')

GetMousePos(x, y);
Mouse(x, y, 5, 5, True);


End;

Repeat
Until InvCount=PlusOne
If InvCount=PlusOne Then
Writeln('Successfully Mined')

End;

Kyle Undefined

2011-12-19 09:18:11

Does this work? It's off the top of my head, so it may need tweaking.


function MineIronOre : Boolean;
var
x, y, prevInvCount : Integer;
begin
prevInvCount := InvCount;
if(FindObjCustom(x, y, ['ine', 'ocks', 'e R'], [2898786, 3557497], 10))then
begin
StatsGuise('Found ore');
repeat
GetMousePos(x, y);
Mouse(x, y, 5, 5, True);
Wait(1000 + RandomRange(250, 750));
Result := (InvCount > prevInvCount);
until(Result);
if(Result)then
WriteLn('Sucessfully Mined');
end;
end;