• 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

Problem - modloot.inc Scripting Error

I enabled looting on my Rogue and it was throwing an error and breaking the script. The error was thrown by the following code on line 217 of modloot.inc:
Code:
/if (${LMFollow}) {

An error is being thrown because LMFollow is defined above it inside a nested /if statement starting on line 181. The variable is out of scope unless FollowFlag is non-zero, as shown below:
Code:
/if (${DeadCount}) {
   /if (${Me.Sneaking}) /multiline ; /doability sneak;/delay 5
   /if (${FollowFlag}) {
     /declare LMFollow bool local TRUE

I revised line 217 to read:
Code:
/if (${FollowFlag} && ${LMFollow}) {

In some languages, it does not even try to evaluate any proceeding booleans if it hits a condition that throws you out of the if statement, however, I was still getting the error, so I am pretty sure MQ2 evaluates until the end of the line.

Here are a couple of ways we could resolve this:

We could nest the lines of code starting at 217 to check for FollowFlag before going any further.
Code:
/if (${FollowFlag}) {
   /if (${LMFollow}) {
      /varset FollowFlag 1
      /call AdvPathCall
      /varset FollowFlag 1
      /squelch /afollow unpause
    } else {
      /call MBMoveTo ${LMStartY} ${LMStartX}
      /delay 15s !${Me.Moving}
      /face heading ${LMStartHeading}
   }
 }

or we could just move the variable declaration to the beginning of the function (what I ended up doing)

Insert this at line 169:
Code:
/declare LMFollow bool local FALSE

and revise the code block starting at Line 181 as follows:
Code:
 /if (${DeadCount}) {
   /if (${Me.Sneaking}) /multiline ; /doability sneak;/delay 5
   /if (${FollowFlag}) {                                           
     /varset LMFollow TRUE

I implemented the second way and it works fine. You may know a better way.
 
Problem - modloot.inc Scripting Error

Users who are viewing this thread

Back
Top
Cart