Dead Men Walking

Forum Archive 2023 => dMw Gaming => Gaming Archive => World of Warcraft - Dead Men Raiding => Topic started by: Carr0t on March 14, 2006, 05:37:33 PM

Title: Macros and Scripts
Post by: Carr0t on March 14, 2006, 05:37:33 PM
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?
Title: Macros and Scripts
Post by: Bob on March 14, 2006, 11:48:38 PM
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"@
   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

Title: Macros and Scripts
Post by: Carr0t on March 15, 2006, 09:31:47 AM
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:.
Title: Macros and Scripts
Post by: Bob on March 15, 2006, 10:11:57 AM
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 :)
Title: Macros and Scripts
Post by: Carr0t on March 16, 2006, 04:48:34 PM
Ahha! I believe this may help:

http://www.wowwiki.com/World_of_Warcraft_API (http://www.wowwiki.com/World_of_Warcraft_API)

Shiny! If it's accurate. Not had a chance to check it out yet.
Title: Macros and Scripts
Post by: TeaLeaf on March 17, 2006, 08:51:46 AM
Nice resource and worthy of being pinned :thumbsup:

TL.
Title: Macros and Scripts
Post by: Carr0t on March 17, 2006, 09:34:36 AM
The scripting language itself is not unique to WoW. It's called lua, the website for which is here (http://www.lua.org/), 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 (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.
Title: Macros and Scripts
Post by: Neff on March 18, 2006, 10:30:29 AM
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:)
Title: Macros and Scripts
Post by: Othbarty on March 23, 2006, 10:33:35 AM
For editing addons you can use the World of Warcraft Interface AddOn Kit (http://www.blizzard.com/support/wow/?id=aww01671p) combined with the WoW UI Designer (http://www.wowinterface.com/downloads/fileinfo.php?id=4222) this will give you allot of the Blizz UIs to learn how to design UIs :)

And a O.K IDE to work with ;)
Title: Macros and Scripts
Post by: Bob on March 23, 2006, 10:39:25 AM
Nice find Oth - will have to look into this when time allows it :D
Title: Macros and Scripts
Post by: Carr0t on March 23, 2006, 11:28:46 AM
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.
Title: Macros and Scripts
Post by: Bob on March 23, 2006, 11:38:16 AM
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 :)
Title: Macros and Scripts
Post by: Othbarty on March 23, 2006, 11:39:02 AM
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...
Title: Macros and Scripts
Post by: Othbarty on March 23, 2006, 11:40:22 AM
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 ;)
Title: Macros and Scripts
Post by: Bob on March 23, 2006, 11:49:43 AM
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)
Title: Macros and Scripts
Post by: Carr0t on March 23, 2006, 11:54:22 AM
QuoteOriginally posted by Threbrilith@Mar 23 2006, 11:38 AM
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:
[post=118881]Quoted post[/post]
[/b]

Yeah, I did notice that :) I'm specifically not looking at is, cos just coping what someone else has done is a bad way to learn ;)

After i've written mine I might look at how other people have done it, to see if i've written something hideously convoluted.
Title: Macros and Scripts
Post by: Carr0t on March 23, 2006, 11:57:37 AM
QuoteOriginally posted by Threbrilith@Mar 23 2006, 11:49 AM
Hey - that's like kind of cheating :huh:

And where is the fun in that :P
[post=118885]Quoted post[/post]
[/b]

Yeah, i'm guessing that's why Blizzard didn't include it. I'm not really that bothered. As you said, it is kinda like cheating.
Title: Macros and Scripts
Post by: Bob on March 23, 2006, 12:06:33 PM
But just one thing:

There might be a sollution to the thing you want to do - because now you have that "decursive" thing that is included in ctRaidAssist - where you can spam-click one button, and every time it targets a new party/raid members and cures one curse/poision.

I also think this can be done with buffing (think I've seen the paladins do it when they only had these 5 minutes buffs).  But that should really be too hard I think, cause you would just start out with thargeting party/raid member #1, check if it has a poision/curse/already buffed, cast the apropriate spell - if the target doesn't have any of those, it targets member #2 and so on.

So the result will be some kind of half-automatic buff/cure/heal system.

But I also think I read somewhere that that is one of those things that won't be possible to do any more after the 1.10 patch - but not 100% shure about this :)