InJournalBetweenTimes
Searching Line Str in UOJournal, limited by time period from TimeBegin to TimeEnd.
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 InJournal, but with 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 InJournalBetweenTimes(Str : String; TimeBegin : TDateTime; TimeEnd : TDateTime) : Integer;
Python
def InJournalBetweenTimes(Str, TimeBegin, TimeEnd) --> int
Example Pascal
Program New;
var
ind, xInd, yInd, tileInd, circle, startTime, tileType, runeID : integer;
startDate : TDateTime;
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();
startDate := Now();
UseObject(StrToInt(GetGlobal('char', 'pickaxe')));
WaitForTarget(550);
TargetToObject(Self());
repeat
CheckSave;
Wait(waitTime);
until (InJournalBetweenTimes(endMsg + '|' + stopMsg, startDate, Now()) > 0) or (GetTickCount() > (startTime + waitTime * 5));
if (InJournalBetweenTimes(oreMsg, startDate, Now()) > 0) then
circle := circle + 1
else
begin
if (InJournalBetweenTimes('ore in your pack|ores in your pack', startDate, Now()) > 0) then
begin
circle := 4;
end;
end;
until (InJournalBetweenTimes(stopMsg, startDate, Now()) > 0) or (circle >= stopCircle) or (Weight() > stopWeight);
end.```