Lineage 2 Tower Forum

Full Version: Select npc dialog by order number or display string
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

WTS SelectDialog and SelectDialogWait functions library, allowing you to select dialog by position number or display dialog.

Documentation

Code:
SelectDialog(integer or string) : parse the npc html and perform a Click or ClickLink. Returns true in case of success, false in case of failure.

SelectDialogAndWait(integer or string) : parse the npc html and perform a ClickAndWait or ClickLinkAndWait. Returns true in case of success, false in case of failure.

NB: SelectDialog can not be used with string parameter for the gate keeper teleport location, since the town names are not contained in the html.

Examples :
Code:
dofile (GetDir() .. "\\scripts\\SelectDialog.lua")
-- Getting wizzard harmony
TargetNpc("Adventurers' Guide", 0)
Talk()
SelectDialogAndWait(2)
SelectDialog(3)

Code:
dofile (GetDir() .. "\\scripts\\SelectDialog.lua")
-- Going to gludio airship from gludio's gatekeeper
TargetNpc("Bella", 0)
Talk()
SelectDialogAndWait(1)
SelectDialog(1)
WaitForTeleport()

Code:
dofile (GetDir() .. "\\scripts\\SelectDialog.lua")
-- opening general store in Dion grocer
TargetNpc("Lars", 0)
Talk()
SelectDialogAndWait("buy general")

Code:
dofile (GetDir() .. "\\scripts\\SelectDialog.lua")
-- Going to kartia 85 solo from aden
MoveTo(147552, 27334, -2192, 30)
TargetNpc("", 33647)
SelectDialogAndWait(1)
SelectDialog(1)
WaitForTeleport()

Code:
dofile (GetDir() .. "\\scripts\\SelectDialog.lua")
-- Going to Goddard from Dion's gatekeeper
TargetNpc("Trisha", 0)
Talk()
SelectDialogAndWait("teleport")
SelectDialog(4)
WaitForTeleport()

For any questions/information, please send me a pm

Additional features that can be added :
- logging selection failure on excel file in case the dialog does not exist anymore or the position is incorrect.
New example : getting a wolf quest

Code:
dofile (GetDir() .. "\\scripts\\SelectDialog.lua")
moveDistance = 30

-- Starting : Gludio

-- Go to Lundy and take the quest
MoveTo(-13935, 123344, -3119, moveDistance)
TargetNpc("Lundy", 30827)
Talk()
SelectDialogAndWait(8) -- quest
SelectDialogAndWait(2) -- obtain a wolf
SelectDialogAndWait(1)
SelectDialogAndWait(1)

-- Go to gate keeper
MoveTo(-14471, 124021, -3131, moveDistance)
TargetNpc("Bella", 30256)
Talk()
SelectDialogAndWait(8) -- quest
SelectDialogAndWait(1)
SelectDialogAndWait(1)

-- move to guard
MoveTo(-14243, 126526, -3158, moveDistance);
MoveTo(-14289, 126531, -3154, moveDistance);
TargetNpc("Brynn", 30335);
Talk()
SelectDialogAndWait(2) -- quest
SelectDialogAndWait(1)

-- goto trader sydnia
MoveTo(-14213, 126527, -3160, moveDistance);
MoveTo(-14320, 124060, -3134, moveDistance);
MoveTo(-14594, 123854, -3128, moveDistance);
MoveTo(-15263, 123775, -3123, moveDistance);
MoveTo(-15241, 123418, -3110, moveDistance);
MoveTo(-15235, 123370, -3110, moveDistance);
TargetNpc("Sydnia", 30321);
Talk()
SelectDialogAndWait(5) -- quest
SelectDialogAndWait(1)

-- go back to lundy
MoveTo(-14684, 123441, -3123, moveDistance);
MoveTo(-13929, 123320, -3119, moveDistance);
TargetNpc("Lundy", 30827)
Talk()
SelectDialogAndWait(8) -- quest
SelectDialogAndWait(1) -- obtain a wolf
SelectDialogAndWait(1) -- obtain a wolf
Up
Reference URL's