• 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

Problem - modloot.inc Scripting Error

Joined
Dec 30, 2010
RedCents
44¢
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