L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Select npc dialog by order number or display string
Author Message
lifenz Offline
Expired VIP Member
**

Posts: 62
Joined: Feb 2014
Reputation: 33
Version: 1.4.2.142
Post: #1
WTS Select npc dialog by order number or display string

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.
(This post was last modified: 03-18-2014 10:48 AM by lifenz.)
03-18-2014 10:40 AM
Find all posts by this user Quote this message in a reply
 Reputed by : kerberos464(+2)
lifenz Offline
Expired VIP Member
**

Posts: 62
Joined: Feb 2014
Reputation: 33
Version: 1.4.2.142
Post: #2
RE: Select npc dialog by order number or display string

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
03-27-2014 13:18 PM
Find all posts by this user Quote this message in a reply
lifenz Offline
Expired VIP Member
**

Posts: 62
Joined: Feb 2014
Reputation: 33
Version: 1.4.2.142
Post: #3
RE: Select npc dialog by order number or display string

Up
06-21-2014 00:54 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)