quinta-feira, 31 de julho de 2008

Alert When No Bag or Backpack on Screen

Const
BagID = 1
AlertFrom = 'C:/Windows/Media/Notify.wav' //must be wav file.

Function IsItemOnScreen(ID:integer):boolean;
begin
Result := false;
for x := 0 to 14 do
begin
if x > 14 then break;
for y := 0 to 10 do
begin
if y > 10 then break;
for i := 0 to Screen.Tile[x,y].count - 1 do
begin
if i >= Screen.Tile[X,Y].Coutn then break;
if Screen.Tile[x,y].Item[i].ID = ID then
begin
Result := true;
exit;
end;
end;
end;
end;
end;

while not terminated do
begin
UpdateWorld;
if not IsItemOnScreen(BagID) then
PlaySound(AlertFrom);
sleep(400);
end;

0 Comments: