Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

InJournal

Searches the journal for the specified string, scanning from the newest entry backward.

Str — the text to search for (case-insensitive substring match). Supports searching for multiple strings using the pipe | separator. For example, 'gold|silver|copper' finds a line containing any of these words.

Returns the line index of the found entry, or -1 if no match was found. The search starts from the entry set by SetJournalLine and goes backward toward older entries.

After a successful match, the following Line* properties are updated with data from the found entry: LineID, LineName, LineTime, LineMsgType, LineType, LineTextColor, LineTextFont, LineIndex, LineCount.

Ищет указанную строку в журнале, просматривая записи от последней к первой.

Str — текст для поиска (регистронезависимый поиск подстроки). Поддерживает поиск нескольких строк через разделитель |. Например, 'gold|silver|copper' найдёт строку, содержащую любое из этих слов.

Возвращает индекс найденной строки или -1, если совпадений не найдено. Поиск начинается от записи, установленной через SetJournalLine, и идёт назад к более старым записям.

После успешного нахождения обновляются следующие свойства Line* данными из найденной записи: LineID, LineName, LineTime, LineMsgType, LineType, LineTextColor, LineTextFont, LineIndex, LineCount.

Pascal

function InJournal(Str: String): Integer;

Python

def InJournal(Str: str) -> int: ...

Pascal Example

begin
  SetJournalLine(HighJournal);
  UOSay('bank');
  Wait(2000);
  if InJournal('balance|gold|withdraw') >= 0 then
    AddToSystemJournal('Found bank-related message at line ' +
      IntToStr(LineIndex) + ': ' + Journal(LineIndex));
end.

Python Example

SetJournalLine(HighJournal())
UOSay('bank')
Wait(2000)
if InJournal('balance|gold|withdraw') >= 0:
    AddToSystemJournal(f'Found bank-related message at line {LineIndex()}: {Journal(LineIndex())}')

See Also

InJournalBetweenTimes, Journal, WaitJournalLine, SetJournalLine, ClearJournal, LineName, LineTime, LineID, LineMsgType, LineType