• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Problem - TLO.Merchant anomalies

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
Cart