i couldnt find it sorry, i wrote this just then though
program new;
{$i SRL/srl.simba}
type
Blacklist = record
Name: string;
UpTextArr: string;
OutlineCount: Integer;
Width: Integer;
Height: Integer;
Colour: Integer;
OutlineTPA: TPointArray;
end;
var
StaffOfAir, RandomItem: Blacklist;
function LoadBlacklist: Blacklist;
begin
with StaffOfAir do
begin
Name := 'Staff of air';
UpTextArr := 'of air';
OutlineCount := 70;
Width := 25;
Height := 29;
Colour := 13090494;
end;
end;
function CreateItem(BlackCount, ItemWidth, ItemHeight, UniqueColour: Integer; BlackTPA: TPointArray): Blacklist;
begin
with Result do
begin
OutlineCount := BlackCount;
Width := ItemWidth;
Height := ItemHeight;
Colour := UniqueColour;
OutlineTPA := BlackTPA;
end;
end;
function GetInvItem(Slot: Integer): Blacklist;
var
t: Integer;
ItemTPA: TPointArray;
ItemBox: TBox;
Unique: TPoint;
Item: Blacklist;
begin
t := GetSystemTime;
ItemBox := InvBox(Slot);
FindColorsTolerance(ItemTPA, srl_outline_black, ItemBox.x1, ItemBox.y1, ItemBox.x2, ItemBox.y2, 0);
ItemBox := GetTPABounds(ItemTPA);
Unique := MiddleTPA(ItemTPA);
Item := CreateItem(Length(ItemTPA), iAbs(ItemBox.x2-ItemBox.x1), iAbs(ItemBox.y2-ItemBox.y1), GetColor(Unique.x, Unique.y),
ItemTPA);
Result := Item;
writeln('GetInvItem = ' + ToStr(Result)+ ' '+IntToStr(GetSystemTime-t)+'ms');
Exit;
end;
function CompareBlacklist(var Item1, Item2: Blacklist; UpText: String): Boolean;
var
t: Integer;
RandomPoint :TPoint;
ItemText : String;
begin
if (not LoggedIn) then Exit;
if (GameTab(tab_Inv)) then
begin
t := GetSystemTime;
if (Item1.OutlineCount = Item2.OutlineCount) and (Item1.Width = Item2.Width) and (Item1.Height = Item2.Height)
and (Item1.Colour = Item2.Colour) then
begin
RandomPoint := MiddleTPA(Item1.OutlineTPA);
MMouse(RandomPoint.x, RandomPoint.y, 5, 5);
Wait(150+random(35));
ItemText:=GetUpText;
writeln('Item text is : '+ItemText);
if (Pos(UpText,ItemText) > 0) then
begin
writeln('Found '+UpText+' in uptext');
writeln('CompareBlacklist = ' + ToStr(Result)+ ' '+IntToStr(GetSystemTime-t)+'ms');
Result:=True;
Exit;
end else
writeln('Cannot find uptext');
Result:=False;
Exit;
end else
writeln('False, Blacklists different');
end else
writeln('CompareBlacklist not in gametab');
end;
begin
setupSRL();
LoadBlacklist;
ActivateClient;
wait(1000);
GameTab(tab_Inv);
RandomItem := GetInvItem(1);
CompareBlacklist(RandomItem, StaffOfAir, 'air');
end.
havent tested it it should work may not =]
what are you planning on making?