Total
2012-03-22 19:08:27
Ok, so I have just begun to try and write my first script with the help of YoHoJo's video tutorial but am having trouble, specifically with the InvCount function. From my understanding it takes the amount of items in your inventory and allows you to store it as a variable, but for me it seems to just be clicking on my inventory. Here is my procedure and where it is going wrong.
If I run it like above, It will just click on my inventory tab and not do anything. If I remove "PlusOne:= InvCount + 1;" it will work up until the loop. Is this a problem with my loop or what am I doing wrong?
Also, is there any other way to check if you have completed an action like mining an ore?
Procedure ClickOre;
Var
X, Y, PlusOne, RockCounter: Integer;
Begin
PlusOne:= InvCount + 1;
X:= MSCX;
Y:= MSCY;
Writeln('Looking for ore.');
If FindObjTPA(X, Y, OreColor, 5, 1, 10, 10, 1, ['Mi', 'ine']) Then
Begin
GetMousePos(X, Y);
Writeln('Clicking on ore.');
Mouse(X, Y, 5, 5, True);
End;
Repeat
MarkTime(RockCounter)
If InvCount=PlusOne Then
Writeln('Got dat ore.');
Until (InvCount=Plusone) Or (TimeFromMark(RockCounter) > 5000)
End;If I run it like above, It will just click on my inventory tab and not do anything. If I remove "PlusOne:= InvCount + 1;" it will work up until the loop. Is this a problem with my loop or what am I doing wrong?
Also, is there any other way to check if you have completed an action like mining an ore?