Chapter 21: Page 397 - 'Format of GUIDs'

The code listed for GUIDToType is not correct due to some subtle changes in the GUID format. It may still appear to work as written, but the mask we are using is incorrect. The typeMask should be 0x007, instead of 0x00F. The code should read:

 function GUIDToType(guid)
   local typeMask = 0x007
   local upper = tonumber(guid:sub(1, 5))
   local type =, typeMask)

and then the rest of the function definition.