• 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 - How to keep a LUA script running when I zone?

How do I keep this (or any) Lua script running when I zone?
Thanks, in advance, for your help.

Travel to LS
Lua:
---@type Mq
mq = require('mq')

function Main()
    local use_gh = {
        ['Guild Lobby'] = true,
        ['The Bazaar'] = true,
        ['The Plane of Knowledge'] = true,
    }
    local current_zone = mq.TLO.Zone.Name()
    print(current_zone)
    if use_gh[current_zone] ~= nil then
        mq.cmd('/travelto guildhalllrg')
        while mq.TLO.Navigation.Active() do
            mq.doevents()
            mq.delay(100)
        end
        mq.delay(100)
    end
    if mq.TLO.Zone.Name() == "Palatial Guild Hall" then
        mq.cmd('/lua run guildclicky')
        mq.delay(1000)
        mq.cmd('/gc laurion')
    end
end

Main()
 
you need a loop to say "hey keep this running"
in the above, it is "staying alive" in your while loop, but as soon as that while loop ends you're going to fall out of the bottom
Lua:
---@type Mq
mq = require('mq')
local run = true
local function GetMyZone()
    return mq.TLO.Zone.Name()
end

 local use_gh = {
        ['Guild Lobby'] = true,
        ['The Bazaar'] = true,
        ['The Plane of Knowledge'] = true,
    }

local function Main()
    print(GetMyZone())
    if use_gh[GetMyZone()] ~= nil then
        mq.cmd('/travelto guildhalllrg')
        while mq.TLO.Navigation.Active() do
            mq.doevents()
            mq.delay(100)
        end
        mq.delay(100)
    end
    if GetMyZone == "Palatial Guild Hall" then
        mq.cmd('/lua run guildclicky')
        mq.delay(1000)
        mq.cmd('/gc laurion')
    end
    if GetMyZone == "Laurion Inn" then
        print('I have arrived in laurion inn!')
        run = false
    end
end

while run do
    Main()
    mq.delay(500)
end

maybe something like that?
 
Thanks to Sic, here is my completed code doodle.
It just extends the guild clicky reach to the world, just remember you will go to the guild hall and you will use guild clicky. Even if you are already in the zone you want to go to. 🤣
Lua:
--[[
    Created by Pricklygoat723
    with thanks to Sic for teaching me not to trust outside variables to much
--]]
---@type Mq
mq = require('mq')

local args = {...}
local guild_clicky_name = args[1]
local travelto_set = false

local function PrintCmd(cmd)
    print(cmd)
    mq.cmd(cmd)
end

local function Main()
    local zone = mq.TLO.Zone.Name()
    if zone == 'Palatial Guild Hall' then
        print(zone)
        PrintCmd('/lua run guildclicky')
        mq.delay(1000)
        PrintCmd('/gc ' .. guild_clicky_name)
        return false
    elseif not travelto_set then
        print(zone)
        PrintCmd('/travelto guildhalllrg')
        travelto_set = true
    end
    return true
end

if guild_clicky_name ~= nil then
    while Main() do
        mq.delay(500)
    end
else
    print('Please pass a Guild Clicky name.')
end
 
Question - How to keep a LUA script running when I zone?

Users who are viewing this thread

Back
Top
Cart