Coder Social home page Coder Social logo

supermacro's Introduction

3.18 new improved user interface by Horu:
Add option to change macros window size (removed old background textures)
Add option to change window script font size
Add monospaced font
Make macros window movable
Fix bug: new line on the end of editbox
Add tabulation handler for editboxes
Show current line number on editbox panel
Fix bug: extend script can be removed on macros renaming
Fix bugs with renaming wow native macros and macros that have the same name.

3.17.1 added "mouseover" can now be used as a unit identifier in the FindBuff() function
added SpellReady function. More details in funtions.txt
Increased the number of buffs counted when looking for a buff/debuff

If you want see tooltips and button text for spell in macros you should add line to top of your macro:
/run -- CastSpellByName("Spell Name")
/script -- CastSpellByName("Spell Name")
/script if nil then CastSpellByName("SPELLNAME"); end
/run -- cast("Spell Name")
/script -- cast("Spell Name")


3.17 added DiscordBars support and TheoryCraft macro tooltip compatibility.

3.16b Bongos support is fixed

3.16a 
Main Menu icon edit
bongos support improved

3.16
fixed compatibilty with Bongos Action Bars //Does not completely solve the problem

3.15 beta 1 release
fixed: FindFirstItem returns correct info for use( %d [,%d]) and /use %d [, %d]
fixed: FindFirstSpell returns correct info for /cast
fixed: /use item to show item's info
fixed: /cast spell to show spell's info for (minor) etc.
fixed: GetSpellCooldown error popup for SM_Channel()
option to hide menu button
option to wrap long sentences (won't work until they add EditBox:SetNonSpaceWrap() )
slash command to run super macro /smacro
register events to run macros. see functions.txt for RegisterEventMacro and UnregisterEventMacro.
Ex. RegisterEventMacro( "ding", 1, "PLAYER_LEVEL_UP"); -- do something whenever you level up
ViewEventMacro() prints the events table
remove virtual templates from toc (Fonts.xml, UIPanelTemplates.xml, ClassTrainerFrameTemplates.xml)



SuperMacro v3.15b1 by Aquendyn

Installing SuperMacro:
Before you unzip, backup your old Bindings.xml and SM_Extend.lua that are in the SuperMacro folder (if you have on older version of SuperMacro).
Unzip the files into WoW/Interface/Addons . A new directory called SuperMacro will be automatically created, and the files will be extracted there.
Then, copy your backup Bindings.xml into SuperMacro folder, if you have one.
You may also create a text file called SM_Extend.lua and put extra long codes in there.

This addon provides a very much improved interface for macros. Its special functions includes the following, and probably more:
New SuperMacro frame shows all 18 global and 18 character macros. *
Work around the maximum macro character length of 256 characters (system limit).**
Run macros through keybinds*** and call other macros with RunMacro()****.
Some convenient slash commands and functions*****.
Put an item link or tradeskill recipe into the macro***** *.
Ingame extended LUA code editor***** **.
Options frame***** ***.
Also see functions.txt for user-friendly functions and slash commands that can be used in your macros.

* The new SuperMacro interface displays 18 (global) account macros on the left and 18 character-specific macros on the right. Buttons at the top create new macros for each category. Buttons on the bottom are, in order, delete macro; save macro; open SuperMacro options frame; delete extend; save extend; exit frame. Enter your macro in the left editbox, and your extended LUA codes and functions in the right editbox.

** The letter limit for the entire macro is 256. However, you can get around that if you use call it through another macro, or put long functions in SM_Extend.lua file, or use the in-game extend editor (explained further down in this document.)
Suppose macro 1 has more than 256 characters. If you put this directly on your action bar and try to activate it, you will get an error because the rest of the line beyond the 256th character will be cut off when the macro is saved. What you can do is break up the long macro into smaller parts, and have them call each other, like so (where macro 1 is named Macro1):
<code>
/script RunMacro("Macro1") --more scripting here
</code>
Then put this new macro on your action bar.

NOTE: Do not type the <code> </code> tags themselves, but type what is between them.

Alternatively, put extremely long functions in a file called SM_Extend.lua, which you have to create since the zip doesn't come with this file (so that it doesn't get overwritten when you unzip.)

You can also put global variables and constants in this file.

To define a function in a lua file:
<code>
function FunctionName(parameter1, parameter2, etc.)
	-- code goes here
	-- return variable
end
</code>

FOR EXAMPLE:

<code>
function FindTradeSkillIndex(tradeskill)
	if (TradeSkillFrame:IsVisible()) then
		for i=1,GetNumTradeSkills() do
			tsn,tst,tsx=GetTradeSkillInfo(i);
			if (tsn==tradeskill) then
				tsi=i;
				SelectTradeSkill(tsi);
				TradeSkillInputBox:SetNumber(tsx);
				TradeSkillFrame.numAvailable=tsx;
				return tsi, tsx;
			end
		end
	end
end
</code>

Then, your macro would look something like this:
<code>
/script CastSpellByName("First Aid")
/script tsi,tsx=FindTradeSkillIndex("Heavy Linen Bandage") if (tsx) then DoTradeSkill(tsi,tsx-1) end
</code>

If you change the file SM_Extend.lua while in-game, you need to reload your UI by closing your Macro frame, then entering /script ReloadUI() into the chat line--even better make a macro and keybind for this:
<code>
/script ReloadUI()
</code>

*** The default bindings for this addon provides entries for Macros #1 through #36. Using these as examples, you can add more keybinds by editing the bindings.xml file. Backup this file before you install a new version of SuperMacro. In addition, there are two special bindings for Attack and PetAttack. To use these two macros, you must first create macros for them.

For Attack, follow these instructions.
Make a macro called Attack (note caps) with this body:
<code>
/script if ( not PlayerFrame.inCombat ) then CastSpellByName("Attack") end
</code>
Now, you can assign a keybind for attack, and you can call this macro when executing other macros. For instance, suppose you want a macro to attack and to cast a spell. You can make a macro with this body:
<code>
/script RunMacro("Attack")
/cast Shadow Bolt
</code>

For PetAttack, do the following.
Make a macro called PetAttack (note caps) with this body:
<code>
/script CastPetAction(1);
</code>
Put the pet attack icon in the first slot on your pet action bar (should be there by default).
Now, you can assign a keybind to tell your pet to attack, and you can call this macro when executing other macros. For example, we can change the above example to this:
<code>
/script RunMacro("Attack");
/script RunMacro("PetAttack");
/cast Shadow Bolt
<code>

**** SuperMacro lets your macros call other macros with the special function RunMacro(index) or RunMacro("name"). If index is a number without quotes, it will call the macro in the order displayed in the macro frame. If you instead provide a name of the macro within quotes, you can call the macro if you know its name.
In Bindings.xml for this addon, you will notice bindings for RunMacro(1) through RunMacro(36). They will run the respective macro in the order that you see in the macro frame. Macros 1 to 18 are account macros, and Macros 19-36 are character-specific macros.If you add or delete macros, their order may change, so be careful here. You are free to edit those bindings to call your own macros.
You can use a macro to call other macros simply by providing the name of the other macro. When writing a macro, you will have something like this:
<code>
/script RunMacro("Attack");
</code>
where Attack can be replaced by the name of another macro.
You can also use Macro() in place of RunMacro() if you are close to 256 letter limit.

***** Slash commands
For complete info on slash commands and their corresponding LUA functions, read functions.txt.

Supermacro changes the /macro command so that you can run a macro from the chat line. Use /macro <macro_name>. This is equivalent to /script RunMacro("macro_name").
Ex. /macro Attack

NOTE: Running a macro or script from the chat line will not cast spells.

Another slash command is /supermacro. Just /supermacro shows help for SuperMacro options.

The first option is hideaction 1 or 0. For instance,
/supermacro hideaction 1
/supermacro hideaction 0
Setting it to 1 hides the macro names on action buttons, and 0 shows them. This option is saved between sessions under SM_VARS.hideAction.

Another option is printcolor <red> <green> <blue>. The red, green, and blue values are numbers from 0 to 1. This option changes the color of the text in the /print slash command.
Ex. /supermacro printcolor 1 .5 0.03
Ex. /supermacro printcolor default
The last line sets the color back to default color, which is white.

/supermacro macrotip 0-3
/supermacro macrotip 1 is default setting
0 is normal, 1 show spells only, 2 show macro code only, 3 show spells and/or macro
This replaces the text in the game tooltip when the cursor moves over the action bar buttons. Instead of just showing the macro name, you can choose to have it show the spell's name, if the macro casts a spell, or show the macro code. For option 3, it will try to show the spell first. If that fails, it will show the macro code.

These options and more can also be set in the SuperMacro options frame.

Slash commands for using and equipping items. Use these only when you want to equip or to use a single item. For more complex situations, use other addons.
/use,/smuse <item_name>
/equip,/smequip,/eq,/smeq <item_name>
/equipoff,/smequipoff,/eqoff,/smeqoff <item_name> to equip offhand
/unequip,/smunequip,/uneq,/smuneq <item_name>

You can item link into the macro. See next section for more on item links.
Make sure the /eq and the item link are on the same line.
Ex. 1
/eq [link] is good
Ex. 2
/eq
[link] is not good
Ex. 3
/use blazing wand
/smuse blazing wand
These two commands are equivalent. If another addon already took /use, you could use the /smuse. Same with /eq and /smeq and other commands.

To print some text to the default chat frame, you can use the /print command. Other people cannot see what is printed.
Ex. /print Hello, world.
The default color is white. You can change the color of this text with /supermacro printcolor <red> <green> <blue>
where each red, green, and blue value is between 0 and 1.

***** * Item links
You can get item links directly into a macro by using Alt-click on the item button. You can do this for container items, paperdoll items, bagslots, and tradeskills. Bagslots are the icons on the main menu bar.

To link tradeskills items, Alt-click on the skill in the top half of the frame, that is, where you would select the skill, or the icon. Ctrl-Alt-click will insert the recipe into the macro.

Shift-click on item or tradeskill will insert name, and Ctrl-Shift will insert the name inside quotes.

Since I was doing this anyway, you can also Shift-click on the skill in the same way to put it into the chat edit box (in addition to Shift-clicking on the icon). Ctrl-Shift-click will insert the recipe into chat edit box.

Similarly, you can Shift-click spells from the spell book to insert /cast <spellname>(<spellrank>). Ctrl-Shift-click to insert just the "<spellname>(<spellrank>)" (with quotes.) Alt-Shift-click on spell in spellbook to insert <spellname>(<spellrank>) (without quotes).

***** ** Ingame extend LUA code editor and SM_EXTEND.lua
The right edit box in SuperMacro frame is for extended codes that is associated with that macro. This is saved in SavedVariables under SM_EXTEND table, which is not associated with SM_EXTEND.lua in any way. Either way, these extended codes can be accessed by all macros, usually in the form of functions.

SM_EXTEND.lua does not come with the zip. If you choose to use this feature, you must create a text file and name it SM_EXTEND.lua . Any code you put in this file will be loaded when the addon is first loaded. Your code can be any length. However, if you edit this during playing, you have to reload UI for the changes to take effect.

The in-game extend editor does not need reloading, simply press the Save Extend button. However, the max length for each macro's extend is 7000 letters (not including the macro itself, which is a totally separate issue.) CAUTION, make sure your code has no errors before you close the macro frame.

There are also weird behaviors when you make a new macro or rename a macro.
When you create a new macro with the same name as an existing macro, it will inherit the same extend code from the existing macro.
When you rename a macro with a new name that is the same as another existing macro, the former's extend will be used for both. For example, if macro A has the extend code a=b, macro B has extend b=a, and you rename macro A to macro B, then both macros will now have extend a=b.

If a macro is deleted, the extend that goes with it is also deleted if there are no other macros with the same name.

Version History

3.14a
fixed: count should show totalcount in all bags and slots

3.14
Include alias replacement from other mods (eg ASF, ChatAlias)
for any other alias addons, do SM_InsertAliasFunction(your_replacement_function, pos) inside your mod. pos must be -1 if the function removes newlines; otherwise leave out pos. make sure SuperMacro is loaded when this insertion is called, so make SM an optional dependency or after VARIABLES_LOADED.
stretched popup frame by two rows
fixed: tooltip with macro code still appear after leaving action button
fixed: sayrandom error
hide action text on discord bars
make minimap button toplevel
brighten rank text on tooltips
new function CancelBuff, unbuff, /unbuff, /smunbuff
fixed: set owner for SM_Tooltip
fixed: FindBuff should work better

3.13
fixed: SM_Tooltip.lua:131: `then' expected near `return'

3.12
fixed: this is nil: SM_tooltip.lua line 81
fixed: body is nil for FindFirstSpell and FindFirstItem
caststop(spell [,...]) put in functions.txt

3.11
text and texture for supers returned for non-default action buttons.
tooltip for supers on action buttons.
optimize tooltip, cooldown and icon replacement.
per-character settings for supers on action bars.
option to check cooldown (may decrease framerate). must be on for auto-replace icons to work properly.

3.1 changes
change Print to Printd, other addons retain their Print if present, else Print works like Printd
Ctrl-Shift-click on spell in spellbook to insert "<spellname>(<spellrank>)" (with quotes).
Alt-Shift-click on spell in spellbook to insert <spellname>(<spellrank>) (without quotes).
Shift-click on item or tradeskill will insert name, and Ctrl-Shift-click will insert the name inside quotes.
CraftItem( skill, item, count), /craft, /smcraft
SayRandom(...), /sayrandom, /smsayrandom
Super tab to hold virtual macros (aka Super ones). You can make an unlimited number of "Super" macros, and each Super will hold 7000 characters. Drag them onto action bar as usual. Downside is you can't tell range or IsUsable from action buttons (won't fade out). Cooldown and tooltip still work.
There are new key bindings for the first ten SuperMacros. You can make your own bindings by copying the format of the default ones in Bindings.xml in SuperMacro folder. You could backup your old Bindings.xml and copy over the new bindings.
Function to run a Super is RunSuperMacro(supername | index).
Ex. RunSuperMacro(1);
Ex. RunSuperMacro("MySuperMacro");
You can place SuperMacros on action buttons, but swapping them around is not perfect. These problems may not be not fixable with LUA.
Read functions.txt for further explanations of these new commands: CraftItem, SayRandom, RunSuperMacro.

3.04 changes
fixed bug: tooltip
fixed bug: update buttons
SM_CastSpell renamed SM_FindSpell

3.03 changes
fixed bug: cooldown
fixed bug: /cast
moved menu button

3.0 changes
for 1.9 patch
lost blizzard_macroui dependency
lost unlimited macros
shortened versions of common functions (eg cast, stopcast, use, echo, send, pickup). read functions.txt
options frame
/supermacro options to open options frame
minimap button (optional)
tooltip, cooldown, and count about items and spells (tooltip optional)
action buttons replaced with appropriate icons (optional)
game menu button below Keybindings and above Macros
tooltip support for discordactionbars (untested)
documentation for user-friendly functions in functions.txt
SM_Channel(spell) for uninterrupted channeling, /smchan, /smchannel
/in seconds[+] command, /smin, SM_IN(seconds, command[, repeat])
/shift form
Right-click macro button in SuperMacro frame to run macro.

2.89 change
fixed self-cast
fixed item link from tradeskill
functions.txt lists convenient functions and slash commands
imported some functions from 1900 series
new functions: DoOrder, Pass, Fail

2.85 changes
fixed sending chat messages with \n from RunMacro
remove editing CastSpellByName
/cast to cast highest ranking spell if no rank specified
allows alias in macro (need more testing) [using my other addon Alias-Spellchecker aka ASF]
switch macros on actionbar with SetActionMacro( actionid, macro )

2.8 changes
actionbarbutton macro tooltips enhanced to show spell and/or macro code
slash command for macrotip options
fixed behavior regarding ingame extend
macroframe framestrata changed to high

2.7 changes
in-game extend code increased to 7000 characters (instead of 900)
shows extend character limit
## OptionalDeps: Blizzard_MacroUI

## 2.6 changes
added Macro() function:
Macro = RunMacro;
in-game extend editor (not same as SM_EXTEND.lua):
scripts written with in-game extend are saved in SavedVariables under SuperMacro.lua

## 2.5 changes
Max macro length decreased from 1023 to 256.
Interface updated to show 256 limit.
Makes use of SM_Extend.lua.
Due to the max macro length being shortened, make a file called SM_Extend.lua to define long functions and global variables, then call them from your macros. See example above (FindTradeSkillIndex).

## 2.4 changes
Item link to MacroFrame from container frame items, paperdoll items, bagslots, tradeskills using Alt-click.
Item link to ChatFrameEditBox from tradeskills using Shift-click.
Slash commands for using and equipping items.
/use,/smuse <item_name>
/equip,/smequip,/eq,/smeq <item_name>
/equipoff,/smequipoff,/eqoff,/smeqoff <item_name> to equip offhand
/unequip,/smunequip,/uneq,/smuneq <item_name>
/print,/smprint <text> to display text into chat frame.
/supermacro printcolor <red> <green> <blue> to change color used in /print.

supermacro's People

Contributors

horu avatar monteo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

supermacro's Issues

Issue pasting large macros

I'm having an issue where very large macros are not pasting into the right-side SM code form. Around 2500+ characters the macro just stops with "..." and blank characters are entered if you try to type.

image

I've tried:
-Updating to 3.16a
-Clearing all Supermacro LUA
-Going back to 3.16

The only workaround I've found is pasting the code in chunks of 1000 characters etc, pressing enter to put a new \CR, then pasting another chunk of code, repeat.

I could demonstrate this behavior in a discord call screen share if needed.

*EDIT
OK, so apparently macros still run fine, all the text is just gone. Maybe a limitation of the WoW text box?

SuperMacros breaks Roidmacros' /equip and /equipoh, when the , but only when certain other addons are active

This bug is really strange, its a doozy and I cannot pin it down past this:

I have two weapons that have a comma in the name: "Gressil, Dawn of Ruin" and "Thunderfury, Blessed Blade of the Windseeker"

I have two macros using Roid-macros syntax, both involving equipping at least one of these comma weapons:

#showtooltip Gressil, Dawn of Ruin
/equip Gressil, Dawn of Ruin
/equipoh The Hungering Cold

I equip a 2h, and this macro works bringing me from 2h -> dw, but then I enable supermacro, and it stops working.
So I then go and turn off all addons except roid and supermacros. Huh, it does work.
Then I start enabling addons one by one, ontop of the roid+super combo. Every time I enable another addon, the game reloads and I test the 2h -> dw macro again.
I keep enabling them one by one and it still works, until I get to enabling Decursive, and then the 2h -> dw macro stops working.
Ok, so it's gotta be the decursive addon's fault! I go and disable decursive in my full addons setup. The bug is still there...
I then turn off all addons again, and enable only roid, super, and decursive. The macro functions....
This doesn't make any sense at all!

The only consistent way I've found that I can use my 50+ other addons all at once, and have this roidmacros macro work, is if I just never enable supermacros.

There are 0 lua errors, ever, when this bug appears.

Yeah I have no clue on how to troubleshoot this further. It doesn't make sense. I can zip my entire addons folder if you would like to try my exact env, and see the bug in action.

Question about SuperMacro future...

Hi, sorry to bother you in this (hateful) way, but I don't have any other means to contact you since I haven't found any useful email here to do that.

My question is: are you planning to make a new SuperMacro branch addon when Classic WoW comes out? (it seems it will be based on Legion API so far, but nothing can be confirmed at the moment and there still is the chance Blizzard will use the 1.12.1 API for that, I hope for the latter to be honest)
I love SuperMacro and I'd really like to use it when that happens, since it has become a mandatory addon for me to have in Vanilla.

Waiting for an answer,
Thank you,

FireReaver

macro icon bug

the option "Auto replace action icon" is totally useless. I teted on various classes macroes and, wether the option is on or off, it changes nothng. The macro will automatically get the first spell in the macro script with the option on or off.

Auto changing

Hey, sometimes when I swap my macros on my actionbar, the macro on the actionbar auto changes to the number 1 macro in general macro.
So whatever macros I swap on actionbar for eachother becomes the first in list macro instead.
I got the 3.18 version of the addon.
Im using bongos actionbar also.

Feature request: assist players into adding links in the macros

When I need to add an item link or a quest link, I have to follow a certain procedure which is not the easiest thing to do. I've learned about it from this forum thread

So I would like to ask for implementing this feature: help the player to add links to the items in their inventory in the macros. When they push a button or hotkey, clicking on an item will add the link to that item in the macro they are currently editing.

Thank you

Feature request: assign an ID to each icon

When you chose the icon for your macro, it would be very helpful to have an unique ID for each icon (button) - a name or at least a number.
And then, when you create a new macro, it would be very easy to find your desired icon, by simply typing it's name or ID number. A searchbox for quickly finding your icon would be also very welcomed.

Thank you

Error on using a hotkey

When I try to use any macro regardless of if I have a supermacro LUA code attached to it, it gives me this error "Interface\AddOns\SuperMacro\SM_Tooltip.lua:127:attempt to index global 'this' (a nil value)". This only happens when I use a hotkey such as "1" to do a specific macro command. If I click on it with my mouse the macro works perfectly.

wow classic

this work on classic? its not working for me

Compatibility issue with Roid Macros regarding key bindings.

When binding keys to macros 1 to 36, the keybinds do nothing if Roid Macros is installed. Binding keys to SuperMacro 1 to 10 seems to work normally.

The bindings.wtf file shows bind MOUSEWHEELUP SM_MACRO19 normally, but it only activates on MOUSEWHEELUP input if Roid Macros is disabled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.