String.Count change?

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

User avatar
warlock45
a grimling bloodguard
a grimling bloodguard
Posts: 881
Joined: Sat Oct 06, 2007 8:32 pm

String.Count change?

Post by warlock45 » Tue May 21, 2019 8:47 pm

After today's patch I am having issues with String.Count giving a "Unparesable condition" and "non-numeric" errors.

In this case it is while trying to use Raid Druid, for the evaluate conditions section

Code: Select all

Sub EvaluateCondition(Condition)
	/declare sCondition string local
	/declare sVarL string local
	/declare sVarC string local
	/declare j int local
	/varset sVarC
	/varset sCondition (${Condition})
	/if (${sCondition.Count[{]}>0) {
		/for j 1 to ${sCondition.Count[{]}
			/varset sVarL ${sCondition.Arg[${j},{]}
			/varset sVarC ${sVarC}${sVarL}${
		/next j
		/varset sVarC ${sVarC}${sCondition.Arg[${j},{]}
		}
	} else {
		/varset sVarC ${sCondition}
	}
	/if (${sVarC}) /return 1
	/return 0

where the Condition would be an INI entry that looks like "{Me.AltAbilityReady[Elemental Conversion]} && {Me.PctMana}<60 && !{Me.Invis}"

If I put echos into the code it appears to properly transfer the INI entry, set it as sCondition, but then doesn't do the count.

Afraid I am unfamiliar with the use of Count. Looking over the wiki I would assume it is counting the amount of { in the condition, if it finds any, then sets the for loop J to the amount, runs through each argument (I get lost on the how) sets sVarC, if it is true returns a 1, else returns 0.

While my current incarnation of RD is probably a little different then what is posted, the evaluation section has not changed.

If the string.Count is working right, a little guidance here would be appreciated.
Attachments
Error01.png
Error01.png (5.29 KiB) Viewed 1776 times

woobs
a grimling bloodguard
a grimling bloodguard
Posts: 627
Joined: Thu Dec 10, 2009 11:53 am

Re: String.Count change?

Post by woobs » Wed May 22, 2019 5:56 am

Yes, something is broken. Counting brackets, either { or } is not working.

User avatar
warlock45
a grimling bloodguard
a grimling bloodguard
Posts: 881
Joined: Sat Oct 06, 2007 8:32 pm

Re: String.Count change?

Post by warlock45 » Wed May 22, 2019 5:22 pm

Ah, thanks for the reply.

Had issues with my machine while waiting for the patch and was unsure where the problem was.

I only got so much hair to pull at a time!
Last edited by warlock45 on Wed May 22, 2019 10:53 pm, edited 1 time in total.

User avatar
warlock45
a grimling bloodguard
a grimling bloodguard
Posts: 881
Joined: Sat Oct 06, 2007 8:32 pm

Re: String.Count change?

Post by warlock45 » Wed May 22, 2019 10:52 pm

Appears to be working again.

Thank you