1. Hi,

    I just completed Chapter 13 - Responding to Game Events on the new 2nd edition book "Programming in World of Warcraft". However, whenever I attempt to run my updated BagBuddy it throws the following error:

     Message: Interface\AddOns\BagBuddy\BagBuddy.lua:82: attempt to index field 'itemTimes' (a nil value)
     Time: 03/06/10 03:29:56
     Count: 1
     Stack: Interface\AddOns\BagBuddy\BagBuddy.lua:82: in function <Interface\AddOns\BagBuddy\BagBuddy.lua:80>
     [C]: in function `sort'
     Interface\AddOns\BagBuddy\BagBuddy.lua:135: in function `BagBuddy_Update'
     [string "*:OnTextChanged"]:1: in function <[string "*:OnTextChanged"]:1>
    
     Locals: a = <table> {
      num = 14047
      count = 12
      link = "[Runecloth]"
      name = "Runecloth"
      quality = -1
      texture = "Interface\Icons\INV_Fabric_PurpleFire_01"
     }
     b = <table> {
      num = 38145
      count = 1
      link = "[Deathweave Bag]"
      name = "Deathweave Bag"
      quality = 1
      texture = "Interface\Icons\INV_Misc_Bag_10_Black"
     }
     (*temporary) = nil
     (*temporary) = 14047
     (*temporary) = nil
     (*temporary) = nil
     (*temporary) = "attempt to index field 'itemTimes' (a nil value)"
    

    It looks as though the variable for itemTimes isn't initialized to zero or something and therefore is a nil value since the "Deathweave Bag" is an item that the character started out with due to testing on a new server with a Death Knight character.

    I'm sure it's not within the constraints of the forum to post my BagBuddy.lua and BagBuddy.xml in entirety so I'm hoping that you could glean a little information from the error message or I could e-mail you the files directly.

    Thanks in advance, TD

  2. Have you compared your code to the version available for download on this site? That's the first place to start, see if there's possibly a typo or something missing.

  3. I had thought to do that on my own, I cannot locate the files on the website for the second edition though.

  4. Sorry about that. I've edited the pages for chapters 10-13 and posted those files. I'll try to check after this weekend to see what else didn't get finished for the second edition.

  5. Thanks for the quick response. I'm sorry to see that you're having a bit of a rough time from other posts and appreciate everything you've done.