• 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

Idea - Got tired of lootnscoot crashing and needing to restart RGMercs so added this.

drawthow

Well-known member
Joined
Sep 8, 2019
RedCents
2,081¢
I added a line to restart lootnscoot when the message is displayed that it's not running. So for the only problem is in the multiple entries in the master looting table for character selection, but I had that problem when restarting RGMercs on characters that the loot crashed on.



function Module:GiveTime(combat_state)
if not Config:GetSetting('DoLoot') then return end
if Config.Globals.PauseMain then return end
if mq.TLO.Lua.Script('lootnscoot').Status() ~= 'RUNNING' then
if not warningMessageSent then
Core.DoCmd("/lua run lootnscoot directed rgmercs")
Logger.log_error("\ar[LOOT]: Looting is enabled, but LNS does not appear to be running!")
Comms.PrintGroupMessage("%s has looting enabled, but LNS does not appear to be running!", mq.TLO.Me.CleanName())
warningMessageSent = true
end
return
end
 
Glad it works for you.
One would hope the crashes were solved so it wasn't necessary.
You could say the same thing about the warning of course ;)
 
Another thought ..
You could do something like this with an external script, so that you don't lose your changes when mercs is updated.
The alternative there is to fork the mercs repo, so you can very easily pull in changes to mercs and be able to keep your customization via a merge commit or rebase.
I am not sure whether that is something that you are familiar with, so wanted to throw it out in case you were interested.
 
Another thought ..
You could do something like this with an external script, so that you don't lose your changes when mercs is updated.
The alternative there is to fork the mercs repo, so you can very easily pull in changes to mercs and be able to keep your customization via a merge commit or rebase.
I am not sure whether that is something that you are familiar with, so wanted to throw it out in case you were interested.
Thanks for the info but I think its way above my ability. I'm just a cut and past and hope it works kind of a guy. Not very knowledgeable in programing just use a little PowerShell and tsql scrip for work.
 
Not sure if grims been around this week but can try to fix the crashes if there is some info on how to reproduce them. Haven't ever seen it just end without a stacktrace myself like was being described in the LNS thread.
 
Not sure if grims been around this week but can try to fix the crashes if there is some info on how to reproduce them. Haven't ever seen it just end without a stacktrace myself like was being described in the LNS thread.
I have provided what I see, there isn't am error message in the crash. It is returning a 0 so looking like it exits gracefully.
 
I have provided what I see, there isn't am error message in the crash. It is returning a 0 so looking like it exits gracefully.
Not to dredge up an old topic but I was dealing with the same issue playing on Perky Crew. I made a Lua that I run alongside my normal startup procedures and its sole purpose is to watch for lootnscoot to be running and if not restart it using /Lua run lootnscoot directed rgmercs.

Has worked for the exact scenario you were describing.


Lua:
local mq = require('mq')

local lootScriptName = 'lootnscoot'
local lootArgs = 'directed rgmercs'

local checkEveryMs = 2000
local missingThreshold = 2
local missingCount = 0

local function getStatus()
  local ok, status = pcall(function()
    -- Status is documented as a string like STARTING/RUNNING/PAUSED/EXITED
    return mq.TLO.Lua.Script(lootScriptName).Status()
  end)
  if not ok then return nil end
  return status
end

local function restartLoot(reason)
  print(('\ay[Watcher]\ax Restarting \at%s\ax (%s)'):format(lootScriptName, reason or 'unknown'))
  -- clears stale EXITED entries if they linger
  mq.cmdf('/lua stop %s', lootScriptName)
  mq.delay(200)
  mq.cmdf('/lua run %s %s', lootScriptName, lootArgs)
end

while true do
  local status = getStatus()

  if status == nil then
    -- couldn't read status this tick, don't change counters
  elseif status == 'RUNNING' or status == 'STARTING' then
    missingCount = 0
  else
    -- PAUSED or EXITED (or anything unexpected) => treat as not healthy
    missingCount = missingCount + 1
    if missingCount >= missingThreshold then
      restartLoot('status=' .. tostring(status))
      missingCount = 0
      mq.delay(1500)
    end
  end

  mq.delay(checkEveryMs)
end
 
Idea - Got tired of lootnscoot crashing and needing to restart RGMercs so added this.

Users who are viewing this thread

Back
Top
Cart