Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Displaying tabled data from event handlers

ZypherZypher Member Posts: 2
I have a simple question, I'm wanting to display data using gmcp event handlers.  There is a lot more to how the mudlet client handles the gmcp data. To explain, what I want to know is how can I store the gmcp tables in my created table each time it's sent from the server?

 Here is an example of a table 
{
  {
    {
      id = "330116",
      attrib = "t",
      name = "a spiny dogfish",
      icon = "seacreature"
    }
  }
}
 My thought is to create a for loop as shown below
--an empty and nil table
myTable = {}
--Im checking for only items in the room with an if statement just before the for loop
itemsInRoom = gmcp.Char.Items.List.items
for k, v in ipairs (itemsInRoom) do
  table.insert(myTable,itemsInRoom)
end --for
--Where I would display the name and id to the Geyser.Label 
 end --if
This is a crude example of lua code
Tagged:

Answers

  • ZypherZypher Member Posts: 2
    Thanks for the information I never thought of clearing the table and starting over. 
Sign In or Register to comment.