PDA

View Full Version : Talking To NPC



BigRedJapan
05-31-2012, 06:38 PM
How can i make it click something and check to make sure it clicked the option!

Brandon
05-31-2012, 07:01 PM
DoConversation('', True);
FindNPCChatText(.....);
DidRedClick.

should suffice..

Recursive
05-31-2012, 07:10 PM
Use a findobj() function to click whatever you are trying to click then look for the npc chathead in the chatbox by checking for the dtm. Then use an if statement with a findtext() function to find the option you are looking for.

(*
FindText
~~~~~~~~

.. code-block:: pascal

function FindText(var cx, cy: Integer; txt,font: string; xs, ys, xe, ye: Integer): Boolean;

Searches for text in specified box with specified font.

.. note::

by Coh3n

Example:

.. code-block:: pascal

*)
function FindText(var cx, cy: integer; txt, font: string; xs, ys, xe, ye: integer): boolean;
begin
result := findTextEx(cx, cy, [txt], [font], xs, ys, xe, ye);
end;

Can't explain how to get the dtm, but if you are interested in this method, pm me

Here is a function by Mat that finds an obj whereever...

function FindObj_pX(Mouse:Boolean;pX, pY,Null,Null2: Integer; Mod1,Mod2:Extended;Lol1:String): Boolean;
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
FindNormalRandoms;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Mod1, Mod2);
If Not Mouse then
FindColorsSpiralTolerance(MSCX, MSCY, TPA,Null, 190, 140, 320, 230, Null2) else
FindColorsSpiralTolerance(MSCX, MSCY, TPA,Null, MSX1, MSY1, MSX2, MSY2, Null2);

ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], pX, pY);
If Mouse then
begin
MMouse(pX, pY, 2, 2);
Wait(300+Random(75));
If(IsUpTextMultiCustom([Lol1])) then
begin
Result := True;
GetMousePos(pX, pY);
Break;
end;
end else
Result := True;
end;
end;

Or Pm the user known as Flight, he is beastly at making obj finding functions (referring to his ZMI crafter ofc :D)

YoHoJo
05-31-2012, 07:12 PM
Tutorial island section is for tutorials, NOT scripting help.
This belongs in the scripting help section.

BigRedJapan
05-31-2012, 11:07 PM
Tutorial island section is for tutorials, NOT scripting help.
This belongs in the scripting help section.

FYI THis is the Development! And Not Only for Tutorials!:google:

CephaXz
05-31-2012, 11:14 PM
FYI THis is the Development! And Not Only for Tutorials!:google:

I didn't even know you could know more about the forum than a mod.

FYI, this section is for development tutorials, which only tutorials can be posted here. From the threads you created, it doesn't looks like a development to me.