Working with code errors.

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

ounvme
a lesser mummy
a lesser mummy
Posts: 61
Joined: Mon Jul 25, 2005 8:36 am

Working with code errors.

Post by ounvme » Mon Jul 25, 2005 10:29 am

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.
-=OUNVME=-

skyler
a snow griffon
a snow griffon
Posts: 311
Joined: Wed May 11, 2005 9:22 am

Post by skyler » Mon Jul 25, 2005 10:31 am

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.

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Mon Jul 25, 2005 10:44 am

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.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

ounvme
a lesser mummy
a lesser mummy
Posts: 61
Joined: Mon Jul 25, 2005 8:36 am

Post by ounvme » Mon Jul 25, 2005 8:53 pm

It looks like this
/declare SpellBuff[1,3] string outer
-=OUNVME=-

Grumpy
a hill giant
a hill giant
Posts: 167
Joined: Sun Nov 10, 2002 4:22 pm

Re: Working with code errors.

Post by Grumpy » Tue Jul 26, 2005 11:21 am

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.

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 6:21 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 6:23 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 6:24 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 6:25 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 6:26 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 7:03 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 7:04 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 7:05 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 7:06 pm


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Working with code errors.

Post by xyilla » Wed Jun 04, 2025 7:44 pm