Page 1 of 2

Working with code errors.

Posted: Mon Jul 25, 2005 10:29 am
by ounvme
I finally decided to step into the realm of this amazing utility. The help forum and wiki are good sources of info but this 1 has me stuck. I am trying to get the Cleric Bot to run but I keep getting the infamous "Due to complete misuse bla bla error. From what I read in the wiki it has to due with a change in variable declaration. My programming skills are at Qbasic level. I know a little but not near what some of you do.

WIKI PAGE [[Identify Code Errors]] Learning to trouble shoot code is a valuable lesson.



Im pretty sure my problems lie here

/varset Classes ${String[${SpellBuff[${i},2]}].Count[,]}

/if (${Spawn[${sID}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]}) {

I removed the $String[ but now I have some more what look to be worse errors.

No such 'bool' member 'Arg'
test.mac@2031 (singlebuffs): /if (${Spawn[${sID}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]}) {
test.mac@789 (Main): /if (${Me.PctMana}>40 /if........./call SingleBuffs
Unparsable in Calculation

What it looks like is the macro is testing conditions then calling the single buff routine and I think the error lies there. Any help/ideas appreciated.

Posted: Mon Jul 25, 2005 10:31 am
by skyler
Your programming skills have nothing to do with fixing your problem. Your ability to use the search function and show signs of common sense however have a lot to do with fixing this yourself.

Posted: Mon Jul 25, 2005 10:44 am
by A_Druid_00
What is SpellBuff /declared as? If its a String, you don't need to have ${String wrapped up in the /varset. The String TLO has been removed due to people converting strings into strings in practically every macro ever created.

Posted: Mon Jul 25, 2005 8:53 pm
by ounvme
It looks like this
/declare SpellBuff[1,3] string outer

Re: Working with code errors.

Posted: Tue Jul 26, 2005 11:21 am
by Grumpy
ounvme wrote: Im pretty sure my problems lie here

/varset Classes ${String[${SpellBuff[${i},2]}].Count[,]}

/if (${Spawn[${sID}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]}) {

I removed the $String[ but now I have some more what look to be worse errors.

No such 'bool' member 'Arg'
test.mac@2031 (singlebuffs): /if (${Spawn[${sID}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]}) {
test.mac@789 (Main): /if (${Me.PctMana}>40 /if........./call SingleBuffs
The reason ${String} was removed is because people were casting strings as strings. I'm not sure exactly why the devs CARE that people were doing this, but apparently they do. Anyway:

Code: Select all

/varset Classes ${String[${SpellBuff[${i},2]}].Count[,]}

should be:

/varset Classes ${SpellBuff[${i},2].Count[,]} 
and

Code: Select all

  /if (${Spawn[${sID}].Class.Name.Equal[${String[${SpellBuff[${i},2]}].Arg[${h},,]}]}) {

should be:

/if (${Spawn[${sID}].Class.Name.Equal[${SpellBuff[${i},2].Arg[${h},,]}]}) {
In almost all cases where you get the "String has been removed due to misuse" message, the correct answer is to just delete the ${String[]} part of the line.

Re: Working with code errors.

Posted: Wed Jun 04, 2025 6:21 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 6:23 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 6:24 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 6:25 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 6:26 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 7:03 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 7:04 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 7:05 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 7:06 pm
by xyilla

Re: Working with code errors.

Posted: Wed Jun 04, 2025 7:44 pm
by xyilla