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

InJournal

Searching Line Str in whole UOJournal.

NB: Str can be partial string, not full (see example)

NB: Str can contains few strings (or parts of strings), divided by | (f.e.’tell someone to attack themselves | are too far away from one or both | cannot see that')

NB: Work same as InJournalBetweenTimes, but without time limits

Returns the index of LATEST found line, if no lines found - returns 0.

Search result:

  • LineID returns Sender ID for found journal string (NOT Index in journal!)
  • LineIndex returns Line Index in journal
  • LineCount returns total amount of found lines
  • LineMsgType returns Message Type for found line(f.e. ST_GUILD_CHAT = $0D; ST_ALLIANCE_CHAT = $0E; ST_BROADCAST = 1; Speech_Type_Label= 6; …)
  • LineName returns Sender Name for found line
  • LineTextColor returns Text color for found line
  • LineTextFont returns Text Font for found line
  • LineTime returns Time for found line
  • LineType returns Sender Type for found line
  • FoundedParamID : Integer returns index of matched param in multi-strings line Str

Pascal

function InJournal(Str : String) : Integer;

Python

def InJournal(Str) --> int

Example Pascal

Program New;

var
	ind, xInd, yInd, tileInd, circle, startTime, tileType, runeID : integer;
const
	endMsg = 'You loosen some rocks|ore in your pack|ores in your pack|You broke the pickaxe|incorrectly entered a code|entered a true code';
	stopMsg = 'There is no ore here to mine|Try mining in rock|You have no line of sight|That is too far away';
	oreMsg = 'Old Copper|Marble|Bronze|Golden|Agapite|Blood Rock';
	stopCircle = 3;
	stopWeight = 550;
	waitTime = 330;

begin
//on position, all checks done, start mining
repeat
	circle := 0;
	
	startTime := GetTickCount();
    ClearJournal; //bad style, for example purpose only. Normally use InJournalBetweenTimes
	
	UseObject(StrToInt(GetGlobal('char', 'pickaxe')));
	WaitForTarget(550);
	TargetToObject(Self());
	
	repeat
		CheckSave;
        Wait(waitTime);
	until (InJournal(endMsg + '|' + stopMsg) > 0) or (GetTickCount() > (startTime + waitTime * 5));
	
	if (InJournal(oreMsg) > 0) then
	  circle := circle + 1
	else
	begin
		if (InJournal('ore in your pack|ores in your pack') > 0) then
		begin
			circle := 4;
		end;
	end;
until (InJournal(stopMsg) > 0) or (circle >= stopCircle) or (Weight() > stopWeight);
end.```