• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

Problem - TLO.Merchant anomalies (1 Viewer)

Joined
Sep 27, 2020
RedCents
5,994¢
Have a Lua script I'm working on which interacts with a merchant. Have a couple things that don't seem to operate as expected.

  • Merchant.OpenWindow() is mostly failing. I've used it before in other scripts, but haven't used those scripts in the last few months. Target.RightClick() always works
  • After a merchant window is open (and items populated), calls to Merchant.CleanName() and Merchant.Name() result in attempt to call field '<field>' (a nil value)

I don't believe this isn't something related to the latest MQ build. The first issue I noticed few weeks ago. The second could be related as I only tried using it today, but it seems unlikely given the patch notes.
 
What does failure mean in this scenario? Can you post a snippet of code for reproduction and possibly better explain the first issue? I'm assuming this is on a Live server?

For the second issue, mq.TLO.Merchant should inherit from spawn, so are you saying that mq.TLO.Merchant.CleanName() gives you that or are you doing something else in your code before that?
 
For the first item, failure means the Merchant window did not open. It works sometimes (I'd say less than 30% of the time), but not reliably all the time. This is on Live, but specifically in tutorialb (Merchant Wijdan).

Set up: If Wijdan is greater than a distance 15, nav to there first.

Code:
local mq = require("mq")
local wijdan = mq.TLO.Spawn("Wijdan")
wijdan.DoTarget()
mq.delay(2000, function ()
    return mq.TLO.Target.ID() == wijdan.ID()
end)
mq.cmd("/hail")
mq.delay(250)
mq.delay(1000, function()
    return mq.TLO.Window("LargeDialogWindow").Open()
end)
if (mq.TLO.Window("LargeDialogWindow").Open()) then
    mq.TLO.Window("LargeDialogWindow").Child("LDW_OkButton").LeftMouseUp()
    mq.delay(1000, function()
        return not mq.TLO.Window("LargeDialogWindow").Open()
    end)
    mq.delay(100)
end
mq.TLO.Merchant.OpenWindow()
mq.delay(5000, function ()
    return mq.TLO.Merchant.Open()
end)
mq.delay(10000, function ()
    return mq.TLO.Merchant.ItemsReceived()
end)
local item = mq.TLO.FindItem("Rat Ears")
if (item.Stack() and not item.NoTrade()) then
    print(string.format("Sell %s %s to %s", item.Stack(), item.Name(), mq.TLO.Merchant.CleanName()))
end
mq.TLO.Window("MerchantWnd").DoClose()

(Window.DoClose() is used because Merchant.CloseWindow() reports as "Not implemented yet")

Using Target.RightClick() instead of Merchant.OpenWindow(), the Merchant window opens within a second on my machine. With Merchant.OpenWindow(), it either opens right away, or not at all. I've played with the delay increasing it to 30 seconds, but it remains inconsistent. This snippet isn't identical to the running code, but it functionally and materially the same. That said, the snippet appears to behave. I'm testing with an additional delay before attempting to open the window (after closing the dialog).

For the second item, I collected something to sell. In this case, Rat Ears. The lines given are functionally the same as the base code except the base code is looping through a list of item names (used where "Rat Ears" is specified in this example). The same error is given even if I manually right-click Wijdan and use /lua parse mq.TLO.Merchant.CleanName().
 
Problem - TLO.Merchant anomalies

Users who are viewing this thread

Back
Top