• 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

Question - Function help

Joined
Dec 2, 2014
RedCents
1,815¢
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