Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. require "json" -- This should be at the top of whatever script does this, or loaded as early as possible.
  2.  
  3. -- Somewhere in here is where you receive the data. This could be from the plugin itself, this could be in an alias or a function called by the alias or however. For the sake of simplicity, I am keeping the `cmd` and `jd` variables as what they are stored in
  4.  
  5. local gmcp_data = json.decode(jd)
  6.  
  7. -- From here, you can access the data or pass it along to whatever you need. The `cmd` variable would store the string akin to "Char.Vitals", so you could sort that out with an if..elseif..else block, have a table of functions with this as its key name, or even delegate out using an observer pattern. The possibilities are endless. truthfully.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement