Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You read my mind. That is one of the things I have in mind. Creating an interface to the c++ containers vector, map and unordered map. And possibly some of the algorithms. I don't know how many of the mq2 data types I can support. Maybe just strings and int.Awesome, how about a map data type for macros next?
MQ2 got a new language feature: functions. See http://www.macroquest2.com/wiki/index.php/Subroutines_and_Functions. How could you live so long without that ?
Also /while and /for loops can now be nested within each other. And /continue and /break will work for both.
You underestimate the lazy.. hehe.
/if (${Select[${2ndPart},Mana,Aura,Mount,Me,Summon,End,0]} || (${FindItemCount[=${Buffs[${i}]}]}>=1 && ${Select[${Spell[${Buffs[${i}]}].TargetType},self]}) || (${FindItemCount[${1stPart}]}>=1 && ${Select[${Spell[${3rdPart}].TargetType},self]}) || (${BookSpellTT.Find[0]} && ${Spell[${Buffs[${i}]}].TargetType.Find[self]}) || ${BookSpellTT.Find[self]} || ${BookSpellTT.Find[pet]}) /goto :SkipCheckIni
Sub needsIni (some args)
/if (!cond1) /return false
/if (!cond2) /return false
...
...
/return true
For whoever writes 400 character long code lines like
lazy doesn't seem the right word to me. Let me think of something better. How about masochist ?Rich (BB code):/if (${Select[${2ndPart},Mana,Aura,Mount,Me,Summon,End,0]} || (${FindItemCount[=${Buffs[${i}]}]}>=1 && ${Select[${Spell[${Buffs[${i}]}].TargetType},self]}) || (${FindItemCount[${1stPart}]}>=1 && ${Select[${Spell[${3rdPart}].TargetType},self]}) || (${BookSpellTT.Find[0]} && ${Spell[${Buffs[${i}]}].TargetType.Find[self]}) || ${BookSpellTT.Find[self]} || ${BookSpellTT.Find[pet]}) /goto :SkipCheckIni
Functions are realy great for stuff like this. ie instead of /if (cond1 && cond2 && ...... && cond99) you can give the thing you want to check a nice name /if (${needsIni[some args]} and define a function
A lot of of grey matter and hair saved. And potentialy faster code because not every condition must be evaluated. End of advertisement.Rich (BB code):Sub needsIni (some args) /if (!cond1) /return false /if (!cond2) /return false ... ... /return true
Sub checkVend(string buyItem)
/if (!${Window[MerchantWnd].Open}) {
/cechob "\ayYou need to open a merchant! Attempting to do that for you."
/target class Merchant
/if (${Target.Distance} < 20) {
/cechob "\awAttempting to open merchant!"
/invoke ${Target.RightClick}
|Need to give the merchant time to load their inventory.
/delay 10s ${Window[MerchantWnd].Open}
} else /if (${Target.Race.Name.Equal[Merchant]}) {
/cechob "\ap${Target.CleanName} is to far away to open the Merchant, get closer and try again!"
/end
} else {
/cechob "\apNo Merchant in this Zone, ending macro!!"
/end
}
}
/return ${Window[MerchantWnd].Child[MW_ItemList].List[=${buyItem},2]}
/if (${checkVend["Water Flask"]})
/noparse /declare SelfBuffCheck string outer (${Spell[${bookcheck}].TargetType.Equal[Self]} && ${Spell[${bookcheck}].Duration}>50 && !${bookcheck.Find[illusion]})
/noparse /declare LifetapCheck string outer (${Spell[${bookcheck}].TargetType.Equal[Lifetap]})
/noparse /declare NukeCheck string outer (${Spell[${bookcheck}].TargetType.Equal[single]} && !${Spell[${bookcheck}].Duration} && (${Spell[${bookcheck}].Category.Find[Direct Damage]}||${Spell[${bookcheck}].Skill.Equal[Archery]}))
/noparse /declare DotCheck string outer (${Spell[${bookcheck}].TargetType.Equal[single]} && ${Spell[${bookcheck}].Duration}>=2 && ${Spell[${bookcheck}].Category.Find[Damage Over Time]})
/noparse /declare FightBuffCheck string outer (${Spell[${bookcheck}].TargetType.Equal[Self]} && ${Range.Between[1,51:${Spell[${bookcheck}].Duration}]})
/noparse /declare MainTankBuffCheck string outer ((${Spell[${bookcheck}].TargetType.Equal[single]}||${Spell[${bookcheck}].TargetType.Equal[group v2]}) && ${Spell[${bookcheck}].SpellType.Equal[beneficial]} && (${Range.Between[4,90:${Spell[${bookcheck}].Duration}]}||${Spell[${bookcheck}].Name.Find[Promised]}) && ${Spell[${bookcheck}].Slot[1].Left[8].NotEqual[Reaction]})
/noparse /declare HealSingleCheck string outer (${Spell[${bookcheck}].TargetType.Equal[single]} && !${Spell[${bookcheck}].Duration} && ${Spell[${bookcheck}].SpellType.Equal[beneficial]} && (${Spell[${bookcheck}].Slot[1].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[2].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[3].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[4].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[5].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[6].Left[21].Equal[Increase Hitpoints by]}))
/noparse /declare HealGroupCheck string outer ((${Select[${Spell[${bookcheck}].TargetType},group v1,group v2]}||${Spell[${bookcheck}].TargetType.Equal[self]} && (${Spell[${bookcheck}].Slot[1].Equal[UnknownEffect400]}||${Spell[${bookcheck}].Slot[1].Find[Increase Current HP by]} && ${Spell[${bookcheck}].AERange})) && !${Spell[${bookcheck}].Duration} && ${Spell[${bookcheck}].SpellType.Equal[beneficial]} && (${Spell[${bookcheck}].Slot[1].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[2].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[3].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[4].Left[21].Equal[Increase Hitpoints by]}))
/noparse /declare HealSelfCheck string outer (${Spell[${bookcheck}].TargetType.Equal[self]} && !${Spell[${bookcheck}].Duration} && ${Spell[${bookcheck}].Category.Equal[Heals]})
/noparse /declare HealSplashCheck string outer (${Select[${Spell[${bookcheck}].TargetType},Unknown,Free Target]} && ${Spell[${bookcheck}].SpellType.Equal[beneficial]} && ${Spell[${bookcheck}].Name.Find[splash]})
/noparse /declare StunCheck string outer (${Spell[${bookcheck}].TargetType.Equal[single]} && ${Spell[${bookcheck}].Subcategory.Equal[Stun]})
/noparse /declare DebuffCheck string outer (${Spell[${bookcheck}].TargetType.Equal[single]} && ${Spell[${bookcheck}].SpellType.Equal[detrimental]} && ${Spell[${bookcheck}].Duration} && ${Select[${Spell[${bookcheck}].Skill},Alteration,Abjuration]} && ${Spell[${bookcheck}].Slot[1].Left[13].NotEqual[Increase Hate]} && ${Spell[${bookcheck}].Slot[2].Left[13].NotEqual[Increase Hate]} && ${Spell[${bookcheck}].Slot[5].Left[13].NotEqual[Increase Hate]})
/noparse /declare HealBalanceCheck string outer (${Me.Class.ShortName.Equal[clr]})
/noparse /declare XHealCheck string outer (${Spell[${bookcheck}].TargetType.Equal[single]} && !${Spell[${bookcheck}].Duration} && ${Spell[${bookcheck}].SpellType.Equal[beneficial]} && (${Spell[${bookcheck}].Slot[1].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[2].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[3].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[4].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[5].Left[21].Equal[Increase Hitpoints by]}||${Spell[${bookcheck}].Slot[6].Left[21].Equal[Increase Hitpoints by]}))
/noparse /declare BuffCheck string outer ((${Spell[${bookcheck}].TargetType.Equal[single]}||${Spell[${bookcheck}].TargetType.Find[group]}||${Spell[${bookcheck} Rk. II].TargetType.Find[group]}) && ${Spell[${bookcheck}].SpellType.Equal[beneficial]} && ((${Range.Between[90,999999:${Spell[${bookcheck}].Duration}]}||${Range.Between[1,3:${Spell[${bookcheck}].Duration}]})||${Spell[${bookcheck}].Name.Find[Promised]}) && ${Spell[${bookcheck}].Slot[1].Left[8].NotEqual[Reaction]})
/noparse /declare BuffRankCheck string outer (${Target.Buff[${iTargetBuff}].ID}==${Spell[${BuffOrigSpellIcon${iBuff}}].ID}||${Target.Buff[${iTargetBuff}].ID}==${Spell[${BuffOrigSpellIcon${iBuff}} Rk. II].ID}||${Target.Buff[${iTargetBuff}].ID}==${Spell[${BuffOrigSpellIcon${iBuff}} Rk. III].ID}||${Target.Buff[${iTargetBuff}].ID}==${Spell[${BuffOrigIconAlt${iBuff}}].ID}||${Target.Buff[${iTargetBuff}].ID}==${Spell[${BuffOrigIconAlt${iBuff}} Rk. II].ID}||${Target.Buff[${iTargetBuff}].ID}==${Spell[${BuffOrigIconAlt${iBuff}} Rk. III].ID})
/noparse /declare JoltCheck string outer (${Spell[${bookcheck}].TargetType.Equal[single]} && ${Spell[${bookcheck}].SpellType.Equal[detrimental]} && (${Spell[${bookcheck}].Slot[1].Left[13].Equal[Decrease Hate]}||${Spell[${bookcheck}].Slot[2].Left[13].Equal[Decrease Hate]}))
/noparse /declare MezCheck string outer (${Spell[${bookcheck}].Slot[1].Left[11].Equal[Mesmerize(2]} && ${Spell[${bookcheck}].TargetType.Equal[single]}||${Spell[${bookcheck}].Slot[1].Left[11].Equal[Mesmerize(1]} && ${Spell[${bookcheck}].TargetType.Equal[single]})
/noparse /declare AEMezCheck string outer (${Spell[${bookcheck}].Slot[1].Left[11].Equal[Mesmerize(2]} && ${Spell[${bookcheck}].TargetType.Equal[targeted ae]})
/noparse /declare PBAEMezCheck string outer (${Spell[${bookcheck}].Slot[1].Left[11].Equal[Mesmerize(1]} && (${Spell[${bookcheck}].TargetType.Equal[pb ae]}||${Spell[${bookcheck} Rk. II].TargetType.Equal[pb ae]}) && !${bookcheck.Find[lullaby]} && !${bookcheck.Find[slumber of]})
/noparse /declare AuraCheck string outer (${Spell[${bookcheck}].Slot[1].Find[Aura Effect]})
/noparse /declare RootCheck string outer (${Spell[${bookcheck}].Slot[2].Equal[root]} && ${Spell[${bookcheck}].SpellType.Equal[detrimental]})
/if (${AuraCheck})
/if (${RootCheck})