![addons for wow 4.3.4 addons for wow 4.3.4](https://i.imgur.com/AO5izo2.jpg)
It says if x is greater than 1, then do this print thing. Here’s the syntax for it: /run local x=3 if x>1 then print("noobsauce") end run local a,b = GetNumCompletedAchievements() print(a,b) The If statementĪs you probably know, the If statement is probably the pinnacle of all addon development and programming in general. This tells the macro that a and b are only used inside this macro scope. So, we need to add “local” before declaring a variable. The reason for this, is you don’t want to be a jerk and be the only person that ever uses a or b and you don’t want to conflict with addons that may be using a or b.
![addons for wow 4.3.4 addons for wow 4.3.4](https://bestwowaddons.com/wp-content/uploads/2018/02/healbot2.jpg)
If you don’t know what variable scope is, the basics is that you only want your variables (a and b from above) to be available inside this macro instance. So if you just wanted to see the total achievements, just use one variable.
Addons for wow 4.3.4 code#
One, we separate lines of code with a semicolon ( ) and two, you don’t have to specify both variables. That will set both returns to those variable names in the order of the documentation. The way we handle it having two returns is like this: /run a,b = GetNumCompletedAchievements() print(a,b) This returns two things: The number of achievements there are in the game and the number that you have completed. We’ll take GetNumCompletedAchievements() function. I’m funny huh? Ok, next we’ll look at printing the results of a function. That will print “hi noob” in your chat window. It simply writes some text, variable name, or return to the chat window: /run print("hi noob") The print() function is just like echo in PHP or console logging in javascript. Next, we’ll look at something simple, like printing some text to your chat panel. That tells the macro to execute the LUA programming. To run some LUA code in your macros, first start with /run or /script. Here’s the completed achievement macro that I’ll be updating more at a later time.
Addons for wow 4.3.4 how to#
In this tutorial guide, I’ll show you how to make a simple LUA scripted macro that retrieves the amount of achievements you have completed.
![addons for wow 4.3.4 addons for wow 4.3.4](https://cdn-wow.mmoui.com/preview/pvw55446.jpg)
Macros are just tiny pieces of code compared to addons, but they can do just about as much as an addon can – if you can fit it inside for 255 characters. World of Warcraft macros and addons are built around a programming language called LUA. Complete list of Druid Symbiosis spell swap list.How to make a Mouseover macro for Wow with proper syntax.How to write a Castsequence macro for Wow with proper syntax.How to make a simple Wow macro with LUA script tutorial guide.List of Wow macro commands with explanations.How to use the (form) conditional in Wow macros.All spells and abilities that are off the global cooldown (GCD).Complete list of Wow macro conditionals.How to properly target spells in macros for Wow.#showtooltip macro usage and how to make your own Wow macros with dynamic, changing icons.How to write a /cast macro for Wow with proper syntax guide.