Is there any way to find the text, for example where the banker says in black NPC text: "Good day. How can I help you?"
I tried modifying the code:
Simba Code:
{*******************************************************************************
function ClickTextNPC (TextFragment: String; Click, Wait: Boolean): Boolean;
By: _ChArMz & Narcle (Original by EvilChicken!)
Description: Returns true if it clicks the option from TextFragment.
*******************************************************************************}
function ClickTextNPC (TextFragment: String; Click, Wait: Boolean): Boolean;
var
bTxt, wTxt, SearchTPA, TextTPA, Matches : TPointArray;
Search2D : T2DPointArray;
b : TBox;
Height, i, x, y : Integer;
begin
Result := false;
FindColors(bTxt, 0, MCX1, MCY1, MCX2, MCY2);
FindColors(wTxt, 0, MCX1, MCY1, MCX2, MCY2);
SearchTPA := CombineTPA(bTxt, wTxt);
if Length(SearchTPA) < 1 then
Exit;
Search2D := SplitTPAEx(SearchTPA, 20, 2);
TextTPA := LoadTextTPA(TextFragment, NPCChars, Height);
for i := 0 to High(Search2D) do
begin
Result := FindTextTPAinTPA(Height, TextTPA, Search2D[i], Matches);
if Result and Click then
begin
b := GetTPABounds(Search2D[i]);
GetMousePos(x, y);
if PointInBox(Point(x, y), b) then
Mouse(x, y, 2, 1, True)
else
with b do
Mouse(RandomRange(x1, x2), RandomRange(y1 + 2, y2 - 2), 2, 1, True);
if Wait then
ChatWait;
end;
if Result then
Break;
end;
end;
This usually finds the text, sometimes is a bit off to the right (but seems to always hit the text though.
I need it to select chat options.
Is this code already added in chat.simba somewhere? I might have missed it. Couldn't find anything like it, but would be extremely useful for myself and others who have to select chat options.
Also very good for random events :P
If there is working code for the black text, just tell me the function and close this thread