Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Function getname from journal, how?

Only working scripts
Post Reply
Ladok
Posts: 3
Joined: 25.12.2009 5:39

Function getname from journal, how?

Post by Ladok »

Hello,

how can I get name from journal?

if (InJournalBetweenTimes('attacking you',gtime,Now) <> -1) then begin
uosay('\ Help guild, '+IntToStr(GetName(InJournal('attacking you'))+' is Killing me.');
gtime := Now; gtime2 := Now;
end;

anything like that, in Injection we use: uo.getserial(UO.JournalSerial(uo.InJournal(...
in stealth I didnt find how to do that,

anyone can help me?

thx =)
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: Function getname from journal, how?

Post by drabadan »

Ladok wrote:Hello,

how can I get name from journal?

if (InJournalBetweenTimes('attacking you',gtime,Now) <> -1) then begin
uosay('\ Help guild, '+IntToStr(GetName(InJournal('attacking you'))+' is Killing me.');
gtime := Now; gtime2 := Now;
end;

anything like that, in Injection we use: uo.getserial(UO.JournalSerial(uo.InJournal(...
in stealth I didnt find how to do that,

anyone can help me?

thx =)
You can use events to handle journal messages. In it's params there is SenderName in which you'l have your name.

Code: Select all

evSpeech : [Text,SenderName,SenderID]

program eventTest;

procedure SpeechEventHandler(Text,SenderName : String; SenderID : Cardinal);
begin
AddToSystemJournal(Text + ' ' + Name);
end;

begin
SetEventProc(evSpeech, 'SpeechEventHandler');
while not dead do
wait(1000);
end.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Function getname from journal, how?

Post by Vizit0r »

Ladok wrote:Hello,

how can I get name from journal?

if (InJournalBetweenTimes('attacking you',gtime,Now) <> -1) then begin
uosay('\ Help guild, '+IntToStr(GetName(InJournal('attacking you'))+' is Killing me.');
gtime := Now; gtime2 := Now;
end;

anything like that, in Injection we use: uo.getserial(UO.JournalSerial(uo.InJournal(...
in stealth I didnt find how to do that,

anyone can help me?

thx =)
InJournalBetweenTimes
+
function LineID : Cardinal;
=
profit!
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Ladok
Posts: 3
Joined: 25.12.2009 5:39

Re: Function getname from journal, how?

Post by Ladok »

better then this is impossible! profit :)

did it!

if (InJournalBetweenTimes('attacking you',gtime,Now) <> -1) then begin
uosay('\Help '+GetName(LineID)+' is killing me');
...

best and easir way...

thanks too much genius ;)
Vizit0r wrote:
Ladok wrote:Hello,

how can I get name from journal?

if (InJournalBetweenTimes('attacking you',gtime,Now) <> -1) then begin
uosay('\ Help guild, '+IntToStr(GetName(InJournal('attacking you'))+' is Killing me.');
gtime := Now; gtime2 := Now;
end;

anything like that, in Injection we use: uo.getserial(UO.JournalSerial(uo.InJournal(...
in stealth I didnt find how to do that,

anyone can help me?

thx =)
InJournalBetweenTimes
+
function LineID : Cardinal;
=
profit!
Post Reply