Ok, So I need help. My script finds the rocks and mouses over them, but it refuses to click. I think it has something to do with my "oreExcists" porcedure, although I thought it worked/should work. Any feedback is appreciated.
SCAR Code:
function GetMyAnimation: Integer;
var
Player: Integer;
begin
Player := SmartGetFieldObject(0, MyPlayer);
Result := SmartGetFieldInt(Player, CharAnim);
SmartFreeObject(Player);
end;
procedure LoadOre;
begin
case LowerCase(Players[CurrentPlayer].Strings[0]) of
'copper': UpIDs := [37307, 37308, 37309];
'tin': UpIDs := [11937, 11936, 11938];
'iron': UpIDs := [11933, 11934, 11935];
end;
end;
function OreExists(Tile : TPoint): Boolean;
var
O: UID;
begin
begin
Result := False;
O := GetObjectAt(Tile.x, Tile.y);
if InIntArray(UpIDs, O.ObjType) then
Result := True;
end;
end;
function WhileMining: Boolean;
var
T: Integer;
begin
Result := (GetMe.Animation= GetMyAnimation);
repeat
MarkTime(T);
Wait(50);
until (TimeFromMark(T) = 2000) or not Result;
while OreExists(P) do
begin
FindRandoms;
AntiBan;
end;
end;
function MineRock: Boolean;
var
I:Integer;
begin
Status('Mining Ore');
try
for I := 0 To High(UpIDs) do
begin
Result := FindObject(P, UpIDs[I]);
if Result then Break;
end;
if Result then
P := TileToMS(P, 0);
MMouse(P.x, P.y, 4, 4);
Wait(100+random(150));
if IsUpText('ine') and OreExists(P) then
Mouse(P.x, P.y, 0, 0, True);
finally
begin
FFlag(0);
WhileMining;
end;
except End;
end;
Btw, I use OreExcists as my gas avoider, as it will stop mining the rock if the id changes. Aso, could someone tell me if my getanimation procedure would work?