Alerta com Poucas Mana Potions.

Const
Message1 = 'Using one of 20 mana potions...' // you can change this message.
Alert = 2 //0 - disable. 1 -enable. 2 - non stop.
Logout = 0 //0 - disable. 1 - no force. 2 - force log.
AlertPath = 'C:/Windows/Media/Notify.wav' //must be wav file.

var
Finish:boolean;
ok:integer;

procedure Event_Notice(Text:string);
begin
if (pos(Message1,Text)) or (pos(Text,Message1)) then
begin
Case Alert of
1:
begin
PlaySound(AlertPath);
finish := true;
end;
2:ok := 1;
end;
Case Logout of
1: Self.Logout(false);
2: Self.Logout(True);
end;
end;
end;

quit := false;
if (not alert) and (not logout) then quit := true;
Finish := false;
while (not terminated) and (not finish) and (not quit) do
begin
UpdateWorld;
ok := 0;
ProcessEvents;
if ok then
repeat
PlaySound(AlertPath);
Sleep(1000);
until terminated;
Sleep(100);
end;

Pesquisar no site

By Chuck Norriz © 2009 Todos os direitos reservados.