/
Chat.simba
925 lines (686 loc) · 17.6 KB
/
Chat.simba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
{
====
Chat
====
}
const
CHAT_PUBLIC = 0;
CHAT_PRIVATE = 1;
CHAT_CLAN = 2;
CHAT_TRADE = 3;
Type TChatOption = Record
Str: string;
Bounds: TBox;
end;
(*
SetChat
~~~~~~~
.. code-block:: pascal
function setChat(state: string; chat: Integer): Boolean;
Sets Chat to desired state
Public Private Clan Trade
0 1 2 3
.. note::
by Wizzup?, WT-Fakawi, Starblaster100, N1ke! & Coh3n
Last Modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function setChat(state: string; chat: Integer): Boolean;
var
pnt : TPoint;
tmpCol : TColEx;
mx,Color : Integer;
begin
result := false;
mx := 166 + (chat * 65); // adjust for use w/o game (has no options in OSRS)
if (not InRange(chat, CHAT_PUBLIC, CHAT_TRADE)) then
begin
warn('Chat(' + intToStr(chat) + ') does not exist.', WT_CORE);
Exit;
end;
// No longer any 'all' or 'filter'
case Lowercase(State) of
'on' : Color := 65280;
'off' : Color := 255;
'hide' : Color := 16776960;
'friends' : Color := 65535;
else
warn(state + ' does not exist.', WT_CORE);
end;
// slightly adjust new coordinates
tmpCol.create(Color, 1);
if (not tmpCol.findIn(toBox(mx-10,490,mx+10,500), pnt)) then
begin
mouse(point(mx,495), 5, 5, MOUSE_RIGHT);
Wait(RandomRange(50, 150));
if (Lowercase(State) = 'off') then
begin
case chat of
CHAT_PUBLIC : mouse(Point(mx,496-33), 8, 3, MOUSE_LEFT);
CHAT_PRIVATE..CHAT_TRADE : mouse(Point(mx,496-20), 8, 3, MOUSE_LEFT);
end;
Wait(RandomRange(50, 150));
tmpCol.create(Color, 1);
Result := tmpCol.findIn(toBox(mx-10,490,mx+10,500), pnt);
end else
Result := waitOption(Capitalize(State), 300);
end;
end;
(*
SetAllChats
~~~~~~~~~~~
.. code-block:: pascal
procedure setAllChats(Pub, Priv, Clan, Trade: string);
Sets all the chats to a particular state in one simple procedure.
Leave the parameter as '' if you wish to leave the chat as it is.
.. note::
by ZephyrsFury
Last Modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
setAlChats('Hide', '', 'Off', '');
*)
procedure setAllChats(Pub, Priv, Clan, Trade: string);
var
States: TStringArray;
II: Integer;
begin
if not isLoggedIn() then Exit;
States := [Pub, Priv, Clan, Trade];
for II := 0 to 3 do
begin
if (States[II] = '') then Continue;
setChat(States[II], II);
end
end;
(*
ChatsOff
~~~~~~~~
.. code-block:: pascal
procedure chatsOff();
Sets all Chats to off.
.. note::
by Starblaster100
Last Modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
procedure chatsOff();
var
i: Integer;
begin
for i := CHAT_PUBLIC to CHAT_TRADE do
setChat('off', i);
end;
(*
ClickContinueEx
~~~~~~~~~~~~~~~
.. code-block:: pascal
function clickContinueEx(Click, Wait: Boolean): Boolean;
Returns true if the blue 'Click To Continue' text in the chat box is found.
If will click if Click = True.
.. note::
by _ChArMz & Narcle (Original by EvilChicken!)
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function clickContinueEx(Click: Boolean): Boolean;
var
b : TBox;
pnt : TPoint;
tmpCol : TColEx;
Height,i,x,y : Integer;
bTxt,wTxt,TextTPA,
SearchTPA,Matches : TPointArray;
Search2D : T2DPointArray;
begin
Result := false;
// only 1 blue color in chat.
tmpCol.create(16711680, 10);
tmpCol.findAllIn(AREA_CB, bTxt);
tmpCol.create(16777215, 30);
tmpCol.findAllIn(AREA_CB, wTxt);
SearchTPA := combineTPA(bTxt, wTxt);
if length(SearchTPA) < 1 then
Exit(false);
Search2D := clusterTPAEx(SearchTPA, 20, 2);
// TO DO: figure out proper Text name (CharsNPC07).. then call will work.
TextTPA := loadTextTPA('here to conti', CharsNPC07, Height);
for i := 0 to High(Search2D) do
begin
Result := findTextTPAinTPA(Height, TextTPA, Search2D[i], Matches);
if Result and Click then
begin
b := Search2D[i].getBounds();
pnt := getMousePnt();
if pointInBox(pnt, b) then
Mouse(pnt, 2, 1, MOUSE_LEFT)
else
with b do
Mouse(point(RandomRange(x1,x2), RandomRange(y1+2,y2-2)), 2, 1, MOUSE_LEFT);
end;
if Result then
Break;
end;
end;
function waitChatChange(): Boolean;
var
T : Timer;
bCol : TColEx;
C : Integer;
begin
bCol.create(0,1);
C := bCol.count(AREA_CB);
T.start();
while T.timeElapsed() < 5000 do
if (bCol.count(AREA_CB) <> C) then
Exit(true);
end;
Function clickContinue(DoWait: Boolean): Boolean;
begin
clickContinueEx(True);
if DoWait then
waitChatChange();
end;
(*
ClickToContinue
~~~~~~~~~~~~~~~
.. code-block:: pascal
function clickToContinue(): Boolean;
Click the blue 'Click To Continue' text in the chat box.
.. note::
by ZephyrsFury
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function clickToContinue(): Boolean;
begin
Result := clickContinue(False);
end;
// Continue chat via the space bar
function continueChat(Wait: Boolean = True): Boolean;
var
b : TBox;
pnt : TPoint;
tmpCol : TColEx;
Height,i,x,y : Integer;
bTxt,wTxt,TextTPA,
SearchTPA,Matches : TPointArray;
Search2D : T2DPointArray;
begin
Result := false;
// only 1 blue color in chat.
tmpCol.create(16711680, 10);
tmpCol.findAllIn(AREA_CB, bTxt);
tmpCol.create(16777215, 30);
tmpCol.findAllIn(AREA_CB, wTxt);
SearchTPA := combineTPA(bTxt, wTxt);
if length(SearchTPA) < 1 then
Exit(false);
Search2D := clusterTPAEx(SearchTPA, 20, 2);
// TO DO: figure out proper Text name (CharsNPC07).. then call will work.
TextTPA := loadTextTPA('here to conti', CharsNPC07, Height);
for i := 0 to High(Search2D) do
if findTextTPAinTPA(Height, TextTPA, Search2D[i], Matches) then
begin
TypeByte(vk_Space);
if Wait then
waitChatChange();
result := True;
Break;
end;
end;
(*
GetTextCoords
~~~~~~~~~~
.. code-block:: pascal
Function getTextCoords(textn: Integer): TPoint;
Returns x, y for text. (1 to 8)
.. note::
by Wizzup?
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function getTextCoords(textn: Integer): TPoint;
begin
Result.X := 15;
Result.Y := 346 + (14 * (textn - 1));
end;
(*
GetChatBoxText
~~~~~~~~~~~~~~
.. code-block:: pascal
function getChatBoxText(Line, TextCol: Integer): string;
Gets text on the line Line with colour TextCol.
(Line 1 is the top, Line 8 is the bottom line).
Colours:
- clMessage/clBlack - Black text messages ("Oh Dear you are dead", etc).
- clChat/clBlue - Chat messages from you and other players.
- clTrade/clPurple - Colour of trade request text.
- clFriend - Colour of friend and clan chat.
Works with other colours too.
.. note::
by ZephyrsFury
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function getChatBoxText(Line, TextCol: Integer): string;
var
B : TBox;
P : TPoint;
bCol : TColEx;
cArr : TPointArray;
begin
Result := '';
P := getTextCoords(Line);
bCol.create(TextCol, 0);
if bCol.findAllIn(toBox(MCX1,P.y,MCX2,P.y+13), cArr) then
begin
B := cArr.getBounds();
result := Trim(getTextAtExWrap(b.x1-1,p.y,B.x2+1,p.y+13,0,5,2,TextCol,0,SmallChars07));
end;
end;
(*
FindChatBoxText
~~~~~~~~~~~~~~~
.. code-block:: pascal
function findChatBoxText(Text: string; Line: Integer; TextCol: Integer): Boolean;
Searches for Text on Line with colour TextCol. True if found.
.. note::
by ZephyrsFury
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function findChatBoxText(Text: string; Line: Integer; TextCol: Integer): Boolean;
begin
Result := (Pos(Text, getChatBoxText(Line, TextCol)) > 0);
end;
(*
IsChatBoxTextBetween
~~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function isChatBoxTextBetween(Text: string; TextCol, StartLine, EndLine: Integer): Boolean;
Returns true if Text with colour TextCol is found anywhere in the chat box.
.. note::
by ZephyrsFury
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function isChatBoxTextBetween(Text: string; TextCol, StartLine, EndLine: Integer): Boolean;
var
II: Integer;
begin
for II := Max(StartLine, EndLine) downto Min(StartLine, EndLine) do
if (findChatBoxText(Text, II, TextCol)) then
Exit(True);
Result := False;
end;
(*
IsChatBoxTextAnyLine
~~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function isChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
Returns true if Text with colour TextCol is found anywhere in the chat box.
.. note::
by ZephyrsFury
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function isChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
begin
Result := isChatBoxTextBetween(Text, TextCol, 1, 8);
end;
function isChatBoxTextAnyLineEx(Text: TStringArray; TextCol: Integer): Boolean;
var
i : Integer;
begin
result := false;
for i:=0 to high(Text) do
if isChatBoxTextBetween(Text[i], TextCol, 1, 8) then
Exit(true);
end;
(*
ChatBoxTextArray
~~~~~~~~~~~~~~~~
.. code-block:: pascal
function chatBoxTextArray(TextCol: Integer): TStringArray;
Gets and return a TStringArray with the contents of each line
with the colour TextCol (see GetChatBoxText for list of colours).
Gets and return a TStringArray with the contents of each line
with the colour TextCol (see GetChatBoxText for list of colours).
- Line 1 is Result[1]
- Line 2 is Result[2]
- Line 3 is Result[3]
- Line 4 is Result[4]
- Line 5 is Result[5]
- Line 6 is Result[6]
- Line 7 is Result[7]
- Line 8 is Result[8]
.. note::
by ZephyrsFury
Example:
.. code-block:: pascal
*)
function chatBoxTextArray(TextCol: Integer): TStringArray;
var
II: Integer;
begin
SetLength(Result, 9);
for II := 8 downto 1 do
Result[II] := getChatBoxText(II, TextCol);
end;
(*
GetBlackChatMessage
~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function getBlackChatMessage: String;
Gets text with color 0 in last chat line.
.. note::
by Wizzup?
Example:
.. code-block:: pascal
*)
function getBlackChatMessage(): string;
begin
Result := getChatBoxText(8, clBlack);
end;
(*
FindBlackChatMessage
~~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function findBlackChatMessage(ChatMsg: String): Boolean;
Returns True if text with color 0 in last chat line is found.
.. note::
by Wizzup?
Example:
.. code-block:: pascal
*)
function findBlackChatMessage(ChatMsg: string): Boolean;
begin
Result := (Pos(ChatMsg, getChatBoxText(8, clBlack)) > 0);
end;
function findBlackMessageMulti(ChatMsgs: TStringArray): Boolean;
var
i : Integer;
begin
result := false;
for i:=0 to high(ChatMsgs) do
if (Pos(ChatMsgs[i], getChatBoxText(8, clBlack)) > 0) then Exit(true);
end;
(*
LastChatter
~~~~~~~~~~~
.. code-block:: pascal
function lastChatter(var name: String): Boolean;
Returns name and true if a person was talking, or false and the text
.. note::
by masquerader
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
function lastChatter(var name: string): Boolean;
var
i: Integer;
begin
Result := False;
Name := LowerCase(getBlackChatMessage());
Name := Between(Name, Name[0], ':');
Result := (Name <> '');
end;
(*
GetLastChatText
~~~~~~~~~~~~~~~
.. code-block:: pascal
function getLastChatText(var chat: String): Boolean;
Returns true if blue chat text was found
.. note::
by masquerader / Wizzup?
Example:
.. code-block:: pascal
*)
function getLastChatText(var chat: string): Boolean;
begin
Chat := getChatBoxText(8, clBlue);
Result := (Chat <> '');
end;
(*
InChat
~~~~~~
.. code-block:: pascal
function inChat(Text: String): Boolean;
Grabs Last Chat Line and performs checks on occurence of text
.. note::
by WT-Fakawi
Example:
.. code-block:: pascal
*)
function inChat(Text: string): Boolean;
var
s: string;
begin
if (not (getLastChatText(s))) then
lastChatter(s);
Result := (Pos(LowerCase(Text), Lowercase(s)) > 0);
end;
(*
FixChat
~~~~~~~
.. code-block:: pascal
procedure fixChat();
Scrolls ChatText scrollbar down.
.. note::
by WT-Fakawi
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
*)
procedure fixChat();
var
ScrollX, ScrollY: Integer;
begin
ScrollX := 507 + Random(8);
ScrollY := 451 + Random(8);
if (getColor(502, 442) = 1646629) then // changed coords + color
begin
mouse(point(ScrollX,ScrollY), 0, 0, MOUSE_MOVE);
HoldMouse(ScrollX, ScrollY, MOUSE_LEFT);
while (getColor(502, 442) = 1646629) do
Wait(10 + random(15));
Wait(50+random(50));
releaseMouse(ScrollX, ScrollY, mouse_left);
Wait(100+random(50));
end;
end;
function getChatOptions(): Array of TChatOption;
var
B : TBox;
mPnt,pnt : TPoint;
tmpCol,
bCol,wCol: TColEx;
i,x,y : Integer;
bPnts,
wPnts : TPointArray;
bAP,wAP,
tmpatpa : T2DPointArray;
begin
tmpCol.create(6383633, 30);
if not tmpCol.findIn(toBox(410,365,417,372), pnt) then
Exit;
bCol.create(0, 1);
wCol.create(16777215, 15);
bCol.findAllIn(toBox(MCX1,381,MCX2,470), bPnts);
wCol.findAllIn(toBox(MCX1,381,MCX2,470), wPnts);
if ((length(bPnts) < 1) and (length(wPnts) < 1)) then Exit;
bAP := clusterTPAEx(bPnts, 20, 2);
setArrayLength(Result, Length(bAP));
wAP := clusterTPAEx(wPnts, 20, 2);
bPnts := [];
wPnts := [];
sortATPAFromFirstPointX(bAP, Point(0,0));
for i:=0 to high(bAP) do
begin
B := bAP[i].getBounds();
bCol.findAllIn(B, bPnts);
tmpatpa := clusterTPAEx(bPnts, 1, 10);
sortATPAFromFirstPointX(tmpatpa, Point(0,0));
result[i].Bounds := B;
result[i].Str := getTextATPA(tmpatpa, 5, 'CharsNPC07');
end;
if length(wAP) < 1 then Exit;
setArrayLength(Result, (Length(result)+Length(wAP)));
sortATPAFromFirstPointX(wAP, Point(0,0));
for i:=0 to high(wAP) do
begin
B := wAP[i].getBounds();
wCol.findAllIn(B, wPnts);
tmpatpa := clusterTPAEx(wPnts, 1, 10);
sortATPAFromFirstPointX(tmpatpa, Point(0,0));
result[High(result)].Bounds := B;
result[High(result)].Str := getTextATPA(tmpatpa, 5, 'CharsNPC07');
end;
end;
(*
GetNPCChatName
~~~~~~~~~~~~~~
.. code-block:: pascal
function getNPCChatName(): string;
Gets the name of the random event NPC from the top of the chat box. The proper
font doesn't exist yet, so it returns a random string of characters.
.. note::
Author: DemiseSythe
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
writeln(getNPCChatName());
*)
function getNPCChatName(): string;
begin
result := getTextAtExWrap(116, 358, 498, 377, 0, 50, 60, 128, 15, CharsNPC07);
end;
(*
AreTalking
~~~~~~~~~~
.. code-block:: pascal
function areTalking(): boolean;
Returns true if player is talking to an NPC.
.. note::
Author: Wizzup?
Last modified: 23/1/14 by Flight
Example:
.. code-block:: pascal
while (areTalking()) do
clickContinue(true);
*)
function areTalking(): boolean;
begin
result := (getNPCChatName() <> '');
end;
function chatOptionScreen(): Boolean;
var
pnt : TPoint;
colO,colB : TColEx;
begin
colO.create(128, 10);
colB.create(6383633, 25);
if not colB.findIn(toBox(MCX1,MCY1,MCX2,390), pnt) then
Exit(False);
result := colO.findIn(toBox(MCX1,MCY1,MCX2,390), pnt);
end;
function findNPCChatTextMulti(txt: TStringArray; Click, DoWait: Boolean): boolean;
var
T : Timer;
pnt : TPoint;
tmpCol : TColEx;
h,i : Integer;
Opts : Array of TChatOption;
begin
if not isLoggedIn() then Exit;
Opts := getChatOptions();
if (length(Opts) < 1) then Exit;
for h:=0 to high(txt) do
for i:=0 to high(Opts) do
if (Pos(txt[h], Opts[i].Str) <> 0) then
begin
if not Click then
Exit(true);
mouseBox(Opts[i].Bounds, MOUSE_LEFT);
if DoWait then
begin
tmpCol.create(6383633, 30);
T.start();
repeat
if not tmpCol.findIn(toBox(410,365,417,372), pnt) then
break;
until(T.timeElapsed() < 5000);
end;
Exit(true);
end;
end;
function findNPCChatText(txt: string; Click: Boolean): boolean;
begin
result := findNPCChatTextMulti([txt], Click, True);
end;
(*
DoConversationEx
~~~~~~~~~~~~~~
.. code-block:: pascal
function doConversationEx(resultText: TStringArray; clickresult: boolean): boolean;
Goes through the initial dialog of a random. Will keep clicking to continue
until any of the conversation's 'resultText' is found. Will click to continue when
any 'resultText' is found if 'clickresult' is set to true. Set 'resultText' to ['']
to click continue until conversation is over.
.. note::
Author: Coh3n, Flight
Last Modified: Jun. 15th, 2013 by Flight
Example:
.. code-block:: pascal
if (DoConversationEx(['thank','nk you'], true)) then
writeln('Finished conversation');
*)
function doConversationEx(resultText: TStringArray; ClickResult: Boolean): boolean;
var
t,i: integer;
begin
while (t < 25) do
begin
if length(resultText) > 0 then
begin
if ClickResult then
begin
if findNPCChatTextMulti(resultText, ClickResult, True) then
Exit(true);
end else
begin
if (findNPCChatText(resultText[i], False)) then
Exit(true);
end;
end;
if not continueChat() then
exit;
wait(100 + random(200));
inc(t);
end;
end;
function doConversation(resultText: TStringArray): boolean;
var
T : Timer;
begin
Result := false;
T.start();
repeat
findNPCChatTextMulti(resultText, True, True);
continueChat();
if not areTalking() then
break;
until(T.timeElapsed() > 8000);
result := not areTalking();
end;