Macros and Scripts

Started by Carr0t, March 14, 2006, 05:37:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carr0t

I'm wanting to wirte myslef some macros for WoW, partially to make it easier for me to fight and heal in a party as a pally, and party becuase I just want to get my head round Blizzards macro system.

Thing is, I can't find *any* tutorials online bar Blizzards very simple explanation of how to cast a single spell on a target, or use a macro to say something. I've seen multiple people use /script to do more complex tasks like get a party members current health or similar, but nowhere can I find an explanation of how scripts work, what scripts are already builtin, and how I can use them or create my own. I've seen various scripts written on websites, and most of what appear to be variables are single letters that never appear to be initialised, but have their value checked later in the macro. How does that work? Are certain letters preassigned to certain variables within the scope of specific scripts?

Basically i'm looking for any kind of reference of all the builtin script and macro commands that are available in WoW, preferrably with some simple starter tutorials on how to use them to make more complex macros and scripts of your own, or a few simple examples, or similar.

I can't believe Blizzard would produce what appears (from what other people are able to do) to be a fairly complex and powerful scripting system, with no real information about what it does or how to use it, but equally over a week of searching google and the various official WoW forums has come up with nothing that really helps me. Occasionally I find posts where someone says ' works great and allows me to do X, Y and Z really easily!' but i've never managed to get a response from anyone about where they found out how to write in the first place.

Anyone?
[imga=right]http://77.108.129.49/fahtags/ms10.jpg[/imga]Wash: This is going to get pretty interesting.
Mal: Define interesting...
Wash: Oh god, oh god, we\'re all going to die?

Bob

I've actually been looking for the exact same thing a couple of times myself, and I end up thinking why the heck Blizzard don't provide us with some real documentation of the stuff (and I also wonder what the few bright people who actually seems to have figured it out have done...).

Anyhow, I can provide you with (hopefully) a bit of help :)

I have been using a pre-made library (DruidFunc) with druid macros to easen up my casting.  It's not very advanced stuff, but it comes in quite handy from time to time.  The basic functionalities it supports are self-casting and adjustment of spell rank according to lower level players.  It also makes Healing Touch use a rank that is adjusted to how much health your target has left before it casts.  In addition, some of the functions can be called in such a way that they also paste in party chat when a spell is casted.

The addon contains of three files (DruidFunc.toc, DruidFunc.lua and DruidFunc.xml) which are all placed in a folder under \Interface\Addons

QuoteOriginally posted by "DruidFunc.toc"+-->
QUOTE("DruidFunc.toc")
## Interface: 1800
## Title: DruidFunc
## Notes: A few handy druid functions
DruidFunc.xml
[/b]

QuoteOriginally posted by "DruidFunc.xml"@
http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.blizzard.com/wow/ui/ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
   <!-- Druid function library -->
   <script file="DruidFunc.lua"/>


These two files aren't really of any big interest.  I assume they just provide some information about the addon so that WoW can understand where to look for the various scripts and so on.

But over to the more interesting part: DruidFunc.lua

[imga=right]http://77.108.135.49/fahtags/ms10.jpg[/imga]* Threbrilith the Nightelf, born and raised by the Silver Oak Guardians *
Proud member of Dead Men Walking

Carr0t

Cool, well that's a start at least :) Thanks. I didn't even know there were lua files with the scripts in. I thought you could write them directly into the macro with /script { <script goes here> } or something :blink:.
[imga=right]http://77.108.129.49/fahtags/ms10.jpg[/imga]Wash: This is going to get pretty interesting.
Mal: Define interesting...
Wash: Oh god, oh god, we\'re all going to die?

Bob

You can most likely also write small pieces of scripts directly into the macro.  The only problem here, is that the number of characters you can have in one macro is very limited, meaning you can only write very small scripts this way :)
[imga=right]http://77.108.135.49/fahtags/ms10.jpg[/imga]* Threbrilith the Nightelf, born and raised by the Silver Oak Guardians *
Proud member of Dead Men Walking

Carr0t

Ahha! I believe this may help:

http://www.wowwiki.com/World_of_Warcraft_API

Shiny! If it's accurate. Not had a chance to check it out yet.
[imga=right]http://77.108.129.49/fahtags/ms10.jpg[/imga]Wash: This is going to get pretty interesting.
Mal: Define interesting...
Wash: Oh god, oh god, we\'re all going to die?

TeaLeaf

Nice resource and worthy of being pinned :thumbsup:

TL.
TL.
Wisdom doesn\'t necessarily come with age. Sometimes age just shows up all by itself.  (Tom Wilson)
Talent wins games, but teamwork and intelligence wins championships. (Michael Jordan)

Carr0t

The scripting language itself is not unique to WoW. It's called lua, the website for which is here, and has documentation. Doesn't look too complex to figure out :) And now that we have a list of the functions Blizzard has supplied for use in scripts it should be a lot easier to start writing stuff. Just a case now of finding out where we need to put the lua files so the game uses them correctly. I assume simple scripts don't need to be put into an Addon of their own in the Addons folder.

There are many other parts of the WoW Wiki that appear to be useful, including http://www.wowwiki.com/Most_Used_Macros which just has some simple and some quite complex macros (which you could then probably alter for your own ends) without getting into scripting using lua yourself.
[imga=right]http://77.108.129.49/fahtags/ms10.jpg[/imga]Wash: This is going to get pretty interesting.
Mal: Define interesting...
Wash: Oh god, oh god, we\'re all going to die?

Neff

Well i think you need to carrot. But think you can dll some mod similar to your need , then you can edit the LUA. files inside. Alot of people do it with Discord action bars:)
[quote=Adularena] Robin?!?!?! *shouts* "Lets ride, my nimble youngster!" - Mmmm, how batman loves Robin to hum the Batman theme (na nananan anan ananana BatMAN!!) while *cough* Exploring Batman`s secret grotto.[/quote]

TEH N00m IS BACK WITH TEH PWN!:yell:

Othbarty

For editing addons you can use the World of Warcraft Interface AddOn Kit combined with the WoW UI Designer this will give you allot of the Blizz UIs to learn how to design UIs :)

And a O.K IDE to work with ;)
-=[dMw]=-Othbarty  ::  Mighty Cheese Event
"Trust the awesomeness!"
- Skippy the Magnificent

Bob

Nice find Oth - will have to look into this when time allows it :D
[imga=right]http://77.108.135.49/fahtags/ms10.jpg[/imga]* Threbrilith the Nightelf, born and raised by the Silver Oak Guardians *
Proud member of Dead Men Walking

Carr0t

Not bad, but i'm more looking into automation than UI editing. Unfortunately there doesn't seem to be any wait() or sleep() type function in either the WoW API or lua. I was hoping to be able to write simple scripts to do stuff like iterate through each member of your party, applying the most efficient heal spell each time (in terms of how much health they need replenishing) until they were back up to full health. Or even something that just applies a Blessing of Might to all Warriors and Rogues, and Blessing of Mana to all other classes. Without some kind of wait, for the cooldown on spells, it works on the first party member then spams 'That spell is not ready yet' to your screen a lot.

To be fair, i'm guessing Blizzard made it this way on purpose. A simple 'heal' script that applies the most efficient spell to your target could still be useful, so i'll prob look into writing one of those for my pally.
[imga=right]http://77.108.129.49/fahtags/ms10.jpg[/imga]Wash: This is going to get pretty interesting.
Mal: Define interesting...
Wash: Oh god, oh god, we\'re all going to die?

Bob

QuoteOriginally posted by Carr0t@Mar 23 2006, 12:28 PM
A simple 'heal' script that applies the most efficient spell to your target could still be useful, so i'll prob look into writing one of those for my pally.
[post=118877]Quoted post[/post]
[/b]
If you look at the first post I made in this thread, and you take a look in the section where I quoted "DruidFunc.lua", you'll see a script that does exactly this:
HealingTouch = function&#40; r, sendChat, targetEnemy &#41;When this function is called from a macro inside the game, it will find out how much health your target has left, and cast the appropriate rank of HT.

The input parameters are:
r - the highes rank available of the spell that you can do (which is the top rank if you are lvl 60 :))
sendChat - true/false wether you want a message notifying the heal in your party chat
targetEnemy - true/false wether you want to target your last enemy when the heal is done

Hope this helps :)
[imga=right]http://77.108.135.49/fahtags/ms10.jpg[/imga]* Threbrilith the Nightelf, born and raised by the Silver Oak Guardians *
Proud member of Dead Men Walking

Othbarty

There are none such function unfortunatly.. But i do think it can be done.. Not sure how though, try finding out what event the general cooldown triggers, cous there has to be one, then capture the event and act on it accordingly...
-=[dMw]=-Othbarty  ::  Mighty Cheese Event
"Trust the awesomeness!"
- Skippy the Magnificent

Othbarty

QuoteOriginally posted by Threbrilith@Mar 23 2006, 12:38 PM
If you look at the first post I made in this thread, and you take a look in the section where I quoted "DruidFunc.lua", you'll see a script that does exactly this:
HealingTouch = function&#40; r, sendChat, targetEnemy &#41;When this function is called from a macro inside the game, it will find out how much health your target has left, and cast the appropriate rank of HT.

The input parameters are:
r - the highes rank available of the spell that you can do (which is the top rank if you are lvl 60 :))
sendChat - true/false wether you want a message notifying the heal in your party chat
targetEnemy - true/false wether you want to target your last enemy when the heal is done

Hope this helps :)
[post=118881]Quoted post[/post]
[/b]

The thing is, that with this script, you have to manually target the person you want to heal, he wants one that heals the entire party on one click ;)
-=[dMw]=-Othbarty  ::  Mighty Cheese Event
"Trust the awesomeness!"
- Skippy the Magnificent

Bob

Hey - that's like kind of cheating :huh:

And where is the fun in that :P
If there ain't no challenge in keeping my party/raid alive (like only have to press one button), I don't think I would have played this game too long...

And btw Oth - you don't need to quote my whole bloody post to respond to it 8)
[imga=right]http://77.108.135.49/fahtags/ms10.jpg[/imga]* Threbrilith the Nightelf, born and raised by the Silver Oak Guardians *
Proud member of Dead Men Walking