-
-
Notifications
You must be signed in to change notification settings - Fork 75
GSE 3.2 Block Specification
Where in previous versions of GSE each line was one discreet action it was noted that sometimes you want to do an action that is more than one line. you also at times want to not do some repeatative tasks every time. GSE3 has moved from a single line to the concept of a "Block".
In short a Block is a series of commands to be executed on a particular click. Each block has a type that defines what kind of block it is.
There are currently 5 types of blocks.
- Action - A normal series of macro commands for GSE to execute on this particular click
- Repeat - A variation on an Action block that is to be repeated within this main block every n times
- Pause - An instruction to wait either a number of clicks or seconds before proceeding
- Loop - A series of Blocks to loop through before proceeding with the rest of the macro
- If - A choice between blocks
An Action is simply a Lua table consisting of strings that describe what to do. These instructions form a "Stack" that wow processes top down.
{
["macro"] = "/cast 34026",
["Type"] = "Action",
["type"] = "macro"
}
As this was built upon GSE 3.0 there is a difference between Type and type. Type
relates to GSE itself and the Block type. type
in comparison relates to the content type. Valid entries and attributes are those found in Action Type as part of the SecureActionButtonTemplate
The action type determines what type of thing SecureActionButtonTemplate will do on this click.
- Pet Ability is for Pet skills like Claw
- Toy for a Toybox Item
- Macro to call another macro that exists in /macro (just enter the macros name) or enter directly some Macro commands. Note: this requires that you Keybind the GSE Sequence.
- Item to use an item
- Spell to use a spell
All action types except macro need a valid unit name. The Unit Name is the target a spell can be cast on. This is mostly synonymous with the @ mods used in macro commands. player for example = [@player], focus for [@focus]. The values that can be used here are defined https://warcraft.wiki.gg/wiki/UnitId
A Repeat block is an Action block that is repeated inside the macro or the current Loop Block. Repeat blocks are included on all child containers (Sub loops, If blocks). That are not included in parent containers.
{
["macro"] = "/cast 34026",
["type"] = "macro"
['Type'] = 'Repeat',
['Interval'] = 3
}
In this example, if the macro had 6 lines and this was line one, this block would be automatically inserted at line 4 and then again at line 7.
{
["Actions"] = {
[1] = {
["macro"] = "1",
["type"] = "macro",
["Type"] = "Action"
},
[2] = {
["macro"] = "x",
["type"] = "macro",
["Interval"] = "2",
["Type"] = "Repeat"
},
[3] = {
["macro"] = "2",
["Type"] = "Action",
["type"] = "macro"
},
[4] = {
["macro"] = "3",
["Type"] = "Action",
["type"] = "macro"
},
[5] = {
["macro"] = "4",
["Type"] = "Action",
["type"] = "macro"
},
[6] = {
["macro"] = "5",
["Type"] = "Action",
["type"] = "macro"
}
},
["InbuiltVariables"] = {
}
}
Creates the following Compiled Template
{
[1] = {
["macro"] = "1",
["type"] = "macro"
},
[2] = {
["macro"] = "x",
["type"] = "macro"
},
[3] = {
["macro"] = "2",
["type"] = "macro"
},
[4] = {
["macro"] = "3",
["type"] = "macro"
},
[5] = {
["macro"] = "x",
["type"] = "macro"
},
[6] = {
["macro"] = "4",
["type"] = "macro"
},
[7] = {
["macro"] = "5",
["type"] = "macro"
},
[8] = {
["macro"] = "x",
["type"] = "macro"
}
}
{
["Actions"] = {
[1] = {
["macro"] = "1",
["type"] = "macro",
["Type"] = "Action"
},
[2] = {
["macro"] = "x",
["type"] = "macro",
["Type"] = "Repeat",
["Interval"] = "2"
},
[3] = {
["macro"] = "2",
["Type"] = "Action",
["type"] = "macro"
},
[4] = {
["macro"] = "3",
["Type"] = "Action",
["type"] = "macro"
},
[5] = {
["macro"] = "4",
["Type"] = "Action",
["type"] = "macro"
},
[6] = {
["macro"] = "5",
["Type"] = "Action",
["type"] = "macro"
},
[7] = {
[1] = {
["macro"] = "A",
["Type"] = "Action",
["type"] = "macro"
},
[2] = {
["macro"] = "B",
["Type"] = "Action",
["type"] = "macro"
},
[3] = {
["macro"] = "C",
["Type"] = "Action",
["type"] = "macro"
},
[4] = {
["macro"] = "D",
["Type"] = "Action",
["type"] = "macro"
},
[5] = {
["macro"] = "E",
["Type"] = "Action",
["type"] = "macro"
},
["Type"] = "Loop",
["Repeat"] = 2,
["StepFunction"] = "ReversePriority"
}
},
["InbuiltVariables"] = {
}
}
correctly inserts x in to the subtables
{
[1] = {
["macro"] = "1",
["type"] = "macro"
},
[2] = {
["macro"] = "x",
["type"] = "macro"
},
[3] = {
["macro"] = "2",
["type"] = "macro"
},
[4] = {
["macro"] = "3",
["type"] = "macro"
},
[5] = {
["macro"] = "x",
["type"] = "macro"
},
[6] = {
["macro"] = "4",
["type"] = "macro"
},
[7] = {
["macro"] = "5",
["type"] = "macro"
},
[8] = {
["macro"] = "x",
["type"] = "macro"
},
[9] = {
["macro"] = "A",
["type"] = "macro"
},
[10] = {
["macro"] = "B",
["type"] = "macro"
},
[11] = {
["macro"] = "x",
["type"] = "macro"
},
[12] = {
["macro"] = "A",
["type"] = "macro"
},
[13] = {
["macro"] = "C",
["type"] = "macro"
},
[14] = {
["macro"] = "x",
["type"] = "macro"
},
[15] = {
["macro"] = "B",
["type"] = "macro"
},
[16] = {
["macro"] = "A",
["type"] = "macro"
},
[17] = {
["macro"] = "x",
["type"] = "macro"
},
[18] = {
["macro"] = "D",
["type"] = "macro"
},
[19] = {
["macro"] = "C",
["type"] = "macro"
},
[20] = {
["macro"] = "x",
["type"] = "macro"
},
[21] = {
["macro"] = "B",
["type"] = "macro"
},
[22] = {
["macro"] = "A",
["type"] = "macro"
},
[23] = {
["macro"] = "x",
["type"] = "macro"
},
[24] = {
["macro"] = "E",
["type"] = "macro"
},
[25] = {
["macro"] = "D",
["type"] = "macro"
},
[26] = {
["macro"] = "x",
["type"] = "macro"
},
[27] = {
["macro"] = "C",
["type"] = "macro"
},
[28] = {
["macro"] = "B",
["type"] = "macro"
},
[29] = {
["macro"] = "x",
["type"] = "macro"
},
[30] = {
["macro"] = "A",
["type"] = "macro"
},
[31] = {
["macro"] = "A",
["type"] = "macro"
},
[32] = {
["macro"] = "x",
["type"] = "macro"
},
[33] = {
["macro"] = "B",
["type"] = "macro"
},
[34] = {
["macro"] = "A",
["type"] = "macro"
},
[35] = {
["macro"] = "x",
["type"] = "macro"
},
[36] = {
["macro"] = "C",
["type"] = "macro"
},
[37] = {
["macro"] = "B",
["type"] = "macro"
},
[38] = {
["macro"] = "x",
["type"] = "macro"
},
[39] = {
["macro"] = "A",
["type"] = "macro"
},
[40] = {
["macro"] = "D",
["type"] = "macro"
},
[41] = {
["macro"] = "x",
["type"] = "macro"
},
[42] = {
["macro"] = "C",
["type"] = "macro"
},
[43] = {
["macro"] = "B",
["type"] = "macro"
},
[44] = {
["macro"] = "x",
["type"] = "macro"
},
[45] = {
["macro"] = "A",
["type"] = "macro"
},
[46] = {
["macro"] = "E",
["type"] = "macro"
},
[47] = {
["macro"] = "x",
["type"] = "macro"
},
[48] = {
["macro"] = "D",
["type"] = "macro"
},
[49] = {
["macro"] = "C",
["type"] = "macro"
},
[50] = {
["macro"] = "x",
["type"] = "macro"
},
[51] = {
["macro"] = "B",
["type"] = "macro"
},
[52] = {
["macro"] = "A",
["type"] = "macro"
}
}
A Pause Block replaces the `/click pause n' from GSE2. It can pause for either a number of clicks or milliseconds
To pause for 3 seconds:
{
['Type'] = 'Pause',
['MS'] = 3000
}
To pause for 3 clicks
{
['Type'] = 'Pause',
['Clicks'] = 3
}
To pause for the GCD
{
['Type'] = 'Pause',
['MS'] = "GCD"
}
Pauses work by counting clicks. GSE’s is unable to tell time within the combat sandbox but if clicking at a consistent rate GSE knows that x clicks = 1 second. If you are spamming at 250ms externally to the game, you would put 250 in the External MS field in GSE’s options. This tells GSE that each click is 250ms so 4 clicks would be 1 second. If the external value you use and the internal option value are not identical then the math will be wrong and GSE won’t be able to count correctly.
It should also be noted that for the pause to evaluate you still need to be clicking the button in game at the same rate.
Loop Blocks replace the PreMacro, PostMacro and Internal Loop functions from GSE2 They allow for a macro to change execution type from Sequential to Priority and contain a series of Action Blocks to loop through.
[1] = {
[1] = {
[1] = {
["macro"] = "/cast 34026",
["Type"] = "Action",
["type"] = "macro"
},
[2] = {
["macro"] = "/cast 3434526",
["Type"] = "Action",
["type"] = "macro"
},
[3] = {
["macro"] = "/cast 234026",
["Type"] = "Action",
["type"] = "macro"
},
[4] = {
["macro"] = "/cast 35295",
["Type"] = "Action",
["type"] = "macro"
}
},
['Type'] = 'Loop',
['Repeat'] = '3',
['StepFunction'] = 'Sequential'
},
[2] = {
["macro"] = "/cast 34026",
["Type"] = "Action",
["type"] = "macro"
},
In this example, the "2" block at the end is the block to be executed after the Loop is finished. This repeats 4 Actions 3 times.
Note: You can have loops within loops. Each Block has a StepFunction. The default is Sequential. Other Step Functions are defined https://github.com/TimothyLuke/GnomeSequencer-Enhanced/wiki/GSE3:-Advanced-Loop-Step-Functions---Priority-and-Reverse-Priority
If blocks are one of the more complicated block types. Similar to Loops they contain other blocks. An If Block needs a variable that is truthy. This means that if a bunch of code executes and returns something it is considered true and if instead it returns a nil or false it treats that as False.
The first is the Variable section - you now put the Implementation Reference into the If Block Variable field. This allows you to use any function in the WoW API or an inline statement as well as GSE Variables.
You can also use = true
and = false
as the Variable to test the If Block
GSE Patrons can tab in the Variable block to get a popup
The Block itself looks like the following. The first set of actions is the True case while the second set is the False case.
{
[1] = { -- True Actions
[1] = {
[1] = "/say Variable returned True",
["Type"] = "Action"
}
},
[2] = { -- False Actions
[1] = {
[1] = "/say Variable returned False",
["Type"] = "Action"
}
},
["Variable"] = "=GSE.V.MyVariable()",
["Type"] = "If"
}
If blocks also have the limit that they are not able to be updated in combat. When you zone or enter a dungeon or flag for PVP etc your macro template is recompiled and updated. If blocks are only evaluated then. As of 3.1.38 these are also evaluated when you change target so can do things dependant on the target selected.