Hi
I need some help with my findobject. It finds all the points correctly, but i have two problems.
The first one is that it finds the color, move to the location real quick and then waits about a second and a half before clicking the objects to mine. I don`t understand why it is so slow in clicking the object.
The second problem is that I keep getting this error Repeatedly and I don`t know what to do about it or where to look for the problem. I`m a bit new to TPA`s.
Simba Code:
Warning! You passed wrong values to a finder function: xs > xe (359,159). Swapping the values for now.
Warning! You passed wrong values to a finder function: ys > ye (270,70). Swapping the values for now.
We Have Found The Ore
Here is my procedure and function I`m using at the moment to find the ore.
Simba Code:
Function FindOre(var x,y:integer) : Boolean;
var
ItemX, ItemY : Integer;
TPA : Array Of TPoint;
ATPA : T2DPointArray;
i : Integer;
PlayerBox, MiningBox: TPointArray;
Begin
PlayerBox := TPAFromBox(IntToBox(240, 140, 275, 195));
x:=MSCX;
y:=MSCY;
FindColorsSpiralTolerance(ItemX, ItemY, TPA, Colour, (MSCX + 100), (MSCY + 100), (MSCX - 100), (MSCY - 100), TolR)
ClearTPAFromTPAWrap(TPA, PlayerBox, {var}TPA);
Begin
ATPA := SplitTPA(TPA, 10);
For i := 0 To High(ATPA) Do
Begin
If MiddleTPAEX(ATPA[i], ItemX, ItemY) then
Begin
MMouse(ItemX, ItemY, 1, 1);
End;
If WaitUptext(Desc, 300) Then
Begin
x := ItemX;
y := ItemY;
Writeln('We Have Found The Ore');
Result := True;
End;
Exit;
End;
End;
End;
procedure Mining; // Mining Operation
var
x, y, RockCounter, FailSafeTime, TempTime: integer;
Begin
Disguise('At The Mining Location. Staring Mining Operation');
WriteLn('At The Mining Location.');
If FindNormalRandoms then
Begin
If Not LoggedIn Then
Begin
Writeln('Found unsolvable random');
NextPlayer(False);
End;
End;
Start_Time := GetTimeRunning;
If MineFirstRun then
Begin
MineFirstRun := True;
End else
Begin
MOriginalXP := GetXPBar(2);
OMSkillLevel := GetSkillLevel(SKILL_MINING);
MineFirstRun := True;
End;
If InvFull Then
Begin
MCurrentXP := GetXPBar(1);
MCurrentXP := (MCurrentXP - MOriginalXP);
End_Time := GetTimeRunning;
TotalTime := (End_Time - Start_Time)/1000;
WriteLn('Mining ' + Desc + ' Took ' + IntToStr(TotalTime) + ' Seconds To Complete');
Exit;
End;
SelectRock(OreChoice);
SetLocation;
MakeCompass(Cam);
Wait(200 + Random(100));
SetAngle(SRL_ANGLE_HIGH);
While IsMoving do
Begin
Wait(50);
End;
MarkTime(FailSafeTime);
Repeat
Disguise('Starting Mining For ' + Desc);
If FindNormalRandoms then
Begin
If Not LoggedIn Then
Begin
Writeln('Found unsolvable random');
NextPlayer(False);
End;
End;
ToggleXPBar(True);
If (TimeFromMark(FailSafeTime) > (30000 + Random(300))) then
Begin
MCurrentXP := GetXPBar(1);
MCurrentXP := (MCurrentXP - MOriginalXP);
End_Time := GetTimeRunning;
TotalTime := (End_Time - Start_Time)/1000;
WriteLn('Mining ' + Desc + ' Took ' + IntToStr(TotalTime) + ' Seconds To Complete');
Lost;
Exit;
End;
If (FindOre(x, y)) then
Begin
While IsMoving Do
Wait(10);
If IsUptext(Desc) and (not(IsMining)) Then
Begin
Mouse(x, y, 0, 0, True);
MarkTime(RockCounter);
MarkTime(FailSafeTime);
Writeln('Clicked The Ore To Start Mining');
End;
End;
Antiban;
Repeat
If FindNormalRandoms then
Begin
If Not LoggedIn Then
Begin
Writeln('Found unsolvable random');
NextPlayer(False);
End;
End;
Until (FindBlackChatMessage('nage')) or (TimeFromMark(RockCounter) > (3700 + Random(300))) and (not(IsMining));
Until (InvFull);
MiningLoads(OreChoice);
MCurrentXP := GetXPBar(1);
MCurrentXP := (MCurrentXP - MOriginalXP);
End_Time := GetTimeRunning;
TotalTime := (End_Time - Start_Time)/1000;
WriteLn('Mining ' + Desc + ' Took ' + IntToStr(TotalTime) + ' Seconds To Complete');
End;
I would appreciate some help with this.
Thanks guys.