• 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

Question - More elegant solution than a delay when using a chat channel?

My guild uses OpenDKP and I wanted to write a Lua to automatically upload loot for auction on raids.

The way the automatic update works uses a small app that monitors an EQ log file for any items named in a specified chat channel and updates the DKP site with those items it "sees".

I wrote a Lua to run through the shared advloot list and put each item name into the chat channel. It "works" and is easier than other options.

My only initial issue was that it would sometimes miss items - and this appeared to be because the chat channel couldn't keep up (or I hit some anti-spam filter?). I have since "solved" the issue by adding a delay of 2 seconds after the post to the chat channel (bolded in the code snippet below).

My question is this - is there a more elegant way of checking that the chat channel has got the message before moving on to the next item? I'm still learning Lua so would be keen to hear any better solutions! Thanks!

Code snippet:

Code:
        print('\ay*** Attempting to load loot ***')
        for i = 1, mq.TLO.AdvLoot.SCount() do
            lootitem = tostring(mq.TLO.AdvLoot.SList(i).Name())
            -- If the item is not an ornament, load it up
            if not string.match(lootitem, "Ornament") then
                itemsloaded = itemsloaded + 1
                mq.cmdf('/1 %s', lootitem)
                printf('\at- %s', lootitem)
                mq.delay(2000)
            end
            mq.delay(200)
        end
        printf('\ay*** %d items loaded - ending lua ***', itemsloaded)
 
You could use events to see when lootitem was posted in chat (edit: and set a variable), and use that as part of a function to callback/break when it happens.
 
When I tried this before, I just used the linking from the advloot window. If you right or left click the name of the mob, it gives you an option to link all of the loot from that mob. Just in case you did not know about that, as I did not until a year ago or so.

I think OpenDKP monitor process monitors a specific chat channel, so I would just make sure I had the window that was set to go to that chat channel selected before linking.
 
When I tried this before, I just used the linking from the advloot window. If you right or left click the name of the mob, it gives you an option to link all of the loot from that mob. Just in case you did not know about that, as I did not until a year ago or so.

I think OpenDKP monitor process monitors a specific chat channel, so I would just make sure I had the window that was set to go to that chat channel selected before linking.

It does, indeed! However, when I tried it, it spreads its links across a number of lines and then you need to go back and get them into the chat channel - which is messy and prone to error. I'm hoping for something a bit "cleaner". Thanks, though!
 
Episode 4 Lightsaber GIF by Star Wars
 
Question - More elegant solution than a delay when using a chat channel?

Users who are viewing this thread

Back
Top
Cart