Moderator: MacroQuest Developers
This macro is pre-MQ2Datavar, so should be a simple fix. Look for the older style Parms @Param and change them to ${Param} and then debug the macro.Sheer delight when i found this post imbue.mac (Imbue/Enchant macro) copied the macros and gave them a whirl. A stream of errors, surprising for scripts posted April 27th thought would work.
Thanks. First I figure out what a "Param" is.CyberCide wrote:This macro is pre-MQ2Datavar, so should be a simple fix. Look for the older style Parms @Param and change them to ${Param} and then debug the macro.Sheer delight when i found this post imbue.mac (Imbue/Enchant macro) copied the macros and gave them a whirl. A stream of errors, surprising for scripts posted April 27th thought would work.
Good luck.
Code: Select all
/declare mount global
Code: Select all
/if (@mount==0) /if (${Me.state[SIT]}==FALSE) /sit
Code: Select all
/if (${mount}==0) /if (${Me.state[SIT]}==FALSE) /sit

Code: Select all
/declare mount int outer
Code: Select all
/if (${Defined[Param1]}) /varset itemname "@Param1"
Code: Select all
/if (${Defined[Param1]}) /varset itemname ${Param1}
Code: Select all
If ( condition )
{
statements
}
Code: Select all
If ( condition ) [b]{[/b]
statements
}


Code: Select all
sub main
/declare MyVar string local
/varset MyVar LordGiddion tells you got it now?
/call testsub "${MyVar}"
/call testsub ${MyVar}
/return
sub testsub
/echo ${Param0}
/return
Okay, I can see what you mention.LordGiddion wrote:First echo will display LordGiddion tells you got it now?Code: Select all
sub main /declare MyVar string local /varset MyVar LordGiddion tells you got it now? /call testsub "${MyVar}" /call testsub ${MyVar} /return sub testsub /echo ${Param0} /return
second echo will display LordGiddion
Code: Select all
/declare MyVar string local
/varset MyVar "LordGiddion tells you got it now?"
Code: Select all
/call testsub "${MyVar}"
/call testsub ${MyVar}
The reason this outputs differently is the parser isn't passing the variable, but the text from the variable to the sub. The parser reads all ${} and replaces those directly with the values. So the parser readsCode:
/call testsub "${MyVar}"
/call testsub ${MyVar}
to output...
LordGiddion tells you got it now?
LordGiddion tells you got it now?
Guessing I'll have some fun after work, with a few "hello worlds" and basic maths operations. Will take a while to get head around some of the language basics before i try to interact with game objects like inventory, containers, combine buttons and so on.
Code: Select all
/call testsub "${MyVar}"
as
/call testsub "LordGiddion tells you got it now?"
Code: Select all
/call testsub ${MyVar}
as
/call testsub LordGiddion tells you got it now?Code: Select all
/if (${Defined[Param1]}==FALSE) /call Syntax
/if (${Defined[Param1]}) /varset itemname ${Param1}
/echo ${Param0}
/echo ${Param1}
/varset spellname ${Param0}
/echo ${spellname}
Code: Select all
/declare spellname int outerCode: Select all
/declare spellname outerCode: Select all
/declare spellname string outerCode: Select all
/declare SpellName string local ${Param0}Code: Select all
/declare SpellName string local
/varset SpellName ${Param0}
Code: Select all
/if (${Defined[Param1]}==FALSE) /call Syntax Code: Select all
/if (${Defined[Param1]}) /echo Param1 is defined
/if (!${Defined[Param1]}) /echo Param1 is not definedCode: Select all
/declare mount global
/declare recast global
/declare mass global
/declare spellname global
/declare itemname global
/declare tmpspellname global Code: Select all
/declare mount int outer
/declare recast int outer
/declare mass int outer
/declare spellname string outer
/declare itemname string outer
/declare tmpspellname string outer
Code: Select all
Sub Event_NOMANA
/varset recast 1
/if (@mount==0) /if (${Me.state[SIT]}==FALSE) /sit
:Loop
/delay 6s
/if ((${Me.CurrentMana})<(${Me.MaxMana})) /goto :Loop
/return
Code: Select all
Sub Event_NOMANA
/varset recast 1
/if (${mount}==0) /if (${ Me.State[SIT] }==FALSE) /sit
/echo ${tmpspellname} needs ${Math.Calc[${Spell[${tmpspellname}].Mana}]} mana to cast.. medding
:Loop
/echo current mana is.. ${Me.CurrentMana}
/delay 6s
/if ((${Me.CurrentMana})<(${Math.Calc[${Spell[${tmpspellname}].Mana}]})) /goto :Loop
/return