• 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 - Function help

Can anyone tell me why the following function below when called locks up my eq client?

Called like this: ${agro_function[]}

Rich (BB code):
| -------------------------------------------------------------------------------------
| SUB: agro_function
| -------------------------------------------------------------------------------------
sub agro_function
	/declare abc int local 0

	/if (!${Me.XTarget}) /return FALSE
	|--XTarget Checks
	/for abc 1 to ${Me.XTarget}
	|--XTarget Aggro Check

		/if (${Me.XTarget[${abc}].PctAggro} < 100) /return TRUE
			
	/next abc
/return FALSE
 
Should be called like /if (${agro_function[]}) /dosomething

if by itself and using a ${Macro.Return} then should be /call agro_function

it shouldn't be used like

Sub main
${agro_function[]}
/return

which is the case?
 
I was using it in this statement. It is strange, because it will usually evaluate a couple of times, then it will shoot the client up to 15% cpu usage and lock it.

Rich (BB code):
} else /if (${AggroOn} && ${agro_function[]}) {
			
			/echo aggro
			/call Mod_AggroCheck 
		}

- - - Updated - - -

So I got the function working roughly the way I would like, but strangely it would only work if it is a stand-alone /if statement. If it was part of an if/else chain it killed the macro.
Works
Rich (BB code):
/if (${AggroOn} && ${agro_function[]}) {
			
			/echo aggro
			/call Mod_AggroCheck 
		}

Kills the macro:
Rich (BB code):
} else /if (${AggroOn} && ${agro_function[]}) {
			
			/echo aggro
			/call Mod_AggroCheck 
		}
 
If you want to email me what you're working on [email protected] then I can take a look at it in it's entirety.

Functions are a relatively new feature added to MQ2 and it may have some bugs in it. To help debug it I'd like to be able to actually run the code instead of piecing together a snippet of the code.
 
Question - Function help

Users who are viewing this thread

Back
Top
Cart