• 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 - Creating an LUA array from TLO output

Rare Spawn

Well-known member
Hello experts, journeymen and fellow novices. I am trying to write a Lua function that will check if all DanNet peers are within a given (range). It appears the output of the highlighted TLO is a string and not multiple objects, what is the proper method to get where I am trying to go? The reason I am avoiding the mq.TLO.Group.Members() is because the group can have unpredictable humans in it from time to time, so I want to exclude them from check if they are in range or not.

Broken LUA function
Lua:
function BotsNotInRange(range)
    Bots = {mq.TLO.DanNet.Peers()}
    for i,v in ipairs(Bots) do
        print(v)
        if mq.TLO.Group.Member(v).Distance() > range then
            print('\ar'..v..' not in range.')
            return true
        end
    end
end

Thanks in advance.
 
I tried to push my luck, and ChatGPT started "hallucinating" answers that don't exist.

1689560841257.png


There is not TLO for Group.HasMember... and when I called ChatGPT out for it, the response was pretty good!

I apologize for the confusion. It seems I made an incorrect assumption about the existence of the mq.TLO.Group.HasMember function. Without specific knowledge of the underlying libraries or frameworks you are using in your Lua environment, I cannot provide a definitive reference for such a function.

To add a check to validate if v is a member of a group, you would typically need to refer to the documentation or resources specific to the library or framework you are working with. The validation logic may differ depending on the implementation details of your environment.

I recommend consulting the documentation or reference materials related to the mq.TLO.Group or related libraries in your Lua environment to find the appropriate method or function for checking if a member exists in a group. The documentation should provide information on how to perform the desired validation based on the available features and functions provided by the library or framework you are using.
 
you shouldn't be using Group members for this, there is no garauntee that the peers in your response are in your group. You should use the Spawn tlo to look them up by name.
 
you shouldn't be using Group members for this, there is no garauntee that the peers in your response are in your group. You should use the Spawn tlo to look them up by name.

Good point for something called BotsInRange(). I have cleanup, consolidation, and much learning yet.
 
Question - Creating an LUA array from TLO output

Users who are viewing this thread

Back
Top
Cart