Chromatics 2
  • Welcome to Chromatics
  • License
  • Getting Started
    • Prerequisites
    • Installation
    • Beta Releases
    • Running Chromatics
    • Chromatics Settings
    • Color Palette
  • Devices
    • Device Types
    • Emulator & Stream Overlay
    • Razer Chroma
    • Logitech G Hub
    • Corsair iCUE
    • Coolermaster
    • SteelSeries Engine
    • Wooting
    • Asus AuraSync
    • MSI Mystic Light
    • LIFX Smartbulbs
    • Philips HUE Smartbulbs
    • Advanced Settings
  • Chromatics Effects
    • Overview
    • Base Modes
    • Device Modes
    • Keybind Highlighting
    • Job Gauge Effects
    • Status Effects
    • Casting Effects
    • Menu/Cutscene Effects
    • Gold Saucer Vegas Mode
  • Integrations
    • LCD Displays
    • Advanced Combat Tracker
    • Logitech ARX
    • Google Cast
    • IFTTT
  • Developers
    • Introduction
    • Plugin Setup
    • Accessing FFXIV Data
    • List of ID's
    • Testing & Debug
    • Publishing
Powered by GitBook
On this page
  • Reading Data from FFXIV (Concept)
  • Setup your Plugin to Read FFXIV Data
  • Accessing the Data
  1. Developers

Accessing FFXIV Data

Reading Data from FFXIV (Concept)

FFXIV is inserted into a number of hidden <div> tags at the top of the HTML file after the opening <body> tag. The contents of each of these values can be read in using JavaScript. While Chromatics will automatically keep these values updated with the latest data, a page refresh would normally be required to get the latest data; as this is quite inefficient to do, wrapping your JavaScript functions in a setInterval() call is the preferred method to update your plugin data.

Setup your Plugin to Read FFXIV Data

To access the FFXIV data within your plugin, you need to include two JavaScript files into your HTML file. The first is the JQuery library. You can do this by linking directly to the latest dist inline:

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>

Or alternatively, you can download the latest version and store it in your /js folder:

 <script src="js/jquery.min.js"></script>

Secondly you must include a JavaScript reference to the ffxivsetup.js file which Chromatics generates. You can do this by adding the following JavaScript include after the above JQuery line:

 <script src="ffxivsetup.js" type="text/javascript"></script>

Both these files must be inserted before the closing </head> tag.

 <head>
  <script src="js/jquery.min.js"></script>
  <script src="ffxivsetup.js" type="text/javascript"></script>
 </head>

Accessing the Data

Once JQuery and ffxivsetup.js have been loaded in the page, you can add an in-line <script> section just before the closing </body> tag to fetch the data into variables. We recommend using the following technique to do so:

 <body>
   //Your plugin HTML

   <script type="text/javascript">
     window.setInterval(FetchData, 500);
     FetchData();

     function FetchData() {
        var myplayername = $("#playername").text();
        //Player name value is now stored into myplayername variable.
     }

   </script>

 </body>

Important: We recommend not setting an interval time of less than 300 milliseconds.

PreviousPlugin SetupNextList of ID's

Last updated 5 years ago