This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| acr [2016/04/01 14:57] – ace | acr [2024/07/23 22:20] (current) – ace | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Features | + | ===== About ===== |
| ACR (Advanced Combat Routines) is a platform for highly customizable combat routines that are written in lua. | ACR (Advanced Combat Routines) is a platform for highly customizable combat routines that are written in lua. | ||
| Routines built on this platform can use a custom GUI, have access to a special multi-clickable Party Interface, and the routines are not bound by the same generic rules that SkillManager routines use. | Routines built on this platform can use a custom GUI, have access to a special multi-clickable Party Interface, and the routines are not bound by the same generic rules that SkillManager routines use. | ||
| - | ==== Usage ==== | + | ===== Features ===== |
| - | == ACR Main Interface == | + | === ACR Main Interface |
| {{http:// | {{http:// | ||
| - | **Enabled** - Enables the current profile. If this is off, MMOMinion | + | == Enabled |
| + | Enables the current profile. If this is off, FFXIVMinion | ||
| - | **Auto-Enabled** - Enables ACR if a profile is found for the current class. | + | == Auto-Enabled |
| + | Enables ACR if a profile is found for the current class. | ||
| - | **Show Party Interface** - Toggles the multi-clickable party interface window, discussed in the next section. | + | == Show Party Interface |
| + | Toggles the multi-clickable party interface window, discussed in the next section. | ||
| - | == ACR Party Interface == | + | ---- |
| + | === ACR Party Interface === | ||
| + | {{http:// | ||
| + | |||
| + | //ACR does not include FFXIV icons, but these can be downloaded from [[http:// | ||
| + | To install the icons, place the icons folder in the root of the ACR module [ACR\icons].// | ||
| + | |||
| + | The party interface is a multi-clickable display that can work in conjunction with routines via their OnClick procedure. | ||
| + | |||
| + | == Examples == | ||
| + | |||
| + | Right-click to dispel debuffs. | ||
| + | Left-click to cast a small heal. | ||
| + | Shift+Left-click to cast a large heal. | ||
| + | Middle-click to use an ability such as Cover/Goad on your teammate. | ||
| + | |||
| + | OnClick API documented in Routine API below. | ||
| + | |||
| + | ---- | ||
| ==== Routine API ==== | ==== Routine API ==== | ||
| Line 27: | Line 48: | ||
| local profile = {} | local profile = {} | ||
| + | -- Create a GUI table, to hold GUI-related information. | ||
| + | profile.GUI = { | ||
| + | open = false, | ||
| + | visible = true, | ||
| + | name = " | ||
| + | } | ||
| + | -- Regions table, lists which game regions are supported (1 - NA, 2 - CN, 3 - KR) | ||
| + | profile.region = { 1, 2, 3} | ||
| + | |||
| + | -- Create a classes table, to specify which classes this profile can be used for. | ||
| + | profile.classes = { | ||
| + | [FFXIV.JOBS.NINJA] = true, | ||
| + | [FFXIV.JOBS.ROGUE] = true, | ||
| + | } | ||
| + | |||
| + | -- Add a tags string to indicate whatever you want when class options are displayed | ||
| + | profile.tags = " | ||
| + | |||
| + | -- The Cast() function is where the magic happens. | ||
| + | -- Action code should be called and fired here. | ||
| + | function profile.Cast() | ||
| + | local currentTarget = MGetTarget() | ||
| + | | ||
| + | if (currentTarget) then | ||
| + | local spinningEdge = ActionList: | ||
| + | if (spinningEdge and spinningEdge.isready) then | ||
| + | spinningEdge: | ||
| + | return true | ||
| + | end | ||
| + | end | ||
| + | return false | ||
| + | end | ||
| + | |||
| + | -- The Draw() function provides a place where a developer can show custom options. | ||
| + | function profile.Draw() | ||
| + | if (profile.GUI.open) then | ||
| + | profile.GUI.visible, | ||
| + | if ( profile.GUI.visible ) then | ||
| + | ACR_MyProfile_MySavedVar = GUI: | ||
| + | end | ||
| + | GUI:End() | ||
| + | end | ||
| + | end | ||
| + | |||
| + | -- Adds a customizable header to the top of the ffxivminion task window. | ||
| + | function profile.DrawHeader() | ||
| + | |||
| + | end | ||
| + | |||
| + | -- Adds a customizable footer to the top of the ffxivminion task window. | ||
| + | function profile.DrawFooter() | ||
| + | |||
| + | end | ||
| + | |||
| + | -- The OnOpen() function is fired when a user pressed "View Profile Options" | ||
| + | function profile.OnOpen() | ||
| + | -- Set our GUI table //open// variable to true so that it will be drawn. | ||
| + | profile.GUI.open = true | ||
| + | end | ||
| + | |||
| + | -- The OnLoad() function is fired when a profile is prepped and loaded by ACR. | ||
| + | function profile.OnLoad() | ||
| + | -- Set and (if necessary) create a saved variable named ACR_MyProfile_MySavedVar. | ||
| + | ACR_MyProfile_MySavedVar = ACR.GetSetting(" | ||
| + | end | ||
| + | |||
| + | -- The OnClick function is fired when a user clicks on the ACR party interface. | ||
| + | -- It accepts 5 parameters: | ||
| + | -- mouse /int/ - Possible values are 0 (Left-click), | ||
| + | -- shiftState /bool/ - Is shift currently pressed? | ||
| + | -- controlState /bool/ - Is control currently pressed? | ||
| + | -- altState /bool/ - Is alt currently pressed? | ||
| + | -- entity /table/ - The entity information for the party member that was clicked on. | ||
| + | function profile.OnClick(mouse, | ||
| + | |||
| + | end | ||
| + | |||
| + | -- The OnUpdate() function is fired on the gameloop, like any other OnUpdate function found in FFXIVMinion code. | ||
| + | function profile.OnUpdate(event, | ||
| + | |||
| + | end | ||
| -- Return the profile to ACR, so it can be read. | -- Return the profile to ACR, so it can be read. | ||
| return profile | return profile | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Pushing Routines API ==== | ||
| + | |||
| + | <code lua> | ||
| + | |||
| + | -- This code is an example of how to push routines into ACR using the new API call. | ||
| + | -- This isn't required anymore. Simply placing your ACR LUA file into a folder named CombatRoutines is enough for the ACR module to detect and load your ACR. | ||
| + | |||
| + | acelib.routinePath = GetStartupPath()..[[\LuaMods\AceLib\CombatRoutines\]] --this can be any subfolder, I'm using the old structure for ease | ||
| + | |||
| + | function AceLib.LoadCombatProfile(filename, | ||
| + | if (acelib.ModuleFunctions and acelib.ModuleFunctions.ReadModuleFile) then | ||
| + | local fileInfo = { p = " | ||
| + | local fileString = acelib.ModuleFunctions.ReadModuleFile(fileInfo) | ||
| + | if (fileString) then | ||
| + | local fileFunction, | ||
| + | if (fileFunction) then | ||
| + | local ok, profileData = pcall(fileFunction) | ||
| + | if (ok and profileData ~= nil) then | ||
| + | ACR.AddPrivateProfile(profileData, | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | else | ||
| + | if (filename ~= "" | ||
| + | local profileData, | ||
| + | if (ValidTable(profileData)) then | ||
| + | ACR.AddPrivateProfile(profileData, | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | |||
| + | function AceLib.LoadCombatProfiles() | ||
| + | AceLib.LoadCombatProfile(" | ||
| + | end | ||
| + | |||
| + | -- Final call should be done in a ModuleInit so that all modules can finish loading other API where required. | ||
| + | function acelib.ModuleInit() | ||
| + | AceLib.LoadCombatProfiles() | ||
| + | end | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Public API Functions ==== | ||
| + | |||
| + | <code lua> | ||
| + | |||
| + | local t = ACR.GetClassOptions(class (int) (default Player.job), | ||
| + | --returns a table " | ||
| + | /* | ||
| + | { | ||
| + | [1] = { | ||
| + | name = " | ||
| + | tags = "" | ||
| + | }, | ||
| + | [2] = { | ||
| + | name = " | ||
| + | tags = "" | ||
| + | }, | ||
| + | } | ||
| + | */ | ||
| + | |||
| + | local b, n = ACR.IsActive() | ||
| + | --returns b (bool) (true if any ACR is active), n (string) (name of active profile or "" | ||
| + | |||
| + | ACR.OpenProfileOptions() | ||
| + | --executes the currently selected profiles OnOpen() event if applicable | ||
| </ | </ | ||