Narcle
2008-06-27 11:14:27
These aren't entirely finished yet. But it seems it doesn't work all the time. I get it to work on Longsword all the time but some other weapons it doesn't work . I don't understand why so I'm posting it here to get some suggestions/help on the matter.
edit:
if someone needs more explaining plz ask
edit:
if someone needs more explaining plz ask
{*******************************************************************************
procedure CombatLookup;
By: Narcle
Description: Records weapon data: Attack, Strength, Defence, Shared, Ranged
*******************************************************************************}
procedure CombatLookup;
var
x, y, i, WaitT:integer;
Xarr, Yarr:array of integer;
TB: TBox;
TP: TPointArray;
begin
Xarr := [600, 685, 600, 685];
Yarr := [275, 275, 330, 330];
GameTab(1);
for i := 0 to 3 do
begin
MMouse(Xarr[i], Yarr[i], 7, 7);
repeat
WaitT := WaitT+1;
wait(50);
if WaitT >= 60 then exit;
until findcolor(x, y, 10551295, 540, 205, 750, 465);
wait(200);
GetClientDimensions(TB.X2, TB.Y2);
TB.X1 := 0;
TB.Y1 := 0;
FindColorsTolerance(TP, 10551295, TB.X1, TB.Y1, TB.X2, TB.Y2, 0);
If Length(TP) = 0 Then Exit;
TB := GetTPABounds(TP);
//Writeln(Inttostr(TB.X1)+', '+inttostr(TB.Y1));
Players[currentplayer].Strings[i+50] := Lowercase(Between('(', ' XP', GetTextAtEx(TB.X1+2, TB.Y1+27, 0, SmallChars, False, True, 0, 1, -1, 30, False, tr_AllChars)));
if Players[currentplayer].Strings[i+50] = '' then
begin //records "range"
Players[currentplayer].Strings[i+50] := Lowercase(Between('(', ' XP',
GetTextAtEx(TB.X1+2, TB.Y1+14, 0, SmallChars, False, True, 0, 1, 0, 20, False, tr_AllChars)));
end;
Writeln(Players[currentplayer].Strings[i+50]);
end;
end;
{*******************************************************************************
function CombatSelect(kind: string): boolean;
By: Narcle
Description: Selects combat from combat data recorded.
*******************************************************************************}
function CombatSelect(kind: string): boolean;
var
i:integer;
begin
for i := 0 to 3 do
if Lowercase(kind) = Players[currentplayer].Strings[i+50] then
begin
SetFightMode(i+1);
result := true;
exit;
end;
end;