• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

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

Joined
Jul 25, 2023
RedCents
2,967¢
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