void_hatred
2010-02-19 05:16:16
hey guys,
so I'm still working on a script of mine but I've came to a halt
what I'm basically wanting to do is open inv_Magic and then check for my HomeBMP, if it's visible then click it (if I get the message saying that we've already done it then Result is false :))
my bitmap function is..
then I composed another method using TPAs:
… and then I came up with another way using (A)TPAs, so i'm not sure which would be better to use (feedback on which to use would be appreciated!)
any ways, here's the (A)TPA version, it just checks for a blue-ish color and clicks [0][0]
thanks in advance for anyone that helps :)
void_hatred
so I'm still working on a script of mine but I've came to a halt
what I'm basically wanting to do is open inv_Magic and then check for my HomeBMP, if it's visible then click it (if I get the message saying that we've already done it then Result is false :))
my bitmap function is..
function HomeTele: Boolean;
var
HomeBMP, x, y: Integer;
begin
GameTab(tab_Magic);
HomeBMP := BitmapFromString(7, 9, 'beNpjYFi48Vpl46Ka2KVAVFa' +
'7ZN66GwwMDEnRxVHuhbVJC4Eo2r0QyAUKhtvWfX33Tc/IC4iADCAX' +
'KOhrkP7mwWtxfhEgAjKAXKCgk2zkpBmHpiw9AERABpALFLSSiFq67' +
'iorAy8QARlALlBQl9+ts3WHPLsBEAEZugJuQEEHs0xRBlkXtUwgAj' +
'JsdDIZsAIA3wk60g=='
);
if FindBitmapToleranceIn(HomeBMP, x, y, MIX1, MIY1, MIX2, MIY2, 4) then
begin
Mouse(x, y, 3, 3, true);
end else
begin
Result := false;
Exit;
end;
Wait(RandomRange(750, 1500));
Result := not FindTextTPA(clBlack, 30, MCX1, MCY1, MCX2, MCY2, 'ait', SmallChars, Nothing);
FreeBitmap(HomeBMP);
end;
then I composed another method using TPAs:
function HomeTele: Boolean;
var
x, y: Integer;
TPA: TPointArray;
begin
GameTab(inv_Magic);
FindColorsTolerance(TPA, 10832730, MIX1, MIY1, MIX2, MIY2, 10);
SortTPAFrom(TPA, Point(MIX1, MIY1));
MMouse(TPA[0].x, TPA[0].x, 3, 3);
if WaitUpText('umb', 250) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end else
begin
Result := false;
Exit;
end;
Wait(RandomRange(750, 1500));
Result := not FindTextTPA(clBlack, 30, MCX1, MCY1, MCX2, MCY2, 'ait', SmallChars, Nothing);
end;
… and then I came up with another way using (A)TPAs, so i'm not sure which would be better to use (feedback on which to use would be appreciated!)
any ways, here's the (A)TPA version, it just checks for a blue-ish color and clicks [0][0]
function HomeTele: Boolean;
var
x, y: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
GameTab(tab_Magic);
FindColorsTolerance(TPA, 10832730, MIX1, MIY1, MIX2, MIY2, 10);
ATPA := TPAToATPAEx(TPA, 20, 20);
MiddleTPAEx(ATPA[0], x, y);
MMouse(x, y, 3,3 );
if WaitUpText('umb', 250) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
end else
begin
Result := false;
Exit;
end;
Wait(RandomRange(750, 1500));
Result := not FindTextTPA(clBlack, 30, MCX1, MCY1, MCX2, MCY2, 'ait', SmallChars, Nothing);
end;
thanks in advance for anyone that helps :)
void_hatred